From 472aa69c5c409a71fcb4c7c41e473ae425dfe987 Mon Sep 17 00:00:00 2001 From: Titus Tscharntke Date: Sun, 2 Jan 2011 18:47:43 +0000 Subject: [PATCH] You see an error message now if you cannot connect to a server and irc is not quitted. --- source/glest_game/menu/menu_state_masterserver.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/glest_game/menu/menu_state_masterserver.cpp b/source/glest_game/menu/menu_state_masterserver.cpp index 94acb419b..5bcfb50c2 100644 --- a/source/glest_game/menu/menu_state_masterserver.cpp +++ b/source/glest_game/menu/menu_state_masterserver.cpp @@ -434,14 +434,14 @@ void MenuStateMasterserver::mouseClick(int x, int y, MouseButton mouseButton){ soundRenderer.playFx(coreData.getClickSoundB()); string connectServerIP = serverLines[i]->getMasterServerInfo()->getIpAddress(); int connectServerPort = serverLines[i]->getMasterServerInfo()->getExternalConnectPort(); - connectToServer(connectServerIP,connectServerPort); + bool connected=connectToServer(connectServerIP,connectServerPort); SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); safeMutex.ReleaseLock(); - - cleanup(); - - SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); - mainMenu->setState(new MenuStateConnectedGame(program, mainMenu,jmMasterserver)); + if(connected){ + cleanup(); + SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); + mainMenu->setState(new MenuStateConnectedGame(program, mainMenu,jmMasterserver)); + } break; } }