Prevent SV_DropClient() from being called recursively if the client is dropped by a kick or timeout and has too many reliable commands

This commit is contained in:
smallmodel authored and Tim Angus committed 2024-10-11 21:03:44 +01:00
1 parent 009f520633
commit cc18246f22
2 files changed
+16

No files matched your search

+6
View File
@@ -159,6 +159,12 @@ void SV_AddServerCommand( client_t *client, const char *cmd ) {
// we check == instead of >= so a broadcast print added by SV_DropClient()
// doesn't cause a recursive drop client
if ( client->reliableSequence - client->reliableAcknowledge == MAX_RELIABLE_COMMANDS + 1 ) {
if ( client->gamestateMessageNum == -1 ) {
// invalid game state message
// this can occur in SV_DropClient() to avoid calling it more than once
return;
}
Com_Printf( "===== pending server commands =====\n" );
for ( i = client->reliableAcknowledge + 1 ; i <= client->reliableSequence ; i++ ) {
Com_Printf( "cmd %5d: %s\n", i, client->reliableCommands[ i & (MAX_RELIABLE_COMMANDS-1) ] );