From 6d18d01eb9e9ce5587967bfa1e6f62c9bacbed41 Mon Sep 17 00:00:00 2001 From: Daemon Date: Sun, 14 Mar 2021 12:28:46 +0000 Subject: [PATCH 1/2] Revert "Modified mod to remove Reactor as a dependency" --- INSTALLATION.md | 21 ++++++++++++-- README.md | 12 ++++++-- 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, 67 insertions(+), 59 deletions(-) diff --git a/INSTALLATION.md b/INSTALLATION.md index 384ace7..982a285 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -3,6 +3,7 @@ # 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 @@ -34,9 +35,9 @@ library then selecting `Manage > Browse local files`. └── winhttp.dll ``` -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: +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: ``` . @@ -60,3 +61,17 @@ 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 6bfd912..0838c9b 100644 --- a/README.md +++ b/README.md @@ -22,11 +22,17 @@ The following regions have been added: > **⚠ WARNING** > -> This mod only has compiled releases for the steam release of the game. +> This mod is only compatible with the steam release of the game. -> This mod requires you to have BepInEx installed. You can install BepInEx by following [this guide](INSTALLATION.md). +> 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. -1. Ensure that BepInEx is installed (more information above). +> 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). 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 49af462..d34e04f 100644 --- a/Unify/Patches/Regions.cs +++ b/Unify/Patches/Regions.cs @@ -1,7 +1,5 @@ using System.Collections.Generic; using BepInEx.Configuration; -using HarmonyLib; -using UnityEngine; using Array = System.Array; using String = System.String; @@ -9,15 +7,23 @@ namespace Unify.Patches { public static class RegionsPatch { - private static readonly IRegionInfo[] NewRegions = new IRegionInfo[] + private static 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 readonly IRegionInfo[] CustomRegions = MergeRegions(NewRegions, LoadCustomUserRegions()); - private static readonly IRegionInfo[] PatchedRegions = MergeRegions(ServerManager.DefaultRegions, CustomRegions); + 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 IRegionInfo[] MergeRegions(IRegionInfo[] oldRegions, IRegionInfo[] newRegions) { @@ -50,19 +56,5 @@ 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 8d2325b..ab05b09 100644 --- a/Unify/Unify.cs +++ b/Unify/Unify.cs @@ -3,17 +3,19 @@ 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.2"; + private const string Version = "2.0.1"; public static readonly ConfigFile ConfigFile = new ConfigFile(Path.Combine(Paths.ConfigPath, $"{UnifyPlugin.Id}.cfg"), true); @@ -22,6 +24,8 @@ namespace Unify public override void Load() { + RegionsPatch.Patch(); + Harmony.PatchAll(); } } diff --git a/Unify/Unify.csproj b/Unify/Unify.csproj index 281e31b..2b16178 100644 --- a/Unify/Unify.csproj +++ b/Unify/Unify.csproj @@ -1,45 +1,36 @@ netstandard2.1 - 2.0.2 - 2021.3.5s + 2.0.1 + NuclearPowered/Mappings:0.2.0 - Region mod + Region mod for Reactor Daemon - - - $(AssemblyName)-$(GameVersion) + + + 2021.3.5s + $(DefineConstants);STEAM - + + + 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 a76515a2334158984ac2feafb571c486351f9072..f9e2d5052bb98b54444bb5c7b72cf20dc78cb322 100644 GIT binary patch delta 2575 zcmZuze{2-T75-*+Z|`o;UVJ}oW1H^bf)5)GpCLhrl9(TIa3WfRV*(Ns4*PIj8=rG$ zDKaR&ONF996@;}BX(W^;@JD{AN*W=NMs=hRwN0Wzo2qKkN~NU=Q5u0LO%)Z2TKAh- z6Z%KTx8J_^y*F>(yqO(Ob#-<1iKjaM-1W}0m~WRM(-F}L#7I~^=}?91%Ro0~ezL`x zT?u?kQQiC*GwFEEKA?vB3p6x)X}R3nCE7&7dxF^Qy&@iIyg`d(7hPgR|^R5 z@3A#rpA1!cG64=MGlE!@fZhIWS)wvgHmE#KqbW0{;>VSzUFx7M!z}Ika*$Z1&1?ta zof7Lf3cE%#5gIbg%$}x;sk|-Q%5Ype<0x1_@b&&;-5sJBrPR(q0kq8rlE+7k<0Ctt zW+-7xi)w~7vW=7yY01P@AivK`dWwja6W*U>qm^QpOw#+eTwL)*dX}DJ?xi0R5=G|O zQ5!DSlg=~{R&@AENK@`r&fX`=jml*qA#Pexv)Du_Sidt8Y`Xv8+}xa1Y$l;n2x31| zP_02Hyd+h6QH|Gso~Q$A{cgO|OX^F%QyvO@htDbfk3*G}Gp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PuU#xj=>($RbHr_f1%@V?=S`Z!zfqZv`@KEsa=L>l~A#9 z{0}AIaYfW0f+ncvLvi9Dwd@9poCHD?x(!*=*@eR3McD5tC zHwvnUgDyLi8o&osw6giZiS-d8h9cIWK;#xE~~=G>)3inZWF#G_N06 zJuq=>+N6aG9) From 071b49f85d30dcf8658061564a81c58a9ea64ea5 Mon Sep 17 00:00:00 2001 From: Daemon Date: Thu, 18 Mar 2021 21:45:39 +0000 Subject: [PATCH 2/2] Added matux.fr to regions menu --- Unify/Patches/Regions.cs | 2 ++ build/Unify-2021.3.5s.dll | Bin 7168 -> 7168 bytes 2 files changed, 2 insertions(+) diff --git a/Unify/Patches/Regions.cs b/Unify/Patches/Regions.cs index 0b8cca8..9495c87 100644 --- a/Unify/Patches/Regions.cs +++ b/Unify/Patches/Regions.cs @@ -16,6 +16,8 @@ namespace Unify.Patches 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(), + new DnsRegionInfo("152.228.160.91", "matux.fr", StringNames.NoTranslation, "152.228.160.91") .Duplicate() }; private static IRegionInfo[] _customRegions = MergeRegions(_newRegions, LoadCustomUserRegions()); diff --git a/build/Unify-2021.3.5s.dll b/build/Unify-2021.3.5s.dll index f6344a92247bfd18ff79330ba66998c5f1d36f17..af12d72bab1f2166d9748988d894f9c1e4cb361b 100644 GIT binary patch delta 296 zcmZp$Xt0>j!LsB_<@Sj^GK~8st_){Pnas$j&gx;zz#ubOkx6HAB%?axk;#pW^^yyK zVj$oF#7qpV3^$Y*7zzX!7#Jrvikfc@VA{jT*$h^|z#utUl*L_GRiem{k)fc-A4n*? zW@cb0GMwzkk~w(?i;GkWBLjnSXfOi@F9QS63iEy254j5Upke>%``28L-2 zhgn+~m>G_4?q+A=a+Wn@Fl8`e&;w#41`8l<$Y91`0HiH}EC#_`hD3%EhEj$Kphy}+ z5y$`r)dOF+7O*OL_e;IlC$V{F#O4Kp1j!D7CcYwpAz8OFScE5jK@CNnasv;Ht*V33)t$fPqll2M(pWO5^8y<~tf z0~mM!NhStXh8;=_3=RSe42+X6ikfc@VA{jTnFLY6ATe2##eH%uOZ4RHEUr=}j0_CQ zp}`C{co-Of>KT;XLp@!9^b4NNW~^yU{AECc7#OB89A<4{U}jjdc{Mu|moQM|@X@(W z!M3_y+qdm{_vY4(-J3rM7BCBnh%zwPK%D~87dN?3RGKNkc%q`n