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 float plArmatureMod::kAvatarInputSynchThreshold = 10.f;
float plArmatureMod::fMouseTurnSensitivity = 1.f;
hsBool plArmatureMod::fClickToTurn = true;
@ -656,7 +655,6 @@ void plArmatureMod::IInitDefaults()
fReverseFBOnIdle = false;
fFollowerParticleSystemSO = nil;
fPendingSynch = false;
fLastInputSynch = 0;
fOpaque = true;
fPhysHeight = 0.f;
fPhysWidth = 0.f;
@ -1524,8 +1522,6 @@ void plArmatureMod::SynchInputState(uint32_t rcvID /* = kInvalidPlayerID */)
msg->AddNetReceiver(rcvID);
msg->Send();
fLastInputSynch = hsTimer::GetSysSeconds();
}
void plArmatureMod::ILinkToPersonalAge()
@ -1589,12 +1585,6 @@ hsBool plArmatureMod::IEval(double time, float elapsed, uint32_t dirty)
}
}
}
if (localPlayer == this)
{
if (time - fLastInputSynch > kAvatarInputSynchThreshold)
SynchInputState();
}
if (noOverlap)
{

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

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

Loading…
Cancel
Save