From 9893fc9e459b8260b2df9f75eae1ad793ce37324 Mon Sep 17 00:00:00 2001 From: js6pak Date: Tue, 23 Aug 2022 20:35:47 +0200 Subject: [PATCH] Add support for 2022.8.23 --- AmongUs.props | 4 ++-- Reactor.Debugger/packages.lock.json | 6 +++--- Reactor.Example/packages.lock.json | 6 +++--- Reactor/Patches/RegionInfoWatcher.cs | 11 +++++++++-- Reactor/Reactor.csproj | 2 +- Reactor/packages.lock.json | 6 +++--- 6 files changed, 21 insertions(+), 14 deletions(-) diff --git a/AmongUs.props b/AmongUs.props index d0e1226..a52ff3e 100644 --- a/AmongUs.props +++ b/AmongUs.props @@ -1,8 +1,8 @@ Steam - 2022.6.21 - 2022.6.21 + 2022.8.23 + 2022.8.23 diff --git a/Reactor.Debugger/packages.lock.json b/Reactor.Debugger/packages.lock.json index 2adb464..deda5ca 100644 --- a/Reactor.Debugger/packages.lock.json +++ b/Reactor.Debugger/packages.lock.json @@ -4,9 +4,9 @@ ".NETStandard,Version=v2.1": { "AmongUs.GameLibs.Steam": { "type": "Direct", - "requested": "[2022.6.21, )", - "resolved": "2022.6.21", - "contentHash": "l5lB5cTEBRWW+WNOso11mT8csmoZK7CUEqTkACSTwQbxtMQyZN9YORNxkJmtOD7pZnNkbWJ3dLAvQ6pMUsFDsQ==" + "requested": "[2022.8.23, )", + "resolved": "2022.8.23", + "contentHash": "baY5JO6dbdOAZ0VTtGX0xre6/BlDdreJDAH8boCKZt3JTAcn+eeH+l8mUZRC9eCJOODUik2C0TTAt5AqBmYtZg==" }, "BepInEx.AutoPlugin": { "type": "Direct", diff --git a/Reactor.Example/packages.lock.json b/Reactor.Example/packages.lock.json index 2adb464..deda5ca 100644 --- a/Reactor.Example/packages.lock.json +++ b/Reactor.Example/packages.lock.json @@ -4,9 +4,9 @@ ".NETStandard,Version=v2.1": { "AmongUs.GameLibs.Steam": { "type": "Direct", - "requested": "[2022.6.21, )", - "resolved": "2022.6.21", - "contentHash": "l5lB5cTEBRWW+WNOso11mT8csmoZK7CUEqTkACSTwQbxtMQyZN9YORNxkJmtOD7pZnNkbWJ3dLAvQ6pMUsFDsQ==" + "requested": "[2022.8.23, )", + "resolved": "2022.8.23", + "contentHash": "baY5JO6dbdOAZ0VTtGX0xre6/BlDdreJDAH8boCKZt3JTAcn+eeH+l8mUZRC9eCJOODUik2C0TTAt5AqBmYtZg==" }, "BepInEx.AutoPlugin": { "type": "Direct", diff --git a/Reactor/Patches/RegionInfoWatcher.cs b/Reactor/Patches/RegionInfoWatcher.cs index 10a2b07..ccc4562 100644 --- a/Reactor/Patches/RegionInfoWatcher.cs +++ b/Reactor/Patches/RegionInfoWatcher.cs @@ -1,5 +1,6 @@ using System; using System.IO; +using System.Reflection; using HarmonyLib; using Reactor.Extensions; using UnityEngine; @@ -54,9 +55,15 @@ public void Dispose() Watcher.Dispose(); } - [HarmonyPatch(typeof(FileIO), nameof(FileIO.WriteAllText))] + [HarmonyPatch] private static class WritePatch { + public static MethodBase TargetMethod() + { + var type = Type.GetType("FileIO, Assembly-CSharp", false) ?? Type.GetType("Innersloth.IO.FileIO, Assembly-CSharp", true); + return AccessTools.Method(type, "WriteAllText"); + } + public static bool Prefix(string path, string contents) { // Among Us' region loading code unfortunately contains a call @@ -67,7 +74,7 @@ public static bool Prefix(string path, string contents) // file again, stop AU from actually writing it. if (ServerManager.Instance && path == ServerManager.Instance.serverInfoFileJson) { - var continueWrite = !FileIO.Exists(path) || FileIO.ReadAllText(path) != contents; + var continueWrite = !File.Exists(path) || File.ReadAllText(path) != contents; Logger.Debug($"Continue serverInfoFile write? {continueWrite}"); // If we will write, ignore the next change action from the observer. PluginSingleton.Instance.RegionInfoWatcher.IgnoreNext = continueWrite; diff --git a/Reactor/Reactor.csproj b/Reactor/Reactor.csproj index a0d0266..5d834b4 100644 --- a/Reactor/Reactor.csproj +++ b/Reactor/Reactor.csproj @@ -6,7 +6,7 @@ enable true - 1.2.7 + 1.2.8 dev Core mod and API for Among Us NuclearPowered diff --git a/Reactor/packages.lock.json b/Reactor/packages.lock.json index ad92556..ce15a6d 100644 --- a/Reactor/packages.lock.json +++ b/Reactor/packages.lock.json @@ -4,9 +4,9 @@ ".NETStandard,Version=v2.1": { "AmongUs.GameLibs.Steam": { "type": "Direct", - "requested": "[2022.6.21, )", - "resolved": "2022.6.21", - "contentHash": "l5lB5cTEBRWW+WNOso11mT8csmoZK7CUEqTkACSTwQbxtMQyZN9YORNxkJmtOD7pZnNkbWJ3dLAvQ6pMUsFDsQ==" + "requested": "[2022.8.23, )", + "resolved": "2022.8.23", + "contentHash": "baY5JO6dbdOAZ0VTtGX0xre6/BlDdreJDAH8boCKZt3JTAcn+eeH+l8mUZRC9eCJOODUik2C0TTAt5AqBmYtZg==" }, "BepInEx.AutoPlugin": { "type": "Direct",