admin autologin

This commit is contained in:
GenZmeY 2022-03-21 20:10:41 +03:00
parent 7b0ad8ddfc
commit bf7b763d77
5 changed files with 73 additions and 53 deletions

View File

@ -12,12 +12,14 @@ var config int WeapLifespan;
var config int DoshLifespan; var config int DoshLifespan;
var config array<string> KickProtectedList; var config array<string> KickProtectedList;
var config array<string> AdminList;
var config array<int> PerPlayerMaxMonsters; var config array<int> PerPlayerMaxMonsters;
var bool bXpNotifications; var bool bXpNotifications;
var array<MskGsRepInfo> RepClients; var array<MskGsRepInfo> RepClients;
var array<Controller> MskGsMemberList; var array<Controller> MskGsMemberList;
var array<UniqueNetId> AdminUIDList;
function InitMutator(string Options, out string ErrorMessage) function InitMutator(string Options, out string ErrorMessage)
{ {
@ -174,6 +176,21 @@ function Initialize()
else `Log("[MskGsMut] WARN: Can't add person:"@Person); 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(); ModifySpawnManager();
`Log("[MskGsMut] Mutator loaded."); `Log("[MskGsMut] Mutator loaded.");
@ -282,6 +299,9 @@ function NotifyLogin(Controller C)
RepInfo.Mut = Self; RepInfo.Mut = Self;
RepClients.AddItem(RepInfo); RepClients.AddItem(RepInfo);
if (AdminUIDList.Find('Uid', C.PlayerReplicationInfo.UniqueId.Uid) != -1)
C.PlayerReplicationInfo.bAdmin = true;
super.NotifyLogin(C); super.NotifyLogin(C);
} }

View File

@ -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"

52
builder.cfg Normal file
View File

@ -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=""

View File

@ -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"

2
tools

@ -1 +1 @@
Subproject commit 48b3a87401e97915659b76a7eda915b09c815af8 Subproject commit 51bb86828f6e32befe05ce9e122cf95d834a46fd