10 Commits

Author SHA1 Message Date
84571178a9 update description 2022-11-07 05:58:38 +03:00
3254fb949c Auto enable cheats 2022-11-07 05:28:50 +03:00
3be5c302c5 update description 2022-10-01 21:29:01 +03:00
1368d97ba3 update build tools 2022-09-13 04:52:46 +03:00
3c14093748 update build tools 2022-09-02 16:20:54 +03:00
7e3cc9071e update build tools 2022-09-02 13:45:37 +03:00
374cba508a add .gitignore 2022-09-02 13:02:01 +03:00
9a1ab1cbd0 fix login/logout order 2022-08-16 10:01:59 +03:00
1e91385909 update description 2022-08-14 14:43:18 +03:00
aadb0f68c2 update description 2022-08-14 12:42:19 +03:00
7 changed files with 73 additions and 16 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.psd
/ignore

View File

@ -1,15 +1,19 @@
class AAL extends Info
config(AAL);
const LatestVersion = 1;
const LatestVersion = 2;
const ProfileURL = "https://steamcommunity.com/profiles/";
const CfgAdminList = class'AdminList';
var private config int Version;
var private config E_LogLevel LogLevel;
var private config bool bAutoEnableCheats;
var private OnlineSubsystem OS;
var private Array<UniqueNetId> AdminUIDList;
var private Array<UniqueNetId> AdminUIDListActive;
public simulated function bool SafeDestroy()
{
@ -62,6 +66,9 @@ private function PreInit()
case `NO_CONFIG:
`Log_Info("Config created");
case 1:
bAutoEnableCheats = false;
case MaxInt:
`Log_Info("Config updated to version" @ LatestVersion);
break;
@ -116,7 +123,6 @@ public function NotifyLogin(Controller C)
local PlayerReplicationInfo PRI;
local String UniqueID;
local String SteamID;
local String Profile;
`Log_Trace();
@ -127,16 +133,25 @@ public function NotifyLogin(Controller C)
if (AdminUIDList.Find('Uid', PRI.UniqueId.Uid) != INDEX_NONE)
{
PRI.bAdmin = true;
}
if (PRI.bAdmin)
{
AdminUIDListActive.AddItem(PRI.UniqueId);
UniqueID = OS.UniqueNetIdToString(PRI.UniqueId);
PC = PlayerController(C);
if (PC != None && bAutoEnableCheats)
{
PC.AddCheats(true);
}
if (PC != None && !PC.bIsEosPlayer)
{
SteamID = OS.UniqueNetIdToInt64(PRI.UniqueId);
Profile = "https://steamcommunity.com/profiles/" $ SteamID;
`Log_Info("Admin login:" @ PRI.PlayerName @ "(" $ UniqueID $ "," @ SteamID $ "," @ Profile $ ")");
`Log_Info("Admin login:" @ PRI.PlayerName @ "(" $ UniqueID $ "," @ SteamID $ "," @ ProfileURL $ SteamID $ ")");
}
else
{
@ -147,7 +162,23 @@ public function NotifyLogin(Controller C)
public function NotifyLogout(Controller C)
{
local PlayerReplicationInfo PRI;
local String UniqueID;
local String SteamID;
`Log_Trace();
if (C == None || C.PlayerReplicationInfo == None) return;
PRI = C.PlayerReplicationInfo;
if (PRI.bAdmin || AdminUIDListActive.Find('Uid', PRI.UniqueId.Uid) != INDEX_NONE)
{
AdminUIDListActive.RemoveItem(PRI.UniqueId);
UniqueID = OS.UniqueNetIdToString(PRI.UniqueId);
SteamID = OS.UniqueNetIdToInt64(PRI.UniqueId);
`Log_Info("Admin logout:" @ PRI.PlayerName @ "(" $ UniqueID $ "," @ SteamID $ "," @ ProfileURL $ SteamID $ ")");
}
}
defaultproperties

View File

@ -42,19 +42,19 @@ public function AddMutator(Mutator Mut)
public function NotifyLogin(Controller C)
{
Super.NotifyLogin(C);
AAL.NotifyLogin(C);
Super.NotifyLogin(C);
}
public function NotifyLogout(Controller C)
{
Super.NotifyLogout(C);
AAL.NotifyLogout(C);
Super.NotifyLogout(C);
}
DefaultProperties
defaultproperties
{
}

View File

@ -68,7 +68,7 @@ private static function bool IsUID(String ID, E_LogLevel LogLevel)
{
`Log_TraceStatic();
return (Locs(Left(ID, 2)) ~= "0x");
return (Left(ID, 2) ~= "0x");
}
private static function bool AnyToUID(OnlineSubsystem OS, String ID, out UniqueNetId UID, E_LogLevel LogLevel)

View File

@ -4,7 +4,10 @@
Small server-side mutator that allows specified players to automatically login as an admin.
[h1]Whitelisted?[/h1]
No. This mod is not whitelisted and will de-rank your server. Any XP gained will not be saved.
[b]No.[/b] But I really hope that it will be whitelisted.
[b]⚠️ I submitted whitelist request here:[/b]
https://forums.tripwireinteractive.com/index.php?threads/whitelisting-mods-and-mutators.120340/post-2353666
[h1]Usage (server)[/h1]
[b]Note:[/b] [i]If you don't understand what is written here, read the article [url=https://wiki.killingfloor2.com/index.php?title=Dedicated_Server_(Killing_Floor_2)][u]Dedicated Server (KF2 wiki)[/u][/url] before following these instructions.[/i]
@ -19,10 +22,23 @@ No. This mod is not whitelisted and will de-rank your server. Any XP gained will
[*]Add mutator to server start parameters: [b]?Mutator=AAL.AALMut[/b] and restart the server.
[/olist]
[h1]Important setup information[/h1]
The config should be created on first start, but now the game contains a bug that initializes the config values randomly if they are not explicitly set. Thus, the config may have incorrect values or not be created at all.
So if you are using this mutator for the first time, I highly recommend doing the following:
[olist]
[*]Create (modify) [b]KFAAL.ini[/b] manually. Put the following content there:
[b][AAL.AAL]
Version=0[/b]
[*]Start the game/server with AAL to generate the contents of the config.
[*]Close the game/server.
[/olist]
[b]Right now this is the only way to correctly create the default config.[/b]
Unfortunately I can't do anything about it because it's a game problem (not mutator). I hope TWI fixes this someday.
[h1]Setup (KFAAL.ini)[/h1]
Config will be created at the first start.
[list]
[*]Use [b]AdminId[/b] to set the list of admins. You can use UniqueID or SteamID;
[*]Set [b]bAutoEnableCheats=True[/b] to automatically enable cheats for admins.
[/list]
[h1]Getting ID[/h1]
@ -36,7 +52,6 @@ SteamID can also be obtained from the player's profile, look at the URL:
[img]https://raw.githubusercontent.com/GenZmeY/KF2-AdminAutoLogin/master/PublicationContent/ID2.png[/img]
If a player uses a nickname in a link to their profile, then add this to the profile url: [b]?xml=1[/b]
SteamID will be at the beginning:
[img]https://raw.githubusercontent.com/GenZmeY/KF2-AdminAutoLogin/master/PublicationContent/ID3.png[/img]
[h1]Sources[/h1]

View File

@ -11,6 +11,15 @@ StripSource="True"
PackageBuildOrder="AAL"
### Brew parameters ###
# Packages you want to brew using @peelz's patched KFEditor.
# Useful for cases where regular brew doesn't put *.upk inside the package.
# Specify them with a space as a separator,
# The order doesn't matter
PackagePeelzBrew=""
### Steam Workshop upload parameters ###
# Mutators that will be uploaded to the workshop
@ -30,7 +39,7 @@ Map="KF-Nuked"
# Endless: KFGameContent.KFGameInfo_Endless
# Objective: KFGameContent.KFGameInfo_Objective
# Versus: KFGameContent.KFGameInfo_VersusSurvival
Game="AAL.restore KFEditor.ini from backup"
Game="KFGameContent.KFGameInfo_Survival"
# Difficulty:
# Normal: 0

2
tools

Submodule tools updated: 2f173aad7a...88b35bd7eb