Skip to content

Commit

Permalink
[release] v2.2 Public Release
Browse files Browse the repository at this point in the history
  • Loading branch information
Vel-San committed Apr 21, 2021
1 parent fbaf89d commit 827c579
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 45 deletions.
43 changes: 21 additions & 22 deletions MutLoader/Classes/MutLoader.uc
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

class MutLoader extends Mutator Config(MutLoaderV2);

// Normal Vars
// Local Vars
var string sServerName;
var bool bKeepServerNameDefault;
var bool AppendFaked, UpdateServerName;
var KFGameType KF;

function PreBeginPlay()
Expand All @@ -20,24 +20,25 @@ function PreBeginPlay()
local array<string> Names;
local int i;

//////////////////// Essence & Vel-San ///////////
Names=Class'MutLoaderObject'.Static.GetPerObjectNames("MutLoaderV2");
for(i=0; i<Names.Length; i++) MutLoaderRecords[i]=New(None, Names[i]) Class'MutLoaderObject';
for(i=0; i<MutLoaderRecords.Length; i++)
{
if (
MutLoaderRecords[i].GameTypeName==string(Level.Game.Class.Name)
&& MutLoaderRecords[i].GameDifficulty==Level.Game.GameDifficulty
)
if( MutLoaderRecords[i].sGameTypeName==string(Level.Game.Class.Name)
&& MutLoaderRecords[i].fGameDifficulty==Level.Game.GameDifficulty)
{
MutLog("-----|| Using MutLoader Config # [" $i$ "]; Total Configs Found: " $MutLoaderRecords.Length$ " ||-----");
MutatorList=MutLoaderRecords[i].Mutator;
if (MutLoaderRecords[i].ServerName != "") sServerName = MutLoaderRecords[i].ServerName;
else bKeepServerNameDefault = True;
MutLog("-----|| Adding [" $MutatorList.Length$ "] Mutators found in MutLoader Config # [" $i$ "]; Total Configs Found: " $MutLoaderRecords.Length$ " ||-----");
if (MutLoaderRecords[i].bUpdateServerName)
{
sServerName = MutLoaderRecords[i].sServerName;
UpdateServerName = true;
}
if (MutLoaderRecords[i].bAppendFaked) AppendFaked = true;
Break;
}
}
//////////////////////////////////////////////////

for(i=0; i<MutatorList.Length; i++)
{
if (
Expand All @@ -57,33 +58,31 @@ function PreBeginPlay()

function PostBeginPlay()
{
SetTimer(1, False);
SetTimer(1, false);
}

function Timer()
{
KF = KFGameType(Level.Game);
TimeStampLog("-----|| Default ServerName: " $Level.GRI.ServerName$ " ||-----");
TimeStampLog("-----|| 'MutLoader' ServerName: " $sServerName$ " ||-----");

CheckMutators(sServerName);
// Check for FakedPlus
if (AppendFaked) CheckMutators(sServerName);

if(!bKeepServerNameDefault)
// Update Server Name
if(UpdateServerName)
{
TimeStampLog("-----|| New ServerName: " $sServerName$ " ||-----");
Level.GRI.ServerName = sServerName;
TimeStampLog("-----|| New ServerName: " $Level.GRI.ServerName$ " ||-----");
}
else TimeStampLog("-----|| Keeping Default Server Name ||-----");
}

// Special Function to detect Faked Mutator and append XF to ServerName
// Detect FakedPlus Mutator and append 'xF' to ServerName
function CheckMutators(out string ServerName)
{
local Mutator M;

// Do not append anything or change the ServerName, if empty ServerName detected in Config
if(bKeepServerNameDefault) return;

for ( M = KF.BaseMutator; M != None; M = M.NextMutator ) {
if(M.IsA('Faked_1')) ServerName $= " | 1F";
if(M.IsA('Faked_2')) ServerName $= " | 2F";
Expand All @@ -107,6 +106,6 @@ function MutLog(string s)
defaultproperties
{
GroupName="KF-MutLoaderV2"
FriendlyName="MutLoader - v2.1"
Description="seamlessly load mutators With optimized config (Difficulty, ServerName, Several GameTypes); By Flame, Essence & Vel-San"
FriendlyName="MutLoader - v2.2"
Description="Seamlessly load mutators based on Game Difficulty & Game Type; By Flame, Essence & Vel-San"
}
12 changes: 9 additions & 3 deletions MutLoader/Classes/MutLoaderObject.uc
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Class MutLoaderObject extends Object PerObjectConfig Config(MutLoaderV2);

// List of Mutators
var config array<string> Mutator;
var config string GameTypeName;
var config float GameDifficulty;
var config string ServerName;
// GameType
var config string sGameTypeName;
// Game Difficulty
var config float fGameDifficulty;
// Custom Server Name with every MapVote
var config string sServerName;
// ServerName Features
var config bool bAppendFaked, bUpdateServerName;
16 changes: 10 additions & 6 deletions Sample_Config/MutLoaderV2.ini
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
[MutLoaderV2.MutLoader]

[Settings1 MutLoaderObject]
GameTypeName=KFGameType # Can be any gametype you want
GameDifficulty=4.0 # Important if you want to make 2 configs of the same GameType, with different difficulties
ServerName=This is a test server - Diff 4.0 # ServerName will change to this
sGameTypeName=KFGameType # Can be any gametype you want
fGameDifficulty=4.0 # Important if you want to make 2 configs of the same GameType, with different difficulties
bAppendFaked=false # Adds 1F, 2F, 3F etc... if true & FakedPlus mutator is enabled
bUpdateServerName=true # If true, updates server name to sServerName below
sServerName=This is a test server - Diff 4.0 # ServerName will change to this if bUpdateServerName is true
Mutator=Mut1.Mut1
Mutator=Mut1.Mut2
Mutator=Mut1.Mut3

[Settings2 MutLoaderObject]
GameTypeName=KFGameType
GameDifficulty=7.0
ServerName=This is a test server - Diff 7.0
sGameTypeName=KFGameType
fGameDifficulty=7.0
bAppendFaked=false # Adds 1F, 2F, 3F etc... if true & FakedPlus mutator is enabled
bUpdateServerName=true # If true, updates server name to sServerName below
sServerName=This is a test server - Diff 7.0
Mutator=Mut1.Mut1
Mutator=Mut1.Mut2
Mutator=Mut1.Mut3
28 changes: 14 additions & 14 deletions Steam_WorkShop_Description/Workshop-text
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Optimized version of 'MutLoader' originally made by Flame &amp; Essence, slightly modified by Vel-San;
Optimized version of 'MutLoader' originally made by Flame, Essence & Modified by Vel-San;

- If your server is crashing because your 'Server Launch Command' has a lot of mutators, or MapVoteV2 is crashing as well, then this mutator is for you

[b]Changes from the original version[/b]

- Better support with MapVoteV2
- ServerName change with every config
- If ServerName is given (not empty), Mutator will also check if you have Faked Mutator installed (1, 2, 3, 4, 5, Custom) and will automatically append XF to your server name
- ServerName change with every config (Optional)
- Detects FakedPlus mutator and adds prefix to ServerName (Optional)

[h1][b][u]Notes[/u][/b][/h1]

Expand All @@ -22,17 +22,21 @@ Optimized version of 'MutLoader' originally made by Flame &amp; Essence, slightl
[MutLoaderV2.MutLoader]

[Settings1 MutLoaderObject]
GameTypeName=KFGameType # Can be any gametype you want
GameDifficulty=4.0 # Important if you want to make 2 configs of the same GameType, with different difficulties
ServerName=This is a test server - Diff 4.0 # ServerName will change to this, set to empty if you want to disable
sGameTypeName=KFGameType # Can be any gametype you want
fGameDifficulty=4.0 # Important if you want to make 2 configs of the same GameType, with different difficulties
bAppendFaked=false # Adds 1F, 2F, 3F etc... if true & FakedPlus mutator is enabled
bUpdateServerName=true # If true, updates server name to sServerName below
sServerName=This is a test server - Diff 4.0 # ServerName will change to this if bUpdateServerName is true
Mutator=Mut1.Mut1
Mutator=Mut1.Mut2
Mutator=Mut1.Mut3

[Settings2 MutLoaderObject]
GameTypeName=KFGameType
GameDifficulty=7.0
ServerName=This is a test server - Diff 7.0
sGameTypeName=KFGameType
fGameDifficulty=7.0
bAppendFaked=false # Adds 1F, 2F, 3F etc... if true & FakedPlus mutator is enabled
bUpdateServerName=true # If true, updates server name to sServerName below
sServerName=This is a test server - Diff 7.0
Mutator=Mut1.Mut1
Mutator=Mut1.Mut2
Mutator=Mut1.Mut3
Expand Down Expand Up @@ -65,8 +69,4 @@ No need to put any other mutators in the list of MapVoteV2. What's important is

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

You can find it under 'Whitelisted' folder named 'KF-Mutloader-v2.1'

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

- Github: https://github.com/Vel-San/KF-Mutloader/releases/tag/v2.1
- Github: https://github.com/Vel-San/KF-Mutloader/releases/tag/v2.2

0 comments on commit 827c579

Please sign in to comment.