updated masterserver stats so we DO NOT update slot counts after game is won

This commit is contained in:
Mark Vejvoda 2013-11-01 14:38:28 +00:00
parent 2612774078
commit d24da2f7b5
1 changed files with 19 additions and 3 deletions

View File

@ -2781,9 +2781,25 @@ std::map<string,string> ServerInterface::publishToMasterserver() {
publishToServerInfo["tech"] = this->getGameSettings()->getTech();
publishToServerInfo["map"] = this->getGameSettings()->getMap();
publishToServerInfo["tileset"] = this->getGameSettings()->getTileset();
publishToServerInfo["activeSlots"] = intToStr(slotCountUsed);
publishToServerInfo["networkSlots"] = intToStr(slotCountHumans);
publishToServerInfo["connectedClients"] = intToStr(slotCountConnectedPlayers);
bool updateSlots = true;
MutexSafeWrapper safeMutex2(gameStatsThreadAccessor,CODE_AT_LINE);
if(gameStats != NULL) {
for(int factionIndex = 0; factionIndex < gameStats->getFactionCount(); ++factionIndex) {
if(gameStats->getVictory(factionIndex) == true) {
updateSlots = false;
break;
}
}
}
safeMutex2.ReleaseLock();
if(updateSlots == true) {
publishToServerInfo["activeSlots"] = intToStr(slotCountUsed);
publishToServerInfo["networkSlots"] = intToStr(slotCountHumans);
publishToServerInfo["connectedClients"] = intToStr(slotCountConnectedPlayers);
}
string serverPort=config.getString("PortServer", intToStr(GameConstants::serverPort).c_str());
string externalPort=config.getString("PortExternal", serverPort.c_str());
publishToServerInfo["externalconnectport"] = externalPort;