From 1e5c5853954fc9556c96162bc159178ad4460bd5 Mon Sep 17 00:00:00 2001 From: Human Gamer <39096122+HumanGamer@users.noreply.github.com> Date: Tue, 10 Aug 2021 21:53:21 -0500 Subject: [PATCH] Fixed #103 - Host loads faster in multiplayer giving them an advantage --- engine/source/sim/netGhost.cpp | 2 +- game/common/server/server.cs | 3 +++ game/marble/client/ui/LevelPreviewGui.gui | 3 +++ game/marble/server/scripts/gameCommands.cs | 3 +++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/engine/source/sim/netGhost.cpp b/engine/source/sim/netGhost.cpp index f23fea32..7eb8bab5 100644 --- a/engine/source/sim/netGhost.cpp +++ b/engine/source/sim/netGhost.cpp @@ -893,7 +893,7 @@ void NetConnection::activateGhosting() sendConnectionMessage(GhostAlwaysStarting, mGhostingSequence, ghostAlwaysSet->size()); // If this is the connection to the local client... - if (getLocalClientConnection() == this) + if (getLocalClientConnection() == this && Con::getBoolVariable("$Host::QuickLoad")) { // Get a pointer to the local client. NetConnection* pClient = NetConnection::getConnectionToServer(); diff --git a/game/common/server/server.cs b/game/common/server/server.cs index a8e8a551..756f8a84 100644 --- a/game/common/server/server.cs +++ b/game/common/server/server.cs @@ -30,6 +30,9 @@ function createServer(%serverType, %mission) $Server::PrivatePlayerCount = 0; $Server::ServerType = %serverType; $Server::ArbRegTimeout = 10000; + + // Enable quick load here, as there can only be the host at this point + $Host::QuickLoad = true; if (!$EnableFMS) { diff --git a/game/marble/client/ui/LevelPreviewGui.gui b/game/marble/client/ui/LevelPreviewGui.gui index 10b1f724..3f4f7dd1 100644 --- a/game/marble/client/ui/LevelPreviewGui.gui +++ b/game/marble/client/ui/LevelPreviewGui.gui @@ -206,6 +206,9 @@ function levelPreviewGui::onA() } else { + // Enable quick load for single player as we don't have to worry about other clients + $Host::QuickLoad = true; + // Spawn the player and start the game if ($EnableFMS) { diff --git a/game/marble/server/scripts/gameCommands.cs b/game/marble/server/scripts/gameCommands.cs index 68f47474..6deb2c9e 100644 --- a/game/marble/server/scripts/gameCommands.cs +++ b/game/marble/server/scripts/gameCommands.cs @@ -345,6 +345,9 @@ function serverStartGameNow() cancel($Server::ArbSched); + // Disable quick load for multi player so that the host doesn't get an advantage + $Host::QuickLoad = false; + if ($EnableFMS) { setSinglePlayerMode(false);