Files
EndlessHostRoles/Patches/ServerVersionPatch.cs
T
2024-10-27 10:47:59 +01:00

32 lines
802 B
C#

using HarmonyLib;
namespace EHR.Patches;
[HarmonyPatch(typeof(Constants), nameof(Constants.GetBroadcastVersion))]
static class ServerUpdatePatch
{
public static void Postfix(ref int __result)
{
if (GameStates.IsLocalGame)
{
Logger.Info($"IsLocalGame: {__result}", "VersionServer");
}
if (GameStates.IsOnlineGame)
{
// Changing server version for AU mods
__result += 25;
Logger.Info($"IsOnlineGame: {__result}", "VersionServer");
}
}
}
[HarmonyPatch(typeof(Constants), nameof(Constants.IsVersionModded))]
public static class IsVersionModdedPatch
{
public static bool Prefix(ref bool __result)
{
__result = true;
return false;
}
}