mirror of
https://github.com/glest/glest-source.git
synced 2025-08-18 06:01:17 +02:00
updated masterserver logic to more properly handle success and error conditions.
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
@@ -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));
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user