Revert "Modified mod to remove Reactor as a dependency"

This reverts commit af6e7f4b4c.
This commit is contained in:
DaemonBeast committed 2021-03-14 12:40:21 +00:00
1 parent af6e7f4b4c
commit 3dbf2befc1
6 files changed
+66 -58

No files matched your search

+18 -3
View File
@@ -3,6 +3,7 @@
# 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
@@ -34,9 +35,9 @@ library then selecting `Manage > Browse local files`.
└── 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:
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:
```
.
@@ -60,3 +61,17 @@ 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 -2
View File
@@ -24,9 +24,15 @@ The following regions have been added:
>
> 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).
> 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 is installed (more information above).
> 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.
+11 -19
View File
@@ -1,7 +1,5 @@
using System.Collections.Generic;
using BepInEx.Configuration;
using HarmonyLib;
using UnityEngine;
using Array = System.Array;
using String = System.String;
@@ -9,15 +7,23 @@ namespace Unify.Patches
{
public static class RegionsPatch
{
private static readonly IRegionInfo[] NewRegions = new IRegionInfo[]
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 readonly IRegionInfo[] CustomRegions = MergeRegions(NewRegions, LoadCustomUserRegions());
private static readonly IRegionInfo[] PatchedRegions = MergeRegions(ServerManager.DefaultRegions, CustomRegions);
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();
}
private static IRegionInfo[] MergeRegions(IRegionInfo[] oldRegions, IRegionInfo[] newRegions)
{
@@ -50,19 +56,5 @@ namespace Unify.Patches
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();
}
}
}
}
+5 -1
View File
@@ -3,17 +3,19 @@ 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 = "2.0.2";
private const string Version = "2.0.1";
public static readonly ConfigFile ConfigFile =
new ConfigFile(Path.Combine(Paths.ConfigPath, $"{UnifyPlugin.Id}.cfg"), true);
@@ -22,6 +24,8 @@ namespace Unify
public override void Load()
{
RegionsPatch.Patch();
Harmony.PatchAll();
}
}
+24 -33
View File
@@ -1,45 +1,36 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<Version>2.0.2</Version>
<GameVersion>2021.3.5s</GameVersion>
<Version>2.0.1</Version>
<Mappings>NuclearPowered/Mappings:0.2.0</Mappings>
<Description>Region mod</Description>
<Description>Region mod for Reactor</Description>
<Authors>Daemon</Authors>
</PropertyGroup>
<PropertyGroup>
<TargetName>$(AssemblyName)-$(GameVersion)</TargetName>
<PropertyGroup Condition="'$(GamePlatform)' == 'Steam'">
<GameVersion>2021.3.5s</GameVersion>
<DefineConstants>$(DefineConstants);STEAM</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(GamePlatform)' == 'Itch'">
<GameVersion>2021.11.17i</GameVersion>
<DefineConstants>$(DefineConstants);ITCH</DefineConstants>
</PropertyGroup>
<ItemGroup>
<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>
<Deobfuscate Include="$(AmongUs)\BepInEx\plugins\Reactor-$(GameVersion).dll" />
</ItemGroup>
<Target Name="Copy" AfterTargets="AfterBuild">
<Copy SourceFiles="$(OutputPath)/$(TargetName).dll" DestinationFolder="../build" />
<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">
<Copy SourceFiles="$(OutputPath)reobfuscated/$(AssemblyName)-$(GameVersion).dll" DestinationFolder="$(AmongUs)/BepInEx/plugins/" />
<Copy SourceFiles="$(OutputPath)reobfuscated/$(AssemblyName)-$(GameVersion).dll" DestinationFolder="../build/" />
</Target>
</Project>
Binary file not shown.