From f35196d68ce6a0dae2d53042b3808afeb37d43b6 Mon Sep 17 00:00:00 2001 From: DaemonBeast Date: Sat, 13 Mar 2021 22:02:02 +0000 Subject: [PATCH 1/2] Improved wording in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0838c9b..98d1b6e 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ The following regions have been added: > **⚠ WARNING** > -> This mod is only compatible with the steam release of the game. +> This mod only has compiled releases for the steam release of the game. > This mod requires you to have BepInEx and Reactor installed. You can install BepInEx and Reactor by following [this guide](INSTALLATION.md) or by following the steps on the > following two pages: https://docs.reactor.gg/docs/basic/install_bepinex and https://docs.reactor.gg/docs/basic/install_reactor. From af6e7f4b4cda2aee8b0ce18fe0ca39e4d70df429 Mon Sep 17 00:00:00 2001 From: DaemonBeast Date: Sun, 14 Mar 2021 12:08:22 +0000 Subject: [PATCH 2/2] Modified mod to remove Reactor as a dependency --- INSTALLATION.md | 21 ++------------ README.md | 10 ++----- Unify/Patches/Regions.cs | 30 ++++++++++++-------- Unify/Unify.cs | 6 +--- Unify/Unify.csproj | 57 ++++++++++++++++++++++---------------- build/Unify-2021.3.5s.dll | Bin 6656 -> 6656 bytes 6 files changed, 58 insertions(+), 66 deletions(-) diff --git a/INSTALLATION.md b/INSTALLATION.md index 982a285..384ace7 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -3,7 +3,6 @@ # Table of Contents - [Locating the Among Us game files directory](#locating-the-among-us-game-files-directory) - [Installing BepInEx](#installing-bepinex) -- [Installing Reactor](#installing-reactor) ## Locating the Among Us game files directory @@ -35,9 +34,9 @@ library then selecting `Manage > Browse local files`. └── winhttp.dll ``` -3. Launch the game so that BepInEx can generate the necessary files, - then close the game after. The Among Us game files should now look - something like this: +3. Launch the game so that BepInEx can generate the necessary files + (this may take a while), then close the game after. The Among Us game + files should now look something like this: ``` . @@ -61,17 +60,3 @@ library then selecting `Manage > Browse local files`. ├── UnityPlayer.dll └── winhttp.dll ``` - -## Installing Reactor - -1. Go to the - [Reactor CI](https://github.com/NuclearPowered/Reactor/actions) - page. -2. Click on the top workflow run. -3. Download the `Reactor.dll` artifact. -4. Move the `Reactor.dll` file to the - `(Among Us game files)/BepInEx/plugins` folder. -5. Launch the game. The top left of the game menu should look - something like this: - -![Mod text](images/ModText.jpg) \ No newline at end of file diff --git a/README.md b/README.md index 98d1b6e..6bfd912 100644 --- a/README.md +++ b/README.md @@ -24,15 +24,9 @@ The following regions have been added: > > This mod only has compiled releases for the steam release of the game. -> This mod requires you to have BepInEx and Reactor installed. You can install BepInEx and Reactor by following [this guide](INSTALLATION.md) or by following the steps on the -> following two pages: https://docs.reactor.gg/docs/basic/install_bepinex and https://docs.reactor.gg/docs/basic/install_reactor. +> This mod requires you to have BepInEx installed. You can install BepInEx by following [this guide](INSTALLATION.md). -> If you are still using 2020.12.9s and Reactor fails to load, try using the Reactor version located -> here: https://github.com/NuclearPowered/Reactor/actions/runs/593649307. - -> If you are using 2021.3.5s and Reactor fails to load, ensure you have the latest version of Reactor installed. - -1. Ensure that BepInEx and Reactor are installed (more information above). +1. Ensure that BepInEx is installed (more information above). 2. Download the latest mod on the [releases](https://github.com/DaemonBeast/Unify/releases) page. 3. Move the mod to the `(Among Us game files)/BepInEx/plugins` folder. 4. Launch the game. diff --git a/Unify/Patches/Regions.cs b/Unify/Patches/Regions.cs index d34e04f..49af462 100644 --- a/Unify/Patches/Regions.cs +++ b/Unify/Patches/Regions.cs @@ -1,5 +1,7 @@ using System.Collections.Generic; using BepInEx.Configuration; +using HarmonyLib; +using UnityEngine; using Array = System.Array; using String = System.String; @@ -7,23 +9,15 @@ namespace Unify.Patches { public static class RegionsPatch { - private static IRegionInfo[] _newRegions = new IRegionInfo[] + private static readonly IRegionInfo[] NewRegions = new IRegionInfo[] { new DnsRegionInfo("192.241.154.115", "skeld.net", StringNames.NoTranslation, "192.241.154.115") .Duplicate(), new DnsRegionInfo("localhost", "localhost", StringNames.NoTranslation, "127.0.0.1") .Duplicate() }; - private static IRegionInfo[] _customRegions = MergeRegions(_newRegions, LoadCustomUserRegions()); - - public static void Patch() - { - IRegionInfo[] patchedRegions = MergeRegions(ServerManager.DefaultRegions, _customRegions); - - ServerManager.DefaultRegions = patchedRegions; - ServerManager.Instance.AvailableRegions = patchedRegions; - ServerManager.Instance.SaveServers(); - } + private static readonly IRegionInfo[] CustomRegions = MergeRegions(NewRegions, LoadCustomUserRegions()); + private static readonly IRegionInfo[] PatchedRegions = MergeRegions(ServerManager.DefaultRegions, CustomRegions); private static IRegionInfo[] MergeRegions(IRegionInfo[] oldRegions, IRegionInfo[] newRegions) { @@ -56,5 +50,19 @@ namespace Unify.Patches return customRegions.ToArray(); } + + [HarmonyPatch(typeof(ServerManager), nameof(ServerManager.Awake))] + public static class AddRegionsPatch + { + public static void Prefix(ServerManager __instance) + { + ServerManager.DefaultRegions = PatchedRegions; + + // ServerManager.AvailableRegions + __instance.JIJNOHCGPHM = PatchedRegions; + + __instance.SaveServers(); + } + } } } \ No newline at end of file diff --git a/Unify/Unify.cs b/Unify/Unify.cs index ab05b09..8d2325b 100644 --- a/Unify/Unify.cs +++ b/Unify/Unify.cs @@ -3,19 +3,17 @@ using BepInEx; using BepInEx.Configuration; using BepInEx.IL2CPP; using HarmonyLib; -using Reactor; using Unify.Patches; namespace Unify { [BepInPlugin(Id, Name, Version)] [BepInProcess("Among Us.exe")] - [BepInDependency(ReactorPlugin.Id)] public class UnifyPlugin : BasePlugin { public const string Id = "daemon.unify.reactor"; private const string Name = "Unify"; - private const string Version = "2.0.1"; + private const string Version = "2.0.2"; public static readonly ConfigFile ConfigFile = new ConfigFile(Path.Combine(Paths.ConfigPath, $"{UnifyPlugin.Id}.cfg"), true); @@ -24,8 +22,6 @@ namespace Unify public override void Load() { - RegionsPatch.Patch(); - Harmony.PatchAll(); } } diff --git a/Unify/Unify.csproj b/Unify/Unify.csproj index 2b16178..281e31b 100644 --- a/Unify/Unify.csproj +++ b/Unify/Unify.csproj @@ -1,36 +1,45 @@ netstandard2.1 - 2.0.1 - NuclearPowered/Mappings:0.2.0 + 2.0.2 + 2021.3.5s - Region mod for Reactor + Region mod Daemon - - - 2021.3.5s - $(DefineConstants);STEAM + + + $(AssemblyName)-$(GameVersion) - - - 2021.11.17i - $(DefineConstants);ITCH - - + - + + ..\..\..\Program Files\SteamLibrary\steamapps\common\Among Us\BepInEx\core\0Harmony.dll + + + ..\..\..\Program Files\SteamLibrary\steamapps\common\Among Us\BepInEx\unhollowed\Assembly-CSharp.dll + + + ..\..\..\Program Files\SteamLibrary\steamapps\common\Among Us\BepInEx\core\BepInEx.Core.dll + + + ..\..\..\Program Files\SteamLibrary\steamapps\common\Among Us\BepInEx\core\BepInEx.IL2CPP.dll + + + ..\..\..\Program Files\SteamLibrary\steamapps\common\Among Us\BepInEx\unhollowed\Il2Cppmscorlib.dll + + + ..\..\..\Program Files\SteamLibrary\steamapps\common\Among Us\BepInEx\core\UnhollowerBaseLib.dll + + + ..\..\..\Program Files\SteamLibrary\steamapps\common\Among Us\BepInEx\unity-libs\UnityEngine.dll + + + ..\..\..\Program Files\SteamLibrary\steamapps\common\Among Us\BepInEx\unhollowed\UnityEngine.CoreModule.dll + - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - + + \ No newline at end of file diff --git a/build/Unify-2021.3.5s.dll b/build/Unify-2021.3.5s.dll index f9e2d5052bb98b54444bb5c7b72cf20dc78cb322..a76515a2334158984ac2feafb571c486351f9072 100644 GIT binary patch delta 2775 zcmZuze{56N75?sf&(F?F;>6Ff6Mpsum&Sy|bsT=K%4ibClCe;S5DFc%b&>}dj2-My z8X;msVH%^fgjcm?VxV^G25MC_MWRfa)a{>2sBCMQy1}HWLrjxst1(SfqEof(yUzjk z$8LPTd%kndJ@?*of8>>xl$MColE* zU!(2`$sPxi>SSZE>RF(Q{L-Vq2B%SJaW;!4@lWRBNehxgsX(3Q(pwb9eu6U7A zCS=(BR*vPZ-}K^q#)-~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