forked from speed-dreams/speed-dreams-code
fixed more problems with network time
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@2563 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 8bd81671d51cec87c61e31a3cf90d290cdea5e90 Former-commit-id: 77a6f9629d5c6ee283b71d6ae524e511c5bcc704
This commit is contained in:
parent
814d819e17
commit
0fde362d08
1 changed files with 15 additions and 3 deletions
|
@ -468,13 +468,13 @@ void Network::SendCarStatusPacket(tSituation *s,bool bForce)
|
|||
return;
|
||||
|
||||
//Clock error fix it
|
||||
if (s->currentTime<m_sendCtrlTime)
|
||||
if (s->currentTime<m_sendCarDataTime)
|
||||
{
|
||||
m_sendCarDataTime=s->currentTime-CAR_DATA_UPDATE;
|
||||
}
|
||||
|
||||
//Send carinfo packet when enough time has passed(CAR_DATA_UPDATE)
|
||||
if (((m_sendCarDataTime+CAR_DATA_UPDATE)>=s->currentTime)&&(!bForce))
|
||||
if (((m_sendCarDataTime+CAR_DATA_UPDATE)>s->currentTime)&&(!bForce))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -548,7 +548,7 @@ void Network::SendCarControlsPacket(tSituation *s)
|
|||
SendCarStatusPacket(s,false);
|
||||
|
||||
//Send carinfo packet when enough time has passed(CAR_CONTROL_UPDATE)
|
||||
if ((m_sendCtrlTime+CAR_CONTROL_UPDATE)>=s->currentTime)
|
||||
if ((m_sendCtrlTime+CAR_CONTROL_UPDATE)>s->currentTime)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -685,6 +685,12 @@ void Network::ReadCarStatusPacket(ENetPacket *pPacket)
|
|||
{
|
||||
pNData->m_vecCarStatus[i] = status;
|
||||
}
|
||||
else
|
||||
{
|
||||
float delta = pNData->m_vecCarStatus[i].time - status.time;
|
||||
GfOut("Rejected car status from startRank %i\n",status.startRank);
|
||||
}
|
||||
GfOut("Recieved car status from startRank %i\n",status.startRank);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -695,6 +701,7 @@ void Network::ReadCarStatusPacket(ENetPacket *pPacket)
|
|||
}
|
||||
|
||||
UnlockNetworkData();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -757,6 +764,11 @@ void Network::ReadCarControlsPacket(ENetPacket *pPacket)
|
|||
{
|
||||
pNData->m_vecCarCtrls[i] = ctrl;
|
||||
}
|
||||
else
|
||||
{
|
||||
float delta = pNData->m_vecCarCtrls[i].time - ctrl.time;
|
||||
GfOut("Rejected car control from startRank %i\n",ctrl.startRank);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue