mirror of
https://github.com/glest/glest-source.git
synced 2025-10-03 10:51:55 +02:00
- when masterserver game is over go right back to custom game lobby
This commit is contained in:
@@ -2077,6 +2077,10 @@ Stats Game::quitGame() {
|
|||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
endStats = *(world.getStats());
|
endStats = *(world.getStats());
|
||||||
|
NetworkManager &networkManager= NetworkManager::getInstance();
|
||||||
|
if(networkManager.getNetworkRole() == nrServer && gameSettings.getMasterserver_admin() != -1) {
|
||||||
|
endStats.setIsMasterserverMode(true);
|
||||||
|
}
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
|
@@ -78,6 +78,7 @@ private:
|
|||||||
time_t timePlayed;
|
time_t timePlayed;
|
||||||
int maxConcurrentUnitCount;
|
int maxConcurrentUnitCount;
|
||||||
int totalEndGameConcurrentUnitCount;
|
int totalEndGameConcurrentUnitCount;
|
||||||
|
bool isMasterserverMode;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -91,6 +92,7 @@ public:
|
|||||||
framesToCalculatePlaytime = 0;
|
framesToCalculatePlaytime = 0;
|
||||||
maxConcurrentUnitCount = 0;
|
maxConcurrentUnitCount = 0;
|
||||||
totalEndGameConcurrentUnitCount = 0;
|
totalEndGameConcurrentUnitCount = 0;
|
||||||
|
isMasterserverMode = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void init(int factionCount, int thisFactionIndex, const string &description);
|
void init(int factionCount, int thisFactionIndex, const string &description);
|
||||||
@@ -119,6 +121,9 @@ public:
|
|||||||
string getPlayerName(int factionIndex) const {return playerStats[factionIndex].playerName;}
|
string getPlayerName(int factionIndex) const {return playerStats[factionIndex].playerName;}
|
||||||
Vec3f getPlayerColor(int factionIndex) const { return playerStats[factionIndex].playerColor;}
|
Vec3f getPlayerColor(int factionIndex) const { return playerStats[factionIndex].playerColor;}
|
||||||
|
|
||||||
|
bool getIsMasterserverMode() const { return isMasterserverMode; }
|
||||||
|
void setIsMasterserverMode(bool value) { isMasterserverMode = value; }
|
||||||
|
|
||||||
void setDescription(const string& description) {this->description = description;}
|
void setDescription(const string& description) {this->description = description;}
|
||||||
void setWorldTimeElapsed(float value) {this->worldTimeElapsed = value;}
|
void setWorldTimeElapsed(float value) {this->worldTimeElapsed = value;}
|
||||||
void setFramesPlayed(int value) {this->framesPlayed = value; }
|
void setFramesPlayed(int value) {this->framesPlayed = value; }
|
||||||
|
@@ -76,6 +76,13 @@ void BattleEnd::update() {
|
|||||||
AutoTest::getInstance().updateBattleEnd(program);
|
AutoTest::getInstance().updateBattleEnd(program);
|
||||||
}
|
}
|
||||||
mouse2d= (mouse2d+1) % Renderer::maxMouse2dAnim;
|
mouse2d= (mouse2d+1) % Renderer::maxMouse2dAnim;
|
||||||
|
|
||||||
|
if(this->stats.getIsMasterserverMode() == true) {
|
||||||
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
//program->setState(new MainMenu(program));
|
||||||
|
program->initServer(program->getWindow(),false,true,true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleEnd::render() {
|
void BattleEnd::render() {
|
||||||
|
Reference in New Issue
Block a user