MCPcopy Create free account
hub / github.com/JACoders/OpenJK / SV_DropClient

Function SV_DropClient

code/server/sv_client.cpp:162–182  ·  view source on GitHub ↗

===================== 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 ===================== */

Source from the content-addressed store, hash-verified

160=====================
161*/
162void 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================

Callers 6

SV_Disconnect_fFunction · 0.70
SV_ExecuteClientMessageFunction · 0.70
SV_SpawnServerFunction · 0.70
SV_AddServerCommandFunction · 0.70
SV_CheckTimeoutsFunction · 0.70
SV_GameDropClientFunction · 0.70

Calls 2

SV_SendServerCommandFunction · 0.70
FS_FreeFileFunction · 0.50

Tested by

no test coverage detected