MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / CloseConnection

Method CloseConnection

src/network/network_query.cpp:20–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18std::vector<std::unique_ptr<QueryNetworkGameSocketHandler>> QueryNetworkGameSocketHandler::queries = {};
19
20NetworkRecvStatus QueryNetworkGameSocketHandler::CloseConnection(NetworkRecvStatus status)
21{
22 assert(status != NETWORK_RECV_STATUS_OKAY);
23 assert(this->sock != INVALID_SOCKET);
24
25 /* Connection is closed, but we never received a packet. Must be offline. */
26 NetworkGame *item = NetworkGameListAddItem(this->connection_string);
27 if (item->refreshing) {
28 item->status = NGLS_OFFLINE;
29 item->refreshing = false;
30
31 UpdateNetworkGameWindow();
32 }
33
34 return status;
35}
36
37/**
38 * Check the connection's state, i.e. is the connection still up?

Callers 2

CheckConnectionMethod · 0.95
ReceiveMethod · 0.95

Calls 2

NetworkGameListAddItemFunction · 0.85
UpdateNetworkGameWindowFunction · 0.85

Tested by

no test coverage detected