mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-02-05 07:51:13 +00:00
Let's try some sanity checks on the resync code...
This commit is contained in:
parent
29f460a21f
commit
204a6d5c20
1 changed files with 24 additions and 0 deletions
|
@ -1052,6 +1052,7 @@ static void SV_SendResynch(INT32 node)
|
|||
return;
|
||||
}
|
||||
|
||||
resynch_inprogress[node] = false; // Let's see if there's REALLY anyone left to sync.....
|
||||
netbuffer->packettype = PT_RESYNCHING;
|
||||
for (i = 0, j = 0; i < MAXPLAYERS; ++i)
|
||||
{
|
||||
|
@ -1059,10 +1060,24 @@ static void SV_SendResynch(INT32 node)
|
|||
if (!(resynch_status[node] & 1<<i))
|
||||
continue;
|
||||
|
||||
if (!playeringame[i])
|
||||
continue; // Player doesn't exist any more, so no need to resync them!
|
||||
|
||||
resynch_inprogress[node] = true;
|
||||
|
||||
// waiting for a reply or just waiting in general
|
||||
if (resynch_sent[node][i])
|
||||
{
|
||||
--resynch_sent[node][i];
|
||||
|
||||
if (resynch_sent[node][i] > TICRATE)
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, "Node %d (%s) somehow had a stupidly-long resync delay?! (%d tics to resync player %d)\n",
|
||||
node, player_names[nodetoplayer[node]], resynch_sent[node][i], i
|
||||
);
|
||||
resynch_sent[node][i] = TICRATE;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1076,6 +1091,15 @@ static void SV_SendResynch(INT32 node)
|
|||
break;
|
||||
}
|
||||
|
||||
if (!resynch_inprogress[node])
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, "Node %d (%s) somehow had resync status for nonexistent players?! (%08x)\n",
|
||||
node, player_names[nodetoplayer[node]], resynch_status[node] = 0x00
|
||||
);
|
||||
resynch_status[node] = 0x00;
|
||||
resynch_inprogress[node] = true; // So they get the PT_RESYNCHEND...
|
||||
}
|
||||
|
||||
if (resynch_score[node] > (unsigned)cv_resynchattempts.value*250)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
|
|
Loading…
Reference in a new issue