Browse Source

Change to use `UnrealAPI` from `_server`

develop
Anton Tarasenko 2 years ago
parent
commit
d3d6ae4627
  1. 13
      sources/VotingHandlerAdapter.uc

13
sources/VotingHandlerAdapter.uc

@ -112,14 +112,14 @@ public final function InjectIntoVotingHandler()
if (votingHandlerReference != none) { if (votingHandlerReference != none) {
return; return;
} }
votingHandler = XVotingHandler(_.unreal.FindActorInstance( votingHandler = XVotingHandler(_server.unreal.FindActorInstance(
_.unreal.GetGameType().VotingHandlerClass)); _server.unreal.GetGameType().VotingHandlerClass));
if (votingHandler == none) if (votingHandler == none)
{ {
_.logger.Auto(fatNoXVotingHandler); _.logger.Auto(fatNoXVotingHandler);
return; return;
} }
votingHandlerReference = _.unreal.ActorRef(votingHandler); votingHandlerReference = _server.unreal.ActorRef(votingHandler);
class'GameMode'.static.Initialize(); class'GameMode'.static.Initialize();
availableGameModes = class'GameMode'.static.AvailableConfigs(); availableGameModes = class'GameMode'.static.AvailableConfigs();
for (i = 0; i < availableGameModes.length; i += 1) for (i = 0; i < availableGameModes.length; i += 1)
@ -220,8 +220,8 @@ public final function PrepareForServerTravel()
return; return;
} }
nextGameClassName = votingHandler.gameConfig[pickedVHConfig].gameClass; nextGameClassName = votingHandler.gameConfig[pickedVHConfig].gameClass;
if (string(_.unreal.GetGameType().class) ~= nextGameClassName) { if (string(_server.unreal.GetGameType().class) ~= nextGameClassName) {
nextGameClass = _.unreal.GetGameType().class; nextGameClass = _server.unreal.GetGameType().class;
} }
else else
{ {
@ -247,7 +247,8 @@ public final function GameMode SetupGameModeAfterTravel()
if (!default.isServerTraveling) { if (!default.isServerTraveling) {
return none; return none;
} }
_.unreal.GetGameType().default.gameDifficulty = default.storedGameDifficulty; _server.unreal.GetGameType().default.gameDifficulty =
default.storedGameDifficulty;
default.isServerTraveling = false; default.isServerTraveling = false;
return GetConfigFromString(targetGameMode); return GetConfigFromString(targetGameMode);
} }

Loading…
Cancel
Save