mirror of
https://github.com/MoltenMods/Unify.git
synced 2026-10-21 15:34:48 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8560fb6a55 | ||
|
|
af6e7f4b4c | ||
|
|
f35196d68c | ||
|
|
fe8f24ce98 | ||
|
|
80051f9ec2 | ||
|
|
999fb61e5e | ||
|
|
907b2f9fe1 | ||
|
|
5675dab961 | ||
|
|
b426eb5243 | ||
|
|
8fbb962627 | ||
|
|
86cb2dd21b | ||
|
|
a9a4ef3efa | ||
|
|
908c0dd5c8 | ||
|
|
98210325b0 |
No files matched your search
@@ -0,0 +1,62 @@
|
||||
# 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)
|
||||
|
||||
## 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
|
||||
(this may take a while), 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
|
||||
```
|
||||
@@ -0,0 +1,53 @@
|
||||
> 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.
|
||||
|
||||

|
||||
|
||||
# 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 only has compiled releases for the steam release of the game.
|
||||
|
||||
> 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.
|
||||
|
||||
## 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.
|
||||
+55
-18
@@ -1,31 +1,68 @@
|
||||
using System;
|
||||
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[] oldRegions = ServerManager.DefaultRegions;
|
||||
RegionInfo[] patchedRegions = new RegionInfo[oldRegions.Length + newRegions.Length];
|
||||
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[] 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(ServerManager), nameof(ServerManager.Awake))]
|
||||
public static class AddRegionsPatch
|
||||
{
|
||||
public static void Prefix(ServerManager __instance)
|
||||
{
|
||||
ServerManager.DefaultRegions = PatchedRegions;
|
||||
|
||||
// ServerManager.AvailableRegions
|
||||
__instance.JIJNOHCGPHM = PatchedRegions;
|
||||
|
||||
__instance.SaveServers();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
-7
@@ -1,26 +1,27 @@
|
||||
using BepInEx;
|
||||
using System.IO;
|
||||
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 = "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.2";
|
||||
|
||||
public static readonly ConfigFile ConfigFile =
|
||||
new ConfigFile(Path.Combine(Paths.ConfigPath, $"{UnifyPlugin.Id}.cfg"), true);
|
||||
|
||||
public Harmony Harmony { get; } = new Harmony(Id);
|
||||
|
||||
public override void Load()
|
||||
{
|
||||
RegionsPatch.Patch();
|
||||
|
||||
Harmony.PatchAll();
|
||||
}
|
||||
}
|
||||
|
||||
+33
-19
@@ -1,31 +1,45 @@
|
||||
<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.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.
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
Reference in new issue
Block a user