15 Commits

Author SHA1 Message Date
9ed1969c7e small mut update 2023-06-03 16:51:18 +03:00
da2e6dac59 update build tools to v1.9.2-1-gfb458ac 2023-05-12 23:47:40 +03:00
f65238de0a update build tools to v1.9.1-6-gddc0bb2 2023-05-10 08:48:07 +03:00
65226ad694 update build tools 2023-05-10 07:31:05 +03:00
8ba4226a8f Update README.md 2023-05-10 04:21:53 +03:00
cda1a26df4 update build tools 2023-05-10 03:07:30 +03:00
82fd1a2f4f update .editorconfig
I changed my mind a little
2023-05-02 22:31:58 +03:00
0ff11a392b Merge pull request #1 from GenZmeY/MegaLinter
add Mega Linter
2023-05-02 01:47:28 +03:00
37539b4611 add MegaLinter badge 2023-05-02 01:43:57 +03:00
a10ad31817 update formatting to match .editorconfig 2023-05-02 01:38:24 +03:00
8c834e2ed0 add MegaLinter and .editorconfig 2023-05-02 01:04:22 +03:00
b887e19077 update build tools 2023-05-02 01:03:12 +03:00
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
14 changed files with 508 additions and 364 deletions

32
.editorconfig Normal file
View File

@ -0,0 +1,32 @@
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]
trim_trailing_whitespace = false
[*.yml]
indent_style = space
indent_size = 2
[*.{txt,cfg,conf}]
indent_style = tab

72
.github/workflows/mega-linter.yml vendored Normal file
View File

@ -0,0 +1,72 @@
---
name: MegaLinter
permissions: read-all
on:
push:
pull_request:
branches: [master]
env:
APPLY_FIXES: none
APPLY_FIXES_EVENT: pull_request
APPLY_FIXES_MODE: commit
DISABLE: SPELL
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
name: MegaLinter
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
- name: MegaLinter
id: ml
uses: oxsecurity/megalinter@v6
env:
VALIDATE_ALL_CODEBASE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Archive production artifacts
if: ${{ success() }} || ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: MegaLinter reports
path: |
megalinter-reports
mega-linter.log
- name: Create Pull Request with applied fixes
id: cpr
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
uses: peter-evans/create-pull-request@v5
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: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
- name: Prepare commit
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
run: sudo chown -Rc $UID .git/
- name: Commit and push applied linter fixes
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
commit_message: "[MegaLinter] Apply linters fixes"
commit_user_name: megalinter-bot
commit_user_email: nicolas.vuillamy@ox.security

View File

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

View File

@ -35,7 +35,7 @@ public function AddMutator(Mutator Mut)
if (Mut == Self) return; if (Mut == Self) return;
if (Mut.Class == Class) if (Mut.Class == Class)
Mut.Destroy(); AALMut(Mut).SafeDestroy();
else else
Super.AddMutator(Mut); Super.AddMutator(Mut);
} }

View File

@ -1,10 +1,13 @@
[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] [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]
[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 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] [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] [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. [*]Add mutator to server start parameters: [b]?Mutator=AAL.AALMut[/b] and restart the server.
[/olist] [/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] [h1]Setup (KFAAL.ini)[/h1]
Config will be created at the first start[b]*[/b].
[list] [list]
[*]Use [b]AdminId[/b] to set the list of admins. You can use UniqueID or SteamID; [*]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 ID[/h1] [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] 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] [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] [h1]Sources[/h1]
[url=https://github.com/GenZmeY/KF2-AdminAutoLogin]https://github.com/GenZmeY/KF2-AdminAutoLogin[/url] [b](GNU GPLv3)[/b] [url=https://github.com/GenZmeY/KF2-AdminAutoLogin]https://github.com/GenZmeY/KF2-AdminAutoLogin[/url] [b](GNU GPLv3)[/b]

View File

@ -1,18 +1,19 @@
# Admin Auto Login # Admin Auto Login
[![Steam Workshop](https://img.shields.io/static/v1?message=workshop&logo=steam&labelColor=gray&color=blue&logoColor=white&label=steam%20)](https://steamcommunity.com/sharedfiles/filedetails/?id=2848836389) [![Steam Workshop](https://img.shields.io/static/v1?message=workshop&logo=steam&labelColor=gray&color=blue&logoColor=white&label=steam%20)](https://steamcommunity.com/sharedfiles/filedetails/?id=2848836389)
[![Steam Downloads](https://img.shields.io/steam/downloads/2848836389)](https://steamcommunity.com/sharedfiles/filedetails/?id=2848836389)
[![Steam Favorites](https://img.shields.io/steam/favorites/2848836389)](https://steamcommunity.com/sharedfiles/filedetails/?id=2848836389) [![Steam Favorites](https://img.shields.io/steam/favorites/2848836389)](https://steamcommunity.com/sharedfiles/filedetails/?id=2848836389)
[![Steam Update Date](https://img.shields.io/steam/update-date/2848836389)](https://steamcommunity.com/sharedfiles/filedetails/?id=2848836389) [![MegaLinter](https://github.com/GenZmeY/KF2-AdminAutoLogin/actions/workflows/mega-linter.yml/badge.svg?branch=master)](https://github.com/GenZmeY/KF2-AdminAutoLogin/actions/workflows/mega-linter.yml)
[![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/GenZmeY/KF2-AdminAutoLogin)](https://github.com/GenZmeY/KF2-AdminAutoLogin/tags) [![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/GenZmeY/KF2-AdminAutoLogin)](https://github.com/GenZmeY/KF2-AdminAutoLogin/tags)
[![GitHub](https://img.shields.io/github/license/GenZmeY/KF2-AdminAutoLogin)](LICENSE) [![GitHub](https://img.shields.io/github/license/GenZmeY/KF2-AdminAutoLogin)](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:
@ -26,9 +27,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
[GNU GPLv3](LICENSE) [![license](https://www.gnu.org/graphics/gplv3-with-text-136x68.png)](LICENSE)

2
tools

Submodule tools updated: 88b35bd7eb...fb458ac61f