tracking down bug on i386 platform

This commit is contained in:
Mark Vejvoda 2013-06-01 17:40:34 +00:00
parent e809080d0f
commit 0df2e19e10
2 changed files with 13 additions and 10 deletions

View File

@ -383,13 +383,13 @@ void MenuStateJoinGame::mouseClick(int x, int y, MouseButton mouseButton) {
soundRenderer.playFx(coreData.getClickSoundB()); soundRenderer.playFx(coreData.getClickSoundB());
labelInfo.setText(""); labelInfo.setText("");
if(clientInterface->isConnected()) if(clientInterface->isConnected()) {
{
clientInterface->reset(); clientInterface->reset();
} }
else else {
{ if(connectToServer() == true) {
connectToServer(); return;
}
} }
} }
else if(buttonCreateGame.mouseClick(x, y)){ else if(buttonCreateGame.mouseClick(x, y)){
@ -614,7 +614,9 @@ void MenuStateJoinGame::update()
} }
else if(autoConnectToServer == true) { else if(autoConnectToServer == true) {
autoConnectToServer = false; autoConnectToServer = false;
connectToServer(); if(connectToServer() == true) {
return;
}
} }
if(clientInterface != NULL && clientInterface->getLaunchGame()) if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] clientInterface->getLaunchGame() - D\n",__FILE__,__FUNCTION__); if(clientInterface != NULL && clientInterface->getLaunchGame()) if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] clientInterface->getLaunchGame() - D\n",__FILE__,__FUNCTION__);
@ -720,7 +722,7 @@ void MenuStateJoinGame::keyPress(SDL_KeyboardEvent c) {
} }
} }
void MenuStateJoinGame::connectToServer() { bool MenuStateJoinGame::connectToServer() {
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] START\n",__FILE__,__FUNCTION__); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] START\n",__FILE__,__FUNCTION__);
Config& config= Config::getInstance(); Config& config= Config::getInstance();
@ -752,7 +754,7 @@ void MenuStateJoinGame::connectToServer() {
for(time_t elapsedWait = time(NULL); for(time_t elapsedWait = time(NULL);
clientInterface->getIntroDone() == false && clientInterface->getIntroDone() == false &&
clientInterface->isConnected() && clientInterface->isConnected() &&
difftime(time(NULL),elapsedWait) <= 8;) { difftime(time(NULL),elapsedWait) <= 10;) {
if(clientInterface->isConnected()) { if(clientInterface->isConnected()) {
//update lobby //update lobby
clientInterface->updateLobby(); clientInterface->updateLobby();
@ -774,9 +776,10 @@ void MenuStateJoinGame::connectToServer() {
abortAutoFind = true; abortAutoFind = true;
clientInterface->stopServerDiscovery(); clientInterface->stopServerDiscovery();
mainMenu->setState(new MenuStateConnectedGame(program, mainMenu)); mainMenu->setState(new MenuStateConnectedGame(program, mainMenu));
return; return true;
} }
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] END\n",__FILE__,__FUNCTION__); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] END\n",__FILE__,__FUNCTION__);
return false;
} }
}}//end namespace }}//end namespace

View File

@ -89,7 +89,7 @@ public:
private: private:
void CommonInit(bool connect, Ip serverIp,int portNumberOverride); void CommonInit(bool connect, Ip serverIp,int portNumberOverride);
void connectToServer(); bool connectToServer();
virtual void DiscoveredServers(std::vector<string> serverList); virtual void DiscoveredServers(std::vector<string> serverList);
}; };
}}//end namespace }}//end namespace