9 Commits
Author SHA1 Message Date
Daemon 8560fb6a55 Modified mod to remove Reactor as a dependency 2021-03-14 12:11:48 +00:00
DaemonBeast af6e7f4b4c Modified mod to remove Reactor as a dependency 2021-03-14 12:08:22 +00:00
DaemonBeast f35196d68c Improved wording in README 2021-03-13 22:02:02 +00:00
Daemon fe8f24ce98 Fixed custom regions
Merged stable dev branch with master branch
2021-03-13 15:23:51 +00:00
DaemonBeast 80051f9ec2 Removed unused using directives 2021-03-13 15:20:06 +00:00
DaemonBeast 999fb61e5e Updated README 2021-03-13 15:17:54 +00:00
DaemonBeast 907b2f9fe1 Fixed custom regions
Changed StaticRegionInfo to DnsRegionInfo
2021-03-13 15:11:39 +00:00
Daemon 5675dab961 Merged pull request from dev branch
Updated code to work with 2021.3.5s
2021-03-11 22:40:11 +00:00
DaemonBeast b426eb5243 Updated code to work with 2021.3.5s
Modified README to add notices
2021-03-11 22:34:22 +00:00
7 changed files with 83 additions and 81 deletions

No files matched your search

+3 -18
View File
@@ -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)
+8 -4
View File
@@ -1,4 +1,7 @@
# Unify
> 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
An Among Us mod to add extra regions to the regions menu.
@@ -19,10 +22,11 @@ The following regions have been added:
> **⚠ WARNING**
>
> 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 only has compiled releases for the steam release of the game.
1. Ensure that BepInEx and Reactor are installed (more information above).
> This mod requires you to have BepInEx installed. You can install BepInEx by following [this guide](INSTALLATION.md).
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.
+38 -35
View File
@@ -1,65 +1,68 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using BepInEx.Configuration;
using HarmonyLib;
using UnityEngine;
using Array = System.Array;
using String = System.String;
namespace Unify.Patches
{
[HarmonyPatch]
public static class RegionsPatch
{
public static void Patch()
private static readonly IRegionInfo[] NewRegions = new IRegionInfo[]
{
RegionInfo[] newRegions = new RegionInfo[]
{
new RegionInfo("skeld.net", "192.241.154.115", new ServerInfo[]
{
new ServerInfo("skeld.net-Master-1", "192.241.154.115", 22023)
}),
new RegionInfo("localhost", "127.0.0.1", new ServerInfo[]
{
new ServerInfo("localhost-Master-1", "127.0.0.1", 22023)
})
};
RegionInfo[] customRegions = LoadCustomRegions();
RegionInfo[] patchedRegions = MergeRegions(ServerManager.DefaultRegions, newRegions);
patchedRegions = MergeRegions(patchedRegions, customRegions);
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);
ServerManager.DefaultRegions = patchedRegions;
}
private static RegionInfo[] MergeRegions(RegionInfo[] oldRegions, RegionInfo[] newRegions)
private static IRegionInfo[] MergeRegions(IRegionInfo[] oldRegions, IRegionInfo[] newRegions)
{
RegionInfo[] patchedRegions = new RegionInfo[oldRegions.Length + newRegions.Length];
IRegionInfo[] patchedRegions = new IRegionInfo[oldRegions.Length + newRegions.Length];
Array.Copy(oldRegions, patchedRegions, oldRegions.Length);
Array.Copy(newRegions, 0, patchedRegions, oldRegions.Length, newRegions.Length);
return patchedRegions;
}
private static RegionInfo[] LoadCustomRegions()
private static IRegionInfo[] LoadCustomUserRegions()
{
List<RegionInfo> customRegions = new List<RegionInfo>();
List<IRegionInfo> customRegions = new List<IRegionInfo>();
for (int x = 0; x < 5; x++)
{
ConfigEntry<string> regionName = UnifyPlugin.ConfigFile.Bind($"Region {x + 1}", $"Name", "custom region");
ConfigEntry<string> regionIp = UnifyPlugin.ConfigFile.Bind($"Region {x + 1}", "IP", "");
ConfigEntry<ushort> regionPort = UnifyPlugin.ConfigFile.Bind($"Region {x + 1}", "Port", (ushort) 22023);
ConfigEntry<string> regionName = UnifyPlugin.ConfigFile.Bind(
$"Region {x + 1}", $"Name", "custom region");
ConfigEntry<string> regionIp = UnifyPlugin.ConfigFile.Bind(
$"Region {x + 1}", "IP", "");
if (String.IsNullOrWhiteSpace(regionIp.Value)) continue;
RegionInfo regionInfo = new RegionInfo(regionName.Value, regionIp.Value, new ServerInfo[]
{
new ServerInfo($"{regionName.Value}-Master-1", regionIp.Value, regionPort.Value)
});
IRegionInfo regionInfo = new DnsRegionInfo(
regionIp.Value, regionName.Value, StringNames.NoTranslation, regionIp.Value)
.Duplicate();
customRegions.Add(regionInfo);
}
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();
}
}
}
}
+1 -5
View File
@@ -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 = "0.1.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();
}
}
+33 -19
View File
@@ -1,31 +1,45 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<Version>0.1.1</Version>
<Mappings>NuclearPowered/Mappings:0.1.2</Mappings>
<Version>2.0.2</Version>
<GameVersion>2021.3.5s</GameVersion>
<Description>Region mod for Reactor</Description>
<Description>Region mod</Description>
<Authors>Daemon</Authors>
</PropertyGroup>
<PropertyGroup Condition="'$(GamePlatform)' == 'Steam'">
<GameVersion>2020.12.9s</GameVersion>
<DefineConstants>$(DefineConstants);STEAM</DefineConstants>
<PropertyGroup>
<TargetName>$(AssemblyName)-$(GameVersion)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(GamePlatform)' == 'Itch'">
<GameVersion>2020.11.17i</GameVersion>
<DefineConstants>$(DefineConstants);ITCH</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Deobfuscate Include="$(AmongUs)\BepInEx\plugins\Reactor-$(GameVersion).dll" />
<PackageReference Include="Reactor.OxygenFilter.MSBuild" Version="0.2.5" />
<Reference Include="0Harmony, Version=2.3.1.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\..\Program Files\SteamLibrary\steamapps\common\Among Us\BepInEx\core\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp, Version=3.7.1.6, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\..\Program Files\SteamLibrary\steamapps\common\Among Us\BepInEx\unhollowed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="BepInEx.Core, Version=6.0.0.16, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\..\Program Files\SteamLibrary\steamapps\common\Among Us\BepInEx\core\BepInEx.Core.dll</HintPath>
</Reference>
<Reference Include="BepInEx.IL2CPP, Version=6.0.0.16, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\..\Program Files\SteamLibrary\steamapps\common\Among Us\BepInEx\core\BepInEx.IL2CPP.dll</HintPath>
</Reference>
<Reference Include="Il2Cppmscorlib, Version=3.7.1.6, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\..\Program Files\SteamLibrary\steamapps\common\Among Us\BepInEx\unhollowed\Il2Cppmscorlib.dll</HintPath>
</Reference>
<Reference Include="UnhollowerBaseLib, Version=0.4.14.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\..\Program Files\SteamLibrary\steamapps\common\Among Us\BepInEx\core\UnhollowerBaseLib.dll</HintPath>
</Reference>
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\..\Program Files\SteamLibrary\steamapps\common\Among Us\BepInEx\unity-libs\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule, Version=3.7.1.6, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\..\Program Files\SteamLibrary\steamapps\common\Among Us\BepInEx\unhollowed\UnityEngine.CoreModule.dll</HintPath>
</Reference>
</ItemGroup>
<Target Name="Copy" AfterTargets="Reobfuscate">
<Copy SourceFiles="$(OutputPath)reobfuscated/$(AssemblyName)-$(GameVersion).dll" DestinationFolder="$(AmongUs)/BepInEx/plugins/" />
<Copy SourceFiles="$(OutputPath)reobfuscated/$(AssemblyName)-$(GameVersion).dll" DestinationFolder="../build/" />
<Target Name="Copy" AfterTargets="AfterBuild">
<Copy SourceFiles="$(OutputPath)/$(TargetName).dll" DestinationFolder="../build" />
</Target>
</Project>
Binary file not shown.
Binary file not shown.