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

Method SendEmptyToServer

neo/framework/async/AsyncClient.cpp:609–638  ·  view source on GitHub ↗

================== idAsyncClient::SendEmptyToServer ================== */

Source from the content-addressed store, hash-verified

607==================
608*/
609void 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==================

Callers

nothing calls this directly

Calls 8

GetIntegerMethod · 0.80
UnsentFragmentsLeftMethod · 0.80
SendNextFragmentMethod · 0.80
PrintfMethod · 0.45
InitMethod · 0.45
WriteIntMethod · 0.45
WriteByteMethod · 0.45
SendMessageMethod · 0.45

Tested by

no test coverage detected