mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-19 15:51:58 +00:00
* Change unload to deactivate only current plugin * only replicate handshake if reactor is not present * prevent server authority incompatibility
33 lines
885 B
C#
33 lines
885 B
C#
using HarmonyLib;
|
|
|
|
namespace EHR.Patches;
|
|
|
|
[HarmonyPatch(typeof(Constants), nameof(Constants.GetBroadcastVersion))]
|
|
internal 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
|
|
var revision = __result % 50;
|
|
if (revision < 25)
|
|
{
|
|
__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;
|
|
}
|
|
} |