Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #19 from CrowdedMods/master
Browse files Browse the repository at this point in the history
Reactor port
  • Loading branch information
andruzzzhka authored Feb 23, 2021
2 parents 118c941 + 6656fe9 commit 033574f
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 207 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# Yes.
.idea

# User-specific files
*.rsuser
Expand Down
10 changes: 5 additions & 5 deletions CustomServersClient.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30320.27
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomServersClient", "CustomServersClient\CustomServersClient.csproj", "{8424C5D8-334F-4CAB-B3C8-4D7635283B7F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CustomServersClient", "CustomServersClient\CustomServersClient.csproj", "{8424C5D8-334F-4CAB-B3C8-4D7635283B7F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -13,14 +13,14 @@ Global
Steam-Release|Any CPU = Steam-Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8424C5D8-334F-4CAB-B3C8-4D7635283B7F}.Itch-Debug|Any CPU.ActiveCfg = Itch-Debug|Any CPU
{8424C5D8-334F-4CAB-B3C8-4D7635283B7F}.Itch-Debug|Any CPU.Build.0 = Itch-Debug|Any CPU
{8424C5D8-334F-4CAB-B3C8-4D7635283B7F}.Itch-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8424C5D8-334F-4CAB-B3C8-4D7635283B7F}.Itch-Debug|Any CPU.Build.0 = Debug|Any CPU
{8424C5D8-334F-4CAB-B3C8-4D7635283B7F}.Itch-Release|Any CPU.ActiveCfg = Itch-Release|Any CPU
{8424C5D8-334F-4CAB-B3C8-4D7635283B7F}.Itch-Release|Any CPU.Build.0 = Itch-Release|Any CPU
{8424C5D8-334F-4CAB-B3C8-4D7635283B7F}.Steam-Debug|Any CPU.ActiveCfg = Steam-Debug|Any CPU
{8424C5D8-334F-4CAB-B3C8-4D7635283B7F}.Steam-Debug|Any CPU.Build.0 = Steam-Debug|Any CPU
{8424C5D8-334F-4CAB-B3C8-4D7635283B7F}.Steam-Release|Any CPU.ActiveCfg = Steam-Release|Any CPU
{8424C5D8-334F-4CAB-B3C8-4D7635283B7F}.Steam-Release|Any CPU.Build.0 = Steam-Release|Any CPU
{8424C5D8-334F-4CAB-B3C8-4D7635283B7F}.Steam-Release|Any CPU.ActiveCfg = Debug|Any CPU
{8424C5D8-334F-4CAB-B3C8-4D7635283B7F}.Steam-Release|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
157 changes: 32 additions & 125 deletions CustomServersClient/CustomServersClient.csproj
Original file line number Diff line number Diff line change
@@ -1,127 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{8424C5D8-334F-4CAB-B3C8-4D7635283B7F}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CustomServersClient</RootNamespace>
<AssemblyName>CustomServersClient</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFramework>netstandard2.1</TargetFramework>
<Version>1.3.0</Version>
<GameVersion>2020.12.9s</GameVersion>
<Mappings>NuclearPowered/Mappings:0.1.2</Mappings>

<Authors>andruzzzhka</Authors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Steam-Release|AnyCPU' ">
<OutputPath>bin\Steam-Release\</OutputPath>
<DefineConstants>TRACE;STEAM</DefineConstants>
<Optimize>true</Optimize>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Steam-Debug|AnyCPU' ">
<OutputPath>bin\Steam-Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;STEAM</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Itch-Release|AnyCPU' ">
<OutputPath>bin\Itch-Release\</OutputPath>
<DefineConstants>TRACE;ITCH</DefineConstants>
<Optimize>true</Optimize>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Itch-Debug|AnyCPU'">
<OutputPath>bin\Itch-Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;ITCH</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp-Steam" Condition=" '$(Configuration)' == 'Steam-Debug' Or '$(Configuration)' == 'Steam-Release'">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Among Us\BepInEx\unhollowed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp-Itch" Condition=" '$(Configuration)' == 'Itch-Debug' Or '$(Configuration)' == 'Itch-Release'">
<HintPath>..\..\..\..\..\..\Games\among-us-windows\AmongUs\BepInEx\unhollowed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="0Harmony">
<Private>False</Private>
</Reference>
<Reference Include="BepInEx.Core, Version=6.0.0.294, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="BepInEx.IL2CPP">
<Private>False</Private>
</Reference>
<Reference Include="Il2Cppmscorlib">
<Private>False</Private>
</Reference>
<Reference Include="UnhollowerBaseLib">
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine">
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UI">
<Private>False</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CustomServerInfo.cs" />
<Compile Include="CustomServersPlugin.cs" />
<Compile Include="CustomServersPatches.cs" />
<Compile Include="UI\EditServerForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\EditServerForm.designer.cs">
<DependentUpon>EditServerForm.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UI\ServersManagementForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\ServersManagementForm.designer.cs">
<DependentUpon>ServersManagementForm.cs</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="UI\EditServerForm.resx">
<DependentUpon>EditServerForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\ServersManagementForm.resx">
<DependentUpon>ServersManagementForm.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
<PropertyGroup Condition="'$(GamePlatform)' == 'Steam'">
<GameVersion>2020.12.9s</GameVersion>
<DefineConstants>$(DefineConstants);STEAM</DefineConstants>
</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" />
</ItemGroup>

<ItemGroup>
<Reference Include="System.Windows.Forms">
<HintPath>$(AmongUs)\mono\Managed\System.Windows.Forms.dll</HintPath>
</Reference>
</ItemGroup>
<Target Name="Copy" AfterTargets="Reobfuscate">
<Copy SourceFiles="$(OutputPath)reobfuscated/$(AssemblyName)-$(GameVersion).dll" DestinationFolder="$(AmongUs)/BepInEx/plugins/" Condition="'$(Configuration)' == 'Debug'" />
</Target>
</Project>
35 changes: 4 additions & 31 deletions CustomServersClient/CustomServersPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,6 @@
using UnhollowerBaseLib;
using CustomServersClient.UI;

#if STEAM
using RegionMenu = CLIGCNHFBCO;
using RegionMenuButtonCallback = CLIGCNHFBCO.EEJIMLMHMGO;
using RegionInfo = OIBMKGDLGOG;
using ServerInfo = PLFDMKKDEMI;
using ServerManager = AOBNFCIHAJL;
using ObjectPoolBehavior = FJBFFDFFBFO;
using PassiveButton = HHMBANDDIOA;
#elif ITCH
using RegionMenu = KIPLKPEOBEO;
using RegionMenuButtonCallback = KIPLKPEOBEO.KKOJKDJKEIK;
using RegionInfo = KMFCKPLMGDK;
using ServerInfo = PIOPAJCMNDK;
using ServerManager = CJPEJFOJIOC;
using ObjectPoolBehavior = NKEKOACGIFD;
using PassiveButton = AJGGJOBLDCP;
#endif

namespace CustomServersClient
{
public static class CustomServersPatches
Expand Down Expand Up @@ -110,26 +92,17 @@ public static void ClearOnClickAction(ObjectPoolBehavior buttonPool)
}


[HarmonyPatch(typeof(RegionMenuButtonCallback), nameof(RegionMenuButtonCallback.Method_Internal_Void_0))]
[HarmonyPatch(typeof(RegionMenu.c__DisplayClass2_0), "Method_Internal_Void_0")]
public static class RegionMenuChooseOptionPatch
{
public static bool Prefix(ref RegionMenuButtonCallback __instance)
public static bool Prefix(ref RegionMenu.c__DisplayClass2_0 __instance)
{
#if STEAM
string buttonName = __instance.region.CBMOEHMADOC;
#elif ITCH
string buttonName = __instance.region.BEIIALBBLIK;
#endif
if (buttonName == "MANAGE_SERVERS")
if (__instance.region.PingServer == "MANAGE_SERVERS")
{
if (_managementForm == null || _managementForm.IsDisposed)
_managementForm = new ServersManagementForm();

#if STEAM
_managementForm.regionMenu = __instance.field_Public_CLIGCNHFBCO_0;
#elif ITCH
_managementForm.regionMenu = __instance.field_Public_KIPLKPEOBEO_0;
#endif
_managementForm.regionMenu = __instance.__this;

if (_managementForm.Visible)
_managementForm.Focus();
Expand Down
35 changes: 0 additions & 35 deletions CustomServersClient/Properties/AssemblyInfo.cs

This file was deleted.

5 changes: 0 additions & 5 deletions CustomServersClient/UI/ServersManagementForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
using System.IO;
using System.Windows.Forms;

#if STEAM
using RegionMenu = CLIGCNHFBCO;
#elif ITCH
using RegionMenu = KIPLKPEOBEO;
#endif

namespace CustomServersClient.UI
{
Expand Down
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,21 @@ An in-game client for custom servers for Among Us. This works on both the Steam
Works on Steam as of **v2020.12.9s**.
Works on Itch as of **v2020.11.17i**.

## Building

1. Download the source code
2. Add references to the required DLLs, add the paths for `Assembly-CSharp-Steam` and `Assembly-CSharp-Itch` by manually editing `CustomServersClient.csproj` in a text editor. (You don't need to add both if you're only building one.)
3. Change the Solution Configuration depending on what version you want to build (both debug and release versions exist for both versions).
4. Build the solution, `CustomServersClient.dll` will be in it's own directory depending on the version built.
## Installation
1. Download latest [BepInEx (Reactor fork)](https://github.com/NuclearPowered/BepInEx/releases)
2. Extract all files from zipped archive and put them in Among Us directory (where Among Us.exe is)
3. Download latest [Reactor.dll](https://nightly.link/NuclearPowered/Reactor/workflows/main/master) and put it in `YourAmongUsDirectory/BepInEx/plugins`
4. Download latest CustomServersClient.zip from releases
5. Unzip it, paste it into `YourAmongUsDirectory`

## Building
1. Install [Reactor](https://docs.reactor.gg/docs/) (Quick Start guide)
2. Open `CustomServersClient.sln` in your favorite IDE
3. Select correct option (for example Steam-Release) and build it.
4. Compiled dll should be automatically copied to your `BepInEx/plugins` folder (Reactor feature)
## Screenshot
![screenshot_0](https://cdn.discordapp.com/attachments/759066383090188308/763331715740729364/unknown.png)

## TO-DO
- Change WinForms to imgui from Reactor
- Make newet screenshot

0 comments on commit 033574f

Please sign in to comment.