From 29f2bc25479fef9d84455b3dc5b03438b61adab0 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sat, 25 Feb 2012 22:35:41 -0500 Subject: [PATCH] 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. --- Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp | 10 ---------- Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.h | 1 - 2 files changed, 11 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp index 5233b8d2..3e8c27cb 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp +++ b/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) { diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.h b/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.h index 93455aa9..04b2fa17 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.h +++ b/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;