diff --git a/sources/Packages.uc b/sources/Packages.uc index cfe9ce4..2bd5d4a 100644 --- a/sources/Packages.uc +++ b/sources/Packages.uc @@ -2,7 +2,7 @@ * Main and only Acedia mutator used for loading Acedia packages * and providing access to mutator events' calls. * Name is chosen to make config files more readable. - * Copyright 2020-2022 Anton Tarasenko + * Copyright 2020-2021 Anton Tarasenko *------------------------------------------------------------------------------ * This file is part of Acedia. * @@ -30,12 +30,8 @@ class Packages extends Mutator var private Packages selfReference; // Acedia's reference to a `Global` object. -var private Global _; -var private ServerGlobal _server; -var private ClientGlobal _client; +var private Global _; -// Load Acedia on the client as well? -var private config bool clientside; // Array of predefined services that must be started along with Acedia mutator. var private config array package; // Set to `true` to activate Acedia's game modes system @@ -62,38 +58,12 @@ static public final function Packages GetInstance() } // "Constructor" -simulated function PreBeginPlay() -{ - if (level.netMode == NM_DedicatedServer) { - InitializeServer(); - } - else { - InitializeClient(); - } -} - -private simulated function InitializeClient() -{ - // Enforce one copy rule and remember a reference to that copy - if (default.selfReference != none) - { - Destroy(); - return; - } - default.selfReference = self; - class'ClientLevelCore'.static.CreateLevelCore(self); - _ = class'Global'.static.GetInstance(); -} - -private function InitializeServer() +event PreBeginPlay() { local int i; local LevelCore serverCore; local GameMode currentGameMode; local array availableFeatures; - if (clientside) { - AddToPackageMap("Acedia"); - } CheckForGarbage(); // Enforce one copy rule and remember a reference to that copy if (default.selfReference != none) @@ -104,14 +74,12 @@ private function InitializeServer() default.selfReference = self; // Launch and setup core Acedia serverCore = class'ServerLevelCore'.static.CreateLevelCore(self); - _ = class'Global'.static.GetInstance(); - _server = class'ServerGlobal'.static.GetInstance(); - _client = class'ClientGlobal'.static.GetInstance(); + _ = class'Global'.static.GetInstance(); for (i = 0; i < package.length; i += 1) { _.environment.RegisterPackage_S(package[i]); } if (serverCore != none) { - _server.ConnectServerLevelCore(); + _.ConnectServerLevelCore(); } else { @@ -280,10 +248,9 @@ function ModifyLogin(out string portal, out string options) defaultproperties { - clientside = false useGameModes = false // This is a server-only mutator - remoteRole = ROLE_SimulatedProxy + remoteRole = ROLE_None bAlwaysRelevant = true // Mutator description GroupName = "Package loader" diff --git a/sources/VotingHandlerAdapter.uc b/sources/VotingHandlerAdapter.uc index 89c89ee..5b921aa 100644 --- a/sources/VotingHandlerAdapter.uc +++ b/sources/VotingHandlerAdapter.uc @@ -166,11 +166,11 @@ private function string BuildMutatorString(GameMode gameMode) private function string BuildOptionsString(GameMode gameMode) { - local bool optionWasAdded; - local string result; - local string nextKey, nextValue; - local CollectionIterator iter; - local AssociativeArray options; + local bool optionWasAdded; + local string result; + local string nextKey, nextValue; + local Iter iter; + local AssociativeArray options; options = gameMode.GetOptions(); for (iter = options.Iterate(); !iter.HasFinished(); iter.Next()) { @@ -223,10 +223,8 @@ public final function PrepareForServerTravel() if (string(_.unreal.GetGameType().class) ~= nextGameClassName) { nextGameClass = _.unreal.GetGameType().class; } - else - { - nextGameClass = - class(_.memory.LoadClass_S(nextGameClassName)); + else { + nextGameClass = class(_.memory.LoadClassS(nextGameClassName)); } default.isServerTraveling = true; default.targetGameMode = availableGameModes[pickedVHConfig].ToString();