===================== SV_DropClient Called when the player is totally leaving the server, either willingly or unwillingly. This is NOT called if the entire server is quiting or crashing -- SV_FinalMessage() will handle that ===================== */
| 160 | ===================== |
| 161 | */ |
| 162 | void SV_DropClient( client_t *drop, const char *reason ) { |
| 163 | if ( drop->state == CS_ZOMBIE ) { |
| 164 | return; // already dropped |
| 165 | } |
| 166 | drop->state = CS_ZOMBIE; // become free in a few seconds |
| 167 | |
| 168 | if (drop->download) { |
| 169 | FS_FreeFile (drop->download); |
| 170 | drop->download = NULL; |
| 171 | } |
| 172 | |
| 173 | // call the prog function for removing a client |
| 174 | // this will remove the body, among other things |
| 175 | ge->ClientDisconnect( drop - svs.clients ); |
| 176 | |
| 177 | // tell everyone why they got dropped |
| 178 | SV_SendServerCommand( NULL, "print \"%s %s\n\"", drop->name, reason ); |
| 179 | |
| 180 | // add the disconnect command |
| 181 | SV_SendServerCommand( drop, "disconnect" ); |
| 182 | } |
| 183 | |
| 184 | /* |
| 185 | ================ |
no test coverage detected