refactoring
This commit is contained in:
parent
ef2bfda4e9
commit
434bdb1782
100
MskGs/Classes/KFGameInfoHelper.uc
Normal file
100
MskGs/Classes/KFGameInfoHelper.uc
Normal file
@ -0,0 +1,100 @@
|
||||
class KFGameInfoHelper extends object;
|
||||
|
||||
static function UpdateGameSettings(KFGameInfo_Survival KFGI, bool bUsesStats, string GameModeClass)
|
||||
{
|
||||
local name SessionName;
|
||||
local KFOnlineGameSettings KFGameSettings;
|
||||
local int NumHumanPlayers;
|
||||
local KFGameEngine KFEngine;
|
||||
local PlayerController PC;
|
||||
|
||||
if (KFGI.WorldInfo.NetMode == NM_DedicatedServer || KFGI.WorldInfo.NetMode == NM_ListenServer)
|
||||
{
|
||||
if (KFGI.GameInterface != None)
|
||||
{
|
||||
KFEngine = KFGameEngine(class'Engine'.static.GetEngine());
|
||||
|
||||
SessionName = KFGI.PlayerReplicationInfoClass.default.SessionName;
|
||||
|
||||
if (KFGI.PlayfabInter != none && KFGI.PlayfabInter.GetGameSettings() != none)
|
||||
{
|
||||
KFGameSettings = KFOnlineGameSettings(KFGI.PlayfabInter.GetGameSettings());
|
||||
KFGameSettings.bAvailableForTakeover = KFEngine.bAvailableForTakeover;
|
||||
}
|
||||
else
|
||||
{
|
||||
KFGameSettings = KFOnlineGameSettings(KFGI.GameInterface.GetGameSettings(SessionName));
|
||||
}
|
||||
|
||||
if (KFGameSettings != None)
|
||||
{
|
||||
KFGameSettings.Mode = class'KFGameInfo'.static.GetGameModeNumFromClass(GameModeClass);
|
||||
KFGameSettings.Difficulty = KFGI.GameDifficulty;
|
||||
|
||||
if (KFGI.WaveNum == 0)
|
||||
{
|
||||
KFGameSettings.bInProgress = false;
|
||||
KFGameSettings.CurrentWave = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
KFGameSettings.bInProgress = true;
|
||||
KFGameSettings.CurrentWave = KFGI.WaveNum;
|
||||
}
|
||||
|
||||
if (KFGI.MyKFGRI != none)
|
||||
{
|
||||
KFGameSettings.NumWaves = KFGI.MyKFGRI.GetFinalWaveNum();
|
||||
KFGI.MyKFGRI.bCustom = False;
|
||||
}
|
||||
else
|
||||
{
|
||||
KFGameSettings.NumWaves = KFGI.WaveMax - 1;
|
||||
}
|
||||
KFGameSettings.OwningPlayerName = class'GameReplicationInfo'.default.ServerName;
|
||||
|
||||
KFGameSettings.NumPublicConnections = KFGI.MaxPlayersAllowed;
|
||||
KFGameSettings.bRequiresPassword = KFGI.RequiresPassword();
|
||||
KFGameSettings.bCustom = False;
|
||||
KFGameSettings.bUsesStats = bUsesStats;
|
||||
KFGameSettings.NumSpectators = KFGI.NumSpectators;
|
||||
|
||||
if (KFGI.WorldInfo.IsConsoleDedicatedServer() || KFGI.WorldInfo.IsEOSDedicatedServer())
|
||||
{
|
||||
KFGameSettings.MapName = KFGI.WorldInfo.GetMapName(true);
|
||||
foreach KFGI.WorldInfo.AllControllers(class'PlayerController', PC)
|
||||
if (PC.bIsPlayer
|
||||
&& PC.PlayerReplicationInfo != none
|
||||
&& !PC.PlayerReplicationInfo.bBot)
|
||||
NumHumanPlayers++;
|
||||
|
||||
KFGameSettings.NumOpenPublicConnections = KFGameSettings.NumPublicConnections - NumHumanPlayers;
|
||||
}
|
||||
|
||||
if (KFGI.PlayfabInter != none && KFGI.PlayfabInter.IsRegisteredWithPlayfab())
|
||||
{
|
||||
KFGI.PlayfabInter.ServerUpdateOnlineGame();
|
||||
if (KFGI.WorldInfo.IsEOSDedicatedServer())
|
||||
{
|
||||
KFGI.GameInterface.UpdateOnlineGame(SessionName, KFGameSettings, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
KFGI.GameInterface.UpdateOnlineGame(SessionName, KFGameSettings, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static function class<KFPawn_Monster> PickProxyZed(class<KFPawn_Monster> MonsterClass, Controller Killer)
|
||||
{
|
||||
`log(">>>>>>>>>>>>> DBG: monsterclass"@MonsterClass);
|
||||
return MonsterClass;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
|
||||
}
|
9
MskGs/Classes/KFPawnProxy_ZedBloat.uc
Normal file
9
MskGs/Classes/KFPawnProxy_ZedBloat.uc
Normal file
@ -0,0 +1,9 @@
|
||||
class KFPawnProxy_ZedBloat extends KFPawn_ZedBloat;
|
||||
|
||||
DefaultProperties
|
||||
{
|
||||
XPValues(0)=17*2.0f
|
||||
XPValues(1)=22*2.0f
|
||||
XPValues(2)=30*2.0f
|
||||
XPValues(3)=34*2.0f
|
||||
}
|
@ -3,7 +3,6 @@ class MskGsGFxMoviePlayer_Manager extends KFGFxMoviePlayer_Manager
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
InGamePartyWidgetClass=class'MskGsGFxWidget_PartyInGame'
|
||||
WidgetBindings.Remove((WidgetName="traderMenu",WidgetClass=class'KFGFxMenu_Trader'))
|
||||
WidgetBindings.Add((WidgetName="traderMenu",WidgetClass=class'MskGsGFxMenu_Trader'))
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
class MskGsGFxTraderContainer_Store extends KFGFxTraderContainer_Store;
|
||||
|
||||
/*
|
||||
var bool GroupMember;
|
||||
|
||||
function Initialize(KFGFxObject_Menu NewParentMenu)
|
||||
{
|
||||
local OnlineSubsystemSteamworks OnlineSub;
|
||||
@ -13,6 +13,7 @@ function Initialize(KFGFxObject_Menu NewParentMenu)
|
||||
class'OnlineSubsystem'.Static.StringToUniqueNetId("0x017000000223386E", GroupID);
|
||||
GroupMember = OnlineSub.CheckPlayerGroup(GroupID);
|
||||
}
|
||||
*/
|
||||
|
||||
function bool IsItemFiltered(STraderItem Item, optional bool bDebug)
|
||||
{
|
||||
@ -32,4 +33,5 @@ function bool IsItemFiltered(STraderItem Item, optional bool bDebug)
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -1,6 +0,0 @@
|
||||
class MskGsGFxWidget_PartyInGame extends KFGFxWidget_PartyInGame within GFxMoviePlayer;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
PlayerSlots=8
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
Class MskGsMut extends KFMutator
|
||||
config(MskGs);
|
||||
|
||||
const CurrentVersion = 2;
|
||||
const CurrentVersion = 3;
|
||||
var config int ConfigVersion;
|
||||
|
||||
var config bool bEnableMapStats;
|
||||
@ -9,6 +9,7 @@ var config string SortStats;
|
||||
var config bool bOfficialNextMapOnly;
|
||||
var config bool bRandomizeNextMap;
|
||||
var config int WeapDespawnTime;
|
||||
var config int DoshDespawnTime;
|
||||
|
||||
var config array<string> KickProtectedList;
|
||||
var config array<int> PerPlayerMaxMonsters;
|
||||
@ -52,6 +53,11 @@ function InitConfig()
|
||||
PerPlayerMaxMonsters.AddItem(34);
|
||||
PerPlayerMaxMonsters.AddItem(36);
|
||||
}
|
||||
case 2:
|
||||
if (DoshDespawnTime == 0)
|
||||
{
|
||||
DoshDespawnTime = 60 * 5;
|
||||
}
|
||||
case 2147483647:
|
||||
`log("[MskGsMut] Config updated to version"@CurrentVersion);
|
||||
break;
|
||||
@ -175,7 +181,7 @@ private function bool IsUID(String ID)
|
||||
function bool CheckRelevance(Actor Other)
|
||||
{
|
||||
local bool SuperRelevant;
|
||||
local KFDroppedPickup PlayerWeap;
|
||||
local KFDroppedPickup DroppedPickup;
|
||||
|
||||
SuperRelevant = super.CheckRelevance(Other);
|
||||
|
||||
@ -185,13 +191,15 @@ function bool CheckRelevance(Actor Other)
|
||||
return SuperRelevant;
|
||||
}
|
||||
|
||||
PlayerWeap = KFDroppedPickup(Other);
|
||||
DroppedPickup = KFDroppedPickup(Other);
|
||||
|
||||
// otherwise modify weapon lifespan
|
||||
if (PlayerWeap != None)
|
||||
if (DroppedPickup != None)
|
||||
{
|
||||
PlayerWeap.Lifespan = WeapDespawnTime;
|
||||
return SuperRelevant;
|
||||
if (KFDroppedPickup_Cash(DroppedPickup) != None)
|
||||
DroppedPickup.Lifespan = DoshDespawnTime;
|
||||
else
|
||||
DroppedPickup.Lifespan = WeapDespawnTime;
|
||||
}
|
||||
|
||||
return SuperRelevant;
|
||||
|
@ -1,5 +1,7 @@
|
||||
class MskGs_Endless extends KFGameInfo_Endless;
|
||||
|
||||
var const class<KFGameInfoHelper> KFGIH;
|
||||
|
||||
simulated function ExileServerUsingKickBan()
|
||||
{
|
||||
return;
|
||||
@ -7,112 +9,16 @@ simulated function ExileServerUsingKickBan()
|
||||
|
||||
function UpdateGameSettings()
|
||||
{
|
||||
local name SessionName;
|
||||
local KFOnlineGameSettings KFGameSettings;
|
||||
local int NumHumanPlayers;
|
||||
local KFGameEngine KFEngine;
|
||||
local PlayerController PC;
|
||||
KFGIH.static.UpdateGameSettings(Self, !IsUnrankedGame(), "KFGameContent.KFGameInfo_Endless");
|
||||
}
|
||||
|
||||
if (WorldInfo.NetMode == NM_DedicatedServer || WorldInfo.NetMode == NM_ListenServer)
|
||||
{
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 1 - GameInterface: "$GameInterface);
|
||||
if (GameInterface != None)
|
||||
{
|
||||
KFEngine = KFGameEngine(class'Engine'.static.GetEngine());
|
||||
|
||||
SessionName = PlayerReplicationInfoClass.default.SessionName;
|
||||
|
||||
if( PlayfabInter != none && PlayfabInter.GetGameSettings() != none )
|
||||
{
|
||||
KFGameSettings = KFOnlineGameSettings(PlayfabInter.GetGameSettings());
|
||||
KFGameSettings.bAvailableForTakeover = KFEngine.bAvailableForTakeover;
|
||||
}
|
||||
else
|
||||
{
|
||||
KFGameSettings = KFOnlineGameSettings(GameInterface.GetGameSettings(SessionName));
|
||||
}
|
||||
//Ensure bug-for-bug compatibility with KF1
|
||||
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 2 - KFGameSettings: "$KFGameSettings);
|
||||
|
||||
if (KFGameSettings != None)
|
||||
{
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 3 - KFGameSettings.bAvailableForTakeover: "$KFGameSettings.bAvailableForTakeover);
|
||||
|
||||
KFGameSettings.Mode = default.GameModes.Find('ClassNameAndPath', "KFGameContent.KFGameInfo_Endless");
|
||||
KFGameSettings.Difficulty = GameDifficulty;
|
||||
//Ensure bug-for-bug compatibility with KF1
|
||||
if (WaveNum == 0)
|
||||
{
|
||||
KFGameSettings.bInProgress = false;
|
||||
KFGameSettings.CurrentWave = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
KFGameSettings.bInProgress = true;
|
||||
KFGameSettings.CurrentWave = WaveNum;
|
||||
}
|
||||
//Also from KF1
|
||||
if(MyKFGRI != none)
|
||||
{
|
||||
KFGameSettings.NumWaves = MyKFGRI.GetFinalWaveNum();
|
||||
}
|
||||
else
|
||||
{
|
||||
KFGameSettings.NumWaves = WaveMax - 1;
|
||||
}
|
||||
KFGameSettings.OwningPlayerName = class'GameReplicationInfo'.default.ServerName;
|
||||
|
||||
KFGameSettings.NumPublicConnections = MaxPlayersAllowed;
|
||||
KFGameSettings.bRequiresPassword = RequiresPassword();
|
||||
KFGameSettings.bCustom = False;
|
||||
KFGameSettings.bUsesStats = !IsUnrankedGame();
|
||||
KFGameSettings.NumSpectators = NumSpectators;
|
||||
KFGameSettings.bServerExiled = false;
|
||||
if(MyKFGRI != none)
|
||||
{
|
||||
MyKFGRI.bCustom = False;
|
||||
}
|
||||
|
||||
// Set the map name
|
||||
//@SABER_EGS IsEOSDedicatedServer() case added
|
||||
if( WorldInfo.IsConsoleDedicatedServer() || WorldInfo.IsEOSDedicatedServer() )
|
||||
{
|
||||
KFGameSettings.MapName = WorldInfo.GetMapName(true);
|
||||
foreach WorldInfo.AllControllers(class'PlayerController', PC)
|
||||
if (PC.bIsPlayer
|
||||
&& PC.PlayerReplicationInfo != none
|
||||
&& !PC.PlayerReplicationInfo.bBot)
|
||||
NumHumanPlayers++;
|
||||
KFGameSettings.NumOpenPublicConnections = KFGameSettings.NumPublicConnections - NumHumanPlayers;
|
||||
}
|
||||
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 4 - PlayfabInter: "$PlayfabInter);
|
||||
if (PlayfabInter != none)
|
||||
{
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 4.1 - IsRegisteredWithPlayfab: "$PlayfabInter.IsRegisteredWithPlayfab());
|
||||
}
|
||||
|
||||
if( PlayfabInter != none && PlayfabInter.IsRegisteredWithPlayfab() )
|
||||
{
|
||||
PlayfabInter.ServerUpdateOnlineGame();
|
||||
//@SABER_EGS_BEGIN Crossplay support
|
||||
if (WorldInfo.IsEOSDedicatedServer()) {
|
||||
GameInterface.UpdateOnlineGame(SessionName, KFGameSettings, true);
|
||||
}
|
||||
//@SABER_EGS_END
|
||||
}
|
||||
else
|
||||
{
|
||||
//Trigger re-broadcast of game settings
|
||||
GameInterface.UpdateOnlineGame(SessionName, KFGameSettings, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
protected function DistributeMoneyAndXP(class<KFPawn_Monster> MonsterClass, const out array<DamageInfo> DamageHistory, Controller Killer)
|
||||
{
|
||||
Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer), DamageHistory, Killer);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
KFGIH=class'KFGameInfoHelper'
|
||||
bIsCustomGame=False
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
class MskGs_Objective extends KFGameInfo_Objective;
|
||||
|
||||
var const class<KFGameInfoHelper> KFGIH;
|
||||
|
||||
simulated function ExileServerUsingKickBan()
|
||||
{
|
||||
return;
|
||||
@ -7,111 +9,16 @@ simulated function ExileServerUsingKickBan()
|
||||
|
||||
function UpdateGameSettings()
|
||||
{
|
||||
local name SessionName;
|
||||
local KFOnlineGameSettings KFGameSettings;
|
||||
local int NumHumanPlayers;
|
||||
local KFGameEngine KFEngine;
|
||||
local PlayerController PC;
|
||||
KFGIH.static.UpdateGameSettings(Self, !IsUnrankedGame(), "KFGameContent.KFGameInfo_Objective");
|
||||
}
|
||||
|
||||
if (WorldInfo.NetMode == NM_DedicatedServer || WorldInfo.NetMode == NM_ListenServer)
|
||||
{
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 1 - GameInterface: "$GameInterface);
|
||||
if (GameInterface != None)
|
||||
{
|
||||
KFEngine = KFGameEngine(class'Engine'.static.GetEngine());
|
||||
|
||||
SessionName = PlayerReplicationInfoClass.default.SessionName;
|
||||
|
||||
if( PlayfabInter != none && PlayfabInter.GetGameSettings() != none )
|
||||
{
|
||||
KFGameSettings = KFOnlineGameSettings(PlayfabInter.GetGameSettings());
|
||||
KFGameSettings.bAvailableForTakeover = KFEngine.bAvailableForTakeover;
|
||||
}
|
||||
else
|
||||
{
|
||||
KFGameSettings = KFOnlineGameSettings(GameInterface.GetGameSettings(SessionName));
|
||||
}
|
||||
//Ensure bug-for-bug compatibility with KF1
|
||||
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 2 - KFGameSettings: "$KFGameSettings);
|
||||
|
||||
if (KFGameSettings != None)
|
||||
{
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 3 - KFGameSettings.bAvailableForTakeover: "$KFGameSettings.bAvailableForTakeover);
|
||||
|
||||
KFGameSettings.Mode = default.GameModes.Find('ClassNameAndPath', "KFGameContent.KFGameInfo_Objective");
|
||||
KFGameSettings.Difficulty = GameDifficulty;
|
||||
//Ensure bug-for-bug compatibility with KF1
|
||||
if (WaveNum == 0)
|
||||
{
|
||||
KFGameSettings.bInProgress = false;
|
||||
KFGameSettings.CurrentWave = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
KFGameSettings.bInProgress = true;
|
||||
KFGameSettings.CurrentWave = WaveNum;
|
||||
}
|
||||
//Also from KF1
|
||||
if(MyKFGRI != none)
|
||||
{
|
||||
KFGameSettings.NumWaves = MyKFGRI.GetFinalWaveNum();
|
||||
}
|
||||
else
|
||||
{
|
||||
KFGameSettings.NumWaves = WaveMax - 1;
|
||||
}
|
||||
KFGameSettings.OwningPlayerName = class'GameReplicationInfo'.default.ServerName;
|
||||
|
||||
KFGameSettings.NumPublicConnections = MaxPlayersAllowed;
|
||||
KFGameSettings.bRequiresPassword = RequiresPassword();
|
||||
KFGameSettings.bCustom = False;
|
||||
KFGameSettings.bUsesStats = !IsUnrankedGame();
|
||||
KFGameSettings.NumSpectators = NumSpectators;
|
||||
if(MyKFGRI != none)
|
||||
{
|
||||
MyKFGRI.bCustom = False;
|
||||
}
|
||||
|
||||
// Set the map name
|
||||
//@SABER_EGS IsEOSDedicatedServer() case added
|
||||
if( WorldInfo.IsConsoleDedicatedServer() || WorldInfo.IsEOSDedicatedServer() )
|
||||
{
|
||||
KFGameSettings.MapName = WorldInfo.GetMapName(true);
|
||||
foreach WorldInfo.AllControllers(class'PlayerController', PC)
|
||||
if (PC.bIsPlayer
|
||||
&& PC.PlayerReplicationInfo != none
|
||||
&& !PC.PlayerReplicationInfo.bBot)
|
||||
NumHumanPlayers++;
|
||||
KFGameSettings.NumOpenPublicConnections = KFGameSettings.NumPublicConnections - NumHumanPlayers;
|
||||
}
|
||||
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 4 - PlayfabInter: "$PlayfabInter);
|
||||
if (PlayfabInter != none)
|
||||
{
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 4.1 - IsRegisteredWithPlayfab: "$PlayfabInter.IsRegisteredWithPlayfab());
|
||||
}
|
||||
|
||||
if( PlayfabInter != none && PlayfabInter.IsRegisteredWithPlayfab() )
|
||||
{
|
||||
PlayfabInter.ServerUpdateOnlineGame();
|
||||
//@SABER_EGS_BEGIN Crossplay support
|
||||
if (WorldInfo.IsEOSDedicatedServer()) {
|
||||
GameInterface.UpdateOnlineGame(SessionName, KFGameSettings, true);
|
||||
}
|
||||
//@SABER_EGS_END
|
||||
}
|
||||
else
|
||||
{
|
||||
//Trigger re-broadcast of game settings
|
||||
GameInterface.UpdateOnlineGame(SessionName, KFGameSettings, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
protected function DistributeMoneyAndXP(class<KFPawn_Monster> MonsterClass, const out array<DamageInfo> DamageHistory, Controller Killer)
|
||||
{
|
||||
Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer), DamageHistory, Killer);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
KFGIH=class'KFGameInfoHelper'
|
||||
bIsCustomGame=False
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
class MskGs_Survival extends KFGameInfo_Survival;
|
||||
|
||||
var const class<KFGameInfoHelper> KFGIH;
|
||||
|
||||
simulated function ExileServerUsingKickBan()
|
||||
{
|
||||
return;
|
||||
@ -7,112 +9,16 @@ simulated function ExileServerUsingKickBan()
|
||||
|
||||
function UpdateGameSettings()
|
||||
{
|
||||
local name SessionName;
|
||||
local KFOnlineGameSettings KFGameSettings;
|
||||
local int NumHumanPlayers;
|
||||
local KFGameEngine KFEngine;
|
||||
local PlayerController PC;
|
||||
KFGIH.static.UpdateGameSettings(Self, !IsUnrankedGame(), "KFGameContent.KFGameInfo_Survival");
|
||||
}
|
||||
|
||||
if (WorldInfo.NetMode == NM_DedicatedServer || WorldInfo.NetMode == NM_ListenServer)
|
||||
{
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 1 - GameInterface: "$GameInterface);
|
||||
if (GameInterface != None)
|
||||
{
|
||||
KFEngine = KFGameEngine(class'Engine'.static.GetEngine());
|
||||
|
||||
SessionName = PlayerReplicationInfoClass.default.SessionName;
|
||||
|
||||
if( PlayfabInter != none && PlayfabInter.GetGameSettings() != none )
|
||||
{
|
||||
KFGameSettings = KFOnlineGameSettings(PlayfabInter.GetGameSettings());
|
||||
KFGameSettings.bAvailableForTakeover = KFEngine.bAvailableForTakeover;
|
||||
}
|
||||
else
|
||||
{
|
||||
KFGameSettings = KFOnlineGameSettings(GameInterface.GetGameSettings(SessionName));
|
||||
}
|
||||
//Ensure bug-for-bug compatibility with KF1
|
||||
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 2 - KFGameSettings: "$KFGameSettings);
|
||||
|
||||
if (KFGameSettings != None)
|
||||
{
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 3 - KFGameSettings.bAvailableForTakeover: "$KFGameSettings.bAvailableForTakeover);
|
||||
|
||||
KFGameSettings.Mode = default.GameModes.Find('ClassNameAndPath', "KFGameContent.KFGameInfo_Survival");
|
||||
KFGameSettings.Difficulty = GameDifficulty;
|
||||
//Ensure bug-for-bug compatibility with KF1
|
||||
if (WaveNum == 0)
|
||||
{
|
||||
KFGameSettings.bInProgress = false;
|
||||
KFGameSettings.CurrentWave = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
KFGameSettings.bInProgress = true;
|
||||
KFGameSettings.CurrentWave = WaveNum;
|
||||
}
|
||||
//Also from KF1
|
||||
if(MyKFGRI != none)
|
||||
{
|
||||
KFGameSettings.NumWaves = MyKFGRI.GetFinalWaveNum();
|
||||
}
|
||||
else
|
||||
{
|
||||
KFGameSettings.NumWaves = WaveMax - 1;
|
||||
}
|
||||
KFGameSettings.OwningPlayerName = class'GameReplicationInfo'.default.ServerName;
|
||||
|
||||
KFGameSettings.NumPublicConnections = MaxPlayersAllowed;
|
||||
KFGameSettings.bRequiresPassword = RequiresPassword();
|
||||
KFGameSettings.bCustom = False;
|
||||
KFGameSettings.bUsesStats = !IsUnrankedGame();
|
||||
KFGameSettings.NumSpectators = NumSpectators;
|
||||
if(MyKFGRI != none)
|
||||
{
|
||||
MyKFGRI.bCustom = False;
|
||||
}
|
||||
|
||||
// Set the map name
|
||||
//@SABER_EGS IsEOSDedicatedServer() case added
|
||||
if( WorldInfo.IsConsoleDedicatedServer() || WorldInfo.IsEOSDedicatedServer() )
|
||||
{
|
||||
KFGameSettings.MapName = WorldInfo.GetMapName(true);
|
||||
foreach WorldInfo.AllControllers(class'PlayerController', PC)
|
||||
if (PC.bIsPlayer
|
||||
&& PC.PlayerReplicationInfo != none
|
||||
&& !PC.PlayerReplicationInfo.bBot)
|
||||
NumHumanPlayers++;
|
||||
|
||||
KFGameSettings.NumOpenPublicConnections = KFGameSettings.NumPublicConnections - NumHumanPlayers;
|
||||
}
|
||||
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 4 - PlayfabInter: "$PlayfabInter);
|
||||
if (PlayfabInter != none)
|
||||
{
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 4.1 - IsRegisteredWithPlayfab: "$PlayfabInter.IsRegisteredWithPlayfab());
|
||||
}
|
||||
|
||||
if( PlayfabInter != none && PlayfabInter.IsRegisteredWithPlayfab() )
|
||||
{
|
||||
PlayfabInter.ServerUpdateOnlineGame();
|
||||
//@SABER_EGS_BEGIN Crossplay support
|
||||
if (WorldInfo.IsEOSDedicatedServer()) {
|
||||
GameInterface.UpdateOnlineGame(SessionName, KFGameSettings, true);
|
||||
}
|
||||
//@SABER_EGS_END
|
||||
}
|
||||
else
|
||||
{
|
||||
//Trigger re-broadcast of game settings
|
||||
GameInterface.UpdateOnlineGame(SessionName, KFGameSettings, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
protected function DistributeMoneyAndXP(class<KFPawn_Monster> MonsterClass, const out array<DamageInfo> DamageHistory, Controller Killer)
|
||||
{
|
||||
Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer), DamageHistory, Killer);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
KFGIH=class'KFGameInfoHelper'
|
||||
bIsCustomGame=False
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
class MskGs_VersusSurvival extends KFGameInfo_VersusSurvival;
|
||||
|
||||
var const class<KFGameInfoHelper> KFGIH;
|
||||
|
||||
simulated function ExileServerUsingKickBan()
|
||||
{
|
||||
return;
|
||||
@ -7,111 +9,16 @@ simulated function ExileServerUsingKickBan()
|
||||
|
||||
function UpdateGameSettings()
|
||||
{
|
||||
local name SessionName;
|
||||
local KFOnlineGameSettings KFGameSettings;
|
||||
local int NumHumanPlayers;
|
||||
local KFGameEngine KFEngine;
|
||||
local PlayerController PC;
|
||||
KFGIH.static.UpdateGameSettings(Self, !IsUnrankedGame(), "KFGameContent.KFGameInfo_VersusSurvival");
|
||||
}
|
||||
|
||||
if (WorldInfo.NetMode == NM_DedicatedServer || WorldInfo.NetMode == NM_ListenServer)
|
||||
{
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 1 - GameInterface: "$GameInterface);
|
||||
if (GameInterface != None)
|
||||
{
|
||||
KFEngine = KFGameEngine(class'Engine'.static.GetEngine());
|
||||
|
||||
SessionName = PlayerReplicationInfoClass.default.SessionName;
|
||||
|
||||
if( PlayfabInter != none && PlayfabInter.GetGameSettings() != none )
|
||||
{
|
||||
KFGameSettings = KFOnlineGameSettings(PlayfabInter.GetGameSettings());
|
||||
KFGameSettings.bAvailableForTakeover = KFEngine.bAvailableForTakeover;
|
||||
}
|
||||
else
|
||||
{
|
||||
KFGameSettings = KFOnlineGameSettings(GameInterface.GetGameSettings(SessionName));
|
||||
}
|
||||
//Ensure bug-for-bug compatibility with KF1
|
||||
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 2 - KFGameSettings: "$KFGameSettings);
|
||||
|
||||
if (KFGameSettings != None)
|
||||
{
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 3 - KFGameSettings.bAvailableForTakeover: "$KFGameSettings.bAvailableForTakeover);
|
||||
|
||||
KFGameSettings.Mode = default.GameModes.Find('ClassNameAndPath', "KFGameContent.KFGameInfo_VersusSurvival");
|
||||
KFGameSettings.Difficulty = GameDifficulty;
|
||||
//Ensure bug-for-bug compatibility with KF1
|
||||
if (WaveNum == 0)
|
||||
{
|
||||
KFGameSettings.bInProgress = false;
|
||||
KFGameSettings.CurrentWave = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
KFGameSettings.bInProgress = true;
|
||||
KFGameSettings.CurrentWave = WaveNum;
|
||||
}
|
||||
//Also from KF1
|
||||
if(MyKFGRI != none)
|
||||
{
|
||||
KFGameSettings.NumWaves = MyKFGRI.GetFinalWaveNum();
|
||||
}
|
||||
else
|
||||
{
|
||||
KFGameSettings.NumWaves = WaveMax - 1;
|
||||
}
|
||||
KFGameSettings.OwningPlayerName = class'GameReplicationInfo'.default.ServerName;
|
||||
|
||||
KFGameSettings.NumPublicConnections = MaxPlayersAllowed;
|
||||
KFGameSettings.bRequiresPassword = RequiresPassword();
|
||||
KFGameSettings.bCustom = False;
|
||||
KFGameSettings.bUsesStats = !IsUnrankedGame();
|
||||
KFGameSettings.NumSpectators = NumSpectators;
|
||||
if(MyKFGRI != none)
|
||||
{
|
||||
MyKFGRI.bCustom = False;
|
||||
}
|
||||
|
||||
// Set the map name
|
||||
//@SABER_EGS IsEOSDedicatedServer() case added
|
||||
if( WorldInfo.IsConsoleDedicatedServer() || WorldInfo.IsEOSDedicatedServer() )
|
||||
{
|
||||
KFGameSettings.MapName = WorldInfo.GetMapName(true);
|
||||
foreach WorldInfo.AllControllers(class'PlayerController', PC)
|
||||
if (PC.bIsPlayer
|
||||
&& PC.PlayerReplicationInfo != none
|
||||
&& !PC.PlayerReplicationInfo.bBot)
|
||||
NumHumanPlayers++;
|
||||
KFGameSettings.NumOpenPublicConnections = KFGameSettings.NumPublicConnections - NumHumanPlayers;
|
||||
}
|
||||
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 4 - PlayfabInter: "$PlayfabInter);
|
||||
if (PlayfabInter != none)
|
||||
{
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 4.1 - IsRegisteredWithPlayfab: "$PlayfabInter.IsRegisteredWithPlayfab());
|
||||
}
|
||||
|
||||
if( PlayfabInter != none && PlayfabInter.IsRegisteredWithPlayfab() )
|
||||
{
|
||||
PlayfabInter.ServerUpdateOnlineGame();
|
||||
//@SABER_EGS_BEGIN Crossplay support
|
||||
if (WorldInfo.IsEOSDedicatedServer()) {
|
||||
GameInterface.UpdateOnlineGame(SessionName, KFGameSettings, true);
|
||||
}
|
||||
//@SABER_EGS_END
|
||||
}
|
||||
else
|
||||
{
|
||||
//Trigger re-broadcast of game settings
|
||||
GameInterface.UpdateOnlineGame(SessionName, KFGameSettings, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
protected function DistributeMoneyAndXP(class<KFPawn_Monster> MonsterClass, const out array<DamageInfo> DamageHistory, Controller Killer)
|
||||
{
|
||||
Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer), DamageHistory, Killer);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
KFGIH=class'KFGameInfoHelper'
|
||||
bIsCustomGame=False
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
class MskGs_WeeklySurvival extends KFGameInfo_WeeklySurvival;
|
||||
|
||||
var const class<KFGameInfoHelper> KFGIH;
|
||||
|
||||
simulated function ExileServerUsingKickBan()
|
||||
{
|
||||
return;
|
||||
@ -7,126 +9,16 @@ simulated function ExileServerUsingKickBan()
|
||||
|
||||
function UpdateGameSettings()
|
||||
{
|
||||
local name SessionName;
|
||||
local KFOnlineGameSettings KFGameSettings;
|
||||
local int NumHumanPlayers;
|
||||
local KFGameEngine KFEngine;
|
||||
local PlayerController PC;
|
||||
|
||||
if (WorldInfo.NetMode == NM_DedicatedServer || WorldInfo.NetMode == NM_ListenServer)
|
||||
{
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 1 - GameInterface: "$GameInterface);
|
||||
if (GameInterface != None)
|
||||
{
|
||||
KFEngine = KFGameEngine(class'Engine'.static.GetEngine());
|
||||
|
||||
SessionName = PlayerReplicationInfoClass.default.SessionName;
|
||||
|
||||
if( PlayfabInter != none && PlayfabInter.GetGameSettings() != none )
|
||||
{
|
||||
KFGameSettings = KFOnlineGameSettings(PlayfabInter.GetGameSettings());
|
||||
KFGameSettings.bAvailableForTakeover = KFEngine.bAvailableForTakeover;
|
||||
}
|
||||
else
|
||||
{
|
||||
KFGameSettings = KFOnlineGameSettings(GameInterface.GetGameSettings(SessionName));
|
||||
}
|
||||
//Ensure bug-for-bug compatibility with KF1
|
||||
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 2 - KFGameSettings: "$KFGameSettings);
|
||||
|
||||
if (KFGameSettings != None)
|
||||
{
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 3 - KFGameSettings.bAvailableForTakeover: "$KFGameSettings.bAvailableForTakeover);
|
||||
|
||||
KFGameSettings.Mode = default.GameModes.Find('ClassNameAndPath', "KFGameContent.KFGameInfo_WeeklySurvival");
|
||||
KFGameSettings.Difficulty = GameDifficulty;
|
||||
//Ensure bug-for-bug compatibility with KF1
|
||||
if (WaveNum == 0)
|
||||
{
|
||||
KFGameSettings.bInProgress = false;
|
||||
KFGameSettings.CurrentWave = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
KFGameSettings.bInProgress = true;
|
||||
KFGameSettings.CurrentWave = WaveNum;
|
||||
}
|
||||
//Also from KF1
|
||||
if(MyKFGRI != none)
|
||||
{
|
||||
KFGameSettings.NumWaves = MyKFGRI.GetFinalWaveNum();
|
||||
}
|
||||
else
|
||||
{
|
||||
KFGameSettings.NumWaves = WaveMax - 1;
|
||||
}
|
||||
KFGameSettings.OwningPlayerName = class'GameReplicationInfo'.default.ServerName;
|
||||
|
||||
KFGameSettings.NumPublicConnections = MaxPlayersAllowed;
|
||||
KFGameSettings.bRequiresPassword = RequiresPassword();
|
||||
KFGameSettings.bCustom = False;
|
||||
KFGameSettings.bUsesStats = !IsUnrankedGame();
|
||||
KFGameSettings.NumSpectators = NumSpectators;
|
||||
if(MyKFGRI != none)
|
||||
{
|
||||
MyKFGRI.bCustom = False;
|
||||
}
|
||||
|
||||
// Set the map name
|
||||
//@SABER_EGS IsEOSDedicatedServer() case added
|
||||
if( WorldInfo.IsConsoleDedicatedServer() || WorldInfo.IsEOSDedicatedServer() )
|
||||
{
|
||||
KFGameSettings.MapName = WorldInfo.GetMapName(true);
|
||||
foreach WorldInfo.AllControllers(class'PlayerController', PC)
|
||||
if (PC.bIsPlayer
|
||||
&& PC.PlayerReplicationInfo != none
|
||||
&& !PC.PlayerReplicationInfo.bBot)
|
||||
NumHumanPlayers++;
|
||||
KFGameSettings.NumOpenPublicConnections = KFGameSettings.NumPublicConnections - NumHumanPlayers;
|
||||
}
|
||||
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 4 - PlayfabInter: "$PlayfabInter);
|
||||
if (PlayfabInter != none)
|
||||
{
|
||||
//`REMOVEMESOON_ServerTakeoverLog("KFGameInfo_Survival.UpdateGameSettings 4.1 - IsRegisteredWithPlayfab: "$PlayfabInter.IsRegisteredWithPlayfab());
|
||||
}
|
||||
|
||||
if( PlayfabInter != none && PlayfabInter.IsRegisteredWithPlayfab() )
|
||||
{
|
||||
PlayfabInter.ServerUpdateOnlineGame();
|
||||
//@SABER_EGS_BEGIN Crossplay support
|
||||
if (WorldInfo.IsEOSDedicatedServer()) {
|
||||
GameInterface.UpdateOnlineGame(SessionName, KFGameSettings, true);
|
||||
}
|
||||
//@SABER_EGS_END
|
||||
}
|
||||
else
|
||||
{
|
||||
//Trigger re-broadcast of game settings
|
||||
GameInterface.UpdateOnlineGame(SessionName, KFGameSettings, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
KFGIH.static.UpdateGameSettings(Self, !IsUnrankedGame(), "KFGameContent.KFGameInfo_WeeklySurvival");
|
||||
}
|
||||
|
||||
function EndOfMatch(bool bVictory)
|
||||
protected function DistributeMoneyAndXP(class<KFPawn_Monster> MonsterClass, const out array<DamageInfo> DamageHistory, Controller Killer)
|
||||
{
|
||||
local KFPlayerController KFPC;
|
||||
|
||||
super.EndOfMatch(bVictory);
|
||||
|
||||
if (bVictory)
|
||||
{
|
||||
foreach WorldInfo.AllControllers(class'KFPlayerController', KFPC)
|
||||
{
|
||||
KFPC.ClientCompletedWeeklySurvival();
|
||||
}
|
||||
}
|
||||
Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer), DamageHistory, Killer);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
KFGIH=class'KFGameInfoHelper'
|
||||
bIsCustomGame=False
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user