Skip to content

Commit

Permalink
Fixed #103 - Host loads faster in multiplayer giving them an advantage
Browse files Browse the repository at this point in the history
  • Loading branch information
HumanGamer committed Aug 11, 2021
1 parent 6f0afa7 commit 1e5c585
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion engine/source/sim/netGhost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 3 additions & 0 deletions game/common/server/server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
3 changes: 3 additions & 0 deletions game/marble/client/ui/LevelPreviewGui.gui
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
3 changes: 3 additions & 0 deletions game/marble/server/scripts/gameCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1e5c585

Please sign in to comment.