=================== CL_DisconnectPacket Sometimes the server can drop the client and the netchan based disconnect can be lost. If the client continues to send packets to the server, the server will send out of band disconnect packets to the client so it doesn't have to wait for the full timeout period. =================== */
| 534 | =================== |
| 535 | */ |
| 536 | void CL_DisconnectPacket( netadr_t from ) { |
| 537 | if ( cls.state != CA_ACTIVE ) { |
| 538 | return; |
| 539 | } |
| 540 | |
| 541 | // if not from our server, ignore it |
| 542 | if ( !NET_CompareAdr( from, clc.netchan.remoteAddress ) ) { |
| 543 | return; |
| 544 | } |
| 545 | |
| 546 | // if we have received packets within three seconds, ignore it |
| 547 | // (it might be a malicious spoof) |
| 548 | if ( cls.realtime - clc.lastPacketTime < 3000 ) { |
| 549 | return; |
| 550 | } |
| 551 | |
| 552 | // drop the connection (FIXME: connection dropped dialog) |
| 553 | Com_Printf( "Server disconnected for unknown reason\n" ); |
| 554 | CL_Disconnect(); |
| 555 | } |
| 556 | |
| 557 | |
| 558 | /* |
no test coverage detected