diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index b0d1966a4..81bede301 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -47,8 +47,8 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu, b vector glestMaps, megaMaps, teamItems, controlItems; //create - buttonReturn.init(350, 140, 125); - buttonPlayNow.init(525, 140, 125); + buttonReturn.init(350, 180, 125); + buttonPlayNow.init(525, 180, 125); //map listBox findAll("maps/*.gbm", glestMaps, true, true); diff --git a/source/glest_game/network/client_interface.cpp b/source/glest_game/network/client_interface.cpp index 2660548ed..3a8ebcc4a 100755 --- a/source/glest_game/network/client_interface.cpp +++ b/source/glest_game/network/client_interface.cpp @@ -1,7 +1,7 @@ // ============================================================== // This file is part of Glest (www.glest.org) // -// Copyright (C) 2001-2008 Martiño Figueroa +// Copyright (C) 2001-2008 Marti�o Figueroa // // You can redistribute this code and/or modify it under // the terms of the GNU General Public License as published @@ -137,18 +137,24 @@ void ClientInterface::updateLobby() if(Socket::enableNetworkDebugInfo) printf("In [%s::%s] got NetworkMessageIntro\n",__FILE__,__FUNCTION__); //check consistency - if(Config::getInstance().getBool("NetworkConsistencyChecks")) + + if(networkMessageIntro.getVersionString() != getNetworkVersionString()) { - if(networkMessageIntro.getVersionString() != getNetworkVersionString()) - { - string sErr = "Server and client binary versions do not match [" + networkMessageIntro.getVersionString() + "]. You have to use the same binaries."; - printf("%s\n",sErr.c_str()); + string sErr = "Server and client binary mismatch!\nYou have to use the exactly same binaries!\n\nServer: " + + networkMessageIntro.getVersionString() + + "\nClient: " + getNetworkVersionString(); + printf("%s\n",sErr.c_str()); - sendTextMessage("Server and client binary mismatch [" + networkMessageIntro.getVersionString() + "]",-1); + sendTextMessage("Server and client binary mismatch!!",-1); + sendTextMessage(" Server:" + networkMessageIntro.getVersionString(),-1); + sendTextMessage(" Client: "+ getNetworkVersionString(),-1); + if(Config::getInstance().getBool("NetworkConsistencyChecks")) + {// error message and disconnect only if checked DisplayErrorMessage(sErr); - return; - } + return; + } } + //send intro message NetworkMessageIntro sendNetworkMessageIntro(getNetworkVersionString(), getHostName(), -1); @@ -474,17 +480,19 @@ void ClientInterface::waitUntilReady(Checksum* checksum) } //check checksum - if(Config::getInstance().getBool("NetworkConsistencyChecks")) + if(networkMessageReady.getChecksum() != checksum->getSum()) { - if(networkMessageReady.getChecksum() != checksum->getSum()) - { - string sErr = "Checksum error, you don't have the same data as the server"; - //throw runtime_error("Checksum error, you don't have the same data as the server"); - sendTextMessage(sErr,-1); - DisplayErrorMessage(sErr); - return; - } + string sErr = "Checksum error, you don't have the same data as the server"; + //throw runtime_error("Checksum error, you don't have the same data as the server"); + sendTextMessage(sErr,-1); + if(Config::getInstance().getBool("NetworkConsistencyChecks")) + {// error message and disconnect only if checked + DisplayErrorMessage(sErr); + return; + } + return; } + //delay the start a bit, so clients have nore room to get messages sleep(GameConstants::networkExtraLatency); diff --git a/source/glest_game/network/network_interface.cpp b/source/glest_game/network/network_interface.cpp index 09268075e..cf57375fd 100644 --- a/source/glest_game/network/network_interface.cpp +++ b/source/glest_game/network/network_interface.cpp @@ -1,7 +1,7 @@ // ============================================================== // This file is part of Glest (www.glest.org) // -// Copyright (C) 2001-2008 Martiño Figueroa +// Copyright (C) 2001-2008 Marti�o Figueroa // // You can redistribute this code and/or modify it under // the terms of the GNU General Public License as published @@ -92,6 +92,12 @@ bool NetworkInterface::isConnected(){ } void NetworkInterface::DisplayErrorMessage(string sErr, bool closeSocket) { + + if(closeSocket == true && getSocket() != NULL) + { + close(); + } + if(pCB_DisplayMessage != NULL) { pCB_DisplayMessage(sErr.c_str(), false); } @@ -99,10 +105,6 @@ void NetworkInterface::DisplayErrorMessage(string sErr, bool closeSocket) { throw runtime_error(sErr); } - if(closeSocket == true && getSocket() != NULL) - { - close(); - } }