Browse Source

Fix launcher failing if server core was already created

develop
Anton Tarasenko 2 years ago
parent
commit
76fdcc46de
  1. 14
      sources/StartUp.uc

14
sources/StartUp.uc

@ -27,7 +27,7 @@ var private ServerGlobal _server;
var private VotingHandlerAdapter votingAdapter; var private VotingHandlerAdapter votingAdapter;
var private LoggerAPI.Definition infoFeatureEnabled; var private LoggerAPI.Definition infoFeatureEnabled;
var private LoggerAPI.Definition errNoServerLevelCore, errorCannotRunTests; var private LoggerAPI.Definition errorCannotRunTests;
function PreBeginPlay() function PreBeginPlay()
{ {
@ -49,7 +49,6 @@ public function VotingHandlerAdapter GetVotingHandlerAdapter()
private function InitializeServer() private function InitializeServer()
{ {
local int i; local int i;
local LevelCore serverCore;
local GameMode currentGameMode; local GameMode currentGameMode;
local array<Packages.FeatureConfigPair> availableFeatures; local array<Packages.FeatureConfigPair> availableFeatures;
@ -60,18 +59,10 @@ private function InitializeServer()
// Launch and setup core Acedia // Launch and setup core Acedia
_ = class'Global'.static.GetInstance(); _ = class'Global'.static.GetInstance();
_server = class'ServerGlobal'.static.GetInstance(); _server = class'ServerGlobal'.static.GetInstance();
serverCore = class'ServerLevelCore'.static.CreateLevelCore(self); class'ServerLevelCore'.static.CreateLevelCore(self);
for (i = 0; i < class'Packages'.default.package.length; i += 1) { for (i = 0; i < class'Packages'.default.package.length; i += 1) {
_.environment.RegisterPackage_S(class'Packages'.default.package[i]); _.environment.RegisterPackage_S(class'Packages'.default.package[i]);
} }
if (serverCore != none) {
_server.ConnectServerLevelCore();
}
else
{
_.logger.Auto(errNoServerLevelCore);
return;
}
if (class'TestingService'.default.runTestsOnStartUp) { if (class'TestingService'.default.runTestsOnStartUp) {
RunStartUpTests(); RunStartUpTests();
} }
@ -197,6 +188,5 @@ defaultproperties
// This is a server-only actor // This is a server-only actor
remoteRole = ROLE_None remoteRole = ROLE_None
infoFeatureEnabled = (l=LOG_Info,m="Feature `%1` enabled with config \"%2\".") infoFeatureEnabled = (l=LOG_Info,m="Feature `%1` enabled with config \"%2\".")
errNoServerLevelCore = (l=LOG_Error,m="Cannot create `ServerLevelCore`!")
errorCannotRunTests = (l=LOG_Error,m="Could not perform Acedia's tests.") errorCannotRunTests = (l=LOG_Error,m="Could not perform Acedia's tests.")
} }
Loading…
Cancel
Save