MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / SendGameInitToClient

Method SendGameInitToClient

neo/framework/async/AsyncServer.cpp:1111–1133  ·  view source on GitHub ↗

================== idAsyncServer::SendGameInitToClient ================== */

Source from the content-addressed store, hash-verified

1109==================
1110*/
1111void idAsyncServer::SendGameInitToClient( int clientNum ) {
1112 idBitMsg msg;
1113 byte msgBuf[MAX_MESSAGE_SIZE];
1114
1115 if ( idAsyncNetwork::verbose.GetInteger() ) {
1116 common->Printf( "sending gameinit to client %d: gameInitId = %d, gameFrame = %d, gameTime = %d\n", clientNum, gameInitId, gameFrame, gameTime );
1117 }
1118
1119 serverClient_t &client = clients[clientNum];
1120
1121 // clear the unsent fragments. might flood winsock but that's ok
1122 while( client.channel.UnsentFragmentsLeft() ) {
1123 client.channel.SendNextFragment( serverPort, serverTime );
1124 }
1125
1126 msg.Init( msgBuf, sizeof( msgBuf ) );
1127 msg.WriteInt( gameInitId );
1128 msg.WriteByte( SERVER_UNRELIABLE_MESSAGE_GAMEINIT );
1129 msg.WriteInt( gameFrame );
1130 msg.WriteInt( gameTime );
1131 msg.WriteDeltaDict( sessLocal.mapSpawnData.serverInfo, NULL );
1132 client.gameInitSequence = client.channel.SendMessage( serverPort, serverTime, msg );
1133}
1134
1135/*
1136==================

Callers

nothing calls this directly

Calls 9

GetIntegerMethod · 0.80
UnsentFragmentsLeftMethod · 0.80
SendNextFragmentMethod · 0.80
WriteDeltaDictMethod · 0.80
PrintfMethod · 0.45
InitMethod · 0.45
WriteIntMethod · 0.45
WriteByteMethod · 0.45
SendMessageMethod · 0.45

Tested by

no test coverage detected