Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
84571178a9 | |||
3254fb949c | |||
3be5c302c5 |
@ -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
|
||||
|
@ -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[b]*[/b].
|
||||
[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]
|
||||
@ -38,13 +54,5 @@ SteamID can also be obtained from the player's profile, look at the URL:
|
||||
If a player uses a nickname in a link to their profile, then add this to the profile url: [b]?xml=1[/b]
|
||||
[img]https://raw.githubusercontent.com/GenZmeY/KF2-AdminAutoLogin/master/PublicationContent/ID3.png[/img]
|
||||
|
||||
[h1]Troubleshooting[/h1]
|
||||
[b](*)[/b] If your config is not created for some reason, create it manually with the following content:
|
||||
[b][AAL.AAL]
|
||||
Version=0
|
||||
[/b]
|
||||
|
||||
Then start the server and check the file again - config content should be generated.
|
||||
|
||||
[h1]Sources[/h1]
|
||||
[url=https://github.com/GenZmeY/KF2-AdminAutoLogin]https://github.com/GenZmeY/KF2-AdminAutoLogin[/url] [b](GNU GPLv3)[/b]
|
Reference in New Issue
Block a user