Reset server if no player in lobby between a grand prix

This commit is contained in:
Benau 2018-04-22 01:03:25 +08:00
parent e1797f0572
commit a4198536a0

View File

@ -384,7 +384,8 @@ void ServerLobby::asynchronousUpdate()
void ServerLobby::update(int ticks) void ServerLobby::update(int ticks)
{ {
// Reset server to initial state if no more connected players // Reset server to initial state if no more connected players
if (m_state.load() > ACCEPTING_CLIENTS && if ((m_state.load() > ACCEPTING_CLIENTS ||
m_game_setup->isGrandPrixStarted()) &&
STKHost::get()->getPeerCount() == 0 && STKHost::get()->getPeerCount() == 0 &&
NetworkConfig::get()->getServerIdFile().empty()) NetworkConfig::get()->getServerIdFile().empty())
{ {