================== idAsyncClient::ProcessUnreliableServerMessage ================== */
| 734 | ================== |
| 735 | */ |
| 736 | void idAsyncClient::ProcessUnreliableServerMessage( const idBitMsg &msg ) { |
| 737 | int i, j, index, id, numDuplicatedUsercmds, aheadOfServer, numUsercmds, delta; |
| 738 | int serverGameInitId, serverGameFrame, serverGameTime; |
| 739 | idDict serverSI; |
| 740 | usercmd_t *last; |
| 741 | bool pureWait; |
| 742 | |
| 743 | serverGameInitId = msg.ReadInt(); |
| 744 | |
| 745 | id = msg.ReadByte(); |
| 746 | switch( id ) { |
| 747 | case SERVER_UNRELIABLE_MESSAGE_EMPTY: { |
| 748 | if ( idAsyncNetwork::verbose.GetInteger() ) { |
| 749 | common->Printf( "received empty message from server\n" ); |
| 750 | } |
| 751 | break; |
| 752 | } |
| 753 | case SERVER_UNRELIABLE_MESSAGE_PING: { |
| 754 | if ( idAsyncNetwork::verbose.GetInteger() == 2 ) { |
| 755 | common->Printf( "received ping message from server\n" ); |
| 756 | } |
| 757 | SendPingResponseToServer( msg.ReadInt() ); |
| 758 | break; |
| 759 | } |
| 760 | case SERVER_UNRELIABLE_MESSAGE_GAMEINIT: { |
| 761 | serverGameFrame = msg.ReadInt(); |
| 762 | serverGameTime = msg.ReadInt(); |
| 763 | msg.ReadDeltaDict( serverSI, NULL ); |
| 764 | pureWait = serverSI.GetBool( "si_pure" ); |
| 765 | |
| 766 | InitGame( serverGameInitId, serverGameFrame, serverGameTime, serverSI ); |
| 767 | |
| 768 | channel.ResetRate(); |
| 769 | |
| 770 | if ( idAsyncNetwork::verbose.GetInteger() ) { |
| 771 | common->Printf( "received gameinit, gameInitId = %d, gameFrame = %d, gameTime = %d\n", gameInitId, gameFrame, gameTime ); |
| 772 | } |
| 773 | |
| 774 | // mute sound |
| 775 | soundSystem->SetMute( true ); |
| 776 | |
| 777 | // ensure chat icon goes away when the GUI is changed... |
| 778 | //cvarSystem->SetCVarBool( "ui_chat", false ); |
| 779 | |
| 780 | if ( pureWait ) { |
| 781 | guiNetMenu = uiManager->FindGui( "guis/netmenu.gui", true, false, true ); |
| 782 | session->SetGUI( guiNetMenu, HandleGuiCommand ); |
| 783 | session->MessageBox( MSG_ABORT, common->GetLanguageDict()->GetString ( "#str_04317" ), common->GetLanguageDict()->GetString ( "#str_04318" ), false, "pure_abort" ); |
| 784 | } else { |
| 785 | // load map |
| 786 | session->SetGUI( NULL, NULL ); |
| 787 | sessLocal.ExecuteMapChange(); |
| 788 | } |
| 789 | |
| 790 | break; |
| 791 | } |
| 792 | case SERVER_UNRELIABLE_MESSAGE_SNAPSHOT: { |
| 793 | // if the snapshot is from a different game |
nothing calls this directly
no test coverage detected