Give gamestate resend integrity check some teeth

This commit is contained in:
AJ Martinez 2023-03-21 23:34:56 -07:00 committed by James R
parent 137f166043
commit f9832eb77f

View file

@ -1388,14 +1388,16 @@ static void CL_LoadReceivedSavegame(boolean reloading)
netbuffer->packettype = PT_RECEIVEDGAMESTATE; netbuffer->packettype = PT_RECEIVEDGAMESTATE;
HSendPacket(servernode, true, 0, 0); HSendPacket(servernode, true, 0, 0);
int i; if (reloading)
for (i = 0; i < MAXPLAYERS; i++)
{ {
if (memcmp(priorGamestateKeySave[i], players[i].public_key, sizeof(priorGamestateKeySave[i])) != 0) int i;
for (i = 0; i < MAXPLAYERS; i++)
{ {
CONS_Printf("New gamestate has different public keys, shenanigans afoot?\n"); if (memcmp(priorGamestateKeySave[i], players[i].public_key, sizeof(priorGamestateKeySave[i])) != 0)
// TODO: Actually do something in this situation {
break; HandleSigfail("Gamestate reload contained new keys");
break;
}
} }
} }
} }