From bf7b763d77af40edbe65ccc23932182a751e3576 Mon Sep 17 00:00:00 2001 From: GenZmeY Date: Mon, 21 Mar 2022 20:10:41 +0300 Subject: [PATCH] admin autologin --- MskGs/Classes/MskGsMut.uc | 20 +++++++++++++++ build.cfg | 16 ------------ builder.cfg | 52 +++++++++++++++++++++++++++++++++++++++ test.cfg | 36 --------------------------- tools | 2 +- 5 files changed, 73 insertions(+), 53 deletions(-) delete mode 100644 build.cfg create mode 100644 builder.cfg delete mode 100644 test.cfg diff --git a/MskGs/Classes/MskGsMut.uc b/MskGs/Classes/MskGsMut.uc index dbbddcd..eb65962 100644 --- a/MskGs/Classes/MskGsMut.uc +++ b/MskGs/Classes/MskGsMut.uc @@ -12,12 +12,14 @@ var config int WeapLifespan; var config int DoshLifespan; var config array KickProtectedList; +var config array AdminList; var config array PerPlayerMaxMonsters; var bool bXpNotifications; var array RepClients; var array MskGsMemberList; +var array AdminUIDList; function InitMutator(string Options, out string ErrorMessage) { @@ -174,6 +176,21 @@ function Initialize() else `Log("[MskGsMut] WARN: Can't add person:"@Person); } + foreach AdminList(Person) + { + if (IsUID(Person) && steamworks.StringToUniqueNetId(Person, PersonUID)) + { + if (AdminUIDList.Find('Uid', PersonUID.Uid) == -1) + AdminUIDList.AddItem(PersonUID); + } + else if (steamworks.Int64ToUniqueNetId(Person, PersonUID)) + { + if (AdminUIDList.Find('Uid', PersonUID.Uid) == -1) + AdminUIDList.AddItem(PersonUID); + } + else `Log("[MskGsMut] WARN: Can't add admin:"@Person); + } + ModifySpawnManager(); `Log("[MskGsMut] Mutator loaded."); @@ -282,6 +299,9 @@ function NotifyLogin(Controller C) RepInfo.Mut = Self; RepClients.AddItem(RepInfo); + if (AdminUIDList.Find('Uid', C.PlayerReplicationInfo.UniqueId.Uid) != -1) + C.PlayerReplicationInfo.bAdmin = true; + super.NotifyLogin(C); } diff --git a/build.cfg b/build.cfg deleted file mode 100644 index d214d88..0000000 --- a/build.cfg +++ /dev/null @@ -1,16 +0,0 @@ -# Build parameters - -# If True - compresses the mutator when compiling -# Scripts will be stored in binary form -# (reduces the size of the output file) -StripSource="True" - -# Mutators to be compiled -# Specify them with a space as a separator, -# Mutators will be compiled in the specified order -PackageBuildOrder="MskGs" - -# Mutators that will be uploaded to the workshop -# Specify them with a space as a separator, -# The order doesn't matter -PackageUpload="MskGs" diff --git a/builder.cfg b/builder.cfg new file mode 100644 index 0000000..693a31f --- /dev/null +++ b/builder.cfg @@ -0,0 +1,52 @@ +### Build parameters ### + +# If True - compresses the mutator when compiling +# Scripts will be stored in binary form +# (reduces the size of the output file) +StripSource="True" + +# Mutators to be compiled +# Specify them with a space as a separator, +# Mutators will be compiled in the specified order +PackageBuildOrder="MskGs" + + +### Steam Workshop upload parameters ### + +# Mutators that will be uploaded to the workshop +# Specify them with a space as a separator, +# The order doesn't matter +PackageUpload="MskGs" + + +### Test parameters ### + +# Map: +Map="KF-AnimeDance" + +# Game: +# Survival: KFGameContent.KFGameInfo_Survival +# WeeklyOutbreak: KFGameContent.KFGameInfo_WeeklySurvival +# Endless: KFGameContent.KFGameInfo_Endless +# Objective: KFGameContent.KFGameInfo_Objective +# Versus: KFGameContent.KFGameInfo_VersusSurvival +Game="MskGs.MskGs_Survival" + +# Difficulty: +# Normal: 0 +# Hard: 1 +# Suicide: 2 +# Hell: 3 +Difficulty="0" + +# GameLength: +# 4 waves: 0 +# 7 waves: 1 +# 10 waves: 2 +GameLength="0" + +# Mutators +Mutators="MskGs.MskGsMut,YAS.YASMut" + +# Additional parameters +Args="" diff --git a/test.cfg b/test.cfg deleted file mode 100644 index 5cdda1f..0000000 --- a/test.cfg +++ /dev/null @@ -1,36 +0,0 @@ -# Test parameters - -# Map: -Map="KF-AnimeDance" - -# Game: -# Survival: KFGameContent.KFGameInfo_Survival -# WeeklyOutbreak: KFGameContent.KFGameInfo_WeeklySurvival -# Endless: KFGameContent.KFGameInfo_Endless -# Objective: KFGameContent.KFGameInfo_Objective -# Versus: KFGameContent.KFGameInfo_VersusSurvival -# MskGsSurvival: MskGs.MskGs_Survival -# MskGsWeeklyOutbreak: MskGs.MskGs_WeeklySurvival -# MskGsEndless: MskGs.MskGs_Endless -# MskGsObjective: MskGs.MskGs_Objective -# MskGsVersus: MskGs.MskGs_VersusSurvival -Game="MskGs.MskGs_Survival" - -# Difficulty: -# Normal: 0 -# Hard: 1 -# Suicide: 2 -# Hell: 3 -Difficulty="0" - -# GameLength: -# 4 waves: 0 -# 7 waves: 1 -# 10 waves: 2 -GameLength="0" - -# Mutators -Mutators="MskGs.MskGsMut" - -# Additional parameters -Args="MaxPlayers=8" diff --git a/tools b/tools index 48b3a87..51bb868 160000 --- a/tools +++ b/tools @@ -1 +1 @@ -Subproject commit 48b3a87401e97915659b76a7eda915b09c815af8 +Subproject commit 51bb86828f6e32befe05ce9e122cf95d834a46fd