Browse Source

Only synch input states when they dirty

Sending dupe input state messages every 10 seconds is wasteful. They are
already sent when the fields dirty, so there's no sense in sending them
any more than that. For keeping the connection alive, we'll use
lightweight pings.
Adam Johnson 13 years ago
parent
commit
29f2bc2547
  1. 10
      Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp
  2. 1
      Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.h

10
Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp

@ -628,7 +628,6 @@ void plArmatureModBase::IEnableBones(int lod, hsBool enable)
const char *plArmatureMod::BoneStrings[] = {"Male", "Female", "Critter", "Actor"}; const char *plArmatureMod::BoneStrings[] = {"Male", "Female", "Critter", "Actor"};
const float plArmatureMod::kAvatarInputSynchThreshold = 10.f;
float plArmatureMod::fMouseTurnSensitivity = 1.f; float plArmatureMod::fMouseTurnSensitivity = 1.f;
hsBool plArmatureMod::fClickToTurn = true; hsBool plArmatureMod::fClickToTurn = true;
@ -656,7 +655,6 @@ void plArmatureMod::IInitDefaults()
fReverseFBOnIdle = false; fReverseFBOnIdle = false;
fFollowerParticleSystemSO = nil; fFollowerParticleSystemSO = nil;
fPendingSynch = false; fPendingSynch = false;
fLastInputSynch = 0;
fOpaque = true; fOpaque = true;
fPhysHeight = 0.f; fPhysHeight = 0.f;
fPhysWidth = 0.f; fPhysWidth = 0.f;
@ -1524,8 +1522,6 @@ void plArmatureMod::SynchInputState(uint32_t rcvID /* = kInvalidPlayerID */)
msg->AddNetReceiver(rcvID); msg->AddNetReceiver(rcvID);
msg->Send(); msg->Send();
fLastInputSynch = hsTimer::GetSysSeconds();
} }
void plArmatureMod::ILinkToPersonalAge() void plArmatureMod::ILinkToPersonalAge()
@ -1590,12 +1586,6 @@ hsBool plArmatureMod::IEval(double time, float elapsed, uint32_t dirty)
} }
} }
if (localPlayer == this)
{
if (time - fLastInputSynch > kAvatarInputSynchThreshold)
SynchInputState();
}
if (noOverlap) if (noOverlap)
{ {
EnablePhysics(false, kDisableReasonRelRegion); EnablePhysics(false, kDisableReasonRelRegion);

1
Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.h

@ -414,7 +414,6 @@ protected:
uint8_t fStealthMode; uint8_t fStealthMode;
int fStealthLevel; // you are invisible to other players/CCRs of lower stealthLevel int fStealthLevel; // you are invisible to other players/CCRs of lower stealthLevel
double fLastInputSynch;
plAGModifier * fRootAGMod; plAGModifier * fRootAGMod;
plAvBoneMap * fBoneMap; // uses id codes to look up bones. set up by the brain as needed. plAvBoneMap * fBoneMap; // uses id codes to look up bones. set up by the brain as needed.
double fLastSynch; double fLastSynch;

Loading…
Cancel
Save