diff --git a/MskGs/Classes/KFGameInfoHelper.uc b/MskGs/Classes/KFGameInfoHelper.uc index e5ee0e9..60d0fa7 100644 --- a/MskGs/Classes/KFGameInfoHelper.uc +++ b/MskGs/Classes/KFGameInfoHelper.uc @@ -28,7 +28,7 @@ public static function UpdateGameSettings(KFGameInfo_Survival KFGI, bool bUsesSt if (KFGameSettings != None) { - KFGameSettings.Mode = class'KFGameInfo'.static.GetGameModeNumFromClass(GameModeClass); + KFGameSettings.Mode = KFGI.default.GameModes.Find('ClassNameAndPath', GameModeClass); KFGameSettings.Difficulty = KFGI.GameDifficulty; if (KFGI.WaveNum == 0) @@ -88,9 +88,10 @@ public static function UpdateGameSettings(KFGameInfo_Survival KFGI, bool bUsesSt } } -public static function class PickProxyZed(class MonsterClass, Controller Killer, MskGsMut Mut) +public static function class PickProxyZed(class 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) { diff --git a/MskGs/Classes/MskGsMut.uc b/MskGs/Classes/MskGsMut.uc index 9024ff7..299e234 100644 --- a/MskGs/Classes/MskGsMut.uc +++ b/MskGs/Classes/MskGsMut.uc @@ -14,9 +14,6 @@ var config int DoshLifespan; var config array KickProtectedList; var config array PerPlayerMaxMonsters; -var array RepClients; -var array MskGsMemberList; - function InitMutator(string Options, out string ErrorMessage) { local int MaxPlayers, MaxPlayersAllowed; @@ -129,12 +126,6 @@ function Initialize() VoteCollector.bRandomizeNextMap = bRandomizeNextMap; 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(); foreach KickProtectedList(Person) @@ -205,9 +196,9 @@ function bool CheckRelevance(Actor Other) // otherwise modify weapon lifespan if (DroppedPickup != None) { - if (KFDroppedPickup_Cash(DroppedPickup) != None) + if (KFDroppedPickup_Cash(DroppedPickup) != None && DoshLifespan != 0) DroppedPickup.Lifespan = DoshLifespan; - else + else if (WeapLifespan != 0) DroppedPickup.Lifespan = WeapLifespan; } @@ -231,40 +222,16 @@ function bool PreventDeath(Pawn Killed, Controller Killer, class dam 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); } function NotifyLogout(Controller C) { local MskGsVoteCollector VoteCollector; - local MskGsRepInfo RepInfo; - - if (C == None) return; VoteCollector = MskGsVoteCollector(MyKFGI.MyKFGRI.VoteCollector); 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); } diff --git a/MskGs/Classes/MskGsRepInfo.uc b/MskGs/Classes/MskGsRepInfo.uc deleted file mode 100644 index 6a65111..0000000 --- a/MskGs/Classes/MskGsRepInfo.uc +++ /dev/null @@ -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; -} \ No newline at end of file diff --git a/MskGs/Classes/MskGs_Endless.uc b/MskGs/Classes/MskGs_Endless.uc index adf27fc..2710f9c 100644 --- a/MskGs/Classes/MskGs_Endless.uc +++ b/MskGs/Classes/MskGs_Endless.uc @@ -2,9 +2,6 @@ class MskGs_Endless extends KFGameInfo_Endless; var const class KFGIH; -var public MskGsMut Mut; - - simulated function ExileServerUsingKickBan() { return; @@ -17,7 +14,7 @@ function UpdateGameSettings() protected function DistributeMoneyAndXP(class MonsterClass, const out array DamageHistory, Controller Killer) { - Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer, Mut), DamageHistory, Killer); + Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer), DamageHistory, Killer); } defaultproperties diff --git a/MskGs/Classes/MskGs_Objective.uc b/MskGs/Classes/MskGs_Objective.uc index 7df05dd..b0d8d56 100644 --- a/MskGs/Classes/MskGs_Objective.uc +++ b/MskGs/Classes/MskGs_Objective.uc @@ -2,9 +2,6 @@ class MskGs_Objective extends KFGameInfo_Objective; var const class KFGIH; -var public MskGsMut Mut; - - simulated function ExileServerUsingKickBan() { return; @@ -17,7 +14,7 @@ function UpdateGameSettings() protected function DistributeMoneyAndXP(class MonsterClass, const out array DamageHistory, Controller Killer) { - Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer, Mut), DamageHistory, Killer); + Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer), DamageHistory, Killer); } defaultproperties diff --git a/MskGs/Classes/MskGs_Survival.uc b/MskGs/Classes/MskGs_Survival.uc index 26eb777..fa93228 100644 --- a/MskGs/Classes/MskGs_Survival.uc +++ b/MskGs/Classes/MskGs_Survival.uc @@ -2,8 +2,6 @@ class MskGs_Survival extends KFGameInfo_Survival; var const class KFGIH; -var public MskGsMut Mut; - simulated function ExileServerUsingKickBan() { return; @@ -16,7 +14,7 @@ function UpdateGameSettings() protected function DistributeMoneyAndXP(class MonsterClass, const out array DamageHistory, Controller Killer) { - Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer, Mut), DamageHistory, Killer); + Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer), DamageHistory, Killer); } defaultproperties diff --git a/MskGs/Classes/MskGs_VersusSurvival.uc b/MskGs/Classes/MskGs_VersusSurvival.uc index d38ce0f..73f88a0 100644 --- a/MskGs/Classes/MskGs_VersusSurvival.uc +++ b/MskGs/Classes/MskGs_VersusSurvival.uc @@ -2,9 +2,6 @@ class MskGs_VersusSurvival extends KFGameInfo_VersusSurvival; var const class KFGIH; -var public MskGsMut Mut; - - simulated function ExileServerUsingKickBan() { return; @@ -17,7 +14,7 @@ function UpdateGameSettings() protected function DistributeMoneyAndXP(class MonsterClass, const out array DamageHistory, Controller Killer) { - Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer, Mut), DamageHistory, Killer); + Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer), DamageHistory, Killer); } defaultproperties diff --git a/MskGs/Classes/MskGs_WeeklySurvival.uc b/MskGs/Classes/MskGs_WeeklySurvival.uc index 9945075..e8c8de4 100644 --- a/MskGs/Classes/MskGs_WeeklySurvival.uc +++ b/MskGs/Classes/MskGs_WeeklySurvival.uc @@ -2,9 +2,6 @@ class MskGs_WeeklySurvival extends KFGameInfo_WeeklySurvival; var const class KFGIH; -var public MskGsMut Mut; - - simulated function ExileServerUsingKickBan() { return; @@ -17,7 +14,7 @@ function UpdateGameSettings() protected function DistributeMoneyAndXP(class MonsterClass, const out array DamageHistory, Controller Killer) { - Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer, Mut), DamageHistory, Killer); + Super.DistributeMoneyAndXP(KFGIH.static.PickProxyZed(MonsterClass, Killer), DamageHistory, Killer); } defaultproperties