mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-22 22:13:35 +02:00
Merge pull request #970 from Nordsoft91/srv-healthcheck
Add simple server healthcheck
This commit is contained in:
commit
1c62f9db1a
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
#include "lobby/CSelectionBase.h"
|
#include "lobby/CSelectionBase.h"
|
||||||
#include "lobby/CLobbyScreen.h"
|
#include "lobby/CLobbyScreen.h"
|
||||||
|
#include "windows/InfoWindows.h"
|
||||||
|
|
||||||
#include "mainmenu/CMainMenu.h"
|
#include "mainmenu/CMainMenu.h"
|
||||||
|
|
||||||
@ -161,6 +162,20 @@ void CServerHandler::startLocalServerAndConnect()
|
|||||||
threadRunLocalServer->join();
|
threadRunLocalServer->join();
|
||||||
|
|
||||||
th->update();
|
th->update();
|
||||||
|
|
||||||
|
auto errorMsg = CGI->generaltexth->localizedTexts["server"]["errors"]["existingProcess"].String();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
CConnection testConnection(settings["server"]["server"].String(), getDefaultPort(), NAME, uuid);
|
||||||
|
logNetwork->error("Port is busy, check if another instance of vcmiserver is working");
|
||||||
|
CInfoWindow::showInfoDialog(errorMsg, {});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
catch(...)
|
||||||
|
{
|
||||||
|
//no connection means that port is not busy and we can start local server
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef VCMI_ANDROID
|
#ifdef VCMI_ANDROID
|
||||||
{
|
{
|
||||||
CAndroidVMHelper envHelper;
|
CAndroidVMHelper envHelper;
|
||||||
|
@ -27,6 +27,13 @@
|
|||||||
"spellUnknownProblem": "Unknown problem with this spell, no more information available.",
|
"spellUnknownProblem": "Unknown problem with this spell, no more information available.",
|
||||||
"playerAttacked" : "Player has been attacked: %s"
|
"playerAttacked" : "Player has been attacked: %s"
|
||||||
},
|
},
|
||||||
|
"server" :
|
||||||
|
{
|
||||||
|
"errors" :
|
||||||
|
{
|
||||||
|
"existingProcess" : "Another vcmiserver process is running, please terminate it first"
|
||||||
|
}
|
||||||
|
},
|
||||||
"systemOptions" :
|
"systemOptions" :
|
||||||
{
|
{
|
||||||
"fullscreenButton" :
|
"fullscreenButton" :
|
||||||
@ -67,12 +74,12 @@
|
|||||||
"allOf" : "All of the following:",
|
"allOf" : "All of the following:",
|
||||||
"noneOf" : "None of the following:"
|
"noneOf" : "None of the following:"
|
||||||
},
|
},
|
||||||
"heroWindow":
|
"heroWindow" :
|
||||||
{
|
{
|
||||||
"openCommander":
|
"openCommander" :
|
||||||
{
|
{
|
||||||
"label": "Open commander window",
|
"label" : "Open commander window",
|
||||||
"help": "Displays information about commander of this hero"
|
"help" : "Displays information about commander of this hero"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"commanderWindow":
|
"commanderWindow":
|
||||||
|
Loading…
Reference in New Issue
Block a user