Only resend the gamestate to one client at a time

This commit is contained in:
Louis-Antoine 2020-10-27 01:22:31 +01:00
parent 7ae53364f2
commit 499bb56436

View file

@ -1391,6 +1391,16 @@ static boolean SV_SendServerConfig(INT32 node)
#ifndef NONET
#define SAVEGAMESIZE (768*1024)
static boolean SV_ResendingSavegameToAnyone(void)
{
INT32 i;
for (i = 0; i < MAXNETNODES; i++)
if (resendingsavegame[i])
return true;
return false;
}
static void SV_SendSaveGame(INT32 node, boolean resending)
{
size_t length, compressedlen;
@ -4074,7 +4084,8 @@ static void HandlePacketFromPlayer(SINT8 node)
// Check player consistancy during the level
if (realstart <= gametic && realstart + BACKUPTICS - 1 > gametic && gamestate == GS_LEVEL
&& consistancy[realstart%BACKUPTICS] != SHORT(netbuffer->u.clientpak.consistancy)
&& !resendingsavegame[node] && savegameresendcooldown[node] <= I_GetTime())
&& !resendingsavegame[node] && savegameresendcooldown[node] <= I_GetTime()
&& !SV_ResendingSavegameToAnyone())
{
if (cv_resynchattempts.value)
{