Skip to content

Commit

Permalink
Add support for 2022.8.23
Browse files Browse the repository at this point in the history
  • Loading branch information
js6pak committed Aug 23, 2022
1 parent 16135fa commit 9893fc9
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 14 deletions.
4 changes: 2 additions & 2 deletions AmongUs.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project>
<PropertyGroup>
<GamePlatform Condition="'$(GamePlatform)' == ''">Steam</GamePlatform>
<GameVersion Condition="'$(GamePlatform)' == 'Steam'">2022.6.21</GameVersion>
<GameVersion Condition="'$(GamePlatform)' == 'Itch'">2022.6.21</GameVersion>
<GameVersion Condition="'$(GamePlatform)' == 'Steam'">2022.8.23</GameVersion>
<GameVersion Condition="'$(GamePlatform)' == 'Itch'">2022.8.23</GameVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions Reactor.Debugger/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions Reactor.Example/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 9 additions & 2 deletions Reactor/Patches/RegionInfoWatcher.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.IO;
using System.Reflection;
using HarmonyLib;
using Reactor.Extensions;
using UnityEngine;
Expand Down Expand Up @@ -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
Expand All @@ -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<ReactorPlugin>.Debug($"Continue serverInfoFile write? {continueWrite}");
// If we will write, ignore the next change action from the observer.
PluginSingleton<ReactorPlugin>.Instance.RegionInfoWatcher.IgnoreNext = continueWrite;
Expand Down
2 changes: 1 addition & 1 deletion Reactor/Reactor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

<VersionPrefix>1.2.7</VersionPrefix>
<VersionPrefix>1.2.8</VersionPrefix>
<VersionSuffix>dev</VersionSuffix>
<Description>Core mod and API for Among Us</Description>
<Authors>NuclearPowered</Authors>
Expand Down
6 changes: 3 additions & 3 deletions Reactor/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 9893fc9

Please sign in to comment.