================== idAsyncClient::ProcessConnectResponseMessage ================== */
| 1103 | ================== |
| 1104 | */ |
| 1105 | void idAsyncClient::ProcessConnectResponseMessage( const netadr_t from, const idBitMsg &msg ) { |
| 1106 | int serverGameInitId, serverGameFrame, serverGameTime; |
| 1107 | idDict serverSI; |
| 1108 | |
| 1109 | if ( clientState >= CS_CONNECTED ) { |
| 1110 | common->Printf( "Duplicate connect received.\n" ); |
| 1111 | return; |
| 1112 | } |
| 1113 | if ( clientState != CS_CONNECTING ) { |
| 1114 | common->Printf( "Connect response packet while not connecting.\n" ); |
| 1115 | return; |
| 1116 | } |
| 1117 | if ( !Sys_CompareNetAdrBase( from, serverAddress ) ) { |
| 1118 | common->Printf( "Connect response from a different server.\n" ); |
| 1119 | common->Printf( "%s should have been %s\n", Sys_NetAdrToString( from ), Sys_NetAdrToString( serverAddress ) ); |
| 1120 | return; |
| 1121 | } |
| 1122 | |
| 1123 | common->Printf( "received connect response from %s\n", Sys_NetAdrToString( from ) ); |
| 1124 | |
| 1125 | channel.Init( from, clientId ); |
| 1126 | clientNum = msg.ReadInt(); |
| 1127 | clientState = CS_CONNECTED; |
| 1128 | lastPacketTime = -9999; |
| 1129 | |
| 1130 | serverGameInitId = msg.ReadInt(); |
| 1131 | serverGameFrame = msg.ReadInt(); |
| 1132 | serverGameTime = msg.ReadInt(); |
| 1133 | msg.ReadDeltaDict( serverSI, NULL ); |
| 1134 | |
| 1135 | InitGame( serverGameInitId, serverGameFrame, serverGameTime, serverSI ); |
| 1136 | |
| 1137 | // load map |
| 1138 | session->SetGUI( NULL, NULL ); |
| 1139 | sessLocal.ExecuteMapChange(); |
| 1140 | |
| 1141 | clientPredictTime = clientPrediction = idMath::ClampInt( 0, idAsyncNetwork::clientMaxPrediction.GetInteger(), clientTime - lastConnectTime ); |
| 1142 | } |
| 1143 | |
| 1144 | /* |
| 1145 | ================== |
nothing calls this directly
no test coverage detected