Compare commits
23 Commits
Author | SHA1 | Date | |
---|---|---|---|
464ba0f492 | |||
afadeba04c | |||
1c1b7f6e90 | |||
690aa2ba6f | |||
158c6b8a2e | |||
e354b714ca | |||
6fb5902567 | |||
8a26a40e90 | |||
edb2334ac8 | |||
c37b64c3be | |||
9635fb5007 | |||
e595daf7ca | |||
9b47405939 | |||
345e765a0e | |||
c724de802b | |||
da1f19cf9d | |||
777b2389c1 | |||
66d7dce3d0 | |||
b66f2e9fef | |||
af861b9888 | |||
5f4617e25f | |||
5dd4279dd4 | |||
31db3849be |
33
.editorconfig
Normal file
33
.editorconfig
Normal 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
|
73
.github/workflows/mega-linter.yml
vendored
Normal file
73
.github/workflows/mega-linter.yml
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
---
|
||||
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
|
||||
DISABLE_ERRORS_LINTERS: COPYPASTE_JSCPD
|
||||
|
||||
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
|
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*.psd
|
||||
/ignore
|
@ -183,6 +183,13 @@ public function bool PlayerIsKickProtected(PlayerReplicationInfo PRI)
|
||||
return (KickProtectedPlayers.Find('Uid', PRI.UniqueId.Uid) != INDEX_NONE);
|
||||
}
|
||||
|
||||
public function bool PlayerPerkLoaded(PlayerReplicationInfo PRI)
|
||||
{
|
||||
`Log_Trace();
|
||||
|
||||
return (KFPlayerReplicationInfo(PRI) != None && KFPlayerReplicationInfo(PRI).CurrentPerkClass != None);
|
||||
}
|
||||
|
||||
public function bool PlayerIsStartWaveKickProtected(KFPlayerController KFPC)
|
||||
{
|
||||
`Log_Trace();
|
||||
@ -326,14 +333,20 @@ public function NotifyLogin(Controller C)
|
||||
{
|
||||
`Log_Trace();
|
||||
|
||||
CreateRepInfo(C);
|
||||
if (!CreateRepInfo(C))
|
||||
{
|
||||
`Log_Error("Can't create RepInfo for:" @ C);
|
||||
}
|
||||
}
|
||||
|
||||
public function NotifyLogout(Controller C)
|
||||
{
|
||||
`Log_Trace();
|
||||
|
||||
DestroyRepInfo(C);
|
||||
if (!DestroyRepInfo(C))
|
||||
{
|
||||
`Log_Error("Can't destroy RepInfo of:" @ C);
|
||||
}
|
||||
}
|
||||
|
||||
public function bool CreateRepInfo(Controller C)
|
||||
@ -369,8 +382,8 @@ public function bool DestroyRepInfo(Controller C)
|
||||
{
|
||||
if (RepInfo.Owner == C)
|
||||
{
|
||||
RepInfo.SafeDestroy();
|
||||
RepInfos.RemoveItem(RepInfo);
|
||||
RepInfo.SafeDestroy();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -378,7 +391,7 @@ public function bool DestroyRepInfo(Controller C)
|
||||
return false;
|
||||
}
|
||||
|
||||
DefaultProperties
|
||||
defaultproperties
|
||||
{
|
||||
|
||||
}
|
@ -35,7 +35,7 @@ public function AddMutator(Mutator Mut)
|
||||
if (Mut == Self) return;
|
||||
|
||||
if (Mut.Class == Class)
|
||||
Mut.Destroy();
|
||||
CVCMut(Mut).SafeDestroy();
|
||||
else
|
||||
Super.AddMutator(Mut);
|
||||
}
|
||||
@ -54,7 +54,7 @@ public function NotifyLogout(Controller C)
|
||||
CVC.NotifyLogout(C);
|
||||
}
|
||||
|
||||
DefaultProperties
|
||||
defaultproperties
|
||||
{
|
||||
|
||||
GroupNames.Add("VoteCollector")
|
||||
}
|
@ -10,6 +10,9 @@ var private localized String PlayerIsStartWaveKickProtected;
|
||||
var const String PlayerCantStartKickVoteDefault;
|
||||
var private localized String PlayerCantStartKickVote;
|
||||
|
||||
var const String PlayerPerkIsNotLoadedDefault;
|
||||
var private localized String PlayerPerkIsNotLoaded;
|
||||
|
||||
var const String KickVoteNotEnoughPlayersDefault;
|
||||
var private localized String KickVoteNotEnoughPlayers;
|
||||
|
||||
@ -33,6 +36,7 @@ enum E_CVC_LocalMessageType
|
||||
CVC_PlayerIsKickProtected,
|
||||
CVC_PlayerIsStartWaveKickProtected,
|
||||
CVC_PlayerCantStartKickVote,
|
||||
CVC_PlayerPerkIsNotLoaded,
|
||||
|
||||
CVC_KickVoteNotEnoughPlayers,
|
||||
CVC_KickVoteStarted,
|
||||
@ -88,6 +92,9 @@ public static function String GetLocalizedString(
|
||||
case CVC_PlayerCantStartKickVote:
|
||||
return ReplWaves(default.PlayerCantStartKickVote != "" ? default.PlayerCantStartKickVote : default.PlayerCantStartKickVoteDefault, String1);
|
||||
|
||||
case CVC_PlayerPerkIsNotLoaded:
|
||||
return ReplKickee(default.PlayerPerkIsNotLoaded != "" ? default.PlayerPerkIsNotLoaded : default.PlayerPerkIsNotLoadedDefault, String1);
|
||||
|
||||
case CVC_KickVoteNotEnoughPlayers:
|
||||
return ReplWaves(default.KickVoteNotEnoughPlayers != "" ? default.KickVoteNotEnoughPlayers : default.KickVoteNotEnoughPlayersDefault, String1);
|
||||
|
||||
@ -136,6 +143,7 @@ defaultproperties
|
||||
PlayerIsKickProtectedDefault = "<kickee> is protected from kick"
|
||||
PlayerIsStartWaveKickProtectedDefault = "You can't kick <kickee> right now. He can be kicked when he plays at least <waves> wave(s)"
|
||||
PlayerCantStartKickVoteDefault = "You can't start kick vote now. You can start kick vote when you play at least <waves> wave(s)"
|
||||
PlayerPerkIsNotLoadedDefault = "You can't kick a player who hasn't loaded yet (<kickee>)"
|
||||
KickVoteNotEnoughPlayersDefault = "Not enough players to start vote (only players who have played at least <waves> wave(s) can vote)"
|
||||
KickVoteStartedDefault = "<kicker> has started a vote to kick <kickee>"
|
||||
KickVoteStartedForPlayerDefault = "<kicker> started voting to kick you"
|
||||
|
@ -38,6 +38,7 @@ public reliable client function WriteToChat(String Message, optional String HexC
|
||||
|
||||
if (KFPC.MyGFxManager.PartyWidget != None && KFPC.MyGFxManager.PartyWidget.PartyChatWidget != None)
|
||||
{
|
||||
KFPC.MyGFxManager.PartyWidget.PartyChatWidget.SetVisible(true);
|
||||
KFPC.MyGFxManager.PartyWidget.PartyChatWidget.AddChatMessage(Message, HexColor);
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,7 @@ var private String KickeeName;
|
||||
var private String YesVotesPlayers, NoVotesPlayers;
|
||||
|
||||
var private bool AllowHudNotification;
|
||||
var private bool AllowSTPNotification; // SkipTrader and Pause
|
||||
|
||||
replication
|
||||
{
|
||||
@ -92,6 +93,16 @@ public function ServerStartVoteKick(PlayerReplicationInfo PRI_Kickee, PlayerRepl
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CVC.PlayerPerkLoaded(PRI_Kickee))
|
||||
{
|
||||
CVC.WriteToChatLocalized(
|
||||
KFPC_Kicker,
|
||||
CVC_PlayerPerkIsNotLoaded,
|
||||
CfgKickVote.default.WarningColorHex,
|
||||
KickeeName);
|
||||
return;
|
||||
}
|
||||
|
||||
if (CVC.PlayerIsStartWaveKickProtected(KFPC_Kickee))
|
||||
{
|
||||
CVC.WriteToChatLocalized(
|
||||
@ -636,6 +647,8 @@ public function ServerStartVoteSkipTrader(PlayerReplicationInfo PRI)
|
||||
KFPRI.ShowSkipTraderVote(PRI, CurrentVoteTime, !(KFPRI == PRI) && PRI.GetTeamNum() != 255);
|
||||
}
|
||||
|
||||
AllowSTPNotification = KFPRIs.Length > 1;
|
||||
|
||||
KFGI.BroadcastLocalized(KFGI, class'KFLocalMessage', LMT_SkipTraderVoteStarted, CurrentSkipTraderVote.PlayerPRI);
|
||||
SetTimer(CurrentVoteTime, false, nameof(ConcludeVoteSkipTrader), Self);
|
||||
SetTimer(1, true, nameof(UpdateTimer), Self);
|
||||
@ -682,7 +695,7 @@ public reliable server function RecieveVoteSkipTrader(PlayerReplicationInfo PRI,
|
||||
|
||||
`Log_Trace();
|
||||
|
||||
MustNotify = (PlayersThatHaveVoted.Find(PRI) == INDEX_NONE);
|
||||
MustNotify = (PlayersThatHaveVoted.Find(PRI) == INDEX_NONE && AllowSTPNotification);
|
||||
|
||||
Super.RecieveVoteSkipTrader(PRI, bSkip);
|
||||
|
||||
@ -797,6 +810,8 @@ public function ServerStartVotePauseGame(PlayerReplicationInfo PRI)
|
||||
KFPRI.ShowPauseGameVote(PRI, CurrentVoteTime, !(KFPRI == PRI));
|
||||
}
|
||||
|
||||
AllowSTPNotification = KFPRIs.Length > 1;
|
||||
|
||||
KFGI.BroadcastLocalized(KFGI, class'KFLocalMessage', bIsEndlessPaused ? LMT_ResumeVoteStarted : LMT_PauseVoteStarted, CurrentPauseGameVote.PlayerPRI);
|
||||
SetTimer(CurrentVoteTime, false, nameof(ConcludeVotePauseGame), Self);
|
||||
SetTimer(1, true, nameof(UpdatePauseGameTimer), Self);
|
||||
@ -843,7 +858,7 @@ public reliable server function ReceiveVotePauseGame(PlayerReplicationInfo PRI,
|
||||
|
||||
`Log_Trace();
|
||||
|
||||
MustNotify = (PlayersThatHaveVoted.Find(PRI) == INDEX_NONE);
|
||||
MustNotify = (PlayersThatHaveVoted.Find(PRI) == INDEX_NONE && AllowSTPNotification);
|
||||
|
||||
Super.ReceiveVotePauseGame(PRI, bSkip);
|
||||
|
||||
@ -1108,4 +1123,5 @@ public function int GetNextMap()
|
||||
defaultproperties
|
||||
{
|
||||
AllowHudNotification = true;
|
||||
AllowSTPNotification = true;
|
||||
}
|
||||
|
@ -60,7 +60,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(String ID, out UniqueNetId UID, E_LogLevel LogLevel)
|
||||
|
@ -64,7 +64,7 @@ static function IncMapStat(String Map, int PlayTime, String SortPolicy, E_LogLev
|
||||
StaticSaveConfig();
|
||||
}
|
||||
|
||||
DefaultProperties
|
||||
defaultproperties
|
||||
{
|
||||
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
@ -16,7 +16,10 @@ New vote collector with improvements and features.
|
||||
[i](it would be logical to separate these features into several mutators, but this is a bad idea for technical reasons)[/i]
|
||||
|
||||
[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-2353667
|
||||
|
||||
[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]
|
||||
|
17
README.md
17
README.md
@ -1,15 +1,16 @@
|
||||
# Controlled Vote Collector
|
||||
|
||||
[](https://steamcommunity.com/sharedfiles/filedetails/?id=2847465899)
|
||||
[](https://steamcommunity.com/sharedfiles/filedetails/?id=2848836389)
|
||||
[](https://steamcommunity.com/sharedfiles/filedetails/?id=2847465899)
|
||||
[](https://steamcommunity.com/sharedfiles/filedetails/?id=2847465899)
|
||||
[](https://github.com/GenZmeY/KF2-ControlledVoteCollector/actions/workflows/mega-linter.yml)
|
||||
[](https://github.com/GenZmeY/KF2-ControlledVoteCollector/tags)
|
||||
[](LICENSE)
|
||||
|
||||
# Description
|
||||
## Description
|
||||
New vote collector with improvements and features.
|
||||
|
||||
# Features
|
||||
## Features
|
||||
- map statistics;
|
||||
- default/next map setting;
|
||||
- anonymous or public voting;
|
||||
@ -17,10 +18,10 @@ New vote collector with improvements and features.
|
||||
- kick voting setup;
|
||||
- early kick protection.
|
||||
|
||||
# Usage & Setup
|
||||
## Usage & Setup
|
||||
[See steam workshop page](https://steamcommunity.com/sharedfiles/filedetails/?id=2847465899)
|
||||
|
||||
# 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:
|
||||
@ -34,9 +35,9 @@ New vote collector with improvements and features.
|
||||
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-ControlledVoteCollector/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)
|
||||
|
@ -11,6 +11,15 @@ StripSource="True"
|
||||
PackageBuildOrder="CVC"
|
||||
|
||||
|
||||
### 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
|
||||
|
2
tools
2
tools
Submodule tools updated: 2f173aad7a...fb458ac61f
Reference in New Issue
Block a user