mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-02-10 18:20:49 +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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resynch_inprogress[node] = false; // Let's see if there's REALLY anyone left to sync.....
|
||||||
netbuffer->packettype = PT_RESYNCHING;
|
netbuffer->packettype = PT_RESYNCHING;
|
||||||
for (i = 0, j = 0; i < MAXPLAYERS; ++i)
|
for (i = 0, j = 0; i < MAXPLAYERS; ++i)
|
||||||
{
|
{
|
||||||
|
@ -1059,10 +1060,24 @@ static void SV_SendResynch(INT32 node)
|
||||||
if (!(resynch_status[node] & 1<<i))
|
if (!(resynch_status[node] & 1<<i))
|
||||||
continue;
|
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
|
// waiting for a reply or just waiting in general
|
||||||
if (resynch_sent[node][i])
|
if (resynch_sent[node][i])
|
||||||
{
|
{
|
||||||
--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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1076,6 +1091,15 @@ static void SV_SendResynch(INT32 node)
|
||||||
break;
|
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)
|
if (resynch_score[node] > (unsigned)cv_resynchattempts.value*250)
|
||||||
{
|
{
|
||||||
XBOXSTATIC UINT8 buf[2];
|
XBOXSTATIC UINT8 buf[2];
|
||||||
|
|
Loading…
Reference in a new issue