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

Method ProcessReliableClientMessages

neo/framework/async/AsyncServer.cpp:1341–1381  ·  view source on GitHub ↗

================== idAsyncServer::ProcessReliableClientMessages ================== */

Source from the content-addressed store, hash-verified

1339==================
1340*/
1341void idAsyncServer::ProcessReliableClientMessages( int clientNum ) {
1342 idBitMsg msg;
1343 byte msgBuf[MAX_MESSAGE_SIZE];
1344 byte id;
1345
1346 serverClient_t &client = clients[clientNum];
1347
1348 msg.Init( msgBuf, sizeof( msgBuf ) );
1349
1350 while ( client.channel.GetReliableMessage( msg ) ) {
1351 id = msg.ReadByte();
1352 switch( id ) {
1353 case CLIENT_RELIABLE_MESSAGE_CLIENTINFO: {
1354 idDict info;
1355 msg.ReadDeltaDict( info, &sessLocal.mapSpawnData.userInfo[clientNum] );
1356 SendUserInfoBroadcast( clientNum, info );
1357 break;
1358 }
1359 case CLIENT_RELIABLE_MESSAGE_PRINT: {
1360 char string[MAX_STRING_CHARS];
1361 msg.ReadString( string, sizeof( string ) );
1362 common->Printf( "%s\n", string );
1363 break;
1364 }
1365 case CLIENT_RELIABLE_MESSAGE_DISCONNECT: {
1366 DropClient( clientNum, "#str_07138" );
1367 break;
1368 }
1369 case CLIENT_RELIABLE_MESSAGE_PURE: {
1370 // we get this message once the client has successfully updated it's pure list
1371 ProcessReliablePure( clientNum, msg );
1372 break;
1373 }
1374 default: {
1375 // pass reliable message on to game code
1376 game->ServerProcessReliableMessage( clientNum, msg );
1377 break;
1378 }
1379 }
1380 }
1381}
1382
1383/*
1384==================

Callers

nothing calls this directly

Calls 7

GetReliableMessageMethod · 0.80
ReadDeltaDictMethod · 0.80
InitMethod · 0.45
ReadByteMethod · 0.45
ReadStringMethod · 0.45
PrintfMethod · 0.45

Tested by

no test coverage detected