| 2080 | } |
| 2081 | |
| 2082 | void NetworkBase::ProcessDisconnectedClients() |
| 2083 | { |
| 2084 | for (auto it = client_connection_list.begin(); it != client_connection_list.end();) |
| 2085 | { |
| 2086 | auto& connection = *it; |
| 2087 | |
| 2088 | if (!connection->shouldDisconnect) |
| 2089 | { |
| 2090 | it++; |
| 2091 | continue; |
| 2092 | } |
| 2093 | |
| 2094 | // Make sure to send all remaining packets out before disconnecting. |
| 2095 | connection->sendQueuedData(); |
| 2096 | connection->socket->Disconnect(); |
| 2097 | |
| 2098 | ServerClientDisconnected(connection); |
| 2099 | RemovePlayer(connection); |
| 2100 | |
| 2101 | it = client_connection_list.erase(it); |
| 2102 | } |
| 2103 | } |
| 2104 | |
| 2105 | void NetworkBase::AddClient(std::unique_ptr<ITcpSocket>&& socket) |
| 2106 | { |
nothing calls this directly
no test coverage detected