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

Method ProcessMessage

neo/framework/async/AsyncClient.cpp:1597–1630  ·  view source on GitHub ↗

================= idAsyncClient::ProcessMessage ================= */

Source from the content-addressed store, hash-verified

1595=================
1596*/
1597void idAsyncClient::ProcessMessage( const netadr_t from, idBitMsg &msg ) {
1598 int id;
1599
1600 id = msg.ReadShort();
1601
1602 // check for a connectionless packet
1603 if ( id == CONNECTIONLESS_MESSAGE_ID ) {
1604 ConnectionlessMessage( from, msg );
1605 return;
1606 }
1607
1608 if ( clientState < CS_CONNECTED ) {
1609 return; // can't be a valid sequenced packet
1610 }
1611
1612 if ( msg.GetRemaingData() < 4 ) {
1613 common->DPrintf( "%s: tiny packet\n", Sys_NetAdrToString( from ) );
1614 return;
1615 }
1616
1617 // is this a packet from the server
1618 if ( !Sys_CompareNetAdrBase( from, channel.GetRemoteAddress() ) || id != serverId ) {
1619 common->DPrintf( "%s: sequenced server packet without connection\n", Sys_NetAdrToString( from ) );
1620 return;
1621 }
1622
1623 if ( !channel.Process( from, clientTime, msg, serverMessageSequence ) ) {
1624 return; // out of order, duplicated, fragment, etc.
1625 }
1626
1627 lastPacketTime = clientTime;
1628 ProcessReliableServerMessages();
1629 ProcessUnreliableServerMessage( msg );
1630}
1631
1632/*
1633==================

Callers

nothing calls this directly

Calls 7

GetRemaingDataMethod · 0.80
GetRemoteAddressMethod · 0.80
Sys_NetAdrToStringFunction · 0.50
Sys_CompareNetAdrBaseFunction · 0.50
ReadShortMethod · 0.45
DPrintfMethod · 0.45
ProcessMethod · 0.45

Tested by

no test coverage detected