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

Method Receive_SERVER_NEWGAME

src/network/network_client.cpp:1076–1093  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1074}
1075
1076NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_NEWGAME(Packet &)
1077{
1078 Debug(net, 9, "Client::Receive_SERVER_NEWGAME()");
1079
1080 /* Only when we're trying to join we really
1081 * care about the server shutting down. */
1082 if (this->status >= STATUS_JOIN) {
1083 /* To throttle the reconnects a bit, every clients waits its
1084 * Client ID modulo 16 + 1 (value 0 means no reconnect).
1085 * This way reconnects should be spread out a bit. */
1086 _network_reconnect = _network_own_client_id % 16 + 1;
1087 ShowErrorMessage(GetEncodedString(STR_NETWORK_MESSAGE_SERVER_REBOOT), {}, WL_CRITICAL);
1088 }
1089
1090 if (this->status == STATUS_ACTIVE) ClientNetworkEmergencySave();
1091
1092 return NETWORK_RECV_STATUS_SERVER_ERROR;
1093}
1094
1095NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_RCON(Packet &p)
1096{

Callers

nothing calls this directly

Calls 3

ShowErrorMessageFunction · 0.85
GetEncodedStringFunction · 0.50

Tested by

no test coverage detected