mirror of
https://github.com/MoltenMods/Unify.git
synced 2026-10-20 11:40:00 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8fbb962627 | ||
|
|
86cb2dd21b | ||
|
|
a9a4ef3efa | ||
|
|
908c0dd5c8 | ||
|
|
98210325b0 |
No files matched your search
@@ -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:
|
||||
|
||||

|
||||
@@ -0,0 +1,49 @@
|
||||
# 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 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 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.
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace Unify.Patches
|
||||
@@ -20,12 +22,44 @@ namespace Unify.Patches
|
||||
})
|
||||
};
|
||||
|
||||
RegionInfo[] oldRegions = ServerManager.DefaultRegions;
|
||||
RegionInfo[] customRegions = LoadCustomRegions();
|
||||
|
||||
RegionInfo[] patchedRegions = MergeRegions(ServerManager.DefaultRegions, newRegions);
|
||||
patchedRegions = MergeRegions(patchedRegions, customRegions);
|
||||
|
||||
ServerManager.DefaultRegions = patchedRegions;
|
||||
}
|
||||
|
||||
private static RegionInfo[] MergeRegions(RegionInfo[] oldRegions, RegionInfo[] newRegions)
|
||||
{
|
||||
RegionInfo[] patchedRegions = new RegionInfo[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 RegionInfo[] LoadCustomRegions()
|
||||
{
|
||||
List<RegionInfo> customRegions = new List<RegionInfo>();
|
||||
|
||||
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);
|
||||
|
||||
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)
|
||||
});
|
||||
|
||||
customRegions.Add(regionInfo);
|
||||
}
|
||||
|
||||
return customRegions.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
-3
@@ -1,4 +1,6 @@
|
||||
using BepInEx;
|
||||
using System.IO;
|
||||
using BepInEx;
|
||||
using BepInEx.Configuration;
|
||||
using BepInEx.IL2CPP;
|
||||
using HarmonyLib;
|
||||
using Reactor;
|
||||
@@ -11,9 +13,12 @@ namespace Unify
|
||||
[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 = "0.1.1";
|
||||
|
||||
public static readonly ConfigFile ConfigFile =
|
||||
new ConfigFile(Path.Combine(Paths.ConfigPath, $"{UnifyPlugin.Id}.cfg"), true);
|
||||
|
||||
public Harmony Harmony { get; } = new Harmony(Id);
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<Version>0.1.0</Version>
|
||||
<Version>0.1.1</Version>
|
||||
<Mappings>NuclearPowered/Mappings:0.1.2</Mappings>
|
||||
|
||||
<Description>Region mod for Reactor</Description>
|
||||
|
||||
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