| 584 | |
| 585 | |
| 586 | bool CServerConnect::IsServerIP(uint32 ip) const |
| 587 | { |
| 588 | if (ip == 0) { |
| 589 | return false; |
| 590 | } |
| 591 | // Match the live connection first -- cheapest, hottest case. |
| 592 | if (connectedsocket && connectedsocket->cur_server |
| 593 | && connectedsocket->cur_server->GetIP() == ip) { |
| 594 | return true; |
| 595 | } |
| 596 | // Then any login still in flight. m_lstOpenSockets includes |
| 597 | // connectedsocket too, but the early-out above keeps the common |
| 598 | // case to a single pointer chase; the loop only runs when we're |
| 599 | // actively trying multiple servers in parallel, which is bounded |
| 600 | // by max_simcons (typically 2-3) so it's negligible. |
| 601 | for (SocketsList::const_iterator it = m_lstOpenSockets.begin(); |
| 602 | it != m_lstOpenSockets.end(); ++it) { |
| 603 | const CServerSocket* sock = *it; |
| 604 | if (sock && sock->cur_server && sock->cur_server->GetIP() == ip) { |
| 605 | return true; |
| 606 | } |
| 607 | } |
| 608 | return false; |
| 609 | } |
| 610 | |
| 611 | |
| 612 | void CServerConnect::KeepConnectionAlive() |
no test coverage detected