mirror of
https://github.com/glest/glest-source.git
synced 2025-08-25 01:05:50 +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);
|
lastMasterserverPublishing = time(NULL);
|
||||||
soundConnectionCount=0;
|
soundConnectionCount=0;
|
||||||
|
|
||||||
mainMessageBox.init(lang.get("Ok"));
|
mainMessageBox.init(lang.get("Ok"),lang.get("Return"));
|
||||||
mainMessageBox.setEnabled(false);
|
mainMessageBox.setEnabled(false);
|
||||||
mainMessageBoxState=0;
|
mainMessageBoxState=0;
|
||||||
|
|
||||||
@@ -265,6 +265,10 @@ void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton){
|
|||||||
{
|
{
|
||||||
mainMessageBox.setEnabled(false);
|
mainMessageBox.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
else if(button==2)
|
||||||
|
{
|
||||||
|
returnToParentMenu();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(buttonReturn.mouseClick(x,y)){
|
else if(buttonReturn.mouseClick(x,y)){
|
||||||
@@ -525,9 +529,9 @@ void MenuStateCustomGame::update()
|
|||||||
|
|
||||||
if(showMasterserverError)
|
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;
|
showMasterserverError=true;
|
||||||
listBoxPublishServer.setSelectedItemIndex(1);
|
listBoxPublishServer.setSelectedItemIndex(1);
|
||||||
@@ -812,12 +816,13 @@ void MenuStateCustomGame::simpleTask() {
|
|||||||
|
|
||||||
std::string serverInfo = SystemFlags::getHTTP(request);
|
std::string serverInfo = SystemFlags::getHTTP(request);
|
||||||
printf("the result is:\n'%s'\n",serverInfo.c_str());
|
printf("the result is:\n'%s'\n",serverInfo.c_str());
|
||||||
// uncomment to enable router setup check of this server
|
// uncomment to enable router setup check of this server
|
||||||
// if(serverInfo!="OK")
|
//if(serverInfo!="OK")
|
||||||
// {
|
if(EndsWith(serverInfo, "OK") == false)
|
||||||
// showMasterserverError=true;
|
{
|
||||||
// masterServererErrorToShow=serverInfo;
|
showMasterserverError=true;
|
||||||
// }
|
masterServererErrorToShow=serverInfo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(needToBroadcastServerSettings)
|
if(needToBroadcastServerSettings)
|
||||||
{
|
{
|
||||||
|
@@ -390,6 +390,7 @@ void MenuStateMasterserver::connectToServer(string ipString)
|
|||||||
//config.setString("ServerIp", serverIp.getString());
|
//config.setString("ServerIp", serverIp.getString());
|
||||||
//config.save();
|
//config.save();
|
||||||
|
|
||||||
|
BaseThread::shutdownAndWait(updateFromMasterserverThread);
|
||||||
mainMenu->setState(new MenuStateConnectedGame(program, mainMenu,jmMasterserver));
|
mainMenu->setState(new MenuStateConnectedGame(program, mainMenu,jmMasterserver));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user