19 Commits
Author SHA1 Message Date
Daemon 25ccc7124c Merge branch 'dev' 2021-03-14 15:49:43 +00:00
DaemonBeast 50c678901f Fixed modded handshake issue 2021-03-14 15:15:14 +00:00
DaemonBeast 3dbf2befc1 Revert "Modified mod to remove Reactor as a dependency"
This reverts commit af6e7f4b4c.
2021-03-14 12:40:21 +00:00
Daemon e91ea01777 Revert "Modified mod to remove Reactor as a dependency" 2021-03-14 12:28:18 +00:00
Daemon bb69bbddfd Revert "Modified mod to remove Reactor as a dependency" 2021-03-14 12:27:47 +00:00
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
Daemon 8fbb962627 Merged pull request from dev branch
Added config file for custom user regions
2021-03-04 18:50:15 +00:00
DaemonBeast 86cb2dd21b Added config file for custom user regions 2021-03-04 18:47:47 +00:00
Daemon a9a4ef3efa Merged pull request from dev branch
Added README and installation guide
2021-03-02 11:13:07 +00:00
DaemonBeast 908c0dd5c8 Added README and installation guide 2021-03-02 11:10:02 +00:00
DaemonBeast 98210325b0 Modified Harmony id to be more unique 2021-02-19 12:15:46 +00:00
9 changed files with 226 additions and 26 deletions

No files matched your search

+77
View File
@@ -0,0 +1,77 @@
# Installing BepInEx and Reactor
# 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
On steam, this can be achieved by right clicking Among Us in the steam
library then selecting `Manage > Browse local files`.
## Installing BepInEx
1. Download the latest release from the NuclearPowered/BepInEx
[releases](https://github.com/NuclearPowered/BepInEx/releases) page.
2. Unzip the files into the Among Us game files directory. It should
look something like this after you add BepInEx:
```
.
├── Among Us_Data
├── Among Us.exe
├── BepInEx
│   ├── core/
│   └── unity-libs/
├── changelog.txt
├── doorstop_config.ini
├── GameAssembly.dll
├── mono
│   ├── Managed/
│   └── MonoBleedingEdge/
├── UnityCrashHandler32.exe
├── UnityPlayer.dll
└── 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:
```
.
├── Among Us_Data
├── Among Us.exe
├── BepInEx
│   ├── cache/
│   ├── config/
│   ├── core/
│   ├── patchers/
│   ├── plugins/
│   ├── unhollowed/
│   └── unity-libs/
├── changelog.txt
├── doorstop_config.ini
├── GameAssembly.dll
├── mono
│   ├── Managed/
│   └── MonoBleedingEdge/
├── UnityCrashHandler32.exe
├── 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)
+59
View File
@@ -0,0 +1,59 @@
> 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.
![Regions menu](images/RegionsMenu.jpg)
# Table of Contents
- [Features](#features)
- [Installation](#installation)
- [Configuration](#configuration)
## Features
The following regions have been added:
- [skeld.net](https://skeld.net/)
- localhost *(for playing on a server running on your computer)*
## Installation
> **⚠ 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.
> 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.
## Configuration
> **⚠ WARNING**
>
> The configuration file will be generated when loading the mod for
> the first time. If the configuration file is not there, try
> launching the game and closing it to see if the configuration
> file creates itself.
The configuration file is located at
`(Among Us game files)/BepInEx/config/daemon.unify.reactor.cfg`.
### Custom regions
Custom regions can be added by modifying the `[Region 1]`,
`[Region 2]` ... `[Region 5]` sections of the configuration file.
The sections allow you to modify the display name of the region,
the IP address of the region, and the port of the region.
If the IP field is left empty, the region will not show up in game.
+67 -17
View File
@@ -1,31 +1,81 @@
using System;
using System.Collections.Generic;
using System.Linq;
using BepInEx.Configuration;
using HarmonyLib;
using Hazel.Udp;
using Reactor;
using Array = System.Array;
using String = System.String;
namespace Unify.Patches
{
[HarmonyPatch]
public static class RegionsPatch
{
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 IRegionInfo[] _customRegions = MergeRegions(_newRegions, LoadCustomUserRegions());
public static void Patch()
{
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[] oldRegions = ServerManager.DefaultRegions;
RegionInfo[] patchedRegions = new RegionInfo[oldRegions.Length + newRegions.Length];
IRegionInfo[] patchedRegions = MergeRegions(ServerManager.DefaultRegions, _customRegions);
ServerManager.DefaultRegions = patchedRegions;
ServerManager.Instance.AvailableRegions = patchedRegions;
ServerManager.Instance.SaveServers();
}
private static IRegionInfo[] MergeRegions(IRegionInfo[] oldRegions, IRegionInfo[] newRegions)
{
IRegionInfo[] patchedRegions = new IRegionInfo[oldRegions.Length + newRegions.Length];
Array.Copy(oldRegions, patchedRegions, oldRegions.Length);
Array.Copy(newRegions, 0, patchedRegions, oldRegions.Length, newRegions.Length);
ServerManager.DefaultRegions = patchedRegions;
return patchedRegions;
}
private static IRegionInfo[] LoadCustomUserRegions()
{
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", "");
if (String.IsNullOrWhiteSpace(regionIp.Value)) continue;
IRegionInfo regionInfo = new DnsRegionInfo(
regionIp.Value, regionName.Value, StringNames.NoTranslation, regionIp.Value)
.Duplicate();
customRegions.Add(regionInfo);
}
return customRegions.ToArray();
}
}
[HarmonyPatch(typeof(UdpConnection), nameof(UdpConnection.HandleSend))]
public static class DisableModdedHandshakePatch
{
[HarmonyBefore(new string[] { "gg.reactor.api" })]
public static void Prefix()
{
if (!UnifyPlugin.NormalHandshake.Contains(ServerManager.Instance.CurrentRegion.Name)) return;
PluginSingleton<ReactorPlugin>.Instance.ModdedHandshake.Value = false;
}
public static void Postfix()
{
PluginSingleton<ReactorPlugin>.Instance.ModdedHandshake.Value = true;
}
}
}
+13 -4
View File
@@ -1,4 +1,6 @@
using BepInEx;
using System.IO;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.IL2CPP;
using HarmonyLib;
using Reactor;
@@ -9,18 +11,25 @@ namespace Unify
[BepInPlugin(Id, Name, Version)]
[BepInProcess("Among Us.exe")]
[BepInDependency(ReactorPlugin.Id)]
[ReactorPluginSide(PluginSide.ClientOnly)]
public class UnifyPlugin : BasePlugin
{
public const string Id = "reactor.unify";
public const string Id = "daemon.unify.reactor";
private const string Name = "Unify";
private const string Version = "0.1.0";
private const string Version = "2.0.3";
public static readonly ConfigFile ConfigFile =
new ConfigFile(Path.Combine(Paths.ConfigPath, $"{UnifyPlugin.Id}.cfg"), true);
public static readonly string[] NormalHandshake =
new string[] {"North America", "Europe", "Asia", "skeld.net"};
public Harmony Harmony { get; } = new Harmony(Id);
public override void Load()
{
RegionsPatch.Patch();
Harmony.PatchAll();
}
}
+10 -5
View File
@@ -1,27 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<Version>0.1.0</Version>
<Mappings>NuclearPowered/Mappings:0.1.2</Mappings>
<Version>2.0.3</Version>
<Mappings>NuclearPowered/Mappings:0.2.0</Mappings>
<Description>Region mod for Reactor</Description>
<Authors>Daemon</Authors>
</PropertyGroup>
<PropertyGroup Condition="'$(GamePlatform)' == 'Steam'">
<GameVersion>2020.12.9s</GameVersion>
<GameVersion>2021.3.5s</GameVersion>
<DefineConstants>$(DefineConstants);STEAM</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(GamePlatform)' == 'Itch'">
<GameVersion>2020.11.17i</GameVersion>
<GameVersion>2021.11.17i</GameVersion>
<DefineConstants>$(DefineConstants);ITCH</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Deobfuscate Include="$(AmongUs)\BepInEx\plugins\Reactor-$(GameVersion).dll" />
</ItemGroup>
<PackageReference Include="Reactor.OxygenFilter.MSBuild" Version="0.2.5" />
<ItemGroup>
<PackageReference Include="Reactor.OxygenFilter.MSBuild" Version="0.2.9">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<Target Name="Copy" AfterTargets="Reobfuscate">
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB