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

Function SV_SendClientSnapshot

code/server/sv_snapshot.cpp:666–696  ·  view source on GitHub ↗

======================= SV_SendClientSnapshot ======================= */

Source from the content-addressed store, hash-verified

664=======================
665*/
666void SV_SendClientSnapshot( client_t *client ) {
667 byte msg_buf[MAX_MSGLEN];
668 msg_t msg;
669
670 // build the snapshot
671 SV_BuildClientSnapshot( client );
672
673 // bots need to have their snapshots build, but
674 // the query them directly without needing to be sent
675 if ( client->gentity && client->gentity->svFlags & SVF_BOT ) {
676 return;
677 }
678
679 MSG_Init (&msg, msg_buf, sizeof(msg_buf));
680 msg.allowoverflow = qtrue;
681
682 // (re)send any reliable server commands
683 SV_UpdateServerCommandsToClient( client, &msg );
684
685 // send over all the relevant entityState_t
686 // and the playerState_t
687 SV_WriteSnapshotToClient( client, &msg );
688
689 // check for overflow
690 if ( msg.overflowed ) {
691 Com_Printf ("WARNING: msg overflowed for %s\n", client->name);
692 MSG_Clear (&msg);
693 }
694
695 SV_SendMessageToClient( &msg, client );
696}
697
698
699/*

Callers 2

SV_SendClientMessagesFunction · 0.70
SV_FinalMessageFunction · 0.70

Calls 7

SV_BuildClientSnapshotFunction · 0.70
SV_WriteSnapshotToClientFunction · 0.70
SV_SendMessageToClientFunction · 0.70
MSG_InitFunction · 0.50
Com_PrintfFunction · 0.50
MSG_ClearFunction · 0.50

Tested by

no test coverage detected