diff --git a/README.md b/README.md index 56fab02..0838c9b 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,5 @@ -> The 2021.3.5s release of this mod currently may not work properly or even at all since -> [Impostor](https://github.com/Impostor/Impostor) doesn't officially support 2021.3.5s yet and I haven't -> been able to test the mod to see if the custom regions actually work. However, you can compile an -> in-development version of Impostor [here](https://github.com/Impostor/Impostor/tree/2021.3.5) to try -> and connect to a local server using 2021.3.5s. I have tried to compile and run that version of Impostor -> but it didn't work at the time of testing. +> The 2021.3.5s release of this mod requires you to compile an in-development version of Impostor +> [here](https://github.com/Impostor/Impostor/tree/2021.3.5) if you want to host a local server. # Unify @@ -26,14 +22,16 @@ The following regions have been added: > **⚠ WARNING** > +> This mod is only compatible with 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 is only compatible with the steam release of the game. - > 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. diff --git a/Unify/Patches/Regions.cs b/Unify/Patches/Regions.cs index 3ff28ea..d34e04f 100644 --- a/Unify/Patches/Regions.cs +++ b/Unify/Patches/Regions.cs @@ -9,21 +9,17 @@ namespace Unify.Patches { private static IRegionInfo[] _newRegions = new IRegionInfo[] { - new StaticRegionInfo("skeld.net", StringNames.NoTranslation, "192.241.154.115", new ServerInfo[] - { - new ServerInfo("skeld.net-Master-1", "192.241.154.115", 22023) - }).Duplicate(), - new StaticRegionInfo("localhost", StringNames.NoTranslation, "127.0.0.1", new ServerInfo[] - { - new ServerInfo("localhost", "127.0.0.1", 22023) - }).Duplicate() + 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, LoadCustomRegions()); + 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(); @@ -38,23 +34,22 @@ namespace Unify.Patches return patchedRegions; } - private static IRegionInfo[] LoadCustomRegions() + private static IRegionInfo[] LoadCustomUserRegions() { List customRegions = new List(); for (int x = 0; x < 5; x++) { - ConfigEntry regionName = UnifyPlugin.ConfigFile.Bind($"Region {x + 1}", $"Name", "custom region"); - ConfigEntry regionIp = UnifyPlugin.ConfigFile.Bind($"Region {x + 1}", "IP", ""); - ConfigEntry regionPort = UnifyPlugin.ConfigFile.Bind($"Region {x + 1}", "Port", (ushort) 22023); - + ConfigEntry regionName = UnifyPlugin.ConfigFile.Bind( + $"Region {x + 1}", $"Name", "custom region"); + ConfigEntry regionIp = UnifyPlugin.ConfigFile.Bind( + $"Region {x + 1}", "IP", ""); + if (String.IsNullOrWhiteSpace(regionIp.Value)) continue; - IRegionInfo regionInfo = new StaticRegionInfo( - regionName.Value, StringNames.NoTranslation, regionIp.Value, new ServerInfo[] - { - new ServerInfo(regionName.Value, regionIp.Value, regionPort.Value) - }).Duplicate(); + IRegionInfo regionInfo = new DnsRegionInfo( + regionIp.Value, regionName.Value, StringNames.NoTranslation, regionIp.Value) + .Duplicate(); customRegions.Add(regionInfo); } diff --git a/Unify/Unify.cs b/Unify/Unify.cs index 9cf7870..ab05b09 100644 --- a/Unify/Unify.cs +++ b/Unify/Unify.cs @@ -15,7 +15,7 @@ namespace Unify { public const string Id = "daemon.unify.reactor"; private const string Name = "Unify"; - private const string Version = "2.0.0"; + private const string Version = "2.0.1"; public static readonly ConfigFile ConfigFile = new ConfigFile(Path.Combine(Paths.ConfigPath, $"{UnifyPlugin.Id}.cfg"), true); diff --git a/Unify/Unify.csproj b/Unify/Unify.csproj index 16bb826..2b16178 100644 --- a/Unify/Unify.csproj +++ b/Unify/Unify.csproj @@ -1,7 +1,7 @@ netstandard2.1 - 2.0.0 + 2.0.1 NuclearPowered/Mappings:0.2.0 Region mod for Reactor @@ -14,7 +14,7 @@ - 2020.11.17i + 2021.11.17i $(DefineConstants);ITCH diff --git a/build/Unify-2021.3.5s.dll b/build/Unify-2021.3.5s.dll index 43c6e8f..f9e2d50 100644 Binary files a/build/Unify-2021.3.5s.dll and b/build/Unify-2021.3.5s.dll differ