From 3f285de271642bbbd7e8acebee68fd11536005a5 Mon Sep 17 00:00:00 2001 From: data-bomb Date: Thu, 13 Jun 2024 18:16:24 -0700 Subject: [PATCH] Fix RTV for Latest Game Version - A game update switched NetworkGameServer.Instance from private to public, which broke the QueueMapChange method and the rockthevote feature - This re-compiles with the latest 0.8.57 build and accounts for the change in scope of the NetworkGameServer.Instance --- Si_Mapcycle/Si_Mapcycle.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Si_Mapcycle/Si_Mapcycle.cs b/Si_Mapcycle/Si_Mapcycle.cs index a7371f5..4eb3fb1 100644 --- a/Si_Mapcycle/Si_Mapcycle.cs +++ b/Si_Mapcycle/Si_Mapcycle.cs @@ -39,7 +39,7 @@ You should have received a copy of the GNU General Public License using System.Linq; using UnityEngine; -[assembly: MelonInfo(typeof(MapCycleMod), "Mapcycle", "1.6.0", "databomb", "https://github.com/data-bomb/Silica")] +[assembly: MelonInfo(typeof(MapCycleMod), "Mapcycle", "1.6.1", "databomb", "https://github.com/data-bomb/Silica")] [assembly: MelonGame("Bohemia Interactive", "Silica")] [assembly: MelonOptionalDependencies("Admin Mod")] @@ -525,14 +525,11 @@ public static void QueueChangeMap(string mapName) NetworkGameServer.Instance.m_QueueGameMode = gameModeInfo; NetworkGameServer.Instance.m_QueueMap = levelInfo.FileName; #else - FieldInfo serverInstanceField = typeof(NetworkGameServer).GetField("Instance", BindingFlags.NonPublic | BindingFlags.Static); - NetworkGameServer serverInstance = (NetworkGameServer)serverInstanceField.GetValue(null); - FieldInfo queueMapField = typeof(NetworkGameServer).GetField("m_QueueMap", BindingFlags.NonPublic | BindingFlags.Instance); FieldInfo queueGameModeInfoField = typeof(NetworkGameServer).GetField("m_QueueGameMode", BindingFlags.NonPublic | BindingFlags.Instance); - - queueGameModeInfoField.SetValue(serverInstance, gameModeInfo); - queueMapField.SetValue(serverInstance, levelInfo.FileName); + + queueGameModeInfoField.SetValue(NetworkGameServer.Instance, gameModeInfo); + queueMapField.SetValue(NetworkGameServer.Instance, levelInfo.FileName); #endif iMapLoadCount++;