Skip to content

Commit

Permalink
[release] v1.4 Public Release
Browse files Browse the repository at this point in the history
  • Loading branch information
Vel-San committed Nov 22, 2020
1 parent eb03509 commit 88d110e
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 46 deletions.
64 changes: 37 additions & 27 deletions KFServerTools/Classes/KFServerTools.uc
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,16 @@ struct ColorRecord
};
var() config array<ColorRecord> ColorList; // Color list

replication
{
unreliable if (Role == ROLE_Authority)
Debug, AdminAndSelectPlayers, ServerPerksCompatibility, ApplyTraderBoost,
DefaultTraderTime, ReviveCost, VoteReset, SpeedBoost,
SkipTraderCmd, VoteSkipTraderCmd, CurrentTraderTimeCmd, CustomTraderTimeCmd, ReviveListCmd, ReviveMeCmd, ReviveThemCmd;
}

// Initialization
function PostBeginPlay()
simulated function PostBeginPlay()
{
local int i;

Expand Down Expand Up @@ -201,12 +209,12 @@ function Mutate(string command, PlayerController Sender)
DefaultTraderTimeMSG = "%bCurrent default trader time: %w" $DefaultTraderTime;
TraderSpeedBoostMSG = "%bTrader speed boost multiplier: %w" $SpeedBoost;
SkipTraderMSG = "%w" $SkipTraderCmd$ ": %gSkip the current trader time. %wUsage: %tmutate " $SkipTraderCmd;
VoteSkipTraderMSG = "%w" $VoteSkipTraderCmd$ ": %gStart a vote to skip trader (Resets after %v" $VoteReset$ "%w). %wUsage: %tmutate " $VoteSkipTraderCmd;
VoteSkipTraderMSG = "%w" $VoteSkipTraderCmd$ ": %gStart a vote to skip trader %w(%gResets after %v" $VoteReset$ "%w). %wUsage: %tmutate " $VoteSkipTraderCmd;
CurrentTraderTimeMSG = "%w" $CurrentTraderTimeCmd$ ": %gChange the current trade time of this wave. %wUsage: %tmutate " $CurrentTraderTimeCmd$ " <6-255>";
CustomTraderTimeMSG = "%w" $CustomTraderTimeCmd$ ": %gChange the default trader time. %wUsage: %tmutate " $CustomTraderTimeCmd$ " <6-255>";
ReviveMeMSG = "%w" $ReviveMeCmd$ ": %gRevive yourself if you have at least %v" $ReviveCost$ " %gDosh. %wUsage: %tmutate " $ReviveMeCmd;
ReviveListMSG = "%w" $ReviveListCmd$ ": %gShows a list of every player + their revive code. %wUsage: %tmutate " $ReviveListCmd;
ReviveThemMSG = "%w" $ReviveThemCmd$ ": %gRevive other players. Costs %v" $ReviveCost$ " %gDosh. %wUsage: %tmutate " $ReviveThemCmd$ " all %w/ %tmutate " $ReviveThemCmd$ " <Rev Code>";
ReviveThemMSG = "%w" $ReviveThemCmd$ ": %gRevive other players. Costs %v" $ReviveCost$ " %gDosh. %wUsage: %tmutate " $ReviveThemCmd$ " all %w| %tmutate " $ReviveThemCmd$ " <Rev Code>";
SetColor(WelcomeMSG);
SetColor(DefaultTraderTimeMSG);
SetColor(SkipTraderMSG);
Expand Down Expand Up @@ -329,8 +337,7 @@ function Mutate(string command, PlayerController Sender)
return;
}
KFGT.TimeBetweenWaves = int(SplitCMD[1]);
iDefaultTraderTime = int(SplitCMD[1]);
default.iDefaultTraderTime = int(SplitCMD[1]);
DefaultTraderTime = int(SplitCMD[1]);
ServerMessage("%t" $PN$ " %wchanged the trader time between waves to %t" $string(int(SplitCMD[1]))$ " %wseconds.");
}
Expand Down Expand Up @@ -394,7 +401,8 @@ function bool StartSkipVote(PlayerController TmpPC)
{
aPlayerIDs.Insert(0,1);
aPlayerIDs[0] = PlayerID;
ServerMessage("%t" $TmpPlayerName$ " %wis ready to skip trader / type in your console %bmutate " $VoteSkipTraderCmd$ " %wif you're also ready, or %bvote%w from the ESC-Menu!");
ServerMessage("%t" $TmpPlayerName$ " %wis ready to skip trader");
ServerMessage("%wType in your console %bmutate " $VoteSkipTraderCmd$ " %wif you're also ready, or %bvote%w from the ESC-Menu!");
// Reset aPlayerIDs to 0 if once a new wave starts
if(IsTimerActive == false)
{
Expand Down Expand Up @@ -459,7 +467,7 @@ function bool FuckingReviveMeCmd(PlayerController TmpPC)
// Check if they have enough dosh
if (dosh < ReviveCost)
{
DeadMSG = "%wYeah... you're fucking %rdead %wAND %rbroke! %wYou need %t" $ReviveCost$ " %wDo$h for a revive";
DeadMSG = "%wYou need %t" $ReviveCost$ " %wDo$h for a revive";
SetColor(DeadMSG);
TmpPC.ClientMessage(DeadMSG);
return false;
Expand All @@ -468,7 +476,7 @@ function bool FuckingReviveMeCmd(PlayerController TmpPC)
{
SelfRespawnProcess(TmpPC);
dosh = TmpPC.PlayerReplicationInfo.Score;
DoshMSG = "%wFuck Yeah! You've been given another chance for life. Your total %g$$$ %wis now: %g" $dosh;
DoshMSG = "%wYou've been given another chance for life. Your total %g$$$ %wis now: %g" $dosh;
SetColor(DoshMSG);
TmpPC.ClientMessage(DoshMSG);
return true;
Expand Down Expand Up @@ -549,7 +557,7 @@ function bool FuckingReviveThemCmd(PlayerController TmpPC, string PlayerToRevive
// And take dosh from the charitable reviver :D
TmpPC.PlayerReplicationInfo.Score = int(TmpPC.PlayerReplicationInfo.Score) - ReviveCost;
dosh = TmpPC.PlayerReplicationInfo.Score;
DoshMSG = "%wFuck Yeah! You've given %t" $PlayerToReviveNAME$ " %wanother chance for life. Your total %g$$$ %wis now: %g" $dosh;
DoshMSG = "%wYou've given %t" $PlayerToReviveNAME$ " %wanother chance for life. Your total %g$$$ %wis now: %g" $dosh;
SetColor(DoshMSG);
TmpPC.ClientMessage(DoshMSG);
OthersRespawnProcess(PlayerController(C));
Expand Down Expand Up @@ -580,7 +588,7 @@ function bool FuckingReviveThemCmd(PlayerController TmpPC, string PlayerToRevive
// And take dosh from the charitable reviver :D
TmpPC.PlayerReplicationInfo.Score = int(TmpPC.PlayerReplicationInfo.Score) - ReviveCost;
dosh = TmpPC.PlayerReplicationInfo.Score;
DoshMSG = "%wFuck Yeah! You've given %t" $PlayerToReviveNAME$ " %wanother chance for life. Your total %g$$$ %wis now: %g" $dosh;
DoshMSG = "%wYou've given %t" $PlayerToReviveNAME$ " %wanother chance for life. Your total %g$$$ %wis now: %g" $dosh;
SetColor(DoshMSG);
TmpPC.ClientMessage(DoshMSG);
OthersRespawnProcess(PlayerController(C));
Expand Down Expand Up @@ -681,7 +689,7 @@ final function WhoTheFuckIsDead(PlayerController TmpPC)
DeadPlayerID = PlayerController(C).GetPlayerIDHash();
DeadPlayerRevCode = Right(DeadPlayerID, 5);

DeadPlayerMSG = "%t" $DeadPlayerName$ " %w / rev code: %t" $DeadPlayerRevCode$ " %w/ full code: %t" $DeadPlayerID;
DeadPlayerMSG = "%t" $DeadPlayerName$ " %w | rev code: %t" $DeadPlayerRevCode;
SetColor(DeadPlayerMSG);
TmpPC.ClientMessage(DeadPlayerMSG);
}
Expand Down Expand Up @@ -799,31 +807,33 @@ defaultproperties
{
// Mandatory Vars
GroupName = "KF-ServerTools"
FriendlyName = "Server Tools - v1.3"
FriendlyName = "Server Tools - v1.4"
Description = "Collection of cool features to empower your server; Made by Vel-San"
bAddToServerPackages = true
RemoteRole = ROLE_SimulatedProxy
bAlwaysRelevant = true
bNetNotify=true

// Inject new ESC-Menu Tab
STMenuType=class'STInvasionLoginMenu'

// Mut Vars
bDebug = False
bAdminAndSelectPlayers = True
bServerPerksCompatibility = False
bApplyTraderBoost = True
sSkipTraderCmd = "skip"
sVoteSkipTraderCmd = "voteskip"
sCurrentTraderTimeCmd = "tt"
sCustomTraderTimeCmd = "ct"
sReviveListCmd = "dpl"
sReviveMeCmd = "revme"
sReviveThemCmd = "rev"
iDefaultTraderTime = 60
iReviveCost = 300
iVoteReset = 30
iSpeedBoost = 2
// Below are just a sample of default config
// bDebug = False
// bAdminAndSelectPlayers = True
// bServerPerksCompatibility = False
// bApplyTraderBoost = True
// sSkipTraderCmd = "skip"
// sVoteSkipTraderCmd = "voteskip"
// sCurrentTraderTimeCmd = "tt"
// sCustomTraderTimeCmd = "ct"
// sReviveListCmd = "dpl"
// sReviveMeCmd = "revme"
// sReviveThemCmd = "rev"
// iDefaultTraderTime = 60
// iReviveCost = 300
// iVoteReset = 30
// iSpeedBoost = 2

// SpecialPlayers Array Example
// Only SteamID is important, PName is just to easily read & track the IDs
Expand Down
16 changes: 10 additions & 6 deletions KFServerTools/Classes/STBlankPanel.uc
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
class STBlankPanel extends MidGamePanel;
class STBlankPanel extends MidGamePanel DependsOn(KFServerTools);

var automated array<GUIButton> b_KFButtons;

var noexport bool bNetGame;
var string SkipForAdminsOnly, PlayerStyleName;
var GUIStyles PlayerStyle;

var KFServerTools MutRef;

function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
local GUIButton B;
Expand Down Expand Up @@ -81,7 +83,7 @@ function InitGRI()

bInit = False;
bNetGame = PC.Level.NetMode != NM_StandAlone;
if (class'KFServerTools'.default.bAdminAndSelectPlayers) b_KFButtons[0].Caption = SkipForAdminsOnly;
if (class'KFServerTools'.default.Mut.AdminAndSelectPlayers) b_KFButtons[0].Caption = SkipForAdminsOnly;
SetupGroups();
}

Expand Down Expand Up @@ -163,21 +165,23 @@ function bool ButtonClicked(GUIComponent Sender)
local string Cmd;

PC = PlayerOwner();
MutRef = class'KFServerTools'.default.Mut;

if (PC == None) return false;

if (Sender == b_KFButtons[0]) PC.ServerMutate(class'KFServerTools'.default.sSkipTraderCmd);
if (Sender == b_KFButtons[0]) PC.ServerMutate(MutRef.SkipTraderCmd);

if (Sender == b_KFButtons[1]) PC.ServerMutate(class'KFServerTools'.default.sVoteSkipTraderCmd);
if (Sender == b_KFButtons[1]) PC.ServerMutate(MutRef.VoteSkipTraderCmd);

if (Sender == b_KFButtons[2])
{
cmd = class'KFServerTools'.default.sReviveMeCmd;
cmd = MutRef.ReviveMeCmd;
PC.ServerMutate(cmd);
}

if (Sender == b_KFButtons[3])
{
cmd = class'KFServerTools'.default.sReviveThemCmd$ " all";
cmd = MutRef.ReviveThemCmd$ " all";
PC.ServerMutate(cmd);
}

Expand Down
19 changes: 10 additions & 9 deletions KFServerTools/Classes/TraderOpt.uc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class TraderOpt extends STBlankPanel;
class TraderOpt extends STBlankPanel DependsOn(KFServerTools);

var automated GUISectionBackground i_BGCenter;
var automated moEditBox ed_DefaultTrader;
Expand Down Expand Up @@ -27,15 +27,16 @@ function ShowPanel(bool bShow)
{
Super.ShowPanel(bShow);

MutRef = class'KFServerTools'.default.Mut;
if (bShow)
{
// Default Trader EditBox
ed_DefaultTrader.SetComponentValue(120, true);
if (class'KFServerTools'.default.bAdminAndSelectPlayers) b_ApplyButton.Caption = AdminsOnlyText;
ed_DefaultTrader.SetComponentValue(MutRef.DefaultTraderTime, true);
if (MutRef.AdminAndSelectPlayers) b_ApplyButton.Caption = AdminsOnlyText;

// Current Trader EditBox
ed_CurrentTrader.SetComponentValue("120", true);
if (class'KFServerTools'.default.bAdminAndSelectPlayers) b_ApplyButton2.Caption = AdminsOnlyText;
ed_CurrentTrader.SetComponentValue(120, true);
if (MutRef.AdminAndSelectPlayers) b_ApplyButton2.Caption = AdminsOnlyText;

// Revive related Info
// Player Code EditBox
Expand All @@ -47,31 +48,31 @@ function UpdateDefaultTraderTime(PlayerController TmpPC)
{
local string Cmd;

cmd = class'KFServerTools'.default.sCustomTraderTimeCmd$ " " $ed_DefaultTrader.GetComponentValue();
cmd = class'KFServerTools'.default.Mut.CustomTraderTimeCmd$ " " $ed_DefaultTrader.GetComponentValue();
TmpPC.ServerMutate(cmd);
}
function UpdateCurrentTraderTime(PlayerController TmpPC)
{
local string Cmd;
cmd = class'KFServerTools'.default.sCurrentTraderTimeCmd$ " " $ed_CurrentTrader.GetComponentValue();
cmd = class'KFServerTools'.default.Mut.CurrentTraderTimeCmd$ " " $ed_CurrentTrader.GetComponentValue();
TmpPC.ServerMutate(cmd);
}
function PrintDeadPlayers(PlayerController TmpPC)
{
local string Cmd;
cmd = class'KFServerTools'.default.sReviveListCmd;
cmd = class'KFServerTools'.default.Mut.ReviveListCmd;
TmpPC.ServerMutate(cmd);
}
function RevivePlayerByCode(PlayerController TmpPC)
{
local string Cmd;
cmd = class'KFServerTools'.default.sReviveThemCmd$ " " $ed_RevPlayer.GetComponentValue();
cmd = class'KFServerTools'.default.Mut.ReviveThemCmd$ " " $ed_RevPlayer.GetComponentValue();
TmpPC.ServerMutate(cmd);
}
Expand Down
4 changes: 2 additions & 2 deletions Sample_Config/KFServerTools.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ sCurrentTraderTimeCmd=tt
# Command to be used to change default trader time for whole match
sCustomTraderTimeCmd=ct
# Command to be used for self revive
sReviveMe=revme
sReviveMeCmd=revme
# Command to show list of all dead players, along with their rev codes
sReviveListCmd=dpl
# Command to revive other players. Usage: mutate rev all, or mutate rev <Rev Code>
# Player Rev Code doesn't have to be 100% accurate, just put at least 3 numbers
sReviveThem=rev
sReviveThemCmd=rev
# Default trader time
iDefaultTraderTime=60
# Cost for a single revive, if you have the Dosh, we give you the revive!
Expand Down
4 changes: 2 additions & 2 deletions Steam_WorkShop_Description/Workshop-Text
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ Optional, if you have ServerPerks installed:

[h1][b][u]Manual Download Links (Recommended)[/u][/b][/h1]

You can find it under 'Not-Whitelisted' folder named 'KF-ServerTools-v1.3'
You can find it under 'Not-Whitelisted' folder named 'KF-ServerTools-v1.4'

- MEGA Link: https://mega DOT nz/folder/YDoEmKiC#s6FGAtgh40-TvB4bHsLaMQ

- Github: https://github.com/Vel-San/KF-ServerTools/releases/tag/v1.3r
- Github: https://github.com/Vel-San/KF-ServerTools/releases/tag/v1.4

0 comments on commit 88d110e

Please sign in to comment.