================== idAsyncClient::SendEmptyToServer ================== */
| 607 | ================== |
| 608 | */ |
| 609 | void idAsyncClient::SendEmptyToServer( bool force, bool mapLoad ) { |
| 610 | idBitMsg msg; |
| 611 | byte msgBuf[MAX_MESSAGE_SIZE]; |
| 612 | |
| 613 | if ( lastEmptyTime > realTime ) { |
| 614 | lastEmptyTime = realTime; |
| 615 | } |
| 616 | |
| 617 | if ( !force && ( realTime - lastEmptyTime < EMPTY_RESEND_TIME ) ) { |
| 618 | return; |
| 619 | } |
| 620 | |
| 621 | if ( idAsyncNetwork::verbose.GetInteger() ) { |
| 622 | common->Printf( "sending empty to server, gameInitId = %d\n", mapLoad ? GAME_INIT_ID_MAP_LOAD : gameInitId ); |
| 623 | } |
| 624 | |
| 625 | msg.Init( msgBuf, sizeof( msgBuf ) ); |
| 626 | msg.WriteInt( serverMessageSequence ); |
| 627 | msg.WriteInt( mapLoad ? GAME_INIT_ID_MAP_LOAD : gameInitId ); |
| 628 | msg.WriteInt( snapshotSequence ); |
| 629 | msg.WriteByte( CLIENT_UNRELIABLE_MESSAGE_EMPTY ); |
| 630 | |
| 631 | channel.SendMessage( clientPort, clientTime, msg ); |
| 632 | |
| 633 | while( channel.UnsentFragmentsLeft() ) { |
| 634 | channel.SendNextFragment( clientPort, clientTime ); |
| 635 | } |
| 636 | |
| 637 | lastEmptyTime = realTime; |
| 638 | } |
| 639 | |
| 640 | /* |
| 641 | ================== |
nothing calls this directly
no test coverage detected