2 #include "ValueTracker.h" 6 #define CLIENT_NORMAL_UPDATE_RATE 3 9 #define SERVER_NORMAL_UPDATE_RATE 3 63 m_nLastSendTime.resize(3, INVALID_TIME);
64 m_nLastReceiveTime.resize(3, INVALID_TIME);
66 m_arrayCustomModelData.SetSize(1);
76 for(
int i=0;i<(int)m_nLastSendTime.size();++i)
77 m_nLastSendTime[i] = INVALID_TIME;
79 for(
int i=0;i<(int)m_nLastReceiveTime.size();++i)
80 m_nLastReceiveTime[i] = INVALID_TIME;
84 m_fVerticalSpeed.Reset();
93 m_bIsCustomModel.Reset();
94 m_arrayCustomModelData.Reset();
100 if(nGroupIndex>=0 && nGroupIndex<(
int)m_nLastSendTime.size())
101 return m_nLastSendTime[nGroupIndex];
108 if(nGroupIndex>=0 && nGroupIndex<(
int)m_nLastSendTime.size())
109 m_nLastSendTime[nGroupIndex] = nTime;
115 if(nGroupIndex>=0 && nGroupIndex<(
int)m_nLastReceiveTime.size())
116 return m_nLastReceiveTime[nGroupIndex];
124 if(nGroupIndex>=0 && nGroupIndex<(
int)m_nLastReceiveTime.size())
125 m_nLastReceiveTime[nGroupIndex] = nTime;
133 return IsGroupConstant(1) && IsGroupConstant(2);
144 return m_vPos.IsConstant() && m_fFacing.IsConstant() && m_fVerticalSpeed.IsConstant() && m_fSpeed.IsConstant() && m_nAnimID.IsConstant() &&
145 m_bWalking.IsConstant() && m_bRunning.IsConstant();
147 return m_fSizeScale.IsConstant() && m_sBasemodel.IsConstant();
174 vector<int> m_nLastSendTime;
177 vector<int> m_nLastReceiveTime;
179 static const int INVALID_TIME = -1;
195 void ResetCharTrackers();
216 bool RemoveCharTracker(
const char* sName);
224 int RemoveCharTracker(
int nBeforePerceivedTime);
240 int m_nLastTrackerGCTime;
243 map<string, CCharacterTracker> m_perceptionTracker;
void FrameMove()
increase the time by 1 frame
Definition: GameNetCommon.h:38
CFloatTracker m_fFacing
character position tracker
Definition: GameNetCommon.h:157
It tracks a character on the network, such as its last update time, position track, etc.
Definition: GameNetCommon.h:59
Current network simulation time.
Definition: GameNetCommon.h:17
int GetLastReceiveTime(int nGroupIndex=0)
last time that the character info is received from the other side of the network. ...
Definition: GameNetCommon.h:113
different physics engine has different winding order.
Definition: EventBinding.h:32
int GetLastTrackerGCTime()
get last character tracker garbage collection time.
Definition: GameNetCommon.h:228
bool IsContant()
this function will return true if all field of the tracker are constant.
Definition: GameNetCommon.h:131
int GetTimeLag()
get the time since last network synchronization.
Definition: GameNetCommon.h:233
it is a class for holding various character trackers by their name.
Definition: GameNetCommon.h:188
OBSOLETED: It represents a normal update packet.
Definition: GameNetCommon.h:49
void SetLastSendTime(int nTime, int nGroupIndex=0)
last time that the character info is send to the other side of the network
Definition: GameNetCommon.h:106
bool IsGroupConstant(int nGroup)
this function will return true if all trackers in the given group are a constant. ...
Definition: GameNetCommon.h:139
void SetLastTrackerGCTime(int nLag)
set last character tracker garbage collection time.
Definition: GameNetCommon.h:230
void SetTimeLag(int nLag)
set the time since last network synchronization.
Definition: GameNetCommon.h:235
void Reset()
reset to tacker to empty
Definition: GameNetCommon.h:74
void SetLastReceiveTime(int nTime, int nGroupIndex=0)
last time that the character info is received from the other side of the network. ...
Definition: GameNetCommon.h:122
int GetLastSendTime(int nGroupIndex=0)
last time that the character info is send to the other side of the network
Definition: GameNetCommon.h:98