================= idAsyncClient::ProcessMessage ================= */
| 1595 | ================= |
| 1596 | */ |
| 1597 | void 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 | ================== |
nothing calls this directly
no test coverage detected