Networking reliability changes

This commit is contained in:
mathusummut
2018-12-10 17:46:52 +01:00
parent 19fe3e6b52
commit 8ad84534ef
6 changed files with 12 additions and 21 deletions

View File

@@ -1,15 +1,8 @@
# Installing ZetaGlest
It's recommended to first [read about the system
requirements](https://zetaglest.github.io/docs/system_requirements.html).
(even though they probably need editing and updating)
You can install from source or download Installers or packages for your
operating system.
There hasn't been a formal first release of ZetaGlest yet, but you may
try development snapshots.
## Binary Packages
**Note:** Installation is not necessary to run the game. You can build
@@ -73,7 +66,6 @@ INSTALL_DIR_MAN:PATH=/home/andy/local/share/man/man6
If you wish to install to a location that does not require super-user
privileges, change '/usr' to a location to which you have write access.
<!-- This needs to be duplicated in the BUILD.md and INSTALL.md doc -->
See [running](https://github.com/ZetaGlest/zetaglest-source#running) for
detailed information about running a server or hosting a game.
@@ -93,7 +85,6 @@ If you want to completely erase your previously-used options, remove
If your build doesn't seem to be using the options you gave it, first
try removing CMakeCache.txt and rebuilding.
<!-- end duplication -->
**Note:** The majority of the game data is not installed during the
steps above. The files from the zetaglest-data repo must be copied into

View File

@@ -457,6 +457,7 @@ namespace Game {
luaScript.registerFunction(getUnitFaction, "unitFaction");
luaScript.registerFunction(getFactionName, "getFactionName");
luaScript.registerFunction(getUnitName, "unitName");
luaScript.registerFunction(getResourceAmount, "resourceAmount");
luaScript.registerFunction(getLastCreatedUnitName,

View File

@@ -48,7 +48,6 @@ using namespace Shared;
using namespace Shared::Util;
namespace Game {
const int MASTERSERVER_BROADCAST_MAX_WAIT_RESPONSE_SECONDS = 15;
static const char *SAVED_GAME_FILENAME = "lastCustomGameSettings.zgg";
static const char *DEFAULT_GAME_FILENAME = "data/defaultGameSetup.zgg";
static const char *DEFAULT_NETWORKGAME_FILENAME =
@@ -3828,32 +3827,30 @@ namespace Game {
return;
}
// Give things another chance to see if we can get a connection from the master server
if (tMasterserverErrorElapsed > 0 &&
/*if (tMasterserverErrorElapsed > 0 &&
difftime((long int) time(NULL),
tMasterserverErrorElapsed) >
MASTERSERVER_BROADCAST_MAX_WAIT_RESPONSE_SECONDS) {
showMasterserverError = true;
masterServererErrorToShow =
(serverInfo != "" ? serverInfo : "No Reply");
} else {
} else {*/
if (tMasterserverErrorElapsed == 0) {
tMasterserverErrorElapsed = time(NULL);
}
SystemFlags::OutputDebug(SystemFlags::debugError,
"In [%s::%s Line %d] error checking response from masterserver elapsed seconds = %.2f / %d\nResponse:\n%s\n",
"In [%s::%s Line %d] error checking response from masterserver elapsed seconds = %.2f\nResponse:\n%s\n",
extractFileFromDirectoryPath
(__FILE__).c_str(),
__FUNCTION__, __LINE__,
difftime((long int)
time(NULL),
tMasterserverErrorElapsed),
MASTERSERVER_BROADCAST_MAX_WAIT_RESPONSE_SECONDS,
serverInfo.c_str());
// Give things another chance to see if we can get a connection from the master server
needToRepublishToMasterserver = true;
}
//}
}
} else {
safeMutexThreadOwner.ReleaseLock();

View File

@@ -1481,7 +1481,7 @@ namespace Game {
}
bool ClientInterface::isMasterServerAdminOverride() {
return (gameSettings.getMasterserver_admin() == this->getSessionKey());
return gameSettings.getMasterserver_admin() == this->getSessionKey();
}
void ClientInterface::waitUntilReady(Checksum* checksum) {

View File

@@ -852,7 +852,7 @@ namespace Game {
//printf("Got uuid from client [%s]\n",this->playerUUID.c_str());
if (SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork, "In [%s::%s] got name [%s] versionString [%s], msgSessionId = %d\n", __FILE__, __FUNCTION__, name.c_str(), versionString.c_str(), msgSessionId);
if (msgSessionId != sessionKey) {
/*if (msgSessionId != sessionKey) {
string playerNameStr = name;
string sErr = "Client gave invalid sessionid for player [" + playerNameStr + "] actual [" + intToStr(msgSessionId) + "] expected [" + intToStr(sessionKey) + "]";
printf("%s\n", sErr.c_str());
@@ -860,7 +860,7 @@ namespace Game {
close();
return;
} else if (this->playerUUID == "") {
} else */if (this->playerUUID == "") {
string playerNameStr = name;
string sErr = "Client gave an invalid UUID for player [" + playerNameStr + "]";
printf("%s\n", sErr.c_str());
@@ -970,7 +970,7 @@ namespace Game {
throw game_runtime_error(szBuf);
}
int minHeadLessPlayersRequired = Config::getInstance().getInt("MinHeadlessPlayersRequired", "2");
int minHeadLessPlayersRequired = Config::getInstance().getInt("MinHeadlessPlayersRequired", "1");
if (this->joinGameInProgress == false &&
networkMessageLaunch.getMessageType() == nmtLaunch &&
this->ready == false &&
@@ -1281,6 +1281,8 @@ namespace Game {
//printf("#2 Server slot got currentFrameCount = %d\n",currentFrameCount);
this->currentLagCount = 0;
this->graceLagCtr = 0;
this->lastReceiveCommandListTime = time(NULL);
this->setReady();