diff --git a/src/network/network_coordinator.cpp b/src/network/network_coordinator.cpp --- a/src/network/network_coordinator.cpp +++ b/src/network/network_coordinator.cpp @@ -135,7 +135,6 @@ bool ClientNetworkCoordinatorSocketHandl return false; case NETWORK_COORDINATOR_ERROR_REGISTRATION_FAILED: - SetDParamStr(0, detail); ShowErrorMessage(STR_NETWORK_ERROR_COORDINATOR_REGISTRATION_FAILED, STR_JUST_RAW_STRING, WL_ERROR); /* To prevent that we constantly try to reconnect, switch to local game. */ @@ -159,6 +158,15 @@ bool ClientNetworkCoordinatorSocketHandl return true; } + case NETWORK_COORDINATOR_ERROR_REUSE_OF_INVITE_CODE: + ShowErrorMessage(STR_NETWORK_ERROR_COORDINATOR_REUSE_OF_INVITE_CODE, STR_JUST_RAW_STRING, WL_ERROR); + + /* To prevent that we constantly battle for the same invite-code, switch to local game. */ + _settings_client.network.server_game_type = SERVER_GAME_TYPE_LOCAL; + + this->CloseConnection(); + return false; + default: Debug(net, 0, "Invalid error type {} received from Game Coordinator", error); this->CloseConnection();