| 539 | //----------------------------------------------------------------------------- |
| 540 | |
| 541 | void cancelServerQuery() |
| 542 | { |
| 543 | // Cancel the current query, if there is anything left |
| 544 | // on the ping list, it's dropped. |
| 545 | if ( sgServerQueryActive ) |
| 546 | { |
| 547 | Con::printf( "Server query canceled." ); |
| 548 | ServerInfo* si; |
| 549 | |
| 550 | // Clear the master server packet list: |
| 551 | gPacketStatusList.clear(); |
| 552 | |
| 553 | // Clear the ping list: |
| 554 | while ( gPingList.size() ) |
| 555 | { |
| 556 | si = findServerInfo( &gPingList[0].address ); |
| 557 | if ( si && !si->status.test( ServerInfo::Status_Responded ) ) |
| 558 | si->status = ServerInfo::Status_TimedOut; |
| 559 | |
| 560 | gPingList.erase( U32( 0 ) ); |
| 561 | } |
| 562 | |
| 563 | // Clear the query list: |
| 564 | while ( gQueryList.size() ) |
| 565 | { |
| 566 | si = findServerInfo( &gQueryList[0].address ); |
| 567 | if ( si && !si->status.test( ServerInfo::Status_Responded ) ) |
| 568 | si->status = ServerInfo::Status_TimedOut; |
| 569 | |
| 570 | gQueryList.erase( U32( 0 ) ); |
| 571 | } |
| 572 | |
| 573 | sgServerQueryActive = false; |
| 574 | gServerBrowserDirty = true; |
| 575 | } |
| 576 | } |
| 577 | |
| 578 | //----------------------------------------------------------------------------- |
| 579 | |