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

Method Receive_SERVER_ERROR

src/network/network_query.cpp:135–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135NetworkRecvStatus QueryNetworkGameSocketHandler::Receive_SERVER_ERROR(Packet &p)
136{
137 NetworkErrorCode error = (NetworkErrorCode)p.Recv_uint8();
138
139 Debug(net, 9, "Query::Receive_SERVER_ERROR(): error={}", error);
140
141 NetworkGame *item = NetworkGameListAddItem(this->connection_string);
142
143 if (error == NETWORK_ERROR_NOT_EXPECTED) {
144 /* If we query a server that is 1.11.1 or older, we get an
145 * NETWORK_ERROR_NOT_EXPECTED on requesting the game info. Show to the
146 * user this server is too old to query.
147 */
148 item->status = NGLS_TOO_OLD;
149 } else {
150 item->status = NGLS_OFFLINE;
151 }
152 item->refreshing = false;
153
154 UpdateNetworkGameWindow();
155
156 return NETWORK_RECV_STATUS_CLOSE_QUERY;
157}
158
159/**
160 * Check if any query needs to send or receive.

Callers

nothing calls this directly

Calls 3

NetworkGameListAddItemFunction · 0.85
UpdateNetworkGameWindowFunction · 0.85
Recv_uint8Method · 0.80

Tested by

no test coverage detected