Compare commits

...

21 Commits

Author SHA1 Message Date
a95a3fb8d5
Merge pull request #3 from GenZmeY/short-name
add short alias for mutator
2024-03-08 16:10:40 +03:00
a1fe46bf8b
update ci/cd 2023-12-31 23:04:45 +03:00
b7a1e233d8
Merge branch 'master' into short-name 2023-12-31 22:59:04 +03:00
263e78ef33
update ci/cd 2023-12-31 20:49:51 +03:00
258e9456bd
add short alias for mutator 2023-12-31 20:15:56 +03:00
ee325fc386 Revert "add group name"
This reverts commit f7c3b61bb4.
2023-06-29 01:06:02 +03:00
f7c3b61bb4 add group name 2023-06-12 18:55:11 +03:00
d001a5c11e
Merge pull request #2 from GenZmeY/mut-update
small mut update
2023-06-06 21:14:43 +03:00
9ed1969c7e small mut update 2023-06-03 16:51:18 +03:00
744d9c6b30 update .editorconfig 2023-05-14 12:16:01 +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
15 changed files with 536 additions and 387 deletions

33
.editorconfig Normal file
View File

@ -0,0 +1,33 @@
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 Normal file
View File

@ -0,0 +1,114 @@
---
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"

View File

@ -1,60 +1 @@
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)
{
AAL.NotifyLogin(C);
Super.NotifyLogin(C);
}
public function NotifyLogout(Controller C)
{
AAL.NotifyLogout(C);
Super.NotifyLogout(C);
}
defaultproperties
{
}
class AALMut extends Mut; // backward compatibility

60
AAL/Classes/Mut.uc Normal file
View File

@ -0,0 +1,60 @@
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
{
}

View File

@ -1,4 +1,4 @@
[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]
Small server-side mutator that allows specified players to automatically login as an admin.
@ -19,7 +19,7 @@ https://forums.tripwireinteractive.com/index.php?threads/whitelisting-mods-and-m
[*]Add the following string to the [b][OnlineSubsystemSteamworks.KFWorkshopSteamworks][/b] section (create one if it doesn't exist):
[b]ServerSubscribedWorkshopItems=2848836389[/b]
[*]Start the server and wait until the mutator is downloading;
[*]Add mutator to server start parameters: [b]?Mutator=AAL.AALMut[/b] and restart the server.
[*]Add mutator to server start parameters: [b]?Mutator=AAL.Mut[/b] and restart the server.
[/olist]
[h1]Important setup information[/h1]

View File

@ -1,18 +1,19 @@
# 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 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 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](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.
# Usage & Setup
## Usage & Setup
[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.
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:
@ -26,9 +27,9 @@ Small server-side mutator that allows specified players to automatically login a
5. The compiled files will be here:
`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.
Describe what the bug looks like and how reproduce it.
# License
[GNU GPLv3](LICENSE)
## License
[![license](https://www.gnu.org/graphics/gplv3-with-text-136x68.png)](LICENSE)

2
tools

@ -1 +1 @@
Subproject commit 88b35bd7ebb7e30448579f1564220398f990541c
Subproject commit fb458ac61f7e6c6426b8dff366dd5e7499e0d95f