diff --git a/src/network/protocols/server_lobby.cpp b/src/network/protocols/server_lobby.cpp index 1aa53e111..1dab67303 100644 --- a/src/network/protocols/server_lobby.cpp +++ b/src/network/protocols/server_lobby.cpp @@ -2606,6 +2606,12 @@ void ServerLobby::configPeersStartTime() } max_ping = std::max(peer->getAveragePing(), max_ping); } + if (race_manager->supportsLiveJoining()) + { + Log::info("ServerLobby", "Max ping to ServerConfig::m_max_ping for " + "live joining."); + max_ping = ServerConfig::m_max_ping; + } // Start up time will be after 2500ms, so even if this packet is sent late // (due to packet loss), the start time will still ahead of current time uint64_t start_time = STKHost::get()->getNetworkTimer() + (uint64_t)2500; diff --git a/src/race/race_manager.hpp b/src/race/race_manager.hpp index b149d491a..afe8ee000 100644 --- a/src/race/race_manager.hpp +++ b/src/race/race_manager.hpp @@ -901,6 +901,15 @@ public: void setFlagReturnTicks(unsigned ticks) { m_flag_return_ticks = ticks; } // ------------------------------------------------------------------------ unsigned getFlagReturnTicks() const { return m_flag_return_ticks; } + // ------------------------------------------------------------------------ + /** Whether the current game mode allow live joining even the current game + *. started in network*/ + bool supportsLiveJoining() const + { + return m_minor_mode == MINOR_MODE_SOCCER || + m_minor_mode == MINOR_MODE_CAPTURE_THE_FLAG || + m_minor_mode == MINOR_MODE_FREE_FOR_ALL; + } }; // RaceManager extern RaceManager *race_manager;