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

Method ProcessReliableMessagePure

neo/framework/async/AsyncClient.cpp:879–923  ·  view source on GitHub ↗

================== idAsyncClient::ProcessReliableMessagePure ================== */

Source from the content-addressed store, hash-verified

877==================
878*/
879void idAsyncClient::ProcessReliableMessagePure( const idBitMsg &msg ) {
880 idBitMsg outMsg;
881 byte msgBuf[ MAX_MESSAGE_SIZE ];
882 int inChecksums[ MAX_PURE_PAKS ];
883 int i;
884 int serverGameInitId;
885
886 session->SetGUI( NULL, NULL );
887
888 serverGameInitId = msg.ReadInt();
889
890 if ( serverGameInitId != gameInitId ) {
891 common->DPrintf( "ignoring pure server checksum from an outdated gameInitId (%d)\n", serverGameInitId );
892 return;
893 }
894
895 if ( !ValidatePureServerChecksums( serverAddress, msg ) ) {
896
897 return;
898 }
899
900 if ( idAsyncNetwork::verbose.GetInteger() ) {
901 common->Printf( "received new pure server info. ExecuteMapChange and report back\n" );
902 }
903
904 // it is now ok to load the next map with updated pure checksums
905 sessLocal.ExecuteMapChange( true );
906
907 // upon receiving our pure list, the server will send us SCS_INGAME and we'll start getting snapshots
908 fileSystem->GetPureServerChecksums( inChecksums );
909 outMsg.Init( msgBuf, sizeof( msgBuf ) );
910 outMsg.WriteByte( CLIENT_RELIABLE_MESSAGE_PURE );
911
912 outMsg.WriteInt( gameInitId );
913
914 i = 0;
915 while ( inChecksums[ i ] ) {
916 outMsg.WriteInt( inChecksums[ i++ ] );
917 }
918 outMsg.WriteInt( 0 );
919
920 if ( !channel.SendReliableMessage( outMsg ) ) {
921 common->Error( "client->server reliable messages overflow\n" );
922 }
923}
924
925/*
926===============

Callers

nothing calls this directly

Calls 12

SetGUIMethod · 0.80
GetIntegerMethod · 0.80
ReadIntMethod · 0.45
DPrintfMethod · 0.45
PrintfMethod · 0.45
ExecuteMapChangeMethod · 0.45
InitMethod · 0.45
WriteByteMethod · 0.45
WriteIntMethod · 0.45
SendReliableMessageMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected