current restored

This commit is contained in:
GenZmeY 2021-12-26 04:06:24 +03:00
parent 6cf72b1aca
commit 2bcee2fed9
8 changed files with 11 additions and 123 deletions

View File

@ -28,7 +28,7 @@ public static function UpdateGameSettings(KFGameInfo_Survival KFGI, bool bUsesSt
if (KFGameSettings != None) if (KFGameSettings != None)
{ {
KFGameSettings.Mode = class'KFGameInfo'.static.GetGameModeNumFromClass(GameModeClass); KFGameSettings.Mode = KFGI.default.GameModes.Find('ClassNameAndPath', GameModeClass);
KFGameSettings.Difficulty = KFGI.GameDifficulty; KFGameSettings.Difficulty = KFGI.GameDifficulty;
if (KFGI.WaveNum == 0) if (KFGI.WaveNum == 0)
@ -88,9 +88,10 @@ public static function UpdateGameSettings(KFGameInfo_Survival KFGI, bool bUsesSt
} }
} }
public static function class<KFPawn_Monster> PickProxyZed(class<KFPawn_Monster> MonsterClass, Controller Killer, MskGsMut Mut) public static function class<KFPawn_Monster> PickProxyZed(class<KFPawn_Monster> MonsterClass, Controller Killer)
{ {
if (Mut.MskGsMemberList.Find(Killer) == INDEX_NONE) return MonsterClass; return MonsterClass; // tmp
//if (Mut.MskGsMemberList.Find(Killer) == INDEX_NONE) return MonsterClass;
switch (MonsterClass) switch (MonsterClass)
{ {

View File

@ -14,9 +14,6 @@ var config int DoshLifespan;
var config array<string> KickProtectedList; var config array<string> KickProtectedList;
var config array<int> PerPlayerMaxMonsters; var config array<int> PerPlayerMaxMonsters;
var array<MskGsRepInfo> RepClients;
var array<Controller> MskGsMemberList;
function InitMutator(string Options, out string ErrorMessage) function InitMutator(string Options, out string ErrorMessage)
{ {
local int MaxPlayers, MaxPlayersAllowed; local int MaxPlayers, MaxPlayersAllowed;
@ -129,12 +126,6 @@ function Initialize()
VoteCollector.bRandomizeNextMap = bRandomizeNextMap; VoteCollector.bRandomizeNextMap = bRandomizeNextMap;
VoteCollector.SortPolicy = SortStats; VoteCollector.SortPolicy = SortStats;
if (MskGs_Endless(MyKFGI) != None) MskGs_Endless(MyKFGI).Mut = Self;
if (MskGs_Objective(MyKFGI) != None) MskGs_Objective(MyKFGI).Mut = Self;
if (MskGs_Survival(MyKFGI) != None) MskGs_Survival(MyKFGI).Mut = Self;
if (MskGs_VersusSurvival(MyKFGI) != None) MskGs_VersusSurvival(MyKFGI).Mut = Self;
if (MskGs_WeeklySurvival(MyKFGI) != None) MskGs_WeeklySurvival(MyKFGI).Mut = Self;
steamworks = class'GameEngine'.static.GetOnlineSubsystem(); steamworks = class'GameEngine'.static.GetOnlineSubsystem();
foreach KickProtectedList(Person) foreach KickProtectedList(Person)
@ -205,9 +196,9 @@ function bool CheckRelevance(Actor Other)
// otherwise modify weapon lifespan // otherwise modify weapon lifespan
if (DroppedPickup != None) if (DroppedPickup != None)
{ {
if (KFDroppedPickup_Cash(DroppedPickup) != None) if (KFDroppedPickup_Cash(DroppedPickup) != None && DoshLifespan != 0)
DroppedPickup.Lifespan = DoshLifespan; DroppedPickup.Lifespan = DoshLifespan;
else else if (WeapLifespan != 0)
DroppedPickup.Lifespan = WeapLifespan; DroppedPickup.Lifespan = WeapLifespan;
} }
@ -231,40 +222,16 @@ function bool PreventDeath(Pawn Killed, Controller Killer, class<DamageType> dam
function NotifyLogin(Controller C) function NotifyLogin(Controller C)
{ {
local MskGsRepInfo RepInfo;
if (C == None) return;
RepInfo = Spawn(class'MskGsRepInfo', KFPlayerController(C));
RepInfo.C = C;
RepInfo.Mut = Self;
RepClients.AddItem(RepInfo);
super.NotifyLogin(C); super.NotifyLogin(C);
} }
function NotifyLogout(Controller C) function NotifyLogout(Controller C)
{ {
local MskGsVoteCollector VoteCollector; local MskGsVoteCollector VoteCollector;
local MskGsRepInfo RepInfo;
if (C == None) return;
VoteCollector = MskGsVoteCollector(MyKFGI.MyKFGRI.VoteCollector); VoteCollector = MskGsVoteCollector(MyKFGI.MyKFGRI.VoteCollector);
VoteCollector.NotifyLogout(C); VoteCollector.NotifyLogout(C);
MskGsMemberList.RemoveItem(C);
foreach RepClients(RepInfo) // TODO: rework this shit
{
if (RepInfo.C == C)
{
RepInfo.Destroy();
RepClients.RemoveItem(RepInfo);
return;
}
}
super.NotifyLogout(C); super.NotifyLogout(C);
} }

View File

@ -1,66 +0,0 @@
class MskGsRepInfo extends ReplicationInfo;
// Server vars
var public MskGsMut Mut;
var public Controller C;
// Client vars
var private OnlineSubsystemSteamworks SW;
simulated event PostBeginPlay()
{
super.PostBeginPlay();
if (bDeleteMe) return;
if (Role < ROLE_Authority || WorldInfo.NetMode == NM_StandAlone)
{
ClientGetOnlineSubsystem();
}
}
private reliable client function ClientGetOnlineSubsystem()
{
if (SW == None)
{
SW = OnlineSubsystemSteamworks(class'GameEngine'.static.GetOnlineSubsystem());
}
if (SW == None)
{
SetTimer(0.1f, false, nameof(ClientGetOnlineSubsystem));
}
else
{
ClearTimer(nameof(ClientGetOnlineSubsystem));
ClientGetMembership();
}
}
private reliable client function ClientGetMembership()
{
local UniqueNetId GroupID;
class'OnlineSubsystem'.Static.StringToUniqueNetId("0x017000000223386E", GroupID);
if (SW.CheckPlayerGroup(GroupID)) ServerApplyMembership();
}
private simulated reliable server function ServerApplyMembership()
{
if (Mut == None || C == None)
{
SetTimer(1.0f, false, nameof(ServerApplyMembership));
return;
}
ClearTimer(nameof(ServerApplyMembership));
Mut.MskGsMemberList.AddItem(C);
}
DefaultProperties
{
bAlwaysRelevant = false;
bOnlyRelevantToOwner = true;
Role = ROLE_Authority;
RemoteRole = ROLE_SimulatedProxy;
bSkipActorPropertyReplication = false;
}

View File

@ -2,9 +2,6 @@ class MskGs_Endless extends KFGameInfo_Endless;
var const class<KFGameInfoHelper> KFGIH; var const class<KFGameInfoHelper> KFGIH;
var public MskGsMut Mut;
simulated function ExileServerUsingKickBan() simulated function ExileServerUsingKickBan()
{ {
return; return;
@ -17,7 +14,7 @@ function UpdateGameSettings()
protected function DistributeMoneyAndXP(class<KFPawn_Monster> MonsterClass, const out array<DamageInfo> DamageHistory, Controller Killer) protected function DistributeMoneyAndXP(class<KFPawn_Monster> MonsterClass, const out array<DamageInfo> DamageHistory, Controller Killer)
{ {
Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer, Mut), DamageHistory, Killer); Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer), DamageHistory, Killer);
} }
defaultproperties defaultproperties

View File

@ -2,9 +2,6 @@ class MskGs_Objective extends KFGameInfo_Objective;
var const class<KFGameInfoHelper> KFGIH; var const class<KFGameInfoHelper> KFGIH;
var public MskGsMut Mut;
simulated function ExileServerUsingKickBan() simulated function ExileServerUsingKickBan()
{ {
return; return;
@ -17,7 +14,7 @@ function UpdateGameSettings()
protected function DistributeMoneyAndXP(class<KFPawn_Monster> MonsterClass, const out array<DamageInfo> DamageHistory, Controller Killer) protected function DistributeMoneyAndXP(class<KFPawn_Monster> MonsterClass, const out array<DamageInfo> DamageHistory, Controller Killer)
{ {
Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer, Mut), DamageHistory, Killer); Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer), DamageHistory, Killer);
} }
defaultproperties defaultproperties

View File

@ -2,8 +2,6 @@ class MskGs_Survival extends KFGameInfo_Survival;
var const class<KFGameInfoHelper> KFGIH; var const class<KFGameInfoHelper> KFGIH;
var public MskGsMut Mut;
simulated function ExileServerUsingKickBan() simulated function ExileServerUsingKickBan()
{ {
return; return;
@ -16,7 +14,7 @@ function UpdateGameSettings()
protected function DistributeMoneyAndXP(class<KFPawn_Monster> MonsterClass, const out array<DamageInfo> DamageHistory, Controller Killer) protected function DistributeMoneyAndXP(class<KFPawn_Monster> MonsterClass, const out array<DamageInfo> DamageHistory, Controller Killer)
{ {
Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer, Mut), DamageHistory, Killer); Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer), DamageHistory, Killer);
} }
defaultproperties defaultproperties

View File

@ -2,9 +2,6 @@ class MskGs_VersusSurvival extends KFGameInfo_VersusSurvival;
var const class<KFGameInfoHelper> KFGIH; var const class<KFGameInfoHelper> KFGIH;
var public MskGsMut Mut;
simulated function ExileServerUsingKickBan() simulated function ExileServerUsingKickBan()
{ {
return; return;
@ -17,7 +14,7 @@ function UpdateGameSettings()
protected function DistributeMoneyAndXP(class<KFPawn_Monster> MonsterClass, const out array<DamageInfo> DamageHistory, Controller Killer) protected function DistributeMoneyAndXP(class<KFPawn_Monster> MonsterClass, const out array<DamageInfo> DamageHistory, Controller Killer)
{ {
Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer, Mut), DamageHistory, Killer); Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer), DamageHistory, Killer);
} }
defaultproperties defaultproperties

View File

@ -2,9 +2,6 @@ class MskGs_WeeklySurvival extends KFGameInfo_WeeklySurvival;
var const class<KFGameInfoHelper> KFGIH; var const class<KFGameInfoHelper> KFGIH;
var public MskGsMut Mut;
simulated function ExileServerUsingKickBan() simulated function ExileServerUsingKickBan()
{ {
return; return;
@ -17,7 +14,7 @@ function UpdateGameSettings()
protected function DistributeMoneyAndXP(class<KFPawn_Monster> MonsterClass, const out array<DamageInfo> DamageHistory, Controller Killer) protected function DistributeMoneyAndXP(class<KFPawn_Monster> MonsterClass, const out array<DamageInfo> DamageHistory, Controller Killer)
{ {
Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer, Mut), DamageHistory, Killer); Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer), DamageHistory, Killer);
} }
defaultproperties defaultproperties