MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / ProcessDisconnectedClients

Method ProcessDisconnectedClients

src/openrct2/network/NetworkBase.cpp:2082–2103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 4

sendQueuedDataMethod · 0.80
endMethod · 0.65
beginMethod · 0.45
DisconnectMethod · 0.45

Tested by

no test coverage detected