36 Commits
Author SHA1 Message Date
js6pak a6152f559c Revert "Start working on http handshake support"
This reverts commit 3579ecb89e.
2022-08-23 20:47:22 +02:00
js6pak 9893fc9e45 Add support for 2022.8.23 2022-08-23 20:36:20 +02:00
js6pak 16135fa897 Merge pull request #58 from miniduikboot/fix/ci-caching 2022-08-07 18:21:05 +00:00
miniduikboot 0eb6ac0cbe Fix CI Caching by cloning first
The cache action requires the checksum of the packages.lock.json files,
but can't find them because the repository wasn't cloned yet. So clone
the repository first
2022-08-07 19:50:32 +02:00
js6pak 3579ecb89e Start working on http handshake support 2022-07-30 01:00:58 +02:00
js6pak ff7a80addf Fix regioninfo watcher crashing when the file doesn't exist 2022-07-29 21:17:17 +02:00
js6pak ef6baeacce Fix epic splashskip fix 2022-07-29 21:00:35 +02:00
js6pak f24cbf182a 1.2.7 2022-06-24 04:58:30 +02:00
js6pak fdda5571b2 Bump dependencies 2022-06-24 04:58:10 +02:00
js6pak 89f06e01f1 Fix splash skip on epic 2022-06-24 04:50:17 +02:00
js6pak 0a03a9d90d Fix udp matchmaking 2022-06-03 21:49:56 +02:00
js6pak 22550a88ca 1.2.6 2022-05-31 00:40:18 +02:00
js6pak 2b98a211bd Merge pull request #55 from miniduikboot/fix/region-info-feedback-loop
Improve regionInfo.json writing logic
2022-05-30 21:43:05 +00:00
miniduikboot cb799e877e Improve regionInfo.json writing logic
Since a few version AU writes the regionInfo.json file after loading it.
This triggers the write observer, causing a positive feedback loop.
70155fe8a6 took the first stab at stopping
this positive feedback, but unfortunately it isn't adequate enough when
4+ clients are running at the same time, so this commit takes it a step
further by not writing the data if it didn't change, stopping the loop.
2022-05-30 23:38:15 +02:00
js6pak fcc8056aaa 1.2.5 2022-05-06 14:02:13 +02:00
js6pak c4a8c8abbe [skip ci] Create release from CI 2022-05-06 14:00:24 +02:00
js6pak 7203698222 Totally didn't forget to commit this 2022-04-01 10:08:10 +02:00
js6pak d3fa33aaf0 2022.3.29 2022-03-31 22:26:18 +02:00
js6pak bbcb1abb67 Merge pull request #53 from miniduikboot/fix/usedtls-desync 2022-03-09 22:54:14 +01:00
miniduikboot 9b1211f505 Add prefix patch to sync up useDtlsLayout argument
Workaround a much deeper, yet unknown issue
2022-03-03 22:01:19 +01:00
js6pak e58f8b5aef Update CustomServersPatch for 2022.2.8+ 2022-02-27 15:52:08 +01:00
js6pak bac31b1b51 Support 2022.2.23s and bump dependencies 2022-02-26 17:43:08 +01:00
amsyarasyiq d2e5d026e3 Patch random name generator (#46) 2022-02-18 21:54:03 +00:00
js6pak 081e6e2ba9 1.2.1 2022-02-18 22:40:48 +01:00
js6pak 70155fe8a6 Don't reload regionInfo.json when the game saves it 2022-02-18 22:38:35 +01:00
js6pak 89a8adadf7 2021.12.15 2021-12-21 15:53:08 +01:00
js6pak 837ee142b3 2021.12.14 2021-12-15 19:45:27 +01:00
js6pak 2453bff8df Merge branch '2021.11.9' 2021-12-14 23:17:43 +01:00
js6pak f501dc1897 RandomExtensions 2021-12-14 22:40:12 +01:00
js6pak f3b510ae2a Bump version to 1.2.0 2021-12-03 00:53:28 +01:00
js6pak bc9b8ea8a2 Merge remote-tracking branch 'origin/master' into 2021.11.9 2021-12-03 00:52:46 +01:00
Simon Kelly c96f12029e Allow sending method rpcs immediately (#45) 2021-11-24 15:28:51 +00:00
js6pak 8e8beaf30c Merge remote-tracking branch 'origin/master' into 2021.11.9
# Conflicts:
#	AmongUs.props
#	Reactor.Debugger/packages.lock.json
#	Reactor.Example/packages.lock.json
#	Reactor/packages.lock.json
2021-11-20 01:20:39 +01:00
js6pak d9e5e7f1a9 Fix freeplay 2021-11-11 11:35:30 +01:00
js6pak 40ae06899c Update CI to .NET 6 2021-11-10 15:45:39 +01:00
js6pak 73e21fc406 2021.11.9 2021-11-10 15:43:17 +01:00
23 changed files with 468 additions and 312 deletions

No files matched your search

+13 -7
View File
@@ -1,13 +1,17 @@
name: CI
on: [ "push", "pull_request" ]
on: ["push", "pull_request"]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/cache@v2
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/cache@v3
with:
path: |
~/.nuget/packages
@@ -16,14 +20,10 @@ jobs:
restore-keys: |
${{ runner.os }}-nuget-
- uses: actions/checkout@v2
with:
submodules: true
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.x
dotnet-version: 6.x
- name: Run the Cake script
uses: cake-build/cake-action@v1
@@ -44,3 +44,9 @@ jobs:
with:
name: Reactor.Debugger.dll
path: Reactor.Debugger/bin/Release/netstandard2.1/Reactor.Debugger.dll
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: Reactor/bin/Release/netstandard2.1/Reactor.dll
+4 -4
View File
@@ -1,16 +1,16 @@
<Project>
<PropertyGroup>
<GamePlatform Condition="'$(GamePlatform)' == ''">Steam</GamePlatform>
<GameVersion Condition="'$(GamePlatform)' == 'Steam'">2021.6.30</GameVersion>
<GameVersion Condition="'$(GamePlatform)' == 'Itch'">2021.6.30</GameVersion>
<GameVersion Condition="'$(GamePlatform)' == 'Steam'">2022.8.23</GameVersion>
<GameVersion Condition="'$(GamePlatform)' == 'Itch'">2022.8.23</GameVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BepInEx.IL2CPP" Version="6.0.0-be.521" />
<PackageReference Include="BepInEx.IL2CPP" Version="6.0.0-be.570" />
<PackageReference Include="AmongUs.GameLibs.$(GamePlatform)" Version="$(GameVersion)" PrivateAssets="all" />
<PackageReference Include="BepInEx.AutoPlugin" Version="1.0.1" PrivateAssets="all" />
<PackageReference Include="BepInEx.IL2CPP.MSBuild" Version="1.0.1" PrivateAssets="all" />
<PackageReference Include="BepInEx.IL2CPP.MSBuild" Version="1.1.1" PrivateAssets="all" />
</ItemGroup>
<Target Name="Copy" AfterTargets="Build" Condition="'$(AmongUs)' != ''">
+10 -18
View File
@@ -5,6 +5,7 @@ using BepInEx.IL2CPP;
using HarmonyLib;
using InnerNet;
using Reactor.Extensions;
using UnhollowerBaseLib;
using UnhollowerBaseLib.Attributes;
using UnityEngine;
@@ -63,20 +64,10 @@ namespace Reactor.Debugger
{
var data = PlayerControl.LocalPlayer.Data;
var newIsImpostor = GUILayout.Toggle(data.IsImpostor, "Is Impostor");
if (data.IsImpostor != newIsImpostor)
var newIsImpostor = GUILayout.Toggle(data.Role.IsImpostor, "Is Impostor");
if (data.Role.IsImpostor != newIsImpostor)
{
if (newIsImpostor)
{
PlayerControl.LocalPlayer.RpcSetInfected(new[]
{
data
});
}
else
{
PlayerControl.LocalPlayer.RemoveInfected();
}
PlayerControl.LocalPlayer.RpcSetRole(newIsImpostor ? RoleTypes.Impostor : RoleTypes.Crewmate);
}
if (GUILayout.Button("Spawn a dummy"))
@@ -89,11 +80,12 @@ namespace Reactor.Debugger
playerControl.GetComponent<DummyBehaviour>().enabled = true;
playerControl.NetTransform.enabled = false;
playerControl.SetName($"{TranslationController.Instance.GetString(StringNames.Dummy, Array.Empty<Il2CppSystem.Object>())} {i}");
playerControl.SetColor((byte) (i % Palette.PlayerColors.Length));
playerControl.SetHat(i % (uint) HatManager.Instance.AllHats.Count, playerControl.Data.ColorId);
playerControl.SetPet(i % (uint) HatManager.Instance.AllPets.Count);
playerControl.SetSkin(i % (uint) HatManager.Instance.AllSkins.Count);
GameData.Instance.RpcSetTasks(playerControl.PlayerId, new byte[0]);
var color = (byte) (i % Palette.PlayerColors.Length);
playerControl.SetColor(color);
playerControl.SetHat(HatManager.Instance.allHats[i % HatManager.Instance.allHats.Count].ProdId, playerControl.Data.DefaultOutfit.ColorId);
playerControl.SetPet(HatManager.Instance.allPets[i % HatManager.Instance.allPets.Count].ProdId);
playerControl.SetSkin(HatManager.Instance.allSkins[i % HatManager.Instance.allSkins.Count].ProdId, color);
GameData.Instance.RpcSetTasks(playerControl.PlayerId, new Il2CppStructArray<byte>(0));
}
}
+1 -1
View File
@@ -44,7 +44,7 @@ namespace Reactor.Debugger
}
}
[HarmonyPatch(typeof(GameSettingMenu), nameof(GameSettingMenu.OnEnable))]
[HarmonyPatch(typeof(GameSettingMenu), nameof(GameSettingMenu.Start))]
public static class GameSettingMenuPatch
{
public static void Prefix(GameSettingMenu __instance)
+65 -59
View File
@@ -4,9 +4,9 @@
".NETStandard,Version=v2.1": {
"AmongUs.GameLibs.Steam": {
"type": "Direct",
"requested": "[2021.6.30, )",
"resolved": "2021.6.30",
"contentHash": "TdlFO+S61WREk/sOV2YUmzQ6MFNXk5o+uxLv4i4ft/Z1VRkxFo66/ff3cR1ZfI8DuXni/Ao9rS4dJP+j85pEFA=="
"requested": "[2022.8.23, )",
"resolved": "2022.8.23",
"contentHash": "baY5JO6dbdOAZ0VTtGX0xre6/BlDdreJDAH8boCKZt3JTAcn+eeH+l8mUZRC9eCJOODUik2C0TTAt5AqBmYtZg=="
},
"BepInEx.AutoPlugin": {
"type": "Direct",
@@ -16,36 +16,36 @@
},
"BepInEx.IL2CPP": {
"type": "Direct",
"requested": "[6.0.0-be.521, )",
"resolved": "6.0.0-be.521",
"contentHash": "nzXG/X9u4Ane4KvzaTTon9iP2o3zBkPierrkefaq9tmmQ91FzXFtmFGkVZpD6hGqGjd+KRIn0c6my58+e0u+gw==",
"requested": "[6.0.0-be.570, )",
"resolved": "6.0.0-be.570",
"contentHash": "JGkWFFGZTWQ+YlFQ17izlwfGNUyo/zfFGNYPX6XAeTkfM5RwXiPYNMNO6eWoxbKwaYlAylQq2YCRkkCnAr9nwQ==",
"dependencies": {
"BepInEx.Core": "6.0.0-be.521",
"BepInEx.Core": "6.0.0-be.570",
"BepInEx.Il2Cpp.TlsAdapter": "1.0.1",
"HarmonyX": "2.5.7",
"Iced": "1.15.0",
"Il2CppAssemblyUnhollower.BaseLib": "0.4.19.5",
"Il2CppAssemblyUnhollower.BaseLib.Legacy": "0.4.19.5",
"Il2CppAssemblyUnhollower.Tool": "0.4.19.5",
"HarmonyX": "2.10.0",
"Iced": "1.17.0",
"Il2CppAssemblyUnhollower.BaseLib": "0.4.33.3",
"Il2CppAssemblyUnhollower.BaseLib.Legacy": "0.4.33.3",
"Il2CppAssemblyUnhollower.Lib": "0.4.33.3",
"Il2CppDumper": "6.6.4",
"MonoMod.RuntimeDetour": "21.10.10.1",
"Samboy063.Cpp2IL.Core": "2021.5.3"
"MonoMod.RuntimeDetour": "22.5.1.1",
"Samboy063.Cpp2IL.Core": "2022.0.5"
}
},
"BepInEx.IL2CPP.MSBuild": {
"type": "Direct",
"requested": "[1.0.1, )",
"resolved": "1.0.1",
"contentHash": "fOxbM3r8vBo5djUh3R4/cfzYNwIL4EyPc2P7yGIPaR+jrql1eS2IW+4oy2MGpfvbMLGeDHaYubcYS4VSc7F3jw=="
"requested": "[1.1.1, )",
"resolved": "1.1.1",
"contentHash": "uUSo4TuamyEIVg+ICNeJMSSW/arKWHGpfBFINc4fdF5kppfHFrsDURKzNPmDvxivtLsiuGthck9J/5uPXgIcTg=="
},
"BepInEx.Core": {
"type": "Transitive",
"resolved": "6.0.0-be.521",
"contentHash": "O1UmrldEd72/0//LIdop26QuWwToNP3lXURfORKZGZv1Kp5nU03jS/hXIXEgDSzxRZJt5j+ffay7x+5eedXMbg==",
"resolved": "6.0.0-be.570",
"contentHash": "kygIunLrK1HMGcRo2E/7e4ZEAA0xewuB/j5mPoMi7Xk58GUi43XnclBJHif9x05a55s0kFkfKOrpwIRmjd0cDw==",
"dependencies": {
"HarmonyX": "2.5.7",
"MonoMod.Utils": "21.10.10.1",
"SemanticVersioning": "2.0.0"
"HarmonyX": "2.10.0",
"MonoMod.Utils": "22.3.23.4",
"SemanticVersioning": "2.0.2"
}
},
"BepInEx.Il2Cpp.TlsAdapter": {
@@ -56,48 +56,43 @@
"HarmonyX": "2.3.1"
}
},
"Gee.External.Capstone": {
"type": "Transitive",
"resolved": "2.0.2",
"contentHash": "6lIJ0uCFRm67Tr/tlEXYPZSrNjwBODjhK1iPafAbZ0FVXvjpqSOY176ZnY3yA9TytyETxpgAZxT07Dnt01SPgw=="
},
"HarmonyX": {
"type": "Transitive",
"resolved": "2.5.7",
"contentHash": "BVQAIGbYKp6S6IoP4pduDFKT4ST6iO4WC/INHJDeK3y2CA1AyhNAgYuPTzap3TVfGFUwphNcDpWBTO7hMu5grw==",
"resolved": "2.10.0",
"contentHash": "4ayiy/dlCiW86K2N7Jvbf+VpI5wvP7dncv/6oRmfwRi32UCmCRzCGzsxdMfzJZkp6/26oBW+DrD8vi4UejzVAg==",
"dependencies": {
"MonoMod.RuntimeDetour": "21.10.10.1",
"MonoMod.RuntimeDetour": "22.3.23.4",
"System.Reflection.Emit": "4.7.0"
}
},
"Iced": {
"type": "Transitive",
"resolved": "1.15.0",
"contentHash": "zSMOcs5qL77q4yb4O4cCrnY3/E8TMrKiz9vDvHgpQacs97gtnj2JfU9WoagNgwdn3C07CmEVaaQMxto11Uh5yQ=="
"resolved": "1.17.0",
"contentHash": "8x+HCVTl/HHTGpscH3vMBhV8sknN/muZFw9s3TsI8SA6+c43cOTCi2+jE4KsU8pNLbJ++iF2ZFcpcXHXtDglnw=="
},
"Il2CppAssemblyUnhollower.BaseLib": {
"type": "Transitive",
"resolved": "0.4.19.5",
"contentHash": "UP0vtj0iDigQ/HZBq6+sP/btgDLc5Ibt1WkFrPvXvOtkgjt+cIdKpJmxVZHwMluUmP6Wsy3RCXeLlXE9eC/15Q==",
"resolved": "0.4.33.3",
"contentHash": "CH91M6Asz4iwennTa8cLg5wqROJY1JvnsfRetyOvs0cy8o/YAikvm8uuNgZv6UiTO/qoyy/QrBE1qSZDvs8bLw==",
"dependencies": {
"Iced": "1.15.0"
}
},
"Il2CppAssemblyUnhollower.BaseLib.Legacy": {
"type": "Transitive",
"resolved": "0.4.19.5",
"contentHash": "dxn4ADz0VlWQtSnNhVIaFzQREnSwZEvS6YaFmwuKW+wbLdHTk9D9bDbS5QkL8glKdgoW2ifpvCBgKd1QAui/1w==",
"resolved": "0.4.33.3",
"contentHash": "6yIJg8lkayBDevPwcdcV3LWTdHt8VAZVY0wQwuXH4POOo0Kzc6Cshy9kLCxH3AC6EQg0G/v+Albs6RZgwszXMQ==",
"dependencies": {
"Il2CppAssemblyUnhollower.BaseLib": "0.4.19.5"
"Il2CppAssemblyUnhollower.BaseLib": "0.4.33.3"
}
},
"Il2CppAssemblyUnhollower.Tool": {
"Il2CppAssemblyUnhollower.Lib": {
"type": "Transitive",
"resolved": "0.4.19.5",
"contentHash": "TYfW5UA77dy0a0N1XaIkZJLMyJIXdHO9q3jyuhTdsZdpuD/oi7qZt1GDlpI5dsg2nf9HKVAlIPNagtIqK9pYvw==",
"resolved": "0.4.33.3",
"contentHash": "tdu4OnMxodkWwoImNDaycaLY1L3qJOazb5UaLAt1ncRpWyu6xvKuKe5NM6OcBXONpkYsJQeQZjD6syeFl5MCQA==",
"dependencies": {
"Il2CppAssemblyUnhollower.BaseLib": "0.4.19.5",
"Il2CppAssemblyUnhollower.BaseLib.Legacy": "0.4.19.5",
"Il2CppAssemblyUnhollower.BaseLib": "0.4.33.3",
"Il2CppAssemblyUnhollower.BaseLib.Legacy": "0.4.33.3",
"Mono.Cecil": "0.11.3"
}
},
@@ -114,6 +109,11 @@
"resolved": "1.0.0",
"contentHash": "6TgS1JLSUkpmPLfXBPaAgB39ZUix8E4soXWk2XSDcscVe84i1JKzIAtA7jHbRHSkOOrcr6YA0MpLCeq98y9mYQ=="
},
"js6pak.Gee.External.Capstone": {
"type": "Transitive",
"resolved": "2.1.0",
"contentHash": "YYpq7NM50bSSVUDjXyV/eiITk6syXqItPjKBOb3jEWS6RFsk0DNhpWMPW6b3hKDmArARuWDU6S2pVu1IeVrvIA=="
},
"Microsoft.NETCore.Platforms": {
"type": "Transitive",
"resolved": "1.1.0",
@@ -131,11 +131,11 @@
},
"MonoMod.RuntimeDetour": {
"type": "Transitive",
"resolved": "21.10.10.1",
"contentHash": "cZFLf8kCTqGAznnrGfAX8tRrMrHFH8hFHtX/Cr/CFZOcHFZZICUA03Cmjs97uoquvKpV1D2YEHGhtLprPj+ZUg==",
"resolved": "22.5.1.1",
"contentHash": "WG5zLRuAr8KJEnIkKTuIG1OJCrGIT3pjvnAD43E0FDchHf3Dp985MF/8tmIQvAzCZV87JNs6QKeGGqmwDmpXpw==",
"dependencies": {
"Mono.Cecil": "0.11.4",
"MonoMod.Utils": "21.10.10.1",
"MonoMod.Utils": "22.5.1.1",
"System.Collections.NonGeneric": "4.3.0",
"System.ComponentModel.TypeConverter": "4.3.0",
"System.IO.FileSystem.Primitives": "4.3.0",
@@ -146,8 +146,8 @@
},
"MonoMod.Utils": {
"type": "Transitive",
"resolved": "21.10.10.1",
"contentHash": "y1ZION4RwtrnLYmE4SqI2Mnk9zZgwQlxUnfdwe0MJS8KWuSi9tU1h6RUZFaEUWSSiVE12Q2wba1Sv45j33+DLw==",
"resolved": "22.5.1.1",
"contentHash": "vBObO1atXxhi2C4AuC53y87Bqeogi9xIrD1Ym3YWr5uxc8Nrm8SrsFeD1i3x04R999+XQ3FdeHrbXScyWYEHqQ==",
"dependencies": {
"Mono.Cecil": "0.11.4",
"System.Collections.NonGeneric": "4.3.0",
@@ -160,31 +160,37 @@
},
"Samboy063.Cpp2IL.Core": {
"type": "Transitive",
"resolved": "2021.5.3",
"contentHash": "e7YdrON5J8Y3KYCwku6srp1/UdCYii/EHCLU1+sVnqKnoEnJh+CZXb2VHuKQ5IRJKLfDq2GDeWdEU8KxOW/7vQ==",
"resolved": "2022.0.5",
"contentHash": "5JipfyEmJWePqLLnvwzxWx9dQXxNfgN0wcZ4IcmuabWKVvk4gA5Rux4vgDh9NrWf8q9LzkizWHkrnMaG1niF7g==",
"dependencies": {
"Gee.External.Capstone": "2.0.2",
"HarmonyX": "2.5.5",
"Iced": "1.11.1",
"IndexRange": "1.0.0",
"Mono.Cecil": "0.11.4",
"Samboy063.LibCpp2IL": "2021.5.3",
"System.ValueTuple": "4.5.0"
"Samboy063.LibCpp2IL": "2022.0.5",
"System.Runtime.InteropServices": "4.3.0",
"System.ValueTuple": "4.5.0",
"js6pak.Gee.External.Capstone": "2.1.0"
}
},
"Samboy063.LibCpp2IL": {
"type": "Transitive",
"resolved": "2021.5.3",
"contentHash": "8N9PZiNqERUXQKRmjiacsC86/qxuBFHeD+P84MXtIzb7X9BkKuPp6N7YfoLv3EFrS+NFbd8gAgPBmAOAb80j+Q==",
"resolved": "2022.0.5",
"contentHash": "eH+/FBclsKDxboa9N/tFoiM8kwvietVX0FtXYxvcexSp/geYCyTt2XUGOQjinqd3Yqg/QxmpIqBO7qy4MQHrhw==",
"dependencies": {
"Iced": "1.11.1",
"IndexRange": "1.0.0"
"IndexRange": "1.0.0",
"Samboy063.WasmDisassembler": "2022.0.2"
}
},
"Samboy063.WasmDisassembler": {
"type": "Transitive",
"resolved": "2022.0.2",
"contentHash": "2uu+xBb7M3HKfBx9tAY6jiDieAf0hRnQjSmGX+7IdE6i24dYsx6TYgtrLvRx5lOuF2M8DijZ5H8yQ1pcuCs2SA=="
},
"SemanticVersioning": {
"type": "Transitive",
"resolved": "2.0.0",
"contentHash": "gb+AtYpacsOpphUUfx4xU5BaMSho0yqSgIl1YL2tBUc1FfdzAAFkxYbmz+hlzSZAUtjWgSsIs7R7hNdMufThAQ=="
"resolved": "2.0.2",
"contentHash": "4EQgYdNZ92SyaO7YFk6olVnebF5V+jrHyMUjvPq89tLeMo8NSfgDF+6Zwq/lgh9j/0yfQp9Lkm0ZA0rUATCZFA=="
},
"System.Collections": {
"type": "Transitive",
@@ -472,7 +478,7 @@
"reactor": {
"type": "Project",
"dependencies": {
"BepInEx.IL2CPP": "6.0.0-be.521"
"BepInEx.IL2CPP": "6.0.0-be.570"
}
}
}
+65 -59
View File
@@ -4,9 +4,9 @@
".NETStandard,Version=v2.1": {
"AmongUs.GameLibs.Steam": {
"type": "Direct",
"requested": "[2021.6.30, )",
"resolved": "2021.6.30",
"contentHash": "TdlFO+S61WREk/sOV2YUmzQ6MFNXk5o+uxLv4i4ft/Z1VRkxFo66/ff3cR1ZfI8DuXni/Ao9rS4dJP+j85pEFA=="
"requested": "[2022.8.23, )",
"resolved": "2022.8.23",
"contentHash": "baY5JO6dbdOAZ0VTtGX0xre6/BlDdreJDAH8boCKZt3JTAcn+eeH+l8mUZRC9eCJOODUik2C0TTAt5AqBmYtZg=="
},
"BepInEx.AutoPlugin": {
"type": "Direct",
@@ -16,36 +16,36 @@
},
"BepInEx.IL2CPP": {
"type": "Direct",
"requested": "[6.0.0-be.521, )",
"resolved": "6.0.0-be.521",
"contentHash": "nzXG/X9u4Ane4KvzaTTon9iP2o3zBkPierrkefaq9tmmQ91FzXFtmFGkVZpD6hGqGjd+KRIn0c6my58+e0u+gw==",
"requested": "[6.0.0-be.570, )",
"resolved": "6.0.0-be.570",
"contentHash": "JGkWFFGZTWQ+YlFQ17izlwfGNUyo/zfFGNYPX6XAeTkfM5RwXiPYNMNO6eWoxbKwaYlAylQq2YCRkkCnAr9nwQ==",
"dependencies": {
"BepInEx.Core": "6.0.0-be.521",
"BepInEx.Core": "6.0.0-be.570",
"BepInEx.Il2Cpp.TlsAdapter": "1.0.1",
"HarmonyX": "2.5.7",
"Iced": "1.15.0",
"Il2CppAssemblyUnhollower.BaseLib": "0.4.19.5",
"Il2CppAssemblyUnhollower.BaseLib.Legacy": "0.4.19.5",
"Il2CppAssemblyUnhollower.Tool": "0.4.19.5",
"HarmonyX": "2.10.0",
"Iced": "1.17.0",
"Il2CppAssemblyUnhollower.BaseLib": "0.4.33.3",
"Il2CppAssemblyUnhollower.BaseLib.Legacy": "0.4.33.3",
"Il2CppAssemblyUnhollower.Lib": "0.4.33.3",
"Il2CppDumper": "6.6.4",
"MonoMod.RuntimeDetour": "21.10.10.1",
"Samboy063.Cpp2IL.Core": "2021.5.3"
"MonoMod.RuntimeDetour": "22.5.1.1",
"Samboy063.Cpp2IL.Core": "2022.0.5"
}
},
"BepInEx.IL2CPP.MSBuild": {
"type": "Direct",
"requested": "[1.0.1, )",
"resolved": "1.0.1",
"contentHash": "fOxbM3r8vBo5djUh3R4/cfzYNwIL4EyPc2P7yGIPaR+jrql1eS2IW+4oy2MGpfvbMLGeDHaYubcYS4VSc7F3jw=="
"requested": "[1.1.1, )",
"resolved": "1.1.1",
"contentHash": "uUSo4TuamyEIVg+ICNeJMSSW/arKWHGpfBFINc4fdF5kppfHFrsDURKzNPmDvxivtLsiuGthck9J/5uPXgIcTg=="
},
"BepInEx.Core": {
"type": "Transitive",
"resolved": "6.0.0-be.521",
"contentHash": "O1UmrldEd72/0//LIdop26QuWwToNP3lXURfORKZGZv1Kp5nU03jS/hXIXEgDSzxRZJt5j+ffay7x+5eedXMbg==",
"resolved": "6.0.0-be.570",
"contentHash": "kygIunLrK1HMGcRo2E/7e4ZEAA0xewuB/j5mPoMi7Xk58GUi43XnclBJHif9x05a55s0kFkfKOrpwIRmjd0cDw==",
"dependencies": {
"HarmonyX": "2.5.7",
"MonoMod.Utils": "21.10.10.1",
"SemanticVersioning": "2.0.0"
"HarmonyX": "2.10.0",
"MonoMod.Utils": "22.3.23.4",
"SemanticVersioning": "2.0.2"
}
},
"BepInEx.Il2Cpp.TlsAdapter": {
@@ -56,48 +56,43 @@
"HarmonyX": "2.3.1"
}
},
"Gee.External.Capstone": {
"type": "Transitive",
"resolved": "2.0.2",
"contentHash": "6lIJ0uCFRm67Tr/tlEXYPZSrNjwBODjhK1iPafAbZ0FVXvjpqSOY176ZnY3yA9TytyETxpgAZxT07Dnt01SPgw=="
},
"HarmonyX": {
"type": "Transitive",
"resolved": "2.5.7",
"contentHash": "BVQAIGbYKp6S6IoP4pduDFKT4ST6iO4WC/INHJDeK3y2CA1AyhNAgYuPTzap3TVfGFUwphNcDpWBTO7hMu5grw==",
"resolved": "2.10.0",
"contentHash": "4ayiy/dlCiW86K2N7Jvbf+VpI5wvP7dncv/6oRmfwRi32UCmCRzCGzsxdMfzJZkp6/26oBW+DrD8vi4UejzVAg==",
"dependencies": {
"MonoMod.RuntimeDetour": "21.10.10.1",
"MonoMod.RuntimeDetour": "22.3.23.4",
"System.Reflection.Emit": "4.7.0"
}
},
"Iced": {
"type": "Transitive",
"resolved": "1.15.0",
"contentHash": "zSMOcs5qL77q4yb4O4cCrnY3/E8TMrKiz9vDvHgpQacs97gtnj2JfU9WoagNgwdn3C07CmEVaaQMxto11Uh5yQ=="
"resolved": "1.17.0",
"contentHash": "8x+HCVTl/HHTGpscH3vMBhV8sknN/muZFw9s3TsI8SA6+c43cOTCi2+jE4KsU8pNLbJ++iF2ZFcpcXHXtDglnw=="
},
"Il2CppAssemblyUnhollower.BaseLib": {
"type": "Transitive",
"resolved": "0.4.19.5",
"contentHash": "UP0vtj0iDigQ/HZBq6+sP/btgDLc5Ibt1WkFrPvXvOtkgjt+cIdKpJmxVZHwMluUmP6Wsy3RCXeLlXE9eC/15Q==",
"resolved": "0.4.33.3",
"contentHash": "CH91M6Asz4iwennTa8cLg5wqROJY1JvnsfRetyOvs0cy8o/YAikvm8uuNgZv6UiTO/qoyy/QrBE1qSZDvs8bLw==",
"dependencies": {
"Iced": "1.15.0"
}
},
"Il2CppAssemblyUnhollower.BaseLib.Legacy": {
"type": "Transitive",
"resolved": "0.4.19.5",
"contentHash": "dxn4ADz0VlWQtSnNhVIaFzQREnSwZEvS6YaFmwuKW+wbLdHTk9D9bDbS5QkL8glKdgoW2ifpvCBgKd1QAui/1w==",
"resolved": "0.4.33.3",
"contentHash": "6yIJg8lkayBDevPwcdcV3LWTdHt8VAZVY0wQwuXH4POOo0Kzc6Cshy9kLCxH3AC6EQg0G/v+Albs6RZgwszXMQ==",
"dependencies": {
"Il2CppAssemblyUnhollower.BaseLib": "0.4.19.5"
"Il2CppAssemblyUnhollower.BaseLib": "0.4.33.3"
}
},
"Il2CppAssemblyUnhollower.Tool": {
"Il2CppAssemblyUnhollower.Lib": {
"type": "Transitive",
"resolved": "0.4.19.5",
"contentHash": "TYfW5UA77dy0a0N1XaIkZJLMyJIXdHO9q3jyuhTdsZdpuD/oi7qZt1GDlpI5dsg2nf9HKVAlIPNagtIqK9pYvw==",
"resolved": "0.4.33.3",
"contentHash": "tdu4OnMxodkWwoImNDaycaLY1L3qJOazb5UaLAt1ncRpWyu6xvKuKe5NM6OcBXONpkYsJQeQZjD6syeFl5MCQA==",
"dependencies": {
"Il2CppAssemblyUnhollower.BaseLib": "0.4.19.5",
"Il2CppAssemblyUnhollower.BaseLib.Legacy": "0.4.19.5",
"Il2CppAssemblyUnhollower.BaseLib": "0.4.33.3",
"Il2CppAssemblyUnhollower.BaseLib.Legacy": "0.4.33.3",
"Mono.Cecil": "0.11.3"
}
},
@@ -114,6 +109,11 @@
"resolved": "1.0.0",
"contentHash": "6TgS1JLSUkpmPLfXBPaAgB39ZUix8E4soXWk2XSDcscVe84i1JKzIAtA7jHbRHSkOOrcr6YA0MpLCeq98y9mYQ=="
},
"js6pak.Gee.External.Capstone": {
"type": "Transitive",
"resolved": "2.1.0",
"contentHash": "YYpq7NM50bSSVUDjXyV/eiITk6syXqItPjKBOb3jEWS6RFsk0DNhpWMPW6b3hKDmArARuWDU6S2pVu1IeVrvIA=="
},
"Microsoft.NETCore.Platforms": {
"type": "Transitive",
"resolved": "1.1.0",
@@ -131,11 +131,11 @@
},
"MonoMod.RuntimeDetour": {
"type": "Transitive",
"resolved": "21.10.10.1",
"contentHash": "cZFLf8kCTqGAznnrGfAX8tRrMrHFH8hFHtX/Cr/CFZOcHFZZICUA03Cmjs97uoquvKpV1D2YEHGhtLprPj+ZUg==",
"resolved": "22.5.1.1",
"contentHash": "WG5zLRuAr8KJEnIkKTuIG1OJCrGIT3pjvnAD43E0FDchHf3Dp985MF/8tmIQvAzCZV87JNs6QKeGGqmwDmpXpw==",
"dependencies": {
"Mono.Cecil": "0.11.4",
"MonoMod.Utils": "21.10.10.1",
"MonoMod.Utils": "22.5.1.1",
"System.Collections.NonGeneric": "4.3.0",
"System.ComponentModel.TypeConverter": "4.3.0",
"System.IO.FileSystem.Primitives": "4.3.0",
@@ -146,8 +146,8 @@
},
"MonoMod.Utils": {
"type": "Transitive",
"resolved": "21.10.10.1",
"contentHash": "y1ZION4RwtrnLYmE4SqI2Mnk9zZgwQlxUnfdwe0MJS8KWuSi9tU1h6RUZFaEUWSSiVE12Q2wba1Sv45j33+DLw==",
"resolved": "22.5.1.1",
"contentHash": "vBObO1atXxhi2C4AuC53y87Bqeogi9xIrD1Ym3YWr5uxc8Nrm8SrsFeD1i3x04R999+XQ3FdeHrbXScyWYEHqQ==",
"dependencies": {
"Mono.Cecil": "0.11.4",
"System.Collections.NonGeneric": "4.3.0",
@@ -160,31 +160,37 @@
},
"Samboy063.Cpp2IL.Core": {
"type": "Transitive",
"resolved": "2021.5.3",
"contentHash": "e7YdrON5J8Y3KYCwku6srp1/UdCYii/EHCLU1+sVnqKnoEnJh+CZXb2VHuKQ5IRJKLfDq2GDeWdEU8KxOW/7vQ==",
"resolved": "2022.0.5",
"contentHash": "5JipfyEmJWePqLLnvwzxWx9dQXxNfgN0wcZ4IcmuabWKVvk4gA5Rux4vgDh9NrWf8q9LzkizWHkrnMaG1niF7g==",
"dependencies": {
"Gee.External.Capstone": "2.0.2",
"HarmonyX": "2.5.5",
"Iced": "1.11.1",
"IndexRange": "1.0.0",
"Mono.Cecil": "0.11.4",
"Samboy063.LibCpp2IL": "2021.5.3",
"System.ValueTuple": "4.5.0"
"Samboy063.LibCpp2IL": "2022.0.5",
"System.Runtime.InteropServices": "4.3.0",
"System.ValueTuple": "4.5.0",
"js6pak.Gee.External.Capstone": "2.1.0"
}
},
"Samboy063.LibCpp2IL": {
"type": "Transitive",
"resolved": "2021.5.3",
"contentHash": "8N9PZiNqERUXQKRmjiacsC86/qxuBFHeD+P84MXtIzb7X9BkKuPp6N7YfoLv3EFrS+NFbd8gAgPBmAOAb80j+Q==",
"resolved": "2022.0.5",
"contentHash": "eH+/FBclsKDxboa9N/tFoiM8kwvietVX0FtXYxvcexSp/geYCyTt2XUGOQjinqd3Yqg/QxmpIqBO7qy4MQHrhw==",
"dependencies": {
"Iced": "1.11.1",
"IndexRange": "1.0.0"
"IndexRange": "1.0.0",
"Samboy063.WasmDisassembler": "2022.0.2"
}
},
"Samboy063.WasmDisassembler": {
"type": "Transitive",
"resolved": "2022.0.2",
"contentHash": "2uu+xBb7M3HKfBx9tAY6jiDieAf0hRnQjSmGX+7IdE6i24dYsx6TYgtrLvRx5lOuF2M8DijZ5H8yQ1pcuCs2SA=="
},
"SemanticVersioning": {
"type": "Transitive",
"resolved": "2.0.0",
"contentHash": "gb+AtYpacsOpphUUfx4xU5BaMSho0yqSgIl1YL2tBUc1FfdzAAFkxYbmz+hlzSZAUtjWgSsIs7R7hNdMufThAQ=="
"resolved": "2.0.2",
"contentHash": "4EQgYdNZ92SyaO7YFk6olVnebF5V+jrHyMUjvPq89tLeMo8NSfgDF+6Zwq/lgh9j/0yfQp9Lkm0ZA0rUATCZFA=="
},
"System.Collections": {
"type": "Transitive",
@@ -472,7 +478,7 @@
"reactor": {
"type": "Project",
"dependencies": {
"BepInEx.IL2CPP": "6.0.0-be.521"
"BepInEx.IL2CPP": "6.0.0-be.570"
}
}
}
+4 -4
View File
@@ -32,14 +32,14 @@ namespace Reactor
}
public static implicit operator StringNames(CustomStringName name) => (StringNames) name.Id;
public static explicit operator CustomStringName(StringNames name) => List.SingleOrDefault(x => x.Id == (int) name);
public static explicit operator CustomStringName?(StringNames name) => List.SingleOrDefault(x => x.Id == (int) name);
[HarmonyPatch(typeof(LanguageUnit), nameof(LanguageUnit.GetString), typeof(StringNames), typeof(string), typeof(Il2CppReferenceArray<Il2CppSystem.Object>))]
[HarmonyPatch(typeof(TranslationController), nameof(TranslationController.GetString), typeof(StringNames), typeof(Il2CppReferenceArray<Il2CppSystem.Object>))]
private static class GetStringPatch
{
public static bool Prefix(StringNames stringId, Il2CppReferenceArray<Il2CppSystem.Object> parts, ref string __result)
public static bool Prefix(StringNames id, Il2CppReferenceArray<Il2CppSystem.Object> parts, ref string __result)
{
var customStringName = (CustomStringName) stringId;
var customStringName = (CustomStringName?) id;
if (customStringName != null)
{
+43
View File
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using UnhollowerBaseLib.Attributes;
using UnityEngine;
namespace Reactor.Extensions;
[RegisterInIl2Cpp]
public class Dispatcher : MonoBehaviour
{
public Dispatcher(IntPtr ptr) : base(ptr)
{
}
public static Dispatcher Instance { get; private set; } = null!;
private static readonly Queue<Action> _queue = new();
private void Awake()
{
Instance = this;
}
private void Update()
{
lock (_queue)
{
while (_queue.Count > 0)
{
_queue.Dequeue().Invoke();
}
}
}
[HideFromIl2Cpp]
public void Enqueue(Action action)
{
lock (_queue)
{
_queue.Enqueue(action);
}
}
}
@@ -44,7 +44,6 @@ namespace Reactor.Extensions
connection.AttachReliableID(buffer, 1, ackCallback);
connection.WriteBytesToConnection(buffer, buffer.Length);
connection.Statistics.LogReliableSend(buffer.Length - 3, buffer.Length);
}
}
}
+23
View File
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace Reactor.Extensions;
public static class RandomExtensions
{
/// <summary>
/// Returns random <typeparamref name="T"/> from <paramref name="input"/> using <paramref name="random"/>
/// </summary>
public static T? Random<T>(this IEnumerable<T> input, Random random)
{
var list = input as IList<T> ?? input.ToList();
return list.Count == 0 ? default : list[random.Next(0, list.Count)];
}
/// <summary>Returns a random double that is within a specified range.</summary>
public static double NextDouble(this Random random, double minValue, double maxValue)
{
return random.NextDouble() * (maxValue - minValue) + minValue;
}
}
+4 -2
View File
@@ -18,11 +18,12 @@ namespace Reactor.Networking.MethodRpc
{
public delegate object HandleDelegate(InnerNetObject innerNetObject, object[] args);
public MethodRpc(BasePlugin plugin, MethodInfo method, uint id, SendOption option, RpcLocalHandling localHandling) : base(plugin, id)
public MethodRpc(BasePlugin plugin, MethodInfo method, uint id, SendOption option, RpcLocalHandling localHandling, bool sendImmediately) : base(plugin, id)
{
Method = method;
LocalHandling = localHandling;
SendOption = option;
SendImmediately = sendImmediately;
if (!method.IsStatic)
{
@@ -56,6 +57,7 @@ namespace Reactor.Networking.MethodRpc
public override Type InnerNetObjectType { get; }
public override RpcLocalHandling LocalHandling { get; }
public override SendOption SendOption { get; }
public bool SendImmediately { get; }
public override void UnsafeWrite(MessageWriter writer, object? data)
{
@@ -82,7 +84,7 @@ namespace Reactor.Networking.MethodRpc
public void Send(InnerNetObject innerNetObject, object[] args)
{
UnsafeSend(innerNetObject, args);
UnsafeSend(innerNetObject, args, SendImmediately);
}
private static readonly MethodInfo _sendMethod = AccessTools.Method(typeof(MethodRpc), nameof(Send));
@@ -13,6 +13,7 @@ namespace Reactor.Networking.MethodRpc
public uint Id { get; }
public SendOption Option { get; set; } = SendOption.Reliable;
public RpcLocalHandling LocalHandling { get; set; } = RpcLocalHandling.Before;
public bool SendImmediately { get; set; }
public MethodRpcAttribute(uint id)
{
@@ -34,7 +35,7 @@ namespace Reactor.Networking.MethodRpc
try
{
var customRpc = new MethodRpc(plugin, method, attribute.Id, attribute.Option, attribute.LocalHandling);
var customRpc = new MethodRpc(plugin, method, attribute.Id, attribute.Option, attribute.LocalHandling, attribute.SendImmediately);
PluginSingleton<ReactorPlugin>.Instance.CustomRpcManager.Register(customRpc);
}
catch (Exception e)
-23
View File
@@ -1,23 +0,0 @@
using HarmonyLib;
using Il2CppSystem.Security.Cryptography.X509Certificates;
namespace Reactor.Networking.Patches
{
internal static class AuthPatches
{
[HarmonyPatch(typeof(X509Certificate2Collection), nameof(X509Certificate2Collection.Contains))]
public static class AcceptCustomCertificatesPatch
{
public static bool Prefix(X509Certificate2Collection __instance, ref bool __result)
{
if (AuthManager.Instance && AuthManager.Instance.connection != null && AuthManager.Instance.connection.serverCertificates.Equals(__instance))
{
__result = true;
return false;
}
return true;
}
}
}
}
+12 -3
View File
@@ -151,14 +151,23 @@ namespace Reactor.Networking.Patches
}
}
[HarmonyPatch(typeof(AmongUsClient), nameof(AmongUsClient.GetConnectionData))]
[HarmonyPatch(typeof(InnerNetClient), nameof(InnerNetClient.GetConnectionData))]
public static class HandshakePatch
{
public static void Prefix(ref bool useDtlsLayout)
{
// Due to reasons currently unknown, the useDtlsLayout parameter sometimes doesn't reflect whether DTLS
// is actually supposed to be enabled. This causes a bad handshake message and a quick disconnect.
// The field on AmongUsClient appears to be more reliable, so override this parameter with what it is supposed to be.
Logger<ReactorPlugin>.Info($"Currently using dtls: {useDtlsLayout}. Should use dtls: {AmongUsClient.Instance.useDtls}");
useDtlsLayout = AmongUsClient.Instance.useDtls;
}
public static void Postfix(ref Il2CppStructArray<byte> __result)
{
ModList.Update();
var handshake = MessageWriter.Get(SendOption.Reliable);
var handshake = new MessageWriter(1000);
handshake.Write(__result);
@@ -167,7 +176,7 @@ namespace Reactor.Networking.Patches
ModList.Current!.Count
);
__result = handshake.ToByteArray(false);
__result = handshake.ToByteArray(true);
handshake.Recycle();
}
}
+32
View File
@@ -0,0 +1,32 @@
using HarmonyLib;
namespace Reactor.Patches
{
[HarmonyPatch]
internal static class CustomServersPatch
{
[HarmonyPatch(typeof(AuthManager._CoConnect_d__4), nameof(AuthManager._CoConnect_d__4.MoveNext))]
[HarmonyPatch(typeof(AuthManager._CoWaitForNonce_d__6), nameof(AuthManager._CoWaitForNonce_d__6.MoveNext))]
[HarmonyPrefix]
public static bool DisableAuthServerPatch(out bool __result)
{
__result = false;
return false;
}
[HarmonyPatch(typeof(AmongUsClient._CoJoinOnlinePublicGame_d__1), nameof(AmongUsClient._CoJoinOnlinePublicGame_d__1.MoveNext))]
[HarmonyPrefix]
public static void EnableUdpMatchmakingPatch(AmongUsClient._CoJoinOnlinePublicGame_d__1 __instance)
{
// Skip to state 1 which just calls CoJoinOnlineGameDirect
if (__instance.__1__state == 0 && !ServerManager.Instance.IsHttp)
{
__instance.__1__state = 1;
__instance.__8__1 = new AmongUsClient.__c__DisplayClass1_0
{
matchmakerToken = string.Empty,
};
}
}
}
}
+19 -7
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using HarmonyLib;
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
@@ -10,6 +11,15 @@ namespace Reactor.Patches
{
public static class FreeNamePatch
{
[HarmonyPatch(typeof(AccountManager), nameof(AccountManager.CheckAndRegenerateName))]
internal static class ValidateRandomNamePatch
{
public static bool Prefix()
{
return false;
}
}
public static void Initialize()
{
SceneManager.add_sceneLoaded((Action<Scene, LoadSceneMode>) ((scene, _) =>
@@ -45,14 +55,16 @@ namespace Reactor.Patches
"JoinGameButton"
};
var offset = Vector3.up;
var gameObjects = toMove.Select(x => GameObject.Find("NormalMenu/" + x)).ToList();
if (gameObjects.Contains(null!)) return false;
var yStart = Vector3.up;
var yOffset = Vector3.down * 1.5f;
gameObjects.ForEach(x => {
x.transform.position = offset;
offset += Vector3.down * 1.5f;
});
var gameObjects = toMove.Select(x => GameObject.Find("NormalMenu/" + x)).ToList();
if (gameObjects.Any(x => x == null)) return false;
for (var i = 0; i < gameObjects.Count; i++)
{
gameObjects[i].transform.position = yStart + (yOffset * i);
}
return true;
}
+56 -3
View File
@@ -1,13 +1,18 @@
using System;
using System.IO;
using System.Reflection;
using HarmonyLib;
using Reactor.Extensions;
using UnityEngine;
using Object = UnityEngine.Object;
namespace Reactor.Patches
{
internal class RegionInfoWatcher : IDisposable
{
private FileSystemWatcher Watcher { get; }
public bool Reload { get; set; }
public bool IgnoreNext { get; set; }
internal RegionInfoWatcher()
{
@@ -20,7 +25,25 @@ namespace Reactor.Patches
{
if (new FileInfo(e.Name).Length > 0)
{
Reload = true;
if (IgnoreNext)
{
IgnoreNext = false;
return;
}
Dispatcher.Instance.Enqueue(() =>
{
ServerManager.Instance.LoadServers();
Object.FindObjectOfType<RegionTextMonitor>()?.Start();
if (Object.FindObjectOfType<RegionMenu>() is { } regionMenu)
{
regionMenu.OnDisable();
regionMenu.OnEnable();
}
Logger<ReactorPlugin>.Info("Region file reloaded");
});
}
};
@@ -29,7 +52,37 @@ namespace Reactor.Patches
public void Dispose()
{
Watcher?.Dispose();
Watcher.Dispose();
}
[HarmonyPatch]
private static class WritePatch
{
public static MethodBase TargetMethod()
{
var type = Type.GetType("FileIO, Assembly-CSharp", false) ?? Type.GetType("Innersloth.IO.FileIO, Assembly-CSharp", true);
return AccessTools.Method(type, "WriteAllText");
}
public static bool Prefix(string path, string contents)
{
// Among Us' region loading code unfortunately contains a call
// to SaveServers, which will write out the region file. This
// will lead to a positive feedback loop when detecting writes,
// which is undesireable. So we check if the write makes a
// change to the file on disk and if it would write the same
// file again, stop AU from actually writing it.
if (ServerManager.Instance && path == ServerManager.Instance.serverInfoFileJson)
{
var continueWrite = !File.Exists(path) || File.ReadAllText(path) != contents;
Logger<ReactorPlugin>.Debug($"Continue serverInfoFile write? {continueWrite}");
// If we will write, ignore the next change action from the observer.
PluginSingleton<ReactorPlugin>.Instance.RegionInfoWatcher.IgnoreNext = continueWrite;
return continueWrite;
}
return true;
}
}
}
}
+3 -36
View File
@@ -7,24 +7,6 @@ using InnerNet;
namespace Reactor.Patches
{
/// <summary>
/// Fixes hardcoded ports
/// </summary>
[HarmonyPatch(typeof(InnerNetClient), nameof(InnerNetClient.SetEndpoint))]
public static class SetEndpointPatch
{
public static void Prefix(InnerNetClient __instance, ref string addr, ref ushort port)
{
var serverManager = ServerManager.Instance;
if (__instance.GameMode == GameModes.OnlineGame && serverManager.CurrentServer != null && addr == serverManager.OnlineNetAddress && port != serverManager.OnlineNetPort)
{
Logger<ReactorPlugin>.Info($"Set endpoint to {addr}:{port}");
Logger<ReactorPlugin>.Info($"Correcting port to {serverManager.OnlineNetPort}");
port = serverManager.OnlineNetPort;
}
}
}
[HarmonyPatch(typeof(InnerNetClient), nameof(InnerNetClient.Connect))]
public static class ConnectPatch
{
@@ -48,37 +30,22 @@ namespace Reactor.Patches
var servers = Dns.GetHostAddresses(__instance.Fqdn)
.Distinct()
.Where(ipAddress => ipAddress.AddressFamily == AddressFamily.InterNetwork)
.Select(ipAddress => new ServerInfo($"{__instance.Name}-{i++}", ipAddress.ToString(), __instance.Port))
.Select(ipAddress => new ServerInfo($"{__instance.Name}-{i++}", ipAddress.ToString(), __instance.Port, __instance.UseDtls))
.ToArray();
__instance.cachedServers = servers;
Logger<ReactorPlugin>.Info($"Populated {__instance.Name} ({__instance.Fqdn}:{__instance.Port}) with {servers.Length} server(s) {{{servers.Join()}}}");
Logger<ReactorPlugin>.Info($"Populated {__instance.Name} ({__instance.Fqdn}:{__instance.Port}) with {servers.Length} server(s) {{{servers.Select(x => x.ToString()).Join()}}}");
}
catch (Exception e)
{
Logger<ReactorPlugin>.Info($"Failed to populate {__instance.Name}: {e}");
__instance.cachedServers = new[]
{
new ServerInfo(__instance.Name ?? string.Empty, __instance.DefaultIp, __instance.Port),
new ServerInfo(__instance.Name ?? string.Empty, __instance.DefaultIp, __instance.Port, __instance.UseDtls),
};
}
return false;
}
}
/// <summary>
/// De-inlines AmongUsClient#SetEndpoint from JoinGameButton
/// </summary>
[HarmonyPatch(typeof(JoinGameButton), nameof(JoinGameButton.OnClick))]
public static class JoinGameButtonPatch
{
public static void Postfix(JoinGameButton __instance)
{
if (__instance.GameMode == GameModes.OnlineGame)
{
AmongUsClient.Instance.SetEndpoint(DestroyableSingleton<ServerManager>.Instance.OnlineNetAddress, DestroyableSingleton<ServerManager>.Instance.OnlineNetPort);
}
}
}
}
+33 -9
View File
@@ -1,19 +1,43 @@
using System;
using UnityEngine.SceneManagement;
using System.Reflection;
using HarmonyLib;
namespace Reactor.Patches
{
[HarmonyPatch(typeof(SplashManager), nameof(SplashManager.Start))]
internal static class SplashSkip
{
internal static void Initialize()
private static void Prefix(SplashManager __instance)
{
SceneManager.add_sceneLoaded((Action<Scene, LoadSceneMode>) ((scene, _) =>
__instance.minimumSecondsBeforeSceneChange = 0;
}
}
[HarmonyPatch(typeof(SplashManager), nameof(SplashManager.Update))]
internal static class WaitForEpicAuth
{
private static readonly PropertyInfo? _localUserIdProperty = typeof(EpicManager).GetProperty("localUserId", BindingFlags.Static | BindingFlags.Public);
private static bool _loginFinished;
private static bool Prefix(SplashManager __instance)
{
if (__instance.startedSceneLoad) return true;
if (_localUserIdProperty != null && !_loginFinished)
{
if (scene.name == "SplashIntro")
{
SceneManager.LoadScene("MainMenu");
}
}));
return false;
}
return true;
}
// EpicManager calls SaveManager.LoadPlayerPrefs(true) both on successful and unsuccessful EOS login
[HarmonyPatch(typeof(SaveManager), nameof(SaveManager.LoadPlayerPrefs))]
private static class LoadPlayerPrefsPatch
{
private static void Postfix(bool overrideLoad)
{
if (overrideLoad) _loginFinished = true;
}
}
}
}
+1 -1
View File
@@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<VersionPrefix>1.1.0</VersionPrefix>
<VersionPrefix>1.2.8</VersionPrefix>
<VersionSuffix>dev</VersionSuffix>
<Description>Core mod and API for Among Us</Description>
<Authors>NuclearPowered</Authors>
+13 -15
View File
@@ -4,6 +4,7 @@ using BepInEx;
using BepInEx.Configuration;
using BepInEx.IL2CPP;
using HarmonyLib;
using Reactor.Extensions;
using Reactor.Networking;
using Reactor.Networking.MethodRpc;
using Reactor.Networking.Serialization;
@@ -11,6 +12,7 @@ using Reactor.Patches;
using Reactor.Unstrip;
using UnhollowerBaseLib.Attributes;
using UnityEngine;
using UnityEngine.SceneManagement;
namespace Reactor
{
@@ -23,7 +25,7 @@ namespace Reactor
public ConfigEntry<bool>? AllowVanillaServers { get; private set; }
private RegionInfoWatcher RegionInfoWatcher { get; } = new RegionInfoWatcher();
internal RegionInfoWatcher RegionInfoWatcher { get; } = new RegionInfoWatcher();
public ReactorPlugin()
{
@@ -44,11 +46,19 @@ namespace Reactor
this.AddComponent<ReactorComponent>().Plugin = this;
this.AddComponent<Coroutines.Component>();
this.AddComponent<Dispatcher>();
ReactorVersionShower.Initialize();
FreeNamePatch.Initialize();
SplashSkip.Initialize();
DefaultBundle.Load();
SceneManager.add_sceneLoaded((Action<Scene, LoadSceneMode>) ((scene, _) =>
{
if (scene.name == "MainMenu")
{
ModManager.Instance.ShowModStamp();
}
}));
}
public override bool Unload()
@@ -69,23 +79,11 @@ namespace Reactor
{
}
private void Start()
{
ModManager.Instance.ShowModStamp();
}
private void Update()
{
if (Plugin!.RegionInfoWatcher.Reload)
{
Plugin.RegionInfoWatcher.Reload = false;
ServerManager.Instance.LoadServers();
Plugin.Log.LogInfo("Region file reloaded");
}
if (Input.GetKeyDown(KeyCode.F5))
{
Plugin.Log.LogInfo("Reloading all configs");
Plugin!.Log.LogInfo("Reloading all configs");
foreach (var pluginInfo in IL2CPPChainloader.Instance.Plugins.Values)
{
+1 -1
View File
@@ -43,7 +43,7 @@ namespace Reactor
try
{
ClassInjector.RegisterTypeInIl2CppWithInterfaces(type, true, interfaces);
ClassInjector.RegisterTypeInIl2Cpp(type, new RegisterTypeOptions { Interfaces = interfaces });
}
catch (Exception e)
{
+64 -58
View File
@@ -4,9 +4,9 @@
".NETStandard,Version=v2.1": {
"AmongUs.GameLibs.Steam": {
"type": "Direct",
"requested": "[2021.6.30, )",
"resolved": "2021.6.30",
"contentHash": "TdlFO+S61WREk/sOV2YUmzQ6MFNXk5o+uxLv4i4ft/Z1VRkxFo66/ff3cR1ZfI8DuXni/Ao9rS4dJP+j85pEFA=="
"requested": "[2022.8.23, )",
"resolved": "2022.8.23",
"contentHash": "baY5JO6dbdOAZ0VTtGX0xre6/BlDdreJDAH8boCKZt3JTAcn+eeH+l8mUZRC9eCJOODUik2C0TTAt5AqBmYtZg=="
},
"BepInEx.AutoPlugin": {
"type": "Direct",
@@ -16,27 +16,27 @@
},
"BepInEx.IL2CPP": {
"type": "Direct",
"requested": "[6.0.0-be.521, )",
"resolved": "6.0.0-be.521",
"contentHash": "nzXG/X9u4Ane4KvzaTTon9iP2o3zBkPierrkefaq9tmmQ91FzXFtmFGkVZpD6hGqGjd+KRIn0c6my58+e0u+gw==",
"requested": "[6.0.0-be.570, )",
"resolved": "6.0.0-be.570",
"contentHash": "JGkWFFGZTWQ+YlFQ17izlwfGNUyo/zfFGNYPX6XAeTkfM5RwXiPYNMNO6eWoxbKwaYlAylQq2YCRkkCnAr9nwQ==",
"dependencies": {
"BepInEx.Core": "6.0.0-be.521",
"BepInEx.Core": "6.0.0-be.570",
"BepInEx.Il2Cpp.TlsAdapter": "1.0.1",
"HarmonyX": "2.5.7",
"Iced": "1.15.0",
"Il2CppAssemblyUnhollower.BaseLib": "0.4.19.5",
"Il2CppAssemblyUnhollower.BaseLib.Legacy": "0.4.19.5",
"Il2CppAssemblyUnhollower.Tool": "0.4.19.5",
"HarmonyX": "2.10.0",
"Iced": "1.17.0",
"Il2CppAssemblyUnhollower.BaseLib": "0.4.33.3",
"Il2CppAssemblyUnhollower.BaseLib.Legacy": "0.4.33.3",
"Il2CppAssemblyUnhollower.Lib": "0.4.33.3",
"Il2CppDumper": "6.6.4",
"MonoMod.RuntimeDetour": "21.10.10.1",
"Samboy063.Cpp2IL.Core": "2021.5.3"
"MonoMod.RuntimeDetour": "22.5.1.1",
"Samboy063.Cpp2IL.Core": "2022.0.5"
}
},
"BepInEx.IL2CPP.MSBuild": {
"type": "Direct",
"requested": "[1.0.1, )",
"resolved": "1.0.1",
"contentHash": "fOxbM3r8vBo5djUh3R4/cfzYNwIL4EyPc2P7yGIPaR+jrql1eS2IW+4oy2MGpfvbMLGeDHaYubcYS4VSc7F3jw=="
"requested": "[1.1.1, )",
"resolved": "1.1.1",
"contentHash": "uUSo4TuamyEIVg+ICNeJMSSW/arKWHGpfBFINc4fdF5kppfHFrsDURKzNPmDvxivtLsiuGthck9J/5uPXgIcTg=="
},
"Microsoft.SourceLink.GitHub": {
"type": "Direct",
@@ -50,12 +50,12 @@
},
"BepInEx.Core": {
"type": "Transitive",
"resolved": "6.0.0-be.521",
"contentHash": "O1UmrldEd72/0//LIdop26QuWwToNP3lXURfORKZGZv1Kp5nU03jS/hXIXEgDSzxRZJt5j+ffay7x+5eedXMbg==",
"resolved": "6.0.0-be.570",
"contentHash": "kygIunLrK1HMGcRo2E/7e4ZEAA0xewuB/j5mPoMi7Xk58GUi43XnclBJHif9x05a55s0kFkfKOrpwIRmjd0cDw==",
"dependencies": {
"HarmonyX": "2.5.7",
"MonoMod.Utils": "21.10.10.1",
"SemanticVersioning": "2.0.0"
"HarmonyX": "2.10.0",
"MonoMod.Utils": "22.3.23.4",
"SemanticVersioning": "2.0.2"
}
},
"BepInEx.Il2Cpp.TlsAdapter": {
@@ -66,48 +66,43 @@
"HarmonyX": "2.3.1"
}
},
"Gee.External.Capstone": {
"type": "Transitive",
"resolved": "2.0.2",
"contentHash": "6lIJ0uCFRm67Tr/tlEXYPZSrNjwBODjhK1iPafAbZ0FVXvjpqSOY176ZnY3yA9TytyETxpgAZxT07Dnt01SPgw=="
},
"HarmonyX": {
"type": "Transitive",
"resolved": "2.5.7",
"contentHash": "BVQAIGbYKp6S6IoP4pduDFKT4ST6iO4WC/INHJDeK3y2CA1AyhNAgYuPTzap3TVfGFUwphNcDpWBTO7hMu5grw==",
"resolved": "2.10.0",
"contentHash": "4ayiy/dlCiW86K2N7Jvbf+VpI5wvP7dncv/6oRmfwRi32UCmCRzCGzsxdMfzJZkp6/26oBW+DrD8vi4UejzVAg==",
"dependencies": {
"MonoMod.RuntimeDetour": "21.10.10.1",
"MonoMod.RuntimeDetour": "22.3.23.4",
"System.Reflection.Emit": "4.7.0"
}
},
"Iced": {
"type": "Transitive",
"resolved": "1.15.0",
"contentHash": "zSMOcs5qL77q4yb4O4cCrnY3/E8TMrKiz9vDvHgpQacs97gtnj2JfU9WoagNgwdn3C07CmEVaaQMxto11Uh5yQ=="
"resolved": "1.17.0",
"contentHash": "8x+HCVTl/HHTGpscH3vMBhV8sknN/muZFw9s3TsI8SA6+c43cOTCi2+jE4KsU8pNLbJ++iF2ZFcpcXHXtDglnw=="
},
"Il2CppAssemblyUnhollower.BaseLib": {
"type": "Transitive",
"resolved": "0.4.19.5",
"contentHash": "UP0vtj0iDigQ/HZBq6+sP/btgDLc5Ibt1WkFrPvXvOtkgjt+cIdKpJmxVZHwMluUmP6Wsy3RCXeLlXE9eC/15Q==",
"resolved": "0.4.33.3",
"contentHash": "CH91M6Asz4iwennTa8cLg5wqROJY1JvnsfRetyOvs0cy8o/YAikvm8uuNgZv6UiTO/qoyy/QrBE1qSZDvs8bLw==",
"dependencies": {
"Iced": "1.15.0"
}
},
"Il2CppAssemblyUnhollower.BaseLib.Legacy": {
"type": "Transitive",
"resolved": "0.4.19.5",
"contentHash": "dxn4ADz0VlWQtSnNhVIaFzQREnSwZEvS6YaFmwuKW+wbLdHTk9D9bDbS5QkL8glKdgoW2ifpvCBgKd1QAui/1w==",
"resolved": "0.4.33.3",
"contentHash": "6yIJg8lkayBDevPwcdcV3LWTdHt8VAZVY0wQwuXH4POOo0Kzc6Cshy9kLCxH3AC6EQg0G/v+Albs6RZgwszXMQ==",
"dependencies": {
"Il2CppAssemblyUnhollower.BaseLib": "0.4.19.5"
"Il2CppAssemblyUnhollower.BaseLib": "0.4.33.3"
}
},
"Il2CppAssemblyUnhollower.Tool": {
"Il2CppAssemblyUnhollower.Lib": {
"type": "Transitive",
"resolved": "0.4.19.5",
"contentHash": "TYfW5UA77dy0a0N1XaIkZJLMyJIXdHO9q3jyuhTdsZdpuD/oi7qZt1GDlpI5dsg2nf9HKVAlIPNagtIqK9pYvw==",
"resolved": "0.4.33.3",
"contentHash": "tdu4OnMxodkWwoImNDaycaLY1L3qJOazb5UaLAt1ncRpWyu6xvKuKe5NM6OcBXONpkYsJQeQZjD6syeFl5MCQA==",
"dependencies": {
"Il2CppAssemblyUnhollower.BaseLib": "0.4.19.5",
"Il2CppAssemblyUnhollower.BaseLib.Legacy": "0.4.19.5",
"Il2CppAssemblyUnhollower.BaseLib": "0.4.33.3",
"Il2CppAssemblyUnhollower.BaseLib.Legacy": "0.4.33.3",
"Mono.Cecil": "0.11.3"
}
},
@@ -124,6 +119,11 @@
"resolved": "1.0.0",
"contentHash": "6TgS1JLSUkpmPLfXBPaAgB39ZUix8E4soXWk2XSDcscVe84i1JKzIAtA7jHbRHSkOOrcr6YA0MpLCeq98y9mYQ=="
},
"js6pak.Gee.External.Capstone": {
"type": "Transitive",
"resolved": "2.1.0",
"contentHash": "YYpq7NM50bSSVUDjXyV/eiITk6syXqItPjKBOb3jEWS6RFsk0DNhpWMPW6b3hKDmArARuWDU6S2pVu1IeVrvIA=="
},
"Microsoft.Build.Tasks.Git": {
"type": "Transitive",
"resolved": "1.1.1",
@@ -151,11 +151,11 @@
},
"MonoMod.RuntimeDetour": {
"type": "Transitive",
"resolved": "21.10.10.1",
"contentHash": "cZFLf8kCTqGAznnrGfAX8tRrMrHFH8hFHtX/Cr/CFZOcHFZZICUA03Cmjs97uoquvKpV1D2YEHGhtLprPj+ZUg==",
"resolved": "22.5.1.1",
"contentHash": "WG5zLRuAr8KJEnIkKTuIG1OJCrGIT3pjvnAD43E0FDchHf3Dp985MF/8tmIQvAzCZV87JNs6QKeGGqmwDmpXpw==",
"dependencies": {
"Mono.Cecil": "0.11.4",
"MonoMod.Utils": "21.10.10.1",
"MonoMod.Utils": "22.5.1.1",
"System.Collections.NonGeneric": "4.3.0",
"System.ComponentModel.TypeConverter": "4.3.0",
"System.IO.FileSystem.Primitives": "4.3.0",
@@ -166,8 +166,8 @@
},
"MonoMod.Utils": {
"type": "Transitive",
"resolved": "21.10.10.1",
"contentHash": "y1ZION4RwtrnLYmE4SqI2Mnk9zZgwQlxUnfdwe0MJS8KWuSi9tU1h6RUZFaEUWSSiVE12Q2wba1Sv45j33+DLw==",
"resolved": "22.5.1.1",
"contentHash": "vBObO1atXxhi2C4AuC53y87Bqeogi9xIrD1Ym3YWr5uxc8Nrm8SrsFeD1i3x04R999+XQ3FdeHrbXScyWYEHqQ==",
"dependencies": {
"Mono.Cecil": "0.11.4",
"System.Collections.NonGeneric": "4.3.0",
@@ -180,31 +180,37 @@
},
"Samboy063.Cpp2IL.Core": {
"type": "Transitive",
"resolved": "2021.5.3",
"contentHash": "e7YdrON5J8Y3KYCwku6srp1/UdCYii/EHCLU1+sVnqKnoEnJh+CZXb2VHuKQ5IRJKLfDq2GDeWdEU8KxOW/7vQ==",
"resolved": "2022.0.5",
"contentHash": "5JipfyEmJWePqLLnvwzxWx9dQXxNfgN0wcZ4IcmuabWKVvk4gA5Rux4vgDh9NrWf8q9LzkizWHkrnMaG1niF7g==",
"dependencies": {
"Gee.External.Capstone": "2.0.2",
"HarmonyX": "2.5.5",
"Iced": "1.11.1",
"IndexRange": "1.0.0",
"Mono.Cecil": "0.11.4",
"Samboy063.LibCpp2IL": "2021.5.3",
"System.ValueTuple": "4.5.0"
"Samboy063.LibCpp2IL": "2022.0.5",
"System.Runtime.InteropServices": "4.3.0",
"System.ValueTuple": "4.5.0",
"js6pak.Gee.External.Capstone": "2.1.0"
}
},
"Samboy063.LibCpp2IL": {
"type": "Transitive",
"resolved": "2021.5.3",
"contentHash": "8N9PZiNqERUXQKRmjiacsC86/qxuBFHeD+P84MXtIzb7X9BkKuPp6N7YfoLv3EFrS+NFbd8gAgPBmAOAb80j+Q==",
"resolved": "2022.0.5",
"contentHash": "eH+/FBclsKDxboa9N/tFoiM8kwvietVX0FtXYxvcexSp/geYCyTt2XUGOQjinqd3Yqg/QxmpIqBO7qy4MQHrhw==",
"dependencies": {
"Iced": "1.11.1",
"IndexRange": "1.0.0"
"IndexRange": "1.0.0",
"Samboy063.WasmDisassembler": "2022.0.2"
}
},
"Samboy063.WasmDisassembler": {
"type": "Transitive",
"resolved": "2022.0.2",
"contentHash": "2uu+xBb7M3HKfBx9tAY6jiDieAf0hRnQjSmGX+7IdE6i24dYsx6TYgtrLvRx5lOuF2M8DijZ5H8yQ1pcuCs2SA=="
},
"SemanticVersioning": {
"type": "Transitive",
"resolved": "2.0.0",
"contentHash": "gb+AtYpacsOpphUUfx4xU5BaMSho0yqSgIl1YL2tBUc1FfdzAAFkxYbmz+hlzSZAUtjWgSsIs7R7hNdMufThAQ=="
"resolved": "2.0.2",
"contentHash": "4EQgYdNZ92SyaO7YFk6olVnebF5V+jrHyMUjvPq89tLeMo8NSfgDF+6Zwq/lgh9j/0yfQp9Lkm0ZA0rUATCZFA=="
},
"System.Collections": {
"type": "Transitive",