Compare commits
No commits in common. "master" and "v1.0.0" have entirely different histories.
@ -1,33 +0,0 @@
|
|||||||
root = true
|
|
||||||
|
|
||||||
# Global
|
|
||||||
[*]
|
|
||||||
indent_style = unset
|
|
||||||
indent_size = 4
|
|
||||||
tab_width = 4
|
|
||||||
end_of_line = lf
|
|
||||||
charset = utf-8
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
insert_final_newline = unset
|
|
||||||
|
|
||||||
# Unreal Engine 3 / Source
|
|
||||||
[*.uc]
|
|
||||||
indent_style = tab
|
|
||||||
|
|
||||||
[*.{uci,upkg}]
|
|
||||||
|
|
||||||
# Unreal Engine 3 / i18n
|
|
||||||
[*.{chn,cht,cze,dan,deu,dut,esl,esn,fra,frc,hun,int,ita,jpn,kor,pol,por,ptb,rus,tur,ukr}]
|
|
||||||
charset = utf-16le
|
|
||||||
|
|
||||||
# Other
|
|
||||||
[*.md]
|
|
||||||
indent_style = space
|
|
||||||
trim_trailing_whitespace = false
|
|
||||||
|
|
||||||
[*.yml]
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
[*.{txt,cfg,conf}]
|
|
||||||
indent_style = tab
|
|
114
.github/workflows/mega-linter.yml
vendored
114
.github/workflows/mega-linter.yml
vendored
@ -1,114 +0,0 @@
|
|||||||
---
|
|
||||||
name: MegaLinter
|
|
||||||
|
|
||||||
permissions: read-all
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
env:
|
|
||||||
APPLY_FIXES: none
|
|
||||||
APPLY_FIXES_EVENT: pull_request
|
|
||||||
APPLY_FIXES_MODE: commit
|
|
||||||
FILTER_REGEX_EXCLUDE: (mega-linter.yml)
|
|
||||||
DISABLE: SPELL
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.ref }}-${{ github.workflow }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
megalinter:
|
|
||||||
name: MegaLinter
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
issues: write
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout Code
|
|
||||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: MegaLinter
|
|
||||||
uses: oxsecurity/megalinter@7e042c726c68415475b05a65a686c612120a1232
|
|
||||||
id: ml
|
|
||||||
env:
|
|
||||||
VALIDATE_ALL_CODEBASE: true
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Archive production artifacts
|
|
||||||
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392
|
|
||||||
if: success() || failure()
|
|
||||||
with:
|
|
||||||
name: MegaLinter reports
|
|
||||||
path: |
|
|
||||||
megalinter-reports
|
|
||||||
mega-linter.log
|
|
||||||
|
|
||||||
- name: Set APPLY_FIXES_IF var
|
|
||||||
run: |
|
|
||||||
printf 'APPLY_FIXES_IF=%s\n' "${{
|
|
||||||
steps.ml.outputs.has_updated_sources == 1 &&
|
|
||||||
(
|
|
||||||
env.APPLY_FIXES_EVENT == 'all' ||
|
|
||||||
env.APPLY_FIXES_EVENT == github.event_name
|
|
||||||
) &&
|
|
||||||
(
|
|
||||||
github.event_name == 'push' ||
|
|
||||||
github.event.pull_request.head.repo.full_name == github.repository
|
|
||||||
)
|
|
||||||
}}" >> "${GITHUB_ENV}"
|
|
||||||
|
|
||||||
- name: Set APPLY_FIXES_IF_* vars
|
|
||||||
run: |
|
|
||||||
printf 'APPLY_FIXES_IF_PR=%s\n' "${{
|
|
||||||
env.APPLY_FIXES_IF == 'true' &&
|
|
||||||
env.APPLY_FIXES_MODE == 'pull_request'
|
|
||||||
}}" >> "${GITHUB_ENV}"
|
|
||||||
printf 'APPLY_FIXES_IF_COMMIT=%s\n' "${{
|
|
||||||
env.APPLY_FIXES_IF == 'true' &&
|
|
||||||
env.APPLY_FIXES_MODE == 'commit' &&
|
|
||||||
(!contains(fromJSON('["refs/heads/main", "refs/heads/master"]'), github.ref))
|
|
||||||
}}" >> "${GITHUB_ENV}"
|
|
||||||
|
|
||||||
- name: Create Pull Request with applied fixes
|
|
||||||
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38
|
|
||||||
id: cpr
|
|
||||||
if: env.APPLY_FIXES_IF_PR == 'true'
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
|
|
||||||
commit-message: "[MegaLinter] Apply linters automatic fixes"
|
|
||||||
title: "[MegaLinter] Apply linters automatic fixes"
|
|
||||||
labels: bot
|
|
||||||
|
|
||||||
- name: Create PR output
|
|
||||||
if: env.APPLY_FIXES_IF_PR == 'true'
|
|
||||||
run: |
|
|
||||||
echo "PR Number - ${{ steps.cpr.outputs.pull-request-number }}"
|
|
||||||
echo "PR URL - ${{ steps.cpr.outputs.pull-request-url }}"
|
|
||||||
|
|
||||||
- name: Prepare commit
|
|
||||||
if: env.APPLY_FIXES_IF_COMMIT == 'true'
|
|
||||||
run: sudo chown -Rc $UID .git/
|
|
||||||
|
|
||||||
- name: Commit and push applied linter fixes
|
|
||||||
uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d
|
|
||||||
if: env.APPLY_FIXES_IF_COMMIT == 'true'
|
|
||||||
with:
|
|
||||||
branch: >-
|
|
||||||
${{
|
|
||||||
github.event.pull_request.head.ref ||
|
|
||||||
github.head_ref ||
|
|
||||||
github.ref
|
|
||||||
}}
|
|
||||||
commit_message: "[MegaLinter] Apply linters fixes"
|
|
||||||
commit_user_name: "github-actions"
|
|
||||||
commit_user_email: "github-actions[bot]@users.noreply.github.com"
|
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +0,0 @@
|
|||||||
*.psd
|
|
||||||
/ignore
|
|
@ -1,187 +1,156 @@
|
|||||||
class AAL extends Info
|
class AAL extends Info
|
||||||
config(AAL);
|
config(AAL);
|
||||||
|
|
||||||
const LatestVersion = 2;
|
const LatestVersion = 1;
|
||||||
|
|
||||||
const ProfileURL = "https://steamcommunity.com/profiles/";
|
const CfgAdminList = class'AdminList';
|
||||||
|
|
||||||
const CfgAdminList = class'AdminList';
|
var private config int Version;
|
||||||
|
var private config E_LogLevel LogLevel;
|
||||||
var private config int Version;
|
|
||||||
var private config E_LogLevel LogLevel;
|
var private OnlineSubsystem OS;
|
||||||
var private config bool bAutoEnableCheats;
|
var private Array<UniqueNetId> AdminUIDList;
|
||||||
|
|
||||||
var private OnlineSubsystem OS;
|
public simulated function bool SafeDestroy()
|
||||||
var private Array<UniqueNetId> AdminUIDList;
|
{
|
||||||
var private Array<UniqueNetId> AdminUIDListActive;
|
`Log_Trace();
|
||||||
|
|
||||||
public simulated function bool SafeDestroy()
|
return (bPendingDelete || bDeleteMe || Destroy());
|
||||||
{
|
}
|
||||||
`Log_Trace();
|
|
||||||
|
public event PreBeginPlay()
|
||||||
return (bPendingDelete || bDeleteMe || Destroy());
|
{
|
||||||
}
|
`Log_Trace();
|
||||||
|
|
||||||
public event PreBeginPlay()
|
if (WorldInfo.NetMode == NM_Client)
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Fatal("Wrong NetMode:" @ WorldInfo.NetMode);
|
||||||
|
SafeDestroy();
|
||||||
if (WorldInfo.NetMode == NM_Client)
|
return;
|
||||||
{
|
}
|
||||||
`Log_Fatal("Wrong NetMode:" @ WorldInfo.NetMode);
|
|
||||||
SafeDestroy();
|
Super.PreBeginPlay();
|
||||||
return;
|
|
||||||
}
|
PreInit();
|
||||||
|
}
|
||||||
Super.PreBeginPlay();
|
|
||||||
|
public event PostBeginPlay()
|
||||||
PreInit();
|
{
|
||||||
}
|
`Log_Trace();
|
||||||
|
|
||||||
public event PostBeginPlay()
|
if (bPendingDelete || bDeleteMe) return;
|
||||||
{
|
|
||||||
`Log_Trace();
|
Super.PostBeginPlay();
|
||||||
|
|
||||||
if (bPendingDelete || bDeleteMe) return;
|
PostInit();
|
||||||
|
}
|
||||||
Super.PostBeginPlay();
|
|
||||||
|
private function PreInit()
|
||||||
PostInit();
|
{
|
||||||
}
|
`Log_Trace();
|
||||||
|
|
||||||
private function PreInit()
|
if (Version == `NO_CONFIG)
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
LogLevel = LL_Info;
|
||||||
|
SaveConfig();
|
||||||
if (Version == `NO_CONFIG)
|
}
|
||||||
{
|
|
||||||
LogLevel = LL_Info;
|
CfgAdminList.static.InitConfig(Version, LatestVersion, LogLevel);
|
||||||
SaveConfig();
|
|
||||||
}
|
switch (Version)
|
||||||
|
{
|
||||||
CfgAdminList.static.InitConfig(Version, LatestVersion, LogLevel);
|
case `NO_CONFIG:
|
||||||
|
`Log_Info("Config created");
|
||||||
switch (Version)
|
|
||||||
{
|
case MaxInt:
|
||||||
case `NO_CONFIG:
|
`Log_Info("Config updated to version" @ LatestVersion);
|
||||||
`Log_Info("Config created");
|
break;
|
||||||
|
|
||||||
case 1:
|
case LatestVersion:
|
||||||
bAutoEnableCheats = false;
|
`Log_Info("Config is up-to-date");
|
||||||
|
break;
|
||||||
case MaxInt:
|
|
||||||
`Log_Info("Config updated to version" @ LatestVersion);
|
default:
|
||||||
break;
|
`Log_Warn("The config version is higher than the current version (are you using an old mutator?)");
|
||||||
|
`Log_Warn("Config version is" @ Version @ "but current version is" @ LatestVersion);
|
||||||
case LatestVersion:
|
`Log_Warn("The config version will be changed to" @ LatestVersion);
|
||||||
`Log_Info("Config is up-to-date");
|
break;
|
||||||
break;
|
}
|
||||||
|
|
||||||
default:
|
if (LatestVersion != Version)
|
||||||
`Log_Warn("The config version is higher than the current version (are you using an old mutator?)");
|
{
|
||||||
`Log_Warn("Config version is" @ Version @ "but current version is" @ LatestVersion);
|
Version = LatestVersion;
|
||||||
`Log_Warn("The config version will be changed to" @ LatestVersion);
|
SaveConfig();
|
||||||
break;
|
}
|
||||||
}
|
|
||||||
|
if (LogLevel == LL_WrongLevel)
|
||||||
if (LatestVersion != Version)
|
{
|
||||||
{
|
LogLevel = LL_Info;
|
||||||
Version = LatestVersion;
|
|
||||||
SaveConfig();
|
`Log_Warn("Wrong 'LogLevel', return to default value");
|
||||||
}
|
|
||||||
|
SaveConfig();
|
||||||
if (LogLevel == LL_WrongLevel)
|
}
|
||||||
{
|
`Log_Base("LogLevel:" @ LogLevel);
|
||||||
LogLevel = LL_Info;
|
|
||||||
|
OS = class'GameEngine'.static.GetOnlineSubsystem();
|
||||||
`Log_Warn("Wrong 'LogLevel', return to default value");
|
if (OS != None)
|
||||||
|
{
|
||||||
SaveConfig();
|
AdminUIDList = CfgAdminList.static.Load(OS, LogLevel);
|
||||||
}
|
}
|
||||||
`Log_Base("LogLevel:" @ LogLevel);
|
else
|
||||||
|
{
|
||||||
OS = class'GameEngine'.static.GetOnlineSubsystem();
|
`Log_Fatal("Can't get online subsystem!");
|
||||||
if (OS != None)
|
SafeDestroy();
|
||||||
{
|
}
|
||||||
AdminUIDList = CfgAdminList.static.Load(OS, LogLevel);
|
}
|
||||||
}
|
|
||||||
else
|
private function PostInit()
|
||||||
{
|
{
|
||||||
`Log_Fatal("Can't get online subsystem!");
|
`Log_Trace();
|
||||||
SafeDestroy();
|
}
|
||||||
}
|
|
||||||
}
|
public function NotifyLogin(Controller C)
|
||||||
|
{
|
||||||
private function PostInit()
|
local PlayerController PC;
|
||||||
{
|
local PlayerReplicationInfo PRI;
|
||||||
`Log_Trace();
|
local String UniqueID;
|
||||||
}
|
local String SteamID;
|
||||||
|
local String Profile;
|
||||||
public function NotifyLogin(Controller C)
|
|
||||||
{
|
`Log_Trace();
|
||||||
local PlayerController PC;
|
|
||||||
local PlayerReplicationInfo PRI;
|
if (C == None || C.PlayerReplicationInfo == None) return;
|
||||||
local String UniqueID;
|
|
||||||
local String SteamID;
|
PRI = C.PlayerReplicationInfo;
|
||||||
|
|
||||||
`Log_Trace();
|
if (AdminUIDList.Find('Uid', PRI.UniqueId.Uid) != INDEX_NONE)
|
||||||
|
{
|
||||||
if (C == None || C.PlayerReplicationInfo == None) return;
|
PRI.bAdmin = true;
|
||||||
|
|
||||||
PRI = C.PlayerReplicationInfo;
|
UniqueID = OS.UniqueNetIdToString(PRI.UniqueId);
|
||||||
|
|
||||||
if (AdminUIDList.Find('Uid', PRI.UniqueId.Uid) != INDEX_NONE)
|
PC = PlayerController(C);
|
||||||
{
|
if (PC != None && !PC.bIsEosPlayer)
|
||||||
PRI.bAdmin = true;
|
{
|
||||||
}
|
SteamID = OS.UniqueNetIdToInt64(PRI.UniqueId);
|
||||||
|
Profile = "https://steamcommunity.com/profiles/" $ SteamID;
|
||||||
if (PRI.bAdmin)
|
|
||||||
{
|
`Log_Info("Admin login:" @ PRI.PlayerName @ "(" $ UniqueID $ "," @ SteamID $ "," @ Profile $ ")");
|
||||||
AdminUIDListActive.AddItem(PRI.UniqueId);
|
}
|
||||||
|
else
|
||||||
UniqueID = OS.UniqueNetIdToString(PRI.UniqueId);
|
{
|
||||||
|
`Log_Info("Admin login:" @ PRI.PlayerName @ "(" $ UniqueID $ ")");
|
||||||
PC = PlayerController(C);
|
}
|
||||||
|
}
|
||||||
if (PC != None && bAutoEnableCheats)
|
}
|
||||||
{
|
|
||||||
PC.AddCheats(true);
|
public function NotifyLogout(Controller C)
|
||||||
}
|
{
|
||||||
|
`Log_Trace();
|
||||||
if (PC != None && !PC.bIsEosPlayer)
|
}
|
||||||
{
|
|
||||||
SteamID = OS.UniqueNetIdToInt64(PRI.UniqueId);
|
defaultproperties
|
||||||
`Log_Info("Admin login:" @ PRI.PlayerName @ "(" $ UniqueID $ "," @ SteamID $ "," @ ProfileURL $ SteamID $ ")");
|
{
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
`Log_Info("Admin login:" @ PRI.PlayerName @ "(" $ UniqueID $ ")");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
[Flags]
|
[Flags]
|
||||||
AllowDownload=False
|
AllowDownload=False
|
||||||
ClientOptional=False
|
ClientOptional=False
|
||||||
ServerSideOnly=True
|
ServerSideOnly=True
|
||||||
|
@ -1 +1,60 @@
|
|||||||
class AALMut extends Mut; // backward compatibility
|
class AALMut extends KFMutator;
|
||||||
|
|
||||||
|
var private AAL AAL;
|
||||||
|
|
||||||
|
public simulated function bool SafeDestroy()
|
||||||
|
{
|
||||||
|
return (bPendingDelete || bDeleteMe || Destroy());
|
||||||
|
}
|
||||||
|
|
||||||
|
public event PreBeginPlay()
|
||||||
|
{
|
||||||
|
Super.PreBeginPlay();
|
||||||
|
|
||||||
|
if (WorldInfo.NetMode == NM_Client) return;
|
||||||
|
|
||||||
|
foreach WorldInfo.DynamicActors(class'AAL', AAL)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AAL == None)
|
||||||
|
{
|
||||||
|
AAL = WorldInfo.Spawn(class'AAL');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AAL == None)
|
||||||
|
{
|
||||||
|
`Log_Base("FATAL: Can't Spawn 'AAL'");
|
||||||
|
SafeDestroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function AddMutator(Mutator Mut)
|
||||||
|
{
|
||||||
|
if (Mut == Self) return;
|
||||||
|
|
||||||
|
if (Mut.Class == Class)
|
||||||
|
Mut.Destroy();
|
||||||
|
else
|
||||||
|
Super.AddMutator(Mut);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function NotifyLogin(Controller C)
|
||||||
|
{
|
||||||
|
Super.NotifyLogin(C);
|
||||||
|
|
||||||
|
AAL.NotifyLogin(C);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function NotifyLogout(Controller C)
|
||||||
|
{
|
||||||
|
Super.NotifyLogout(C);
|
||||||
|
|
||||||
|
AAL.NotifyLogout(C);
|
||||||
|
}
|
||||||
|
|
||||||
|
DefaultProperties
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
@ -1,84 +1,84 @@
|
|||||||
class AdminList extends Object
|
class AdminList extends Object
|
||||||
config(AAL)
|
config(AAL)
|
||||||
abstract;
|
abstract;
|
||||||
|
|
||||||
var private config Array<String> AdminId;
|
var private config Array<String> AdminId;
|
||||||
|
|
||||||
public static function InitConfig(int Version, int LatestVersion, E_LogLevel LogLevel)
|
public static function InitConfig(int Version, int LatestVersion, E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
switch (Version)
|
switch (Version)
|
||||||
{
|
{
|
||||||
case `NO_CONFIG:
|
case `NO_CONFIG:
|
||||||
ApplyDefault(LogLevel);
|
ApplyDefault(LogLevel);
|
||||||
|
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LatestVersion != Version)
|
if (LatestVersion != Version)
|
||||||
{
|
{
|
||||||
StaticSaveConfig();
|
StaticSaveConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function Array<UniqueNetId> Load(OnlineSubsystem OS, E_LogLevel LogLevel)
|
public static function Array<UniqueNetId> Load(OnlineSubsystem OS, E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
local Array<UniqueNetId> UIDs;
|
local Array<UniqueNetId> UIDs;
|
||||||
local UniqueNetId UID;
|
local UniqueNetId UID;
|
||||||
local String ID;
|
local String ID;
|
||||||
|
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
foreach default.AdminId(ID)
|
foreach default.AdminId(ID)
|
||||||
{
|
{
|
||||||
if (AnyToUID(OS, ID, UID, LogLevel))
|
if (AnyToUID(OS, ID, UID, LogLevel))
|
||||||
{
|
{
|
||||||
UIDs.AddItem(UID);
|
UIDs.AddItem(UID);
|
||||||
`Log_Debug("Loaded:" @ ID);
|
`Log_Debug("Loaded:" @ ID);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
`Log_Warn("Can't load AdminId:" @ ID);
|
`Log_Warn("Can't load AdminId:" @ ID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (default.AdminId.Length == UIDs.Length)
|
if (default.AdminId.Length == UIDs.Length)
|
||||||
{
|
{
|
||||||
`Log_Info("Loaded" @ UIDs.Length @ "entries");
|
`Log_Info("Loaded" @ UIDs.Length @ "entries");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
`Log_Info("Loaded" @ UIDs.Length @ "of" @ default.AdminId.Length @ "entries");
|
`Log_Info("Loaded" @ UIDs.Length @ "of" @ default.AdminId.Length @ "entries");
|
||||||
}
|
}
|
||||||
|
|
||||||
return UIDs;
|
return UIDs;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function ApplyDefault(E_LogLevel LogLevel)
|
private static function ApplyDefault(E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
default.AdminId.Length = 0;
|
default.AdminId.Length = 0;
|
||||||
default.AdminId.AddItem("76561190000000000");
|
default.AdminId.AddItem("76561190000000000");
|
||||||
default.AdminId.AddItem("0x0000000000000000");
|
default.AdminId.AddItem("0x0000000000000000");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function bool IsUID(String ID, E_LogLevel LogLevel)
|
private static function bool IsUID(String ID, E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
return (Left(ID, 2) ~= "0x");
|
return (Locs(Left(ID, 2)) ~= "0x");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function bool AnyToUID(OnlineSubsystem OS, String ID, out UniqueNetId UID, E_LogLevel LogLevel)
|
private static function bool AnyToUID(OnlineSubsystem OS, String ID, out UniqueNetId UID, E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
return IsUID(ID, LogLevel) ? OS.StringToUniqueNetId(ID, UID) : OS.Int64ToUniqueNetId(ID, UID);
|
return IsUID(ID, LogLevel) ? OS.StringToUniqueNetId(ID, UID) : OS.Int64ToUniqueNetId(ID, UID);
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultproperties
|
defaultproperties
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,60 +0,0 @@
|
|||||||
class Mut extends KFMutator;
|
|
||||||
|
|
||||||
var private AAL AAL;
|
|
||||||
|
|
||||||
public simulated function bool SafeDestroy()
|
|
||||||
{
|
|
||||||
return (bPendingDelete || bDeleteMe || Destroy());
|
|
||||||
}
|
|
||||||
|
|
||||||
public event PreBeginPlay()
|
|
||||||
{
|
|
||||||
Super.PreBeginPlay();
|
|
||||||
|
|
||||||
if (WorldInfo.NetMode == NM_Client) return;
|
|
||||||
|
|
||||||
foreach WorldInfo.DynamicActors(class'AAL', AAL)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (AAL == None)
|
|
||||||
{
|
|
||||||
AAL = WorldInfo.Spawn(class'AAL');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (AAL == None)
|
|
||||||
{
|
|
||||||
`Log_Base("FATAL: Can't Spawn 'AAL'");
|
|
||||||
SafeDestroy();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function AddMutator(Mutator M)
|
|
||||||
{
|
|
||||||
if (M == Self) return;
|
|
||||||
|
|
||||||
if (M.Class == Class)
|
|
||||||
Mut(M).SafeDestroy();
|
|
||||||
else
|
|
||||||
Super.AddMutator(M);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function NotifyLogin(Controller C)
|
|
||||||
{
|
|
||||||
AAL.NotifyLogin(C);
|
|
||||||
|
|
||||||
Super.NotifyLogin(C);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function NotifyLogout(Controller C)
|
|
||||||
{
|
|
||||||
AAL.NotifyLogout(C);
|
|
||||||
|
|
||||||
Super.NotifyLogout(C);
|
|
||||||
}
|
|
||||||
|
|
||||||
defaultproperties
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
@ -1,20 +1,20 @@
|
|||||||
class _Logger extends Object
|
class _Logger extends Object
|
||||||
abstract;
|
abstract;
|
||||||
|
|
||||||
enum E_LogLevel
|
enum E_LogLevel
|
||||||
{
|
{
|
||||||
LL_WrongLevel,
|
LL_WrongLevel,
|
||||||
LL_None,
|
LL_None,
|
||||||
LL_Fatal,
|
LL_Fatal,
|
||||||
LL_Error,
|
LL_Error,
|
||||||
LL_Warning,
|
LL_Warning,
|
||||||
LL_Info,
|
LL_Info,
|
||||||
LL_Debug,
|
LL_Debug,
|
||||||
LL_Trace,
|
LL_Trace,
|
||||||
LL_All
|
LL_All
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultproperties
|
defaultproperties
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
// Constants
|
// Constants
|
||||||
`define NO_CONFIG 0
|
`define NO_CONFIG 0
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
// Imports
|
// Imports
|
||||||
`include(Logger.uci)
|
`include(Logger.uci)
|
||||||
`include(Constants.uci)
|
`include(Constants.uci)
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
// Logger
|
// Logger
|
||||||
`define Log_Tag 'AAL'
|
`define Log_Tag 'AAL'
|
||||||
|
|
||||||
`define LocationStatic "`{ClassName}::" $ GetFuncName()
|
`define LocationStatic "`{ClassName}::" $ GetFuncName()
|
||||||
|
|
||||||
`define Log_Base(msg, cond) `log(`msg `if(`cond), `cond`{endif}, `Log_Tag)
|
`define Log_Base(msg, cond) `log(`msg `if(`cond), `cond`{endif}, `Log_Tag)
|
||||||
|
|
||||||
`define Log_Fatal(msg) `log("FATAL:" @ `msg, (LogLevel >= LL_Fatal), `Log_Tag)
|
`define Log_Fatal(msg) `log("FATAL:" @ `msg, (LogLevel >= LL_Fatal), `Log_Tag)
|
||||||
`define Log_Error(msg) `log("ERROR:" @ `msg, (LogLevel >= LL_Error), `Log_Tag)
|
`define Log_Error(msg) `log("ERROR:" @ `msg, (LogLevel >= LL_Error), `Log_Tag)
|
||||||
`define Log_Warn(msg) `log("WARN:" @ `msg, (LogLevel >= LL_Warning), `Log_Tag)
|
`define Log_Warn(msg) `log("WARN:" @ `msg, (LogLevel >= LL_Warning), `Log_Tag)
|
||||||
`define Log_Info(msg) `log("INFO:" @ `msg, (LogLevel >= LL_Info), `Log_Tag)
|
`define Log_Info(msg) `log("INFO:" @ `msg, (LogLevel >= LL_Info), `Log_Tag)
|
||||||
`define Log_Debug(msg) `log("DEBUG:" @ `msg, (LogLevel >= LL_Debug), `Log_Tag)
|
`define Log_Debug(msg) `log("DEBUG:" @ `msg, (LogLevel >= LL_Debug), `Log_Tag)
|
||||||
|
|
||||||
`define Log_Trace(msg) `log("TRACE:" @ `Location `if(`msg) @ `msg`{endif}, (LogLevel >= LL_Trace), `Log_Tag)
|
`define Log_Trace(msg) `log("TRACE:" @ `Location `if(`msg) @ `msg`{endif}, (LogLevel >= LL_Trace), `Log_Tag)
|
||||||
`define Log_TraceStatic(msg) `log("TRACE:" @ `LocationStatic `if(`msg) @ `msg`{endif}, (LogLevel >= LL_Trace), `Log_Tag)
|
`define Log_TraceStatic(msg) `log("TRACE:" @ `LocationStatic `if(`msg) @ `msg`{endif}, (LogLevel >= LL_Trace), `Log_Tag)
|
||||||
|
@ -1,68 +1,43 @@
|
|||||||
[img]https://img.shields.io/static/v1?logo=GitHub&labelColor=gray&color=blue&logoColor=white&label=&message=Open Source[/img] [img]https://img.shields.io/github/license/GenZmeY/KF2-AdminAutoLogin[/img] [img]https://img.shields.io/steam/downloads/2848836389[/img] [img]https://img.shields.io/steam/favorites/2848836389[/img] [img]https://img.shields.io/steam/update-date/2848836389[/img] [url=https://steamcommunity.com/sharedfiles/filedetails/changelog/2848836389][img]https://img.shields.io/github/v/tag/GenZmeY/KF2-AdminAutoLogin[/img][/url]
|
[img]https://img.shields.io/static/v1?logo=GitHub&labelColor=gray&color=blue&logoColor=white&label=&message=Open Source[/img] [img]https://img.shields.io/github/license/GenZmeY/KF2-AdminAutoLogin[/img] [img]https://img.shields.io/steam/favorites/2848836389[/img] [img]https://img.shields.io/steam/update-date/2848836389[/img] [url=https://steamcommunity.com/sharedfiles/filedetails/changelog/2848836389][img]https://img.shields.io/github/v/tag/GenZmeY/KF2-AdminAutoLogin[/img][/url]
|
||||||
|
|
||||||
[h1]📋 Description[/h1]
|
[h1]Description[/h1]
|
||||||
Small server-side mutator that allows specified players to automatically login as an admin.
|
Small server-side mutator that allows specified players to automatically login as an admin.
|
||||||
|
|
||||||
[h1]❌ Whitelisted?[/h1]
|
[h1]Whitelisted?[/h1]
|
||||||
No. This mod is not whitelisted and will de-rank your server. Any XP earned will not be saved.
|
No. This mod is not whitelisted and will de-rank your server. Any XP gained will not be saved.
|
||||||
|
|
||||||
But I hope that it will be whitelisted - I submitted whitelist request here:
|
[h1]Usage (server)[/h1]
|
||||||
https://forums.tripwireinteractive.com/index.php?threads/whitelisting-mods-and-mutators.120340/post-2353666
|
[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]
|
||||||
|
|
||||||
[h1]🖥️ Usage (server)[/h1]
|
|
||||||
[b]Note:[/b] [i]If this is unclear, first read: [url=https://wiki.killingfloor2.com/index.php?title=Dedicated_Server_(Killing_Floor_2)][u]Dedicated Server Guide (KF2 wiki)[/u][/url][/i]
|
|
||||||
[olist]
|
[olist]
|
||||||
[*]Open [b]PCServer-KFEngine.ini[/b] / [b]LinuxServer-KFEngine.ini[/b].
|
[*]Open your [b]PCServer-KFEngine.ini[/b] / [b]LinuxServer-KFEngine.ini[/b];
|
||||||
[*]Find [b][IpDrv.TcpNetDriver][/b] section and ensure line exists (add if missing):
|
[*]Find the [b][IpDrv.TcpNetDriver][/b] section and make sure that there is a line (add if not):
|
||||||
[code]DownloadManagers=OnlineSubsystemSteamworks.SteamWorkshopDownload[/code]
|
[b]DownloadManagers=OnlineSubsystemSteamworks.SteamWorkshopDownload[/b]
|
||||||
(If there are several [b]DownloadManagers[/b] then the line above should be the first)
|
❗️ If there are several [b]DownloadManagers=[/b] then the line above should be the first ❗️
|
||||||
[*]Add the following string to the [b][OnlineSubsystemSteamworks.KFWorkshopSteamworks][/b] section (create one if it doesn't exist):
|
[*]Add the following string to the [b][OnlineSubsystemSteamworks.KFWorkshopSteamworks][/b] section (create one if it doesn't exist):
|
||||||
[code]ServerSubscribedWorkshopItems=2848836389[/code]
|
[b]ServerSubscribedWorkshopItems=2848836389[/b]
|
||||||
[*]Start server and wait for mutator download.
|
[*]Start the server and wait until the mutator is downloading;
|
||||||
[*]When the download is complete, stop the server.
|
[*]Add mutator to server start parameters: [b]?Mutator=AAL.AALMut[/b] and restart the server.
|
||||||
[*]Create a file [b](*)[/b]: [code]<kf2-server>\KFGame\Config\KFAAL.ini[/code]
|
|
||||||
with content:
|
|
||||||
[code][AAL.AAL]
|
|
||||||
Version=0[/code]
|
|
||||||
[*]Add mutator to server start parameters: [code]?Mutator=AAL.Mut[/code] and start the server (this will generate the default KFAAL.ini content).
|
|
||||||
[*]Stop the server and configure the mutator (see [b]⚙️ Setup (KFAAL.ini)[/b] below).
|
|
||||||
[*]Start the server.
|
|
||||||
[/olist]
|
[/olist]
|
||||||
|
|
||||||
[h1]🐞 (*) Buggy config initialization[/h1]
|
[h1]Setup (KFAAL.ini)[/h1]
|
||||||
This mutator (like many others) relies on UnrealScript's default values (0 for int type) to detect first-time use and generate a config.
|
Config will be created at the first start.
|
||||||
However, the game contains a bug that initializes unset values to random data, which can lead to incorrect settings or missing configs.
|
|
||||||
|
|
||||||
As a workaround, I recommend explicitly setting [b]Version=0[/b] in the config during the first initialization.
|
|
||||||
|
|
||||||
Unfortunately, I can't fix this issue because it's a game engine problem (not the mutator's fault).
|
|
||||||
|
|
||||||
[h1]⚙️ Setup (KFAAL.ini)[/h1]
|
|
||||||
[list]
|
[list]
|
||||||
[*]Use [b]AdminId[/b] to set the list of admins, you can use UniqueID or SteamID. The default config contains example UniqueID and SteamID entries - replace them with the values you need or delete them, but don’t leave it as is.
|
[*]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]
|
[/list]
|
||||||
|
|
||||||
[h1]🔎 Getting IDs[/h1]
|
[h1]Getting ID[/h1]
|
||||||
You can view the Steam ID and UniqueID in WebAdmin on the PLAYERS tab:
|
You can view the Steam ID and UniqueID in WebAdmin on the PLAYERS tab:
|
||||||
[img]https://raw.githubusercontent.com/GenZmeY/KF2-AdminAutoLogin/master/PublicationContent/ID1.png[/img]
|
[img]https://raw.githubusercontent.com/GenZmeY/KF2-AdminAutoLogin/master/PublicationContent/ID1.png[/img]
|
||||||
|
|
||||||
But don't try to use the SteamID from here for EGS players - it won't work. SteamID is for Steam players only. UniqueID is suitable for all platforms.
|
But don't try to use the SteamID from here for EGS players - it won't work. SteamID is for Steam players only.
|
||||||
|
UniqueID is suitable for all platforms.
|
||||||
|
|
||||||
SteamID can also be obtained from the player's profile, look at the URL:
|
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]
|
[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]
|
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]
|
[img]https://raw.githubusercontent.com/GenZmeY/KF2-AdminAutoLogin/master/PublicationContent/ID3.png[/img]
|
||||||
|
|
||||||
[h1]🌍 Credits[/h1]
|
[h1]Sources[/h1]
|
||||||
[list]
|
[url=https://github.com/GenZmeY/KF2-AdminAutoLogin]https://github.com/GenZmeY/KF2-AdminAutoLogin[/url] [b](GNU GPLv3)[/b]
|
||||||
[*]The cat on the cover is Meawbin (original character by [url=https://x.com/horrormove]Cotton Valent[/url]).
|
|
||||||
[/list]
|
|
||||||
|
|
||||||
[h1]☑️ Status: Completed[/h1]
|
|
||||||
✔️ The mutator works with the current version of the game (v1150) and I have implemented everything I planned.
|
|
||||||
⛔️ Development has stopped: I no longer have the time or motivation to maintain this mod. No further updates or bug fixes are planned.
|
|
||||||
|
|
||||||
[h1]📜 Sources[/h1]
|
|
||||||
https://github.com/GenZmeY/KF2-AdminAutoLogin [b](GNU GPLv3)[/b]
|
|
15
README.md
15
README.md
@ -1,19 +1,18 @@
|
|||||||
# Admin Auto Login
|
# Admin Auto Login
|
||||||
|
|
||||||
[](https://steamcommunity.com/sharedfiles/filedetails/?id=2848836389)
|
[](https://steamcommunity.com/sharedfiles/filedetails/?id=2848836389)
|
||||||
[](https://steamcommunity.com/sharedfiles/filedetails/?id=2848836389)
|
|
||||||
[](https://steamcommunity.com/sharedfiles/filedetails/?id=2848836389)
|
[](https://steamcommunity.com/sharedfiles/filedetails/?id=2848836389)
|
||||||
[](https://github.com/GenZmeY/KF2-AdminAutoLogin/actions/workflows/mega-linter.yml)
|
[](https://steamcommunity.com/sharedfiles/filedetails/?id=2848836389)
|
||||||
[](https://github.com/GenZmeY/KF2-AdminAutoLogin/tags)
|
[](https://github.com/GenZmeY/KF2-AdminAutoLogin/tags)
|
||||||
[](LICENSE)
|
[](LICENSE)
|
||||||
|
|
||||||
## Description
|
# Description
|
||||||
Small server-side mutator that allows specified players to automatically login as an admin.
|
Small server-side mutator that allows specified players to automatically login as an admin.
|
||||||
|
|
||||||
## Usage & Setup
|
# Usage & Setup
|
||||||
[See steam workshop page](https://steamcommunity.com/sharedfiles/filedetails/?id=2848836389)
|
[See steam workshop page](https://steamcommunity.com/sharedfiles/filedetails/?id=2848836389)
|
||||||
|
|
||||||
## Build
|
# Build
|
||||||
**Note:** If you want to build/test/brew/publish a mutator without git-bash and/or scripts, follow [these instructions](https://tripwireinteractive.atlassian.net/wiki/spaces/KF2SW/pages/26247172/KF2+Code+Modding+How-to) instead of what is described here.
|
**Note:** If you want to build/test/brew/publish a mutator without git-bash and/or scripts, follow [these instructions](https://tripwireinteractive.atlassian.net/wiki/spaces/KF2SW/pages/26247172/KF2+Code+Modding+How-to) instead of what is described here.
|
||||||
1. Install [Killing Floor 2](https://store.steampowered.com/app/232090/Killing_Floor_2/), Killing Floor 2 - SDK and [git for windows](https://git-scm.com/download/win);
|
1. Install [Killing Floor 2](https://store.steampowered.com/app/232090/Killing_Floor_2/), Killing Floor 2 - SDK and [git for windows](https://git-scm.com/download/win);
|
||||||
2. open git-bash and go to any folder where you want to store sources:
|
2. open git-bash and go to any folder where you want to store sources:
|
||||||
@ -27,9 +26,9 @@ Small server-side mutator that allows specified players to automatically login a
|
|||||||
5. The compiled files will be here:
|
5. The compiled files will be here:
|
||||||
`C:\Users\<USERNAME>\Documents\My Games\KillingFloor2\KFGame\Unpublished\BrewedPC\Script\`
|
`C:\Users\<USERNAME>\Documents\My Games\KillingFloor2\KFGame\Unpublished\BrewedPC\Script\`
|
||||||
|
|
||||||
## Bug reports
|
# Bug reports
|
||||||
If you find a bug, go to the [issue page](https://github.com/GenZmeY/KF2-AdminAutoLogin/issues) and check if there is a description of your bug. If not, create a new issue.
|
If you find a bug, go to the [issue page](https://github.com/GenZmeY/KF2-AdminAutoLogin/issues) and check if there is a description of your bug. If not, create a new issue.
|
||||||
Describe what the bug looks like and how reproduce it.
|
Describe what the bug looks like and how reproduce it.
|
||||||
|
|
||||||
## License
|
# License
|
||||||
[](LICENSE)
|
[GNU GPLv3](LICENSE)
|
||||||
|
15
builder.cfg
15
builder.cfg
@ -7,24 +7,15 @@ StripSource="True"
|
|||||||
|
|
||||||
# Mutators to be compiled
|
# Mutators to be compiled
|
||||||
# Specify them with a space as a separator,
|
# Specify them with a space as a separator,
|
||||||
# Mutators will be compiled in the specified order
|
# Mutators will be compiled in the specified order
|
||||||
PackageBuildOrder="AAL"
|
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 ###
|
### Steam Workshop upload parameters ###
|
||||||
|
|
||||||
# Mutators that will be uploaded to the workshop
|
# Mutators that will be uploaded to the workshop
|
||||||
# Specify them with a space as a separator,
|
# Specify them with a space as a separator,
|
||||||
# The order doesn't matter
|
# The order doesn't matter
|
||||||
PackageUpload="AAL"
|
PackageUpload="AAL"
|
||||||
|
|
||||||
|
|
||||||
@ -39,7 +30,7 @@ Map="KF-Nuked"
|
|||||||
# Endless: KFGameContent.KFGameInfo_Endless
|
# Endless: KFGameContent.KFGameInfo_Endless
|
||||||
# Objective: KFGameContent.KFGameInfo_Objective
|
# Objective: KFGameContent.KFGameInfo_Objective
|
||||||
# Versus: KFGameContent.KFGameInfo_VersusSurvival
|
# Versus: KFGameContent.KFGameInfo_VersusSurvival
|
||||||
Game="KFGameContent.KFGameInfo_Survival"
|
Game="AAL.[0mrestore KFEditor.ini from backup[0m"
|
||||||
|
|
||||||
# Difficulty:
|
# Difficulty:
|
||||||
# Normal: 0
|
# Normal: 0
|
||||||
|
2
tools
2
tools
@ -1 +1 @@
|
|||||||
Subproject commit fb458ac61f7e6c6426b8dff366dd5e7499e0d95f
|
Subproject commit 2f173aad7a6f4578574764801136a0d86e830653
|
Loading…
x
Reference in New Issue
Block a user