diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index e63b107e5..8b4c69c4d 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -63,7 +63,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu, b lastMasterserverPublishing = time(NULL); soundConnectionCount=0; - mainMessageBox.init(lang.get("Ok")); + mainMessageBox.init(lang.get("Ok"),lang.get("Return")); mainMessageBox.setEnabled(false); mainMessageBoxState=0; @@ -265,6 +265,10 @@ void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton){ { mainMessageBox.setEnabled(false); } + else if(button==2) + { + returnToParentMenu(); + } } } else if(buttonReturn.mouseClick(x,y)){ @@ -525,9 +529,9 @@ void MenuStateCustomGame::update() if(showMasterserverError) { - if(masterServererErrorToShow=="wrong router setup") + if(EndsWith(masterServererErrorToShow, "wrong router setup") == true) { - masterServererErrorToShow=lang.get(" wrong router setup"); + masterServererErrorToShow=lang.get("wrong router setup"); } showMasterserverError=true; listBoxPublishServer.setSelectedItemIndex(1); @@ -812,12 +816,13 @@ void MenuStateCustomGame::simpleTask() { std::string serverInfo = SystemFlags::getHTTP(request); printf("the result is:\n'%s'\n",serverInfo.c_str()); -// uncomment to enable router setup check of this server -// if(serverInfo!="OK") -// { -// showMasterserverError=true; -// masterServererErrorToShow=serverInfo; -// } + // uncomment to enable router setup check of this server + //if(serverInfo!="OK") + if(EndsWith(serverInfo, "OK") == false) + { + showMasterserverError=true; + masterServererErrorToShow=serverInfo; + } } if(needToBroadcastServerSettings) { diff --git a/source/glest_game/menu/menu_state_masterserver.cpp b/source/glest_game/menu/menu_state_masterserver.cpp index da8f24fb2..5bf2294df 100644 --- a/source/glest_game/menu/menu_state_masterserver.cpp +++ b/source/glest_game/menu/menu_state_masterserver.cpp @@ -390,6 +390,7 @@ void MenuStateMasterserver::connectToServer(string ipString) //config.setString("ServerIp", serverIp.getString()); //config.save(); + BaseThread::shutdownAndWait(updateFromMasterserverThread); mainMenu->setState(new MenuStateConnectedGame(program, mainMenu,jmMasterserver)); }