====================== SV_AddServerCommand The given command will be transmitted to the client, and is guaranteed to not have future snapshot_t executed before it is executed ====================== */
| 94 | ====================== |
| 95 | */ |
| 96 | void SV_AddServerCommand( client_t *client, const char *cmd ) { |
| 97 | int index; |
| 98 | |
| 99 | // if we would be losing an old command that hasn't been acknowledged, |
| 100 | // we must drop the connection |
| 101 | if ( client->reliableSequence - client->reliableAcknowledge > MAX_RELIABLE_COMMANDS ) { |
| 102 | SV_DropClient( client, "Server command overflow" ); |
| 103 | return; |
| 104 | } |
| 105 | client->reliableSequence++; |
| 106 | index = client->reliableSequence & ( MAX_RELIABLE_COMMANDS - 1 ); |
| 107 | if ( client->reliableCommands[ index ] ) { |
| 108 | Z_Free( client->reliableCommands[ index ] ); |
| 109 | } |
| 110 | client->reliableCommands[ index ] = CopyString( cmd ); |
| 111 | } |
| 112 | |
| 113 | |
| 114 | /* |
no test coverage detected