UnofficialKFPatch compat

This commit is contained in:
GenZmeY 2022-11-26 02:52:22 +03:00
parent e8d229e5b7
commit 6305c8f162
3 changed files with 50 additions and 9 deletions

View File

@ -5,7 +5,7 @@
[*]Subscribe your server to this. [*]Subscribe your server to this.
[*]Add [b]SML.Mut[/b] [u]first[/u] to your list of mutators, example: [*]Add [b]SML.Mut[/b] [u]first[/u] to your list of mutators, example:
[code] [code]
?Mutator=SML.Mut,AAL.AALMut,YAS.YASMut,CTI.CTIMut,CVC.CVCMut,ZedSpawner.ZedSpawnerMut ?Mutator=SML.Mut,UnofficialKFPatch.UKFPMutator,AAL.AALMut,DiscordMessage.DMMutator,YAS.YASMut,CTI.CTIMut,CVC.CVCMut,ZedSpawner.ZedSpawnerMut
[/code] [/code]
(add/remove [b]compatible[/b] mutators you need) (add/remove [b]compatible[/b] mutators you need)
[/olist] [/olist]
@ -25,11 +25,14 @@
[*]Purchasing a DLC weapon will unrank the server if currently there is no player with the purchased DLC. This can be bypassed by replacing all DLC weapons with their clones. [*]Purchasing a DLC weapon will unrank the server if currently there is no player with the purchased DLC. This can be bypassed by replacing all DLC weapons with their clones.
[*]Since [url=https://wiki.killingfloor2.com/index.php?title=Update_1133_(Killing_Floor_2)]KF2 v1133[/url] the content preload causes the server to unrank for some reason. Disable it in CTI settings ([b]bPreloadContent=False[/b]) to stay ranked. [*]Since [url=https://wiki.killingfloor2.com/index.php?title=Update_1133_(Killing_Floor_2)]KF2 v1133[/url] the content preload causes the server to unrank for some reason. Disable it in CTI settings ([b]bPreloadContent=False[/b]) to stay ranked.
[/list] [/list]
🟢 [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2891475864]Discord Link [Edited][/url]
🟢 [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2875147606]Unofficial Killing Floor 2 Patch[/url]
🟢 [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2521826524]Yet Another Scoreboard[/url]
🟡 [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2811290931]Zed Spawner[/url] 🟡 [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2811290931]Zed Spawner[/url]
[list] [list]
[*]Since [url=https://wiki.killingfloor2.com/index.php?title=Update_1133_(Killing_Floor_2)]KF2 v1133[/url] zed preload causes the server to unrank for some reason. Disable it in ZedSpawner settings ([b]bPreloadContentServer=False[/b]) to stay ranked. [*]Since [url=https://wiki.killingfloor2.com/index.php?title=Update_1133_(Killing_Floor_2)]KF2 v1133[/url] zed preload causes the server to unrank for some reason. Disable it in ZedSpawner settings ([b]bPreloadContentServer=False[/b]) to stay ranked.
[/list] [/list]
🟢 [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2521826524]Yet Another Scoreboard[/url]
[h1]Sources[/h1] [h1]Sources[/h1]
[url=https://github.com/GenZmeY/KF2-SafeMutLoader]https://github.com/GenZmeY/KF2-SafeMutLoader[/url] [b](GNU GPLv3)[/b] [url=https://github.com/GenZmeY/KF2-SafeMutLoader]https://github.com/GenZmeY/KF2-SafeMutLoader[/url] [b](GNU GPLv3)[/b]

View File

@ -14,7 +14,7 @@ However, [AccessPlus](https://forums.tripwireinteractive.com/index.php?threads/u
* **with workshop:** Use the instructions below to build the SML and upload it to your workshop, then subscribe your server to SML * **with workshop:** Use the instructions below to build the SML and upload it to your workshop, then subscribe your server to SML
2. Add `SML.Mut` **first** to your list of mutators, example: 2. Add `SML.Mut` **first** to your list of mutators, example:
``` ```
?Mutator=SML.Mut,AAL.AALMut,DiscordMessage.DMMutator,YAS.YASMut,CTI.CTIMut,CVC.CVCMut,ZedSpawner.ZedSpawnerMut ?Mutator=SML.Mut,UnofficialKFPatch.UKFPMutator,AAL.AALMut,DiscordMessage.DMMutator,YAS.YASMut,CTI.CTIMut,CVC.CVCMut,ZedSpawner.ZedSpawnerMut
``` ```
(add/remove **compatible** mutators you need) (add/remove **compatible** mutators you need)
@ -32,9 +32,10 @@ However, [AccessPlus](https://forums.tripwireinteractive.com/index.php?threads/u
Purchasing a DLC weapon will unrank the server if currently there is no player with the purchased DLC. This can be bypassed by replacing all DLC weapons with their clones. Purchasing a DLC weapon will unrank the server if currently there is no player with the purchased DLC. This can be bypassed by replacing all DLC weapons with their clones.
Since KF2 [v1133](https://wiki.killingfloor2.com/index.php?title=Update_1133_(Killing_Floor_2)) the content preload causes the server to unrank for some reason. Disable it in CTI settings (`bPreloadContent=False`) to stay ranked. Since KF2 [v1133](https://wiki.killingfloor2.com/index.php?title=Update_1133_(Killing_Floor_2)) the content preload causes the server to unrank for some reason. Disable it in CTI settings (`bPreloadContent=False`) to stay ranked.
🟢 [Discord Link [Edited]](https://steamcommunity.com/sharedfiles/filedetails/?id=2891475864) 🟢 [Discord Link [Edited]](https://steamcommunity.com/sharedfiles/filedetails/?id=2891475864)
🟢 [Unofficial Killing Floor 2 Patch](https://steamcommunity.com/sharedfiles/filedetails/?id=2875147606)
🟢 [Yet Another Scoreboard](https://steamcommunity.com/sharedfiles/filedetails/?id=2521826524)
🟡 [Zed Spawner](https://steamcommunity.com/sharedfiles/filedetails/?id=2811290931) 🟡 [Zed Spawner](https://steamcommunity.com/sharedfiles/filedetails/?id=2811290931)
Since KF2 [v1133](https://wiki.killingfloor2.com/index.php?title=Update_1133_(Killing_Floor_2)) zed preload causes the server to unrank for some reason. Disable it in ZedSpawner settings (`bPreloadContentServer=False`) to stay ranked. Since KF2 [v1133](https://wiki.killingfloor2.com/index.php?title=Update_1133_(Killing_Floor_2)) zed preload causes the server to unrank for some reason. Disable it in ZedSpawner settings (`bPreloadContentServer=False`) to stay ranked.
🟢 [Yet Another Scoreboard](https://steamcommunity.com/sharedfiles/filedetails/?id=2521826524)
# Making SML-compatible mutators # Making SML-compatible mutators
See [developer guide](https://github.com/GenZmeY/KF2-SafeMutLoader/blob/master/DEV.md) See [developer guide](https://github.com/GenZmeY/KF2-SafeMutLoader/blob/master/DEV.md)

View File

@ -1,7 +1,14 @@
class SafeMutLoader extends KFAccessControl class SafeMutLoader extends KFAccessControl
config(SML); config(SML);
struct CMR
{
var String Mutator;
var String Replacement;
};
var private Array<Actor> ServerActors; var private Array<Actor> ServerActors;
var private Array<CMR> CustomMutReplacements;
var private config E_LogLevel LogLevel; var private config E_LogLevel LogLevel;
var private config Array<String> Mutators; var private config Array<String> Mutators;
@ -89,6 +96,13 @@ public static function String GetName(optional Object O)
} }
} }
public static function String GetMutName(class<Mutator> CMut)
{
if (CMut == None) return "";
return CMut.GetPackageName() $ "." $ String(CMut);
}
public function PostLogin(PlayerController C) public function PostLogin(PlayerController C)
{ {
local Actor A; local Actor A;
@ -138,10 +152,26 @@ public static function E_LogLevel GetLogLevel()
private static function class<Actor> GetMutReplacement(class<Mutator> MutClass) private static function class<Actor> GetMutReplacement(class<Mutator> MutClass)
{ {
if (MutClass == None || MutClass.static.GetLocalString() == "") return None; local int Index;
return class<Actor>(DynamicLoadObject( local String Replacement;
MutClass.GetPackageName() $ "." $
MutClass.static.GetLocalString(), class'Class')); if (MutClass == None) return None;
Index = default.CustomMutReplacements.Find('Mutator', GetMutName(MutClass));
if (Index != INDEX_NONE)
{
Replacement = default.CustomMutReplacements[Index].Replacement;
}
else if (MutClass.static.GetLocalString() == "")
{
return None;
}
else
{
Replacement = MutClass.GetPackageName() $ "." $ MutClass.static.GetLocalString();
}
return class<Actor>(DynamicLoadObject(Replacement, class'Class'));
} }
private static function class<Actor> GetMutStringReplacement(String MutString) private static function class<Actor> GetMutStringReplacement(String MutString)
@ -151,5 +181,12 @@ private static function class<Actor> GetMutStringReplacement(String MutString)
defaultproperties defaultproperties
{ {
CustomMutReplacements.Add({(
Mutator="UnofficialKFPatch.UKFPMutator",
Replacement="UnofficialKFPatch.UKFPReplicationInfo"
)})
CustomMutReplacements.Add({(
Mutator="UnofficialKFPatch.UKFPMutatorNW",
Replacement="UnofficialKFPatch.UKFPReplicationInfo"
)})
} }