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

Function SV_ClientEnterWorld

code/server/sv_client.cpp:244–266  ·  view source on GitHub ↗

================== SV_ClientEnterWorld ================== */

Source from the content-addressed store, hash-verified

242==================
243*/
244void SV_ClientEnterWorld( client_t *client, usercmd_t *cmd, SavedGameJustLoaded_e eSavedGameJustLoaded ) {
245 int clientNum;
246 gentity_t *ent;
247
248 Com_DPrintf ("SV_ClientEnterWorld() from %s\n", client->name);
249 client->state = CS_ACTIVE;
250
251 // set up the entity for the client
252 clientNum = client - svs.clients;
253 ent = SV_GentityNum( clientNum );
254 ent->s.number = clientNum;
255 client->gentity = ent;
256
257 // normally I check 'qbFromSavedGame' to avoid overwriting loaded client data, but this stuff I want
258 // to be reset so that client packet delta-ing bgins afresh, rather than based on your previous frame
259 // (which didn't in fact happen now if we've just loaded from a saved game...)
260 //
261 client->deltaMessage = -1;
262 client->cmdNum = 0;
263
264 // call the game begin function
265 ge->ClientBegin( client - svs.clients, cmd, eSavedGameJustLoaded );
266}
267
268/*
269============================================================

Callers 1

SV_UserMoveFunction · 0.70

Calls 2

SV_GentityNumFunction · 0.70
Com_DPrintfFunction · 0.50

Tested by

no test coverage detected