From fbaf89d5a03bb7a2bb3deb21dd0903c42c1c79b5 Mon Sep 17 00:00:00 2001 From: Vel-San <13340023+Vel-San@users.noreply.github.com> Date: Sun, 6 Dec 2020 13:03:44 +0100 Subject: [PATCH] [release] v2.1 Public Release --- MutLoader/Classes/MutLoader.uc | 131 ++++++++++++++--------- README.md | 1 + Sample_Config/MutLoaderV2.ini | 1 - Steam_WorkShop_Description/Workshop-text | 6 +- 4 files changed, 83 insertions(+), 56 deletions(-) diff --git a/MutLoader/Classes/MutLoader.uc b/MutLoader/Classes/MutLoader.uc index 2552d6e..045c2c1 100644 --- a/MutLoader/Classes/MutLoader.uc +++ b/MutLoader/Classes/MutLoader.uc @@ -7,63 +7,91 @@ class MutLoader extends Mutator Config(MutLoaderV2); -var config bool bDebug; +// Normal Vars var string sServerName; +var bool bKeepServerNameDefault; +var KFGameType KF; function PreBeginPlay() { - // Vars - local array MutLoaderRecords; - local array MutatorList; - local array Names; - local int i; + // Vars + local array MutLoaderRecords; + local array MutatorList; + local array Names; + local int i; - Super.PreBeginPlay(); + //////////////////// Essence & Vel-San /////////// + Names=Class'MutLoaderObject'.Static.GetPerObjectNames("MutLoaderV2"); + for(i=0; i"@MutatorList[i]$ " ||-----"); + } + } +} - //////////////////// Essence & Vel-San /////////// - Names=Class'MutLoaderObject'.Static.GetPerObjectNames("MutLoaderV2"); - for(i=0; i"@MutatorList[i]$ " ||-----"); - } - } +function PostBeginPlay() +{ + SetTimer(1, False); } -function Tick(float DeltaTime) +function Timer() { - if(bDebug) - { - TimeStampLog("-----|| TICK - Default ServerName: " $Level.GRI.ServerName$ " ||-----"); - TimeStampLog("-----|| TICK - 'MutLoader' ServerName: " $sServerName$ " ||-----"); - } - Level.GRI.ServerName = sServerName; - if(bDebug) TimeStampLog("-----|| TICK - Updated Default ServerName: " $Level.GRI.ServerName$ " ||-----"); - Disable('Tick'); + KF = KFGameType(Level.Game); + TimeStampLog("-----|| Default ServerName: " $Level.GRI.ServerName$ " ||-----"); + TimeStampLog("-----|| 'MutLoader' ServerName: " $sServerName$ " ||-----"); + + CheckMutators(sServerName); + + if(!bKeepServerNameDefault) + { + 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 +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"; + if(M.IsA('Faked_3')) ServerName $= " | 3F"; + if(M.IsA('Faked_4')) ServerName $= " | 4F"; + if(M.IsA('Faked_5')) ServerName $= " | 5F"; + if(M.IsA('Custom')) ServerName $= " | CustomFaked"; + } } function TimeStampLog(coerce string s) @@ -78,8 +106,7 @@ function MutLog(string s) defaultproperties { - bDebug=True - GroupName="KF-MutLoaderV2" - FriendlyName="MutLoader - v2.0" - Description="seamlessly load mutators With optimized config (Difficulty, ServerName, Several GameTypes); By Flame, Essence & Vel-San" + GroupName="KF-MutLoaderV2" + FriendlyName="MutLoader - v2.1" + Description="seamlessly load mutators With optimized config (Difficulty, ServerName, Several GameTypes); By Flame, Essence & Vel-San" } diff --git a/README.md b/README.md index 9b4736c..63c8630 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,4 @@ No need to put any other mutators in the list of MapVoteV2. What's important is - 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 diff --git a/Sample_Config/MutLoaderV2.ini b/Sample_Config/MutLoaderV2.ini index 812f70b..4357b7c 100644 --- a/Sample_Config/MutLoaderV2.ini +++ b/Sample_Config/MutLoaderV2.ini @@ -1,5 +1,4 @@ [MutLoaderV2.MutLoader] -bDebug=True [Settings1 MutLoaderObject] GameTypeName=KFGameType # Can be any gametype you want diff --git a/Steam_WorkShop_Description/Workshop-text b/Steam_WorkShop_Description/Workshop-text index 79b203b..714994a 100644 --- a/Steam_WorkShop_Description/Workshop-text +++ b/Steam_WorkShop_Description/Workshop-text @@ -6,6 +6,7 @@ Optimized version of 'MutLoader' originally made by Flame & Essence, slightl - 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 [h1][b][u]Notes[/u][/b][/h1] @@ -19,7 +20,6 @@ Optimized version of 'MutLoader' originally made by Flame & Essence, slightl [code] [MutLoaderV2.MutLoader] -bDebug=True [Settings1 MutLoaderObject] GameTypeName=KFGameType # Can be any gametype you want @@ -65,8 +65,8 @@ 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.0' +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.0 \ No newline at end of file +- Github: https://github.com/Vel-San/KF-Mutloader/releases/tag/v2.1 \ No newline at end of file