1 Commits
Author SHA1 Message Date
js6pak 1a7755b987 Localize Reactor with fluent 2022-10-26 13:08:44 +02:00
79 changed files with 1442 additions and 2110 deletions

No files matched your search

+2 -2
View File
@@ -4,7 +4,7 @@ on: ["push", "pull_request"]
jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
@@ -23,7 +23,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x
dotnet-version: 6.x
- name: Run the Cake script
uses: cake-build/cake-action@v1
+9 -10
View File
@@ -9,15 +9,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- uses: actions/cache@v4
- uses: actions/cache@v3
with:
path: |
~/Unity/Hub/Editor
~/.config/unityhub
~/.local/share/unity3d/Unity/Unity_lic.ulf
key: unity-${{ hashFiles('./Reactor.Assets/ProjectSettings/ProjectVersion.txt') }}
key: unity-2020.3.22f1
- name: Setup Unity
uses: js6pak/setup-unity@master
@@ -26,17 +25,17 @@ jobs:
unity-modules: windows-mono android
- name: Activate Unity
env:
UNITY_USERNAME: ${{ secrets.UNITY_USERNAME }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
run: |
/opt/unityhub/UnityLicensingClient_V1/Unity.Licensing.Client --activate-ulf --username "$UNITY_USERNAME" --password "$UNITY_PASSWORD"
uses: js6pak/activate-unity@master
with:
unity-username: ${{ secrets.UNITY_USERNAME }}
unity-password: ${{ secrets.UNITY_PASSWORD }}
unity-authenticator-key: ${{ secrets.UNITY_AUTHENTICATOR_KEY }}
- name: Build
working-directory: ./Reactor.Assets
run: bash ./build.sh
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v3
with:
name: bundles
path: ./Reactor/Assets/*.bundle
+2 -2
View File
@@ -1,7 +1,7 @@
<Project>
<ItemGroup>
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.679" Private="false" ExcludeAssets="runtime;native" />
<PackageReference Include="AmongUs.GameLibs.Steam" Version="2024.6.18" PrivateAssets="all" />
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.662" Private="false" ExcludeAssets="runtime;native" />
<PackageReference Include="AmongUs.GameLibs.Steam" Version="2022.10.25" PrivateAssets="all" />
<PackageReference Include="BepInEx.AutoPlugin" Version="1.1.0" PrivateAssets="all" />
<PackageReference Include="BepInEx.IL2CPP.MSBuild" Version="2.0.1" PrivateAssets="all" ExcludeAssets="runtime" />
+2 -7
View File
@@ -8,7 +8,7 @@
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<VersionPrefix>2.2.0</VersionPrefix>
<VersionPrefix>2.0.0</VersionPrefix>
<VersionSuffix>dev</VersionSuffix>
<Authors>NuclearPowered</Authors>
@@ -16,11 +16,6 @@
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/NuclearPowered/Reactor</RepositoryUrl>
<PackageLicenseExpression>LGPL-3.0-or-later</PackageLicenseExpression>
<!-- SourceLink -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild>
</PropertyGroup>
<ItemGroup>
@@ -35,7 +30,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435" PrivateAssets="all" />
<AdditionalFiles Include="$(MSBuildThisFileDirectory)\stylecop.json" Link="stylecop.json" Visible="false" />
</ItemGroup>
<PropertyGroup>
+4 -4
View File
@@ -69,14 +69,14 @@ internal static class Build
}
}
private static string GetTargetName(BuildTarget target, bool includeArchitecture = false)
private static string GetTargetName(BuildTarget target)
{
return target switch
{
BuildTarget.StandaloneWindows => includeArchitecture ? "win-x86" : "win",
BuildTarget.StandaloneWindows64 => includeArchitecture ? "win-x64" : "win",
BuildTarget.StandaloneWindows => "win-x86",
BuildTarget.StandaloneWindows64 => "win-x64",
BuildTarget.Android => "android",
BuildTarget.StandaloneLinux64 => includeArchitecture ? "linux-x64" : "linux",
BuildTarget.StandaloneLinux64 => "linux-x64",
_ => throw new ArgumentOutOfRangeException(nameof(target), target, null),
};
}
+3 -3
View File
@@ -1,10 +1,10 @@
{
"dependencies": {
"com.unity.2d.sprite": "1.0.0",
"com.unity.ide.rider": "3.0.31",
"com.unity.ide.visualstudio": "2.0.22",
"com.unity.ide.rider": "2.0.7",
"com.unity.ide.visualstudio": "2.0.16",
"com.unity.ide.vscode": "1.2.5",
"com.unity.toolchain.linux-x86_64": "2.0.9",
"com.unity.toolchain.linux-x86_64": "2.0.2",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
+11 -11
View File
@@ -8,22 +8,22 @@
},
"com.unity.ext.nunit": {
"version": "1.0.6",
"depth": 1,
"depth": 2,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.ide.rider": {
"version": "3.0.31",
"version": "2.0.7",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ext.nunit": "1.0.6"
"com.unity.test-framework": "1.1.1"
},
"url": "https://packages.unity.com"
},
"com.unity.ide.visualstudio": {
"version": "2.0.22",
"version": "2.0.16",
"depth": 0,
"source": "registry",
"dependencies": {
@@ -39,23 +39,23 @@
"url": "https://packages.unity.com"
},
"com.unity.sysroot": {
"version": "2.0.10",
"version": "2.0.3",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.sysroot.linux-x86_64": {
"version": "2.0.9",
"version": "2.0.2",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.sysroot": "2.0.10"
"com.unity.sysroot": "2.0.3"
},
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.33",
"version": "1.1.29",
"depth": 1,
"source": "registry",
"dependencies": {
@@ -66,12 +66,12 @@
"url": "https://packages.unity.com"
},
"com.unity.toolchain.linux-x86_64": {
"version": "2.0.9",
"version": "2.0.2",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.sysroot": "2.0.10",
"com.unity.sysroot.linux-x86_64": "2.0.9"
"com.unity.sysroot": "2.0.3",
"com.unity.sysroot.linux-x86_64": "2.0.2"
},
"url": "https://packages.unity.com"
},
@@ -1,2 +1,2 @@
m_EditorVersion: 2020.3.45f1
m_EditorVersionWithRevision: 2020.3.45f1 (660cd1701bd5)
m_EditorVersion: 2020.3.22f1
m_EditorVersionWithRevision: 2020.3.22f1 (e1a7f79fd887)
+3 -3
View File
@@ -1,12 +1,12 @@
#!/bin/bash
UNITY_VERSION=2020.3.45f1
UNITY_VERSION=2020.3.22f1
if [[ ! -v UNITY_PATH ]]; then
if command -v unityhub &>/dev/null; then
echo "Trying to get unity path from unityhub..."
UNITYHUB_INSTALL_PATH=$(unityhub -- --headless install-path)
UNITYHUB_INSTALL_PATH=$(unityhub --headless install-path)
UNITY_PATH="$UNITYHUB_INSTALL_PATH/$UNITY_VERSION/Editor/Unity"
if [[ ! -f $UNITY_PATH ]]; then
@@ -22,4 +22,4 @@ fi
echo "UNITY_PATH = $UNITY_PATH"
rm Library -rf # TODO figure out why having Library cached makes invalid bundles in batchmode
"$UNITY_PATH" -batchmode -nographics -quit -logFile "-" -projectPath "$PWD" -executeMethod Build.BuildAssetBundles
$UNITY_PATH -batchmode -nographics -quit -logFile "-" -projectPath $pwd -executeMethod Build.BuildAssetBundles
+2 -2
View File
@@ -16,7 +16,7 @@ namespace Reactor.Benchmarks;
[StopOnFirstError, Config(typeof(Config))]
public class AssetBundleBenchmarks
{
private sealed class Config : ManualConfig
private class Config : ManualConfig
{
public Config()
{
@@ -41,7 +41,7 @@ public class AssetBundleBenchmarks
private AssetBundle LoadAll(AssetBundle assetBundle)
{
ArgumentNullException.ThrowIfNull(assetBundle);
if (assetBundle == null) throw new ArgumentNullException(nameof(assetBundle));
assetBundle.LoadAllAssets();
return assetBundle;
+1 -1
View File
@@ -8,7 +8,7 @@
<ItemGroup>
<ProjectReference Include="..\Reactor\Reactor.csproj" Private="false" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.10" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.2" />
</ItemGroup>
<Import Project="../AmongUs.props" />
+137 -187
View File
@@ -4,26 +4,28 @@
"net6.0": {
"AmongUs.GameLibs.Steam": {
"type": "Direct",
"requested": "[2024.6.18, )",
"resolved": "2024.6.18",
"contentHash": "xb+HP1xXn4/ES8AgXpk9xeoW568LFYw5NTjY6bHwd6vQjHDf2kT1xHMmQ1me5Vfee/Gp69YIMZDXUAUToG7Elg=="
"requested": "[2022.10.25, )",
"resolved": "2022.10.25",
"contentHash": "PWgkH/VvMlShVhZB8G432q0tnMaNVZrbIdbEMCZN/fETUlT/ch+qQj4PdTcZhPHREbnJHH3ijHxlca1d7QMBcQ=="
},
"BenchmarkDotNet": {
"type": "Direct",
"requested": "[0.13.10, )",
"resolved": "0.13.10",
"contentHash": "p/LrTtR5TlwhZIvy2hG9VzTFWEDPS90r3QP9Q9pL4/B1iXzC/JNrpYyCWW3Xeg4vuiq/qV8hvJkJmT1sj+5LSw==",
"requested": "[0.13.2, )",
"resolved": "0.13.2",
"contentHash": "82IflYxY8qnQXEA3kXtqC9pntrkJYJZbQ9PV7hEV/XcfCtOdwLz84ilyO8tLRVbiliWttvmt/v44P+visN+fPQ==",
"dependencies": {
"BenchmarkDotNet.Annotations": "0.13.10",
"CommandLineParser": "2.9.1",
"Gee.External.Capstone": "2.3.0",
"BenchmarkDotNet.Annotations": "0.13.2",
"CommandLineParser": "2.4.3",
"Iced": "1.17.0",
"Microsoft.CodeAnalysis.CSharp": "4.1.0",
"Microsoft.CodeAnalysis.CSharp": "3.0.0",
"Microsoft.Diagnostics.Runtime": "2.2.332302",
"Microsoft.Diagnostics.Tracing.TraceEvent": "3.0.2",
"Microsoft.DotNet.PlatformAbstractions": "3.1.6",
"Perfolizer": "[0.2.1]",
"System.Management": "5.0.0"
"Perfolizer": "0.2.1",
"System.Management": "6.0.0",
"System.Reflection.Emit": "4.7.0",
"System.Reflection.Emit.Lightweight": "4.7.0",
"System.Threading.Tasks.Extensions": "4.5.4"
}
},
"BepInEx.AutoPlugin": {
@@ -40,84 +42,54 @@
},
"BepInEx.Unity.IL2CPP": {
"type": "Direct",
"requested": "[6.0.0-be.679, )",
"resolved": "6.0.0-be.679",
"contentHash": "KnfMjWSXI5+dxbkLCy8VssEnZtTN3MXUHDdBkvPbMiZ6oR1RGZWdLlA90/XQkY/4kMA5P4OCZP4eQ1o0XftbSQ==",
"requested": "[6.0.0-be.662, )",
"resolved": "6.0.0-be.662",
"contentHash": "fn7jQ88IBmjssoY9XjGBTg3cULkS+N/le/eUijYf2VV8raWok/6cU/GbU9bejkJS8g+2MvzIwnROAhAxvrGI2Q==",
"dependencies": {
"BepInEx.Core": "6.0.0-be.679",
"BepInEx.Unity.Common": "6.0.0-be.679",
"HarmonyX": "2.10.1",
"Iced": "1.18.0",
"Il2CppInterop.Generator": "1.4.6-ci.389",
"Il2CppInterop.HarmonySupport": "1.4.6-ci.389",
"Il2CppInterop.Runtime": "1.4.6-ci.389",
"BepInEx.Core": "6.0.0-be.662",
"BepInEx.Unity.Common": "6.0.0-be.662",
"HarmonyX": "2.10.0",
"Iced": "1.17.0",
"Il2CppInterop.Generator": "1.3.0",
"Il2CppInterop.HarmonySupport": "1.3.0",
"Il2CppInterop.Runtime": "1.3.0",
"MonoMod.RuntimeDetour": "22.5.1.1",
"Samboy063.Cpp2IL.Core": "2022.1.0-development.866"
"Samboy063.Cpp2IL.Core": "2022.0.7.2"
}
},
"StyleCop.Analyzers": {
"type": "Direct",
"requested": "[1.2.0-beta.507, )",
"resolved": "1.2.0-beta.507",
"contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==",
"requested": "[1.2.0-beta.435, )",
"resolved": "1.2.0-beta.435",
"contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==",
"dependencies": {
"StyleCop.Analyzers.Unstable": "1.2.0.507"
}
},
"AsmResolver": {
"type": "Transitive",
"resolved": "5.1.0",
"contentHash": "7PjujQzgQ3wjzqZYT4CY8SV6zx7FY6swIwj3Yk4QLolLqo9sBPb7FLF3W30QFvCsCkNfiVWXlSbeZKs4xGgQOQ=="
},
"AsmResolver.DotNet": {
"type": "Transitive",
"resolved": "5.1.0",
"contentHash": "oKrBU94OaSrbbTwydvpLRFalYxozrNXGkl13nIkm823ZFQtPNYOiOMJb5DQLvkCJlWyis7q865tg803T5zg9IA==",
"dependencies": {
"AsmResolver.PE": "5.1.0",
"System.Text.Json": "6.0.7"
}
},
"AsmResolver.PE": {
"type": "Transitive",
"resolved": "5.1.0",
"contentHash": "XD3iAgLSInJIODKUUlpHWXf8MR9H1SFMb1lsmabb4GxxxnDQRPjMxjglv2NOCjQQuNB2Oh0bvjHE7ewf82UqyQ==",
"dependencies": {
"AsmResolver.PE.File": "5.1.0"
}
},
"AsmResolver.PE.File": {
"type": "Transitive",
"resolved": "5.1.0",
"contentHash": "YituBYe0Fh471sXQMfu+f4tWKX/JZvRwrX6g/SVsr4XkUIUzYi/aGT3/QvjHoYx19fE1KYOB6zBKqPkkOK7HPw==",
"dependencies": {
"AsmResolver": "5.1.0"
"StyleCop.Analyzers.Unstable": "1.2.0.435"
}
},
"AssetRipper.VersionUtilities": {
"type": "Transitive",
"resolved": "1.3.1",
"contentHash": "/1D18NOpqm7rS7+qVUbAReVMNWwgDuYpsnf0RkX1Aah/I0a0irqldoFJ+Kku7YdbSm0zqD+Z6iYUGKoP3GwTNQ=="
"resolved": "1.2.1",
"contentHash": "knQ/W1YwTZS2AbdaZh+nhyyBEZQPQDcahhSOnh88i+cdg4/FEoFJiCwaavgFvCMNuUeHTbcZc4qttF8WQ8xLIA=="
},
"BenchmarkDotNet.Annotations": {
"type": "Transitive",
"resolved": "0.13.10",
"contentHash": "abYKp+P5NBuam7q0w7AFgOYF3nqAvKBw6MLq96Kjk1WdaRDNpgBc6uCgOP4pVIH/g0IF9d4ubnFLBwiJuIAHMw=="
"resolved": "0.13.2",
"contentHash": "+SGOYyXT6fiagbtrni38B8BqBgjruYKU3PfROI0lDIYo8jQ+APUmLKMEswK7zwR5fEOCrDmoAHSH6oykBkqPgA=="
},
"BepInEx.Core": {
"type": "Transitive",
"resolved": "6.0.0-be.679",
"contentHash": "yg6NSGeevv86P2ERe3VDEa7W/l0lmM7m+AdPSW78dcBOe36Zc3QK/vmNEq57txGa+1kwv+macXLSwkL4UpucjA==",
"resolved": "6.0.0-be.662",
"contentHash": "VVBeCD/KQVy0/TK3V6SD8QZ/es35Xb1mEz/+PbBs3ST1yUC1r7k2JOymhSnmghVqf6UsvlMglOO9pljqhuE/Pw==",
"dependencies": {
"HarmonyX": "2.10.1",
"HarmonyX": "2.10.0",
"MonoMod.Utils": "22.5.1.1",
"SemanticVersioning": "2.0.2"
}
},
"BepInEx.Unity.Common": {
"type": "Transitive",
"resolved": "6.0.0-be.679",
"contentHash": "q4Sux3ULBDasSQAtlAWzAKpAfCyV3ujxVJpK7ydV1bUIksaHNqw9yYTLCUrw8p4DQ/wHvShECFjzeMGHi+wylA==",
"resolved": "6.0.0-be.662",
"contentHash": "BgETw6+snwY//3xjQxLiiEAFRmXaMTcSkg+1UQz6fVBG0YA5Usm/m4GflhTc3nwF61KO3Iznn1AORi5CwLJoUw==",
"dependencies": {
"AssetRipper.VersionUtilities": "1.2.1",
"MonoMod.Utils": "22.5.1.1"
@@ -125,23 +97,13 @@
},
"CommandLineParser": {
"type": "Transitive",
"resolved": "2.9.1",
"contentHash": "OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA=="
},
"Disarm": {
"type": "Transitive",
"resolved": "2022.1.0-master.26",
"contentHash": "YnZEbRGr0nG+N3G8WbRQ4Lkg8dTD3oso9iJlCVBmyhEyhLyqs+drBs1kWQbQqFPnb9mi/RJ++R9bPb+L3HF03Q=="
},
"Gee.External.Capstone": {
"type": "Transitive",
"resolved": "2.3.0",
"contentHash": "2ap/rYmjtzCOT8hxrnEW/QeiOt+paD8iRrIcdKX0cxVwWLFa1e+JDBNeECakmccXrSFeBQuu5AV8SNkipFMMMw=="
"resolved": "2.4.3",
"contentHash": "U2FC9Y8NyIxxU6MpFFdWWu1xwiqz/61v/Doou7kmVjpeIEMLWyiNNkzNlSE84kyJ0O1LKApuEj5z48Ow0Hi4OQ=="
},
"HarmonyX": {
"type": "Transitive",
"resolved": "2.10.1",
"contentHash": "9LodMC9Y0u1TW96eKJoWrFJFpmzbgojEO38/Q+e7c1mFPhmHt8xcR8qhI06iF1rf0Dnsk+hqENFVSgbtwl/bEw==",
"resolved": "2.10.0",
"contentHash": "4ayiy/dlCiW86K2N7Jvbf+VpI5wvP7dncv/6oRmfwRi32UCmCRzCGzsxdMfzJZkp6/26oBW+DrD8vi4UejzVAg==",
"dependencies": {
"MonoMod.RuntimeDetour": "22.3.23.4",
"System.Reflection.Emit": "4.7.0"
@@ -149,13 +111,13 @@
},
"Iced": {
"type": "Transitive",
"resolved": "1.18.0",
"contentHash": "G60lZOvbvqttA+SBSv/yY6/wUboXKJlkffhSNR9iOrx0M5gpcK1TRr6xrFR+qAhqIAhvrsPF1jkn9fYb4lEufQ=="
"resolved": "1.17.0",
"contentHash": "8x+HCVTl/HHTGpscH3vMBhV8sknN/muZFw9s3TsI8SA6+c43cOTCi2+jE4KsU8pNLbJ++iF2ZFcpcXHXtDglnw=="
},
"Il2CppInterop.Common": {
"type": "Transitive",
"resolved": "1.4.6-ci.389",
"contentHash": "KTyf2f66Q2mS9a6xhvoPWwD0VzRIoskPMVQehaVMo1dx4Di1FPFsKqukQ+ob6wgP5Rbnx53kiH0PY+IRSb35XA==",
"resolved": "1.3.0",
"contentHash": "IR3BrZXvL2nvJAn4pruPMgC78Y87hVa5xTYZCuHN67OzRD6WDl5dTO55vtvTl8dXFALKvlN+spja2tXhVuquOw==",
"dependencies": {
"Iced": "1.17.0",
"Microsoft.Extensions.Logging.Abstractions": "6.0.1",
@@ -164,36 +126,63 @@
},
"Il2CppInterop.Generator": {
"type": "Transitive",
"resolved": "1.4.6-ci.389",
"contentHash": "XJX4sn/RzAEBNIZZXuyDcLZrFx5tCoahujDu5aKWjApiMj/nTRQAxZn17daIIvd9aHqLaAfiWWth5QDLIt2bKw==",
"resolved": "1.3.0",
"contentHash": "FuhPxbh/K4K94U3xac/ClMaaBp+MZ4aIaqi5dR0QihyGQoombT+OM/A22RwAIzbaCTbFbvabWaAuOSgB69ZwWQ==",
"dependencies": {
"Il2CppInterop.Common": "1.4.6-ci.389",
"Il2CppInterop.Common": "1.3.0",
"Mono.Cecil": "0.11.3"
}
},
"Il2CppInterop.HarmonySupport": {
"type": "Transitive",
"resolved": "1.4.6-ci.389",
"contentHash": "Xd2zK6sLqwA0ReyUy83SWKcALwY99fq6vVL5gFOMN5Ct8OOVhtNIws0ysCWsfx1GL0RJiRYfR4pza/MmWRz4PQ==",
"resolved": "1.3.0",
"contentHash": "VppBnXtbMNGFhX8a1gg/85E883t2pW/+FZyV7eOaOXMNQyorg++u+kUFOIYwNpzTVqxWmMeoPS0DH0toVpjoKA==",
"dependencies": {
"HarmonyX": "2.10.0",
"Il2CppInterop.Runtime": "1.4.6-ci.389"
"Il2CppInterop.Runtime": "1.3.0"
}
},
"Il2CppInterop.Runtime": {
"type": "Transitive",
"resolved": "1.4.6-ci.389",
"contentHash": "nzYjuVzDG/O8+AQ8ax3WVHf+ZVsQKrVtp/yvuW8XoEPLdkbgryIrMo75dvN+tPqxOU3o2MPt9MZ9j25P5aVJMw==",
"resolved": "1.3.0",
"contentHash": "8A+N2yvja960Ap+s2RpW7Nb6HSpyuXJy2ipIlU+1erYU9SWHMyU9JZzUZGOhwWXJChKGvRmDdTZAg12k1+72dg==",
"dependencies": {
"Iced": "1.17.0",
"Il2CppInterop.Common": "1.4.6-ci.389"
"Il2CppInterop.Common": "1.3.0"
}
},
"IndexRange": {
"type": "Transitive",
"resolved": "1.0.0",
"contentHash": "6TgS1JLSUkpmPLfXBPaAgB39ZUix8E4soXWk2XSDcscVe84i1JKzIAtA7jHbRHSkOOrcr6YA0MpLCeq98y9mYQ=="
},
"js6pak.Gee.External.Capstone": {
"type": "Transitive",
"resolved": "2.1.0",
"contentHash": "YYpq7NM50bSSVUDjXyV/eiITk6syXqItPjKBOb3jEWS6RFsk0DNhpWMPW6b3hKDmArARuWDU6S2pVu1IeVrvIA=="
},
"Linguini.Bundle": {
"type": "Transitive",
"resolved": "0.3.1",
"contentHash": "k3D0IBSsS91T0G9rYACRYtAS27NDTGz4T3ygHhbhaFdA9i3cCfCpR39MqYEpoA1Ark3lzmvklHePmRCX5EQi1A==",
"dependencies": {
"Linguini.Shared": "0.3.0",
"Linguini.Syntax": "0.3.0"
}
},
"Linguini.Shared": {
"type": "Transitive",
"resolved": "0.3.0",
"contentHash": "rEYA9jWU1Nc9iDuPKar+4IVXjFbGrcNyYZCeU6hiWQoS4nA2UecHu36Rp4bxzasvRGda4FB2JZqty75m4e26VQ=="
},
"Linguini.Syntax": {
"type": "Transitive",
"resolved": "0.3.0",
"contentHash": "v8YV3xPFZfP+OSWjMd6yysp+o7cNnQXxq/slN8Yekoi+dFjsTNF0YiQWJIwg1j2FUbs6claJxY9R1FFlc4s6MA==",
"dependencies": {
"Linguini.Shared": "0.3.0"
}
},
"Microsoft.Bcl.AsyncInterfaces": {
"type": "Transitive",
"resolved": "1.1.0",
@@ -201,29 +190,29 @@
},
"Microsoft.CodeAnalysis.Analyzers": {
"type": "Transitive",
"resolved": "3.3.3",
"contentHash": "j/rOZtLMVJjrfLRlAMckJLPW/1rze9MT1yfWqSIbUPGRu1m1P0fuo9PmqapwsmePfGB5PJrudQLvmUOAMF0DqQ=="
"resolved": "2.6.2-beta2",
"contentHash": "rg5Ql73AmGCMG5Q40Kzbndq7C7S4XvsJA+2QXfZBCy2dRqD+a7BSbx/3942EoRUJ/8Wh9+kLg2G2qC46o3f1Aw=="
},
"Microsoft.CodeAnalysis.Common": {
"type": "Transitive",
"resolved": "4.1.0",
"contentHash": "bNzTyxP3iD5FPFHfVDl15Y6/wSoI7e3MeV0lOaj9igbIKTjgrmuw6LoVJ06jUNFA7+KaDC/OIsStWl/FQJz6sQ==",
"resolved": "3.0.0",
"contentHash": "HEnLZ9Op5IoXeuokhfSLIXstXfEyPzXhQ/xsnvUmxzb+7YpwuLk57txArzGs/Wne5bWmU7Uey4Q1jUZ3++heqg==",
"dependencies": {
"Microsoft.CodeAnalysis.Analyzers": "3.3.3",
"System.Collections.Immutable": "5.0.0",
"System.Memory": "4.5.4",
"System.Reflection.Metadata": "5.0.0",
"System.Runtime.CompilerServices.Unsafe": "5.0.0",
"System.Text.Encoding.CodePages": "4.5.1",
"System.Threading.Tasks.Extensions": "4.5.4"
"Microsoft.CodeAnalysis.Analyzers": "2.6.2-beta2",
"System.Collections.Immutable": "1.5.0",
"System.Memory": "4.5.1",
"System.Reflection.Metadata": "1.6.0",
"System.Runtime.CompilerServices.Unsafe": "4.5.0",
"System.Text.Encoding.CodePages": "4.5.0",
"System.Threading.Tasks.Extensions": "4.5.0"
}
},
"Microsoft.CodeAnalysis.CSharp": {
"type": "Transitive",
"resolved": "4.1.0",
"contentHash": "sbu6kDGzo9bfQxuqWpeEE7I9P30bSuZEnpDz9/qz20OU6pm79Z63+/BsAzO2e/R/Q97kBrpj647wokZnEVr97w==",
"resolved": "3.0.0",
"contentHash": "hWFUxc0iUbVvIKWJODErOeOa5GiqZuEcetxaCfHqZ04zHy0ZCLx3v4/TdF/6Erx1mXPHfoT2Tiz5rZCQZ6OyxQ==",
"dependencies": {
"Microsoft.CodeAnalysis.Common": "[4.1.0]"
"Microsoft.CodeAnalysis.Common": "[3.0.0]"
}
},
"Microsoft.Diagnostics.NETCore.Client": {
@@ -323,23 +312,14 @@
},
"Microsoft.NETCore.Platforms": {
"type": "Transitive",
"resolved": "5.0.0",
"contentHash": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ=="
"resolved": "2.0.0",
"contentHash": "VdLJOCXhZaEMY7Hm2GKiULmn7IEPFE4XC5LPSfBVCUIA8YLZVh846gtfBJalsPQF2PlzdD7ecX7DZEulJ402ZQ=="
},
"Microsoft.NETCore.Targets": {
"type": "Transitive",
"resolved": "1.1.0",
"contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg=="
},
"Microsoft.Win32.Registry": {
"type": "Transitive",
"resolved": "5.0.0",
"contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==",
"dependencies": {
"System.Security.AccessControl": "5.0.0",
"System.Security.Principal.Windows": "5.0.0"
}
},
"Mono.Cecil": {
"type": "Transitive",
"resolved": "0.11.4",
@@ -482,50 +462,47 @@
},
"Samboy063.Cpp2IL.Core": {
"type": "Transitive",
"resolved": "2022.1.0-development.866",
"contentHash": "QPMuix/3jRngWBdNSLhAbm9BHYf95Ln1Ph1eCK/cDZdVibxFDFP3a6Yczyx1p7GbN7bRQwrhs2skPJSS/z3m2w==",
"resolved": "2022.0.7.2",
"contentHash": "e17CAhKSxdAp7vFcYEVxjSc7t7rcvVGBipGhgE9tAjRXY85wZXLlHEVO0AEvMRkLmf9U+if4wK/nZEC1AX6VqQ==",
"dependencies": {
"AsmResolver.DotNet": "5.1.0",
"Disarm": "2022.1.0-master.26",
"Iced": "1.18.0",
"Samboy063.LibCpp2IL": "2022.1.0-development.866",
"StableNameDotNet": "0.1.0-development.866",
"HarmonyX": "2.5.5",
"Iced": "1.11.1",
"IndexRange": "1.0.0",
"Mono.Cecil": "0.11.4",
"Samboy063.LibCpp2IL": "2022.0.7.2",
"System.Runtime.InteropServices": "4.3.0",
"System.ValueTuple": "4.5.0",
"js6pak.Gee.External.Capstone": "2.1.0"
}
},
"Samboy063.LibCpp2IL": {
"type": "Transitive",
"resolved": "2022.1.0-development.866",
"contentHash": "EcJSWTfQko8SQozozoUT+aQJVWC8wj8C0YUiPBF4rNRId19yTKp2IXcXnI747v+8/aal222QR6WHfoBK2WlVLg==",
"resolved": "2022.0.7.2",
"contentHash": "DpVeU0dQkUJCpbw0f1xKOG8vimdK2oYhrVABC7HDE3/ikGjhnMZd3i5b1joKDHZ+AiL90TWOaEXPcy24rCZ0dA==",
"dependencies": {
"AssetRipper.VersionUtilities": "1.3.1",
"Samboy063.WasmDisassembler": "2022.1.0-development.866"
"IndexRange": "1.0.0",
"Samboy063.WasmDisassembler": "2022.0.2"
}
},
"Samboy063.WasmDisassembler": {
"type": "Transitive",
"resolved": "2022.1.0-development.866",
"contentHash": "2QK8F3eISkLcoW/Nt7wtxyQh31EXAqEMBVXXjEnuxyvXpBXxOIGpjmE3pWhGwxQwDCbe4zBsLF1zUiqq3/pXRA=="
"resolved": "2022.0.2",
"contentHash": "2uu+xBb7M3HKfBx9tAY6jiDieAf0hRnQjSmGX+7IdE6i24dYsx6TYgtrLvRx5lOuF2M8DijZ5H8yQ1pcuCs2SA=="
},
"SemanticVersioning": {
"type": "Transitive",
"resolved": "2.0.2",
"contentHash": "4EQgYdNZ92SyaO7YFk6olVnebF5V+jrHyMUjvPq89tLeMo8NSfgDF+6Zwq/lgh9j/0yfQp9Lkm0ZA0rUATCZFA=="
},
"StableNameDotNet": {
"type": "Transitive",
"resolved": "0.1.0-development.866",
"contentHash": "DJb8x4dV3ucDgM12sU28HxCdeqY/JudJbeJG6mgXWDJzpFZw2Jd7JF1pKFRNLzh/0gpo8bCGLQS9gOWZmBjdtg=="
},
"StyleCop.Analyzers.Unstable": {
"type": "Transitive",
"resolved": "1.2.0.507",
"contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw=="
"resolved": "1.2.0.435",
"contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg=="
},
"System.CodeDom": {
"type": "Transitive",
"resolved": "5.0.0",
"contentHash": "JPJArwA1kdj8qDAkY2XGjSWoYnqiM7q/3yRNkt6n28Mnn95MuEGkZXUbPBf7qc3IjwrGY5ttQon7yqHZyQJmOQ=="
"resolved": "6.0.0",
"contentHash": "CPc6tWO1LAer3IzfZufDBRL+UZQcj5uS207NHALQzP84Vp/z6wF0Aa0YZImOQY8iStY0A2zI/e3ihKNPfUm8XA=="
},
"System.Collections": {
"type": "Transitive",
@@ -741,18 +718,16 @@
},
"System.Management": {
"type": "Transitive",
"resolved": "5.0.0",
"contentHash": "MF1CHaRcC+MLFdnDthv4/bKWBZnlnSpkGqa87pKukQefgEdwtb9zFW6zs0GjPp73qtpYYg4q6PEKbzJbxCpKfw==",
"resolved": "6.0.0",
"contentHash": "sHsESYMmPDhQuOC66h6AEOs/XowzKsbT9srMbX71TCXP58hkpn1BqBjdmKj1+DCA/WlBETX1K5WjQHwmV0Txrg==",
"dependencies": {
"Microsoft.NETCore.Platforms": "5.0.0",
"Microsoft.Win32.Registry": "5.0.0",
"System.CodeDom": "5.0.0"
"System.CodeDom": "6.0.0"
}
},
"System.Memory": {
"type": "Transitive",
"resolved": "4.5.4",
"contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw=="
"resolved": "4.5.3",
"contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA=="
},
"System.Net.Http": {
"type": "Transitive",
@@ -838,8 +813,8 @@
},
"System.Reflection.Metadata": {
"type": "Transitive",
"resolved": "5.0.0",
"contentHash": "5NecZgXktdGg34rh1OenY1rFNDCI8xSjFr+Z4OU4cU06AQHUdRnIIEeWENu3Wl4YowbzkymAIMvi3WyK9U53pQ=="
"resolved": "1.6.0",
"contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ=="
},
"System.Reflection.Primitives": {
"type": "Transitive",
@@ -879,8 +854,8 @@
},
"System.Runtime.CompilerServices.Unsafe": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg=="
"resolved": "5.0.0",
"contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA=="
},
"System.Runtime.Extensions": {
"type": "Transitive",
@@ -926,15 +901,6 @@
"System.Runtime.Extensions": "4.3.0"
}
},
"System.Security.AccessControl": {
"type": "Transitive",
"resolved": "5.0.0",
"contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==",
"dependencies": {
"Microsoft.NETCore.Platforms": "5.0.0",
"System.Security.Principal.Windows": "5.0.0"
}
},
"System.Security.Cryptography.Algorithms": {
"type": "Transitive",
"resolved": "4.3.0",
@@ -1079,11 +1045,6 @@
"runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0"
}
},
"System.Security.Principal.Windows": {
"type": "Transitive",
"resolved": "5.0.0",
"contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA=="
},
"System.Text.Encoding": {
"type": "Transitive",
"resolved": "4.3.0",
@@ -1096,28 +1057,11 @@
},
"System.Text.Encoding.CodePages": {
"type": "Transitive",
"resolved": "4.5.1",
"contentHash": "4J2JQXbftjPMppIHJ7IC+VXQ9XfEagN92vZZNoG12i+zReYlim5dMoXFC1Zzg7tsnKDM7JPo5bYfFK4Jheq44w==",
"resolved": "4.5.0",
"contentHash": "S0wEUiKcLvRlkFUXca8uio1UQ5bYQzYgOmOKtCqaBQC3GR9AJjh43otcM32IGsAyvadFTaAMw9Irm6dS4Evfng==",
"dependencies": {
"Microsoft.NETCore.Platforms": "2.1.2",
"System.Runtime.CompilerServices.Unsafe": "4.5.2"
}
},
"System.Text.Encodings.Web": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "Vg8eB5Tawm1IFqj4TVK1czJX89rhFxJo9ELqc/Eiq0eXy13RK00eubyU6TJE6y+GQXjyV5gSfiewDUZjQgSE0w==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
},
"System.Text.Json": {
"type": "Transitive",
"resolved": "6.0.7",
"contentHash": "/Tf/9XjprpHolbcDOrxsKVYy/mUG/FS7aGd9YUgBVEiHeQH4kAE0T1sMbde7q6B5xcrNUsJ5iW7D1RvHudQNqA==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0",
"System.Text.Encodings.Web": "6.0.0"
"Microsoft.NETCore.Platforms": "2.0.0",
"System.Runtime.CompilerServices.Unsafe": "4.5.0"
}
},
"System.Threading": {
@@ -1144,10 +1088,16 @@
"resolved": "4.5.4",
"contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg=="
},
"System.ValueTuple": {
"type": "Transitive",
"resolved": "4.5.0",
"contentHash": "okurQJO6NRE/apDIP23ajJ0hpiNmJ+f0BwOlB/cSqTLQlw5upkf+5+96+iG2Jw40G1fCVCyPz/FhIABUjMR+RQ=="
},
"reactor": {
"type": "Project",
"dependencies": {
"BepInEx.Unity.IL2CPP": "[6.0.0-be.679, )"
"BepInEx.Unity.IL2CPP": "[6.0.0-be.662, )",
"Linguini.Bundle": "[0.3.1, )"
}
}
}
@@ -1,82 +0,0 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.IO.Pipes;
using InnerNet;
using Reactor.Debugger.AutoJoin.Messages;
using Reactor.Utilities;
namespace Reactor.Debugger.AutoJoin;
internal sealed class AutoJoinClientConnection : AutoJoinConnection
{
public const string PipeName = "Reactor.Debugger.AutoJoin";
private AutoJoinClientConnection(NamedPipeClientStream pipe) : base(pipe)
{
}
protected override void Handle(BinaryReader reader, MessageType messageType)
{
switch (messageType)
{
case MessageType.JoinGame:
{
Handle(JoinGameMessage.Deserialize(reader));
break;
}
default:
{
throw new ArgumentOutOfRangeException(nameof(messageType), messageType, null);
}
}
}
private static void Handle(in JoinGameMessage message)
{
var (address, port, gameCode) = message;
Dispatcher.Instance.Enqueue(() =>
{
var gameCodeText = gameCode == InnerNetServer.LocalGameId ? "<local>" : GameCode.IntToGameName(gameCode);
Info($"Joining {gameCodeText} on {address}:{port}");
if (gameCode == InnerNetServer.LocalGameId)
{
AmongUsClient.Instance.NetworkMode = NetworkModes.LocalGame;
AmongUsClient.Instance.GameId = gameCode;
AmongUsClient.Instance.StartCoroutine(AmongUsClient.Instance.CoConnectToGameServer(MatchMakerModes.Client, address, port, null));
}
else
{
AmongUsClient.Instance.StartCoroutine(AmongUsClient.Instance.CoJoinOnlineGameDirect(gameCode, address, port, null));
}
});
}
public void SendRequestJoin()
{
Write(default(RequestJoinGameMessage));
}
public static bool TryConnect([NotNullWhen(true)] out AutoJoinClientConnection? client)
{
var pipeClient = new NamedPipeClientStream(".", PipeName, PipeDirection.InOut, PipeOptions.Asynchronous);
try
{
pipeClient.Connect(100);
client = new AutoJoinClientConnection(pipeClient);
return true;
}
catch (TimeoutException)
{
pipeClient.Dispose();
client = null;
return false;
}
}
}
@@ -1,61 +0,0 @@
using System;
using System.IO;
using System.IO.Pipes;
using System.Threading.Tasks;
using Reactor.Debugger.AutoJoin.Messages;
namespace Reactor.Debugger.AutoJoin;
internal abstract class AutoJoinConnection : IDisposable
{
private readonly BinaryWriter _writer;
protected AutoJoinConnection(PipeStream pipe)
{
_writer = new BinaryWriter(pipe);
Task.Run(() =>
{
try
{
var reader = new BinaryReader(pipe);
while (pipe.IsConnected)
{
try
{
var messageType = (MessageType) reader.ReadByte();
Debug($"Received {messageType}");
Handle(reader, messageType);
}
catch (EndOfStreamException)
{
break;
}
}
pipe.Dispose();
Disconnected?.Invoke();
}
catch (Exception e)
{
Error(e);
}
});
}
public event Action? Disconnected;
protected abstract void Handle(BinaryReader reader, MessageType messageType);
public void Write<T>(in T message) where T : IMessage<T>
{
Debug($"Writing {message}");
_writer.Write(message);
}
public void Dispose()
{
_writer.Dispose();
}
}
@@ -1,113 +0,0 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO.Pipes;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using InnerNet;
using Reactor.Debugger.AutoJoin.Messages;
namespace Reactor.Debugger.AutoJoin;
internal sealed class AutoJoinConnectionListener : IDisposable
{
private readonly CancellationTokenSource _cancellationTokenSource = new();
private readonly Mutex _mutex;
private AutoJoinConnectionListener(Mutex mutex)
{
_mutex = mutex;
Task.Run(async () =>
{
while (!_cancellationTokenSource.IsCancellationRequested)
{
try
{
Info("Listening for connections");
var pipeServer = new NamedPipeServerStream(
AutoJoinClientConnection.PipeName,
PipeDirection.InOut,
NamedPipeServerStream.MaxAllowedServerInstances,
PipeTransmissionMode.Byte,
PipeOptions.Asynchronous
);
try
{
await pipeServer.WaitForConnectionAsync(_cancellationTokenSource.Token);
}
catch (OperationCanceledException)
{
pipeServer.Dispose();
break;
}
Info("Client connected");
var client = new AutoJoinServerConnection(pipeServer);
Clients.Add(client);
client.Disconnected += () =>
{
Clients.Remove(client);
client.Dispose();
};
}
catch (Exception e)
{
Error(e);
}
}
Info("Stopped");
Stopped?.Invoke();
});
}
public event Action? Stopped;
public List<AutoJoinServerConnection> Clients { get; } = new();
public void Dispose()
{
_cancellationTokenSource.Cancel();
_cancellationTokenSource.Dispose();
foreach (var client in Clients)
{
client.Dispose();
}
Clients.Clear();
_mutex.Dispose();
}
public void SendJoinMe(InnerNetClient innerNetClient)
{
var joinGameMessage = JoinGameMessage.From(innerNetClient);
foreach (var client in Clients)
{
client.Write(joinGameMessage);
}
}
public static bool TryStart([NotNullWhen(true)] out AutoJoinConnectionListener? connectionListener)
{
var mutex = new Mutex(false, $@"Global\{AutoJoinClientConnection.PipeName}");
if (mutex.WaitOne(100))
{
connectionListener = new AutoJoinConnectionListener(mutex);
return true;
}
mutex.Dispose();
connectionListener = null;
return false;
}
}
@@ -1,66 +0,0 @@
using HarmonyLib;
using InnerNet;
namespace Reactor.Debugger.AutoJoin;
internal static class AutoJoinConnectionManager
{
public static AutoJoinConnectionListener? Server { get; set; }
public static AutoJoinClientConnection? Client { get; set; }
public static void StartOrConnect()
{
if (AutoJoinConnectionListener.TryStart(out var connectionListener))
{
Info("Started an AutoJoin session");
Server = connectionListener;
Server.Stopped += () =>
{
if (Server == connectionListener)
{
Server = null;
}
};
}
else if (AutoJoinClientConnection.TryConnect(out var client))
{
Info("Connected to an AutoJoin session");
Client = client;
client.Disconnected += () =>
{
if (Client == client)
{
Client = null;
Info("Disconnected from an AutoJoin session, trying to reconnect");
StartOrConnect();
}
};
}
else
{
Error("Failed to start or connect to an AutoJoin session");
}
}
[HarmonyPatch(typeof(InnerNetClient), nameof(InnerNetClient.Start))]
public static class ConnectPatch
{
public static void Postfix(InnerNetClient __instance)
{
if (!DebuggerConfig.JoinGameOnStart.Value) return;
if (__instance.TryCast<AmongUsClient>() is { } amongUsClient)
{
if (Server != null)
{
amongUsClient.StartCoroutine(amongUsClient.CoCreateOnlineGame());
}
else if (Client is { } client)
{
client.SendRequestJoin();
}
}
}
}
}
@@ -1,38 +0,0 @@
using System;
using System.IO;
using System.IO.Pipes;
using Reactor.Debugger.AutoJoin.Messages;
namespace Reactor.Debugger.AutoJoin;
internal sealed class AutoJoinServerConnection : AutoJoinConnection
{
public AutoJoinServerConnection(NamedPipeServerStream pipe) : base(pipe)
{
}
protected override void Handle(BinaryReader reader, MessageType messageType)
{
switch (messageType)
{
case MessageType.RequestJoinGame:
{
Handle(RequestJoinGameMessage.Deserialize(reader));
break;
}
default:
{
throw new ArgumentOutOfRangeException(nameof(messageType), messageType, null);
}
}
}
private void Handle(in RequestJoinGameMessage message)
{
if (AmongUsClient.Instance.AmConnected)
{
Write(JoinGameMessage.From(AmongUsClient.Instance));
}
}
}
@@ -1,12 +0,0 @@
using System.IO;
namespace Reactor.Debugger.AutoJoin.Messages;
internal static class Extensions
{
public static void Write<T>(this BinaryWriter writer, in T message) where T : IMessage<T>
{
writer.Write((byte) T.Type);
message.Serialize(writer);
}
}
@@ -1,15 +0,0 @@
#pragma warning disable CA2252 // TODO Remove after BepInEx updates the .NET version
using System.IO;
namespace Reactor.Debugger.AutoJoin.Messages;
internal interface IMessage<TSelf> where TSelf : IMessage<TSelf>
{
static abstract MessageType Type { get; }
void Serialize(BinaryWriter writer);
static abstract TSelf Deserialize(BinaryReader reader);
string ToString();
}
@@ -1,40 +0,0 @@
using System.IO;
using InnerNet;
namespace Reactor.Debugger.AutoJoin.Messages;
internal readonly record struct JoinGameMessage(
string Address,
ushort Port,
int GameCode
) : IMessage<JoinGameMessage>
{
public static MessageType Type => MessageType.JoinGame;
public void Serialize(BinaryWriter writer)
{
writer.Write(Address);
writer.Write(Port);
writer.Write(GameCode);
}
public static JoinGameMessage Deserialize(BinaryReader reader)
{
return new JoinGameMessage
{
Address = reader.ReadString(),
Port = reader.ReadUInt16(),
GameCode = reader.ReadInt32(),
};
}
public static JoinGameMessage From(InnerNetClient innerNetClient)
{
return new JoinGameMessage
{
Address = innerNetClient.networkAddress,
Port = (ushort) innerNetClient.networkPort,
GameCode = innerNetClient.GameId,
};
}
}
@@ -1,7 +0,0 @@
namespace Reactor.Debugger.AutoJoin.Messages;
internal enum MessageType : byte
{
JoinGame,
RequestJoinGame,
}
@@ -1,17 +0,0 @@
using System.IO;
namespace Reactor.Debugger.AutoJoin.Messages;
internal readonly record struct RequestJoinGameMessage : IMessage<RequestJoinGameMessage>
{
public static MessageType Type => MessageType.RequestJoinGame;
public void Serialize(BinaryWriter writer)
{
}
public static RequestJoinGameMessage Deserialize(BinaryReader reader)
{
return default;
}
}
-26
View File
@@ -1,26 +0,0 @@
using BepInEx.Configuration;
namespace Reactor.Debugger;
internal static class DebuggerConfig
{
public const string FeaturesSection = "Features";
public const string AutoJoinSection = "AutoJoin";
public static ConfigEntry<bool> DisableGameEnd { get; private set; } = null!;
public static ConfigEntry<bool> RedirectLogger { get; private set; } = null!;
public static ConfigEntry<bool> AutoPlayAgain { get; private set; } = null!;
public static ConfigEntry<bool> DisableTimeout { get; private set; } = null!;
public static ConfigEntry<bool> JoinGameOnStart { get; private set; } = null!;
public static void Bind(ConfigFile config)
{
DisableGameEnd = config.Bind(FeaturesSection, nameof(DisableGameEnd), false, "Stops the game from ending regardless of conditions");
RedirectLogger = config.Bind(FeaturesSection, nameof(RedirectLogger), false, "Redirect base game Logger calls into BepInEx logging");
AutoPlayAgain = config.Bind(FeaturesSection, nameof(AutoPlayAgain), true, "Automatically calls Play Again after game ends");
DisableTimeout = config.Bind(FeaturesSection, nameof(DisableTimeout), false, "Disable the network disconnection timeout");
JoinGameOnStart = config.Bind(AutoJoinSection, nameof(JoinGameOnStart), false, "Automatically hosts/joins a game on start");
}
}
+97 -9
View File
@@ -1,10 +1,15 @@
global using static Reactor.Utilities.Logger<Reactor.Debugger.DebuggerPlugin>;
using System;
using System.Linq;
using AmongUs.Data;
using BepInEx;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Reactor.Debugger.AutoJoin;
using Reactor.Debugger.Patches;
using Reactor.Debugger.Window;
using Il2CppInterop.Runtime.Attributes;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using InnerNet;
using Reactor.Utilities.Attributes;
using Reactor.Utilities.ImGui;
using UnityEngine;
namespace Reactor.Debugger;
@@ -14,17 +19,100 @@ namespace Reactor.Debugger;
public partial class DebuggerPlugin : BasePlugin
{
public Harmony Harmony { get; } = new(Id);
public DebuggerComponent Component { get; private set; } = null!;
public override void Load()
{
DebuggerConfig.Bind(Config);
Component = this.AddComponent<DebuggerComponent>();
this.AddComponent<DebuggerWindow>();
GameOptionsPatches.Initialize();
GameOptionsData.MaxImpostors = GameOptionsData.RecommendedImpostors = Enumerable.Repeat((int) byte.MaxValue, byte.MaxValue).ToArray();
GameOptionsData.MinPlayers = Enumerable.Repeat(1, 4).ToArray();
Harmony.PatchAll();
}
AutoJoinConnectionManager.StartOrConnect();
[RegisterInIl2Cpp]
public class DebuggerComponent : MonoBehaviour
{
[HideFromIl2Cpp]
public bool DisableGameEnd { get; set; }
[HideFromIl2Cpp]
public DragWindow TestWindow { get; }
public DebuggerComponent(IntPtr ptr) : base(ptr)
{
TestWindow = new DragWindow(new Rect(20, 20, 0, 0), "Debugger", () =>
{
GUILayout.Label("Name: " + DataManager.Player.Customization.Name);
DisableGameEnd = GUILayout.Toggle(DisableGameEnd, "Disable game end");
if (ShipStatus.Instance && AmongUsClient.Instance.AmHost)
{
if (GUILayout.Button("Force game end"))
{
ShipStatus.Instance.enabled = false;
ShipStatus.RpcEndGame(GameOverReason.ImpostorDisconnect, false);
}
if (GUILayout.Button("Call a meeting"))
{
PlayerControl.LocalPlayer.CmdReportDeadBody(null);
}
}
if (TutorialManager.InstanceExists && PlayerControl.LocalPlayer)
{
var data = PlayerControl.LocalPlayer.Data;
var newIsImpostor = GUILayout.Toggle(data.Role.IsImpostor, "Is Impostor");
if (data.Role.IsImpostor != newIsImpostor)
{
PlayerControl.LocalPlayer.RpcSetRole(newIsImpostor ? RoleTypes.Impostor : RoleTypes.Crewmate);
}
if (GUILayout.Button("Spawn a dummy"))
{
var playerControl = Instantiate(TutorialManager.Instance.PlayerPrefab);
var i = playerControl.PlayerId = (byte) GameData.Instance.GetAvailableId();
GameData.Instance.AddPlayer(playerControl);
AmongUsClient.Instance.Spawn(playerControl, -2, SpawnFlags.None);
playerControl.transform.position = PlayerControl.LocalPlayer.transform.position;
playerControl.GetComponent<DummyBehaviour>().enabled = true;
playerControl.NetTransform.enabled = false;
playerControl.SetName($"{TranslationController.Instance.GetString(StringNames.Dummy, Array.Empty<Il2CppSystem.Object>())} {i}");
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));
}
}
if (PlayerControl.LocalPlayer)
{
var position = PlayerControl.LocalPlayer.transform.position;
GUILayout.Label($"x: {position.x}");
GUILayout.Label($"y: {position.y}");
}
})
{
Enabled = false,
};
}
private void Update()
{
if (Input.GetKeyDown(KeyCode.F1))
{
TestWindow.Enabled = !TestWindow.Enabled;
}
}
private void OnGUI()
{
TestWindow.OnGUI();
}
}
}
+70
View File
@@ -0,0 +1,70 @@
using System.Linq;
using HarmonyLib;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Reactor.Utilities;
using UnityEngine;
namespace Reactor.Debugger;
internal static class Patches
{
[HarmonyPatch(typeof(GameStartManager), nameof(GameStartManager.Update))]
public static class UpdatePatch
{
public static void Prefix(GameStartManager __instance)
{
__instance.MinPlayers = 1;
}
}
[HarmonyPatch(typeof(GameStartManager), nameof(GameStartManager.Update))]
public static class CountdownPatch
{
public static void Prefix(GameStartManager __instance)
{
__instance.countDownTimer = 0;
}
}
[HarmonyPatch(typeof(StatsManager), nameof(StatsManager.AmBanned), MethodType.Getter)]
public static class AmBannedPatch
{
public static void Postfix(out bool __result)
{
__result = false;
}
}
[HarmonyPatch(typeof(ShipStatus), nameof(ShipStatus.CheckEndCriteria))]
[HarmonyPriority(Priority.First)]
public static class CheckEndCriteriaPatch
{
public static bool Prefix()
{
return !PluginSingleton<DebuggerPlugin>.Instance.Component.DisableGameEnd;
}
}
[HarmonyPatch(typeof(GameSettingMenu), nameof(GameSettingMenu.Start))]
public static class GameSettingMenuPatch
{
public static void Prefix(GameSettingMenu __instance)
{
// Unlocks map/impostor amount changing in online (for testing on your custom servers)
__instance.HideForOnline = new Il2CppReferenceArray<Transform>(0);
}
}
[HarmonyPatch(typeof(GameOptionsMenu), nameof(GameOptionsMenu.Start))]
[HarmonyPriority(Priority.First)]
public static class GameOptionsMenuPatch
{
public static void Postfix(GameOptionsMenu __instance)
{
__instance.Children
.Single(o => o.Title == StringNames.GameNumImpostors)
.Cast<NumberOption>()
.ValidRange = new FloatRange(0, byte.MaxValue);
}
}
}
@@ -1,14 +0,0 @@
using HarmonyLib;
namespace Reactor.Debugger.Patches;
[HarmonyPatch(typeof(EndGameNavigation), nameof(EndGameNavigation.ShowDefaultNavigation))]
internal static class AutoPlayAgainPatch
{
public static void Postfix(EndGameNavigation __instance)
{
if (!DebuggerConfig.AutoPlayAgain.Value) return;
__instance.NextGame();
}
}
@@ -1,18 +0,0 @@
using HarmonyLib;
namespace Reactor.Debugger.Patches;
[HarmonyPatch]
[HarmonyPriority(Priority.First)]
internal static class DisableGameEndPatch
{
private static bool Enabled => DebuggerConfig.DisableGameEnd.Value;
[HarmonyPatch(typeof(LogicGameFlow), nameof(LogicGameFlow.CheckEndCriteria))]
[HarmonyPatch(typeof(LogicGameFlowNormal), nameof(LogicGameFlow.CheckEndCriteria))]
[HarmonyPatch(typeof(LogicGameFlowHnS), nameof(LogicGameFlow.CheckEndCriteria))]
public static bool Prefix()
{
return !Enabled;
}
}
@@ -1,27 +0,0 @@
using HarmonyLib;
using Hazel.Udp;
namespace Reactor.Debugger.Patches;
[HarmonyPatch]
internal static class DisableTimeoutPatch
{
private static bool Enabled => DebuggerConfig.DisableTimeout.Value;
[HarmonyPatch(typeof(UdpConnection), nameof(UdpConnection.HandleKeepAlive))]
[HarmonyPrefix]
public static bool DisableKeepAlive()
{
return !Enabled;
}
[HarmonyPatch(typeof(UnityUdpClientConnection), nameof(UnityUdpClientConnection.ConnectAsync))]
[HarmonyPostfix]
public static void DisableTimeout(UnityUdpClientConnection __instance)
{
if (!Enabled) return;
__instance.DisconnectTimeoutMs = int.MaxValue;
__instance.ResendLimit = 0;
}
}
@@ -1,70 +0,0 @@
using System.Linq;
using AmongUs.GameOptions;
using HarmonyLib;
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem.Reflection;
using UnityEngine;
namespace Reactor.Debugger.Patches;
[HarmonyPatch]
internal static class GameOptionsPatches
{
public static void Initialize()
{
var maxImpostors = (Il2CppStructArray<int>) Enumerable.Repeat((int) byte.MaxValue, byte.MaxValue).ToArray();
GameOptionsData.MaxImpostors = maxImpostors;
NormalGameOptionsV07.MaxImpostors = maxImpostors;
HideNSeekGameOptionsV07.MaxImpostors = maxImpostors;
var minPlayers = (Il2CppStructArray<int>) Enumerable.Repeat(1, byte.MaxValue).ToArray();
GameOptionsData.MinPlayers = minPlayers;
NormalGameOptionsV07.MinPlayers = minPlayers;
HideNSeekGameOptionsV07.MinPlayers = minPlayers;
}
[HarmonyPatch(typeof(GameSettingMenu), nameof(GameSettingMenu.Start))]
[HarmonyPrefix]
public static void UnlockAllOptions(GameSettingMenu __instance)
{
__instance.GameSettingsTab.HideForOnline = new Il2CppReferenceArray<Transform>(0);
}
[HarmonyPatch(typeof(NumberOption), nameof(NumberOption.SetUpFromData))]
[HarmonyPostfix]
public static void UnlockOptionRange(NumberOption __instance)
{
__instance.ValidRange.min = float.MinValue;
__instance.ValidRange.max = float.MaxValue;
}
[HarmonyPatch(typeof(CreateOptionsPicker), nameof(CreateOptionsPicker.SetImpostorButtons))]
public static class DisableImpostorCountReset
{
private static readonly MethodInfo _refreshMethod = Il2CppType.Of<CreateOptionsPicker>().GetMethod("Refresh", BindingFlags.Public | BindingFlags.Instance);
public static bool Prefix()
{
foreach (var stackFrame in new Il2CppSystem.Diagnostics.StackTrace().GetFrames())
{
if (_refreshMethod.Equals(stackFrame.GetMethod()))
{
return false;
}
}
return true;
}
}
[HarmonyPatch(typeof(CrewVisualizer), nameof(CrewVisualizer.SetCrewSize))]
[HarmonyPrefix]
public static void SetCrewSizePatch(int numPlayers, ref int numImpostors)
{
if (numImpostors >= numPlayers)
{
numImpostors = 0;
}
}
}
@@ -1,21 +0,0 @@
using HarmonyLib;
namespace Reactor.Debugger.Patches;
[HarmonyPatch(typeof(GameStartManager))]
internal static class GameStartManagerPatches
{
[HarmonyPatch(nameof(GameStartManager.Start))]
[HarmonyPrefix]
public static void StartPatch(GameStartManager __instance)
{
__instance.MinPlayers = 1;
}
[HarmonyPatch(nameof(GameStartManager.Update))]
[HarmonyPrefix]
public static void UpdatePatch(GameStartManager __instance)
{
__instance.countDownTimer = 0;
}
}
@@ -1,14 +0,0 @@
using HarmonyLib;
namespace Reactor.Debugger.Patches;
[HarmonyPatch]
internal static class MiscellaneousPatches
{
[HarmonyPatch(typeof(StatsManager), nameof(StatsManager.AmBanned), MethodType.Getter)]
[HarmonyPrefix]
public static void AmBannedPatch(out bool __result)
{
__result = false;
}
}
@@ -1,39 +0,0 @@
using System;
using System.Net;
using HarmonyLib;
using InnerNet;
namespace Reactor.Debugger.Patches;
[HarmonyPatch]
internal static class RandomizeFreeplayServerPortPatch
{
private static ushort? _lastPort;
[HarmonyPatch(typeof(InnerNetServer), nameof(InnerNetServer.StartAsLocalServer))]
public static class StartServerPatch
{
public static void Prefix(InnerNetServer __instance)
{
var port = (ushort) Random.Shared.Next(1024, IPEndPoint.MaxPort);
_lastPort = port;
__instance.Port = port;
}
public static void Postfix(InnerNetServer __instance)
{
__instance.Port = Constants.GamePlayPort;
}
}
[HarmonyPatch(typeof(InnerNetClient), nameof(InnerNetClient.SetEndpoint))]
[HarmonyPrefix]
public static void SetEndpointPatch(InnerNetClient __instance, string addr, ref ushort port)
{
if (_lastPort != null && __instance.NetworkMode == NetworkModes.FreePlay)
{
port = _lastPort.Value;
_lastPort = null;
}
}
}
@@ -1,74 +0,0 @@
using System;
using System.Globalization;
using System.Text;
using BepInEx.Logging;
using HarmonyLib;
using Object = UnityEngine.Object;
namespace Reactor.Debugger.Patches;
[HarmonyPatch(typeof(Logger))]
internal static class RedirectLoggerPatch
{
private static readonly ManualLogSource _log = BepInEx.Logging.Logger.CreateLogSource("Among Us");
private static bool Enabled => DebuggerConfig.RedirectLogger.Value;
private static void Log(Logger logger, Logger.Level level, Il2CppSystem.Object message, Object? context = null)
{
var finalMessage = new StringBuilder();
if (logger.category != Logger.Category.None) finalMessage.Append(CultureInfo.InvariantCulture, $"[{logger.category}] ");
if (!string.IsNullOrEmpty(logger.tag)) finalMessage.Append(CultureInfo.InvariantCulture, $"[{logger.tag}] ");
if (context != null) finalMessage.Append(CultureInfo.InvariantCulture, $"[{context.name} ({context.GetIl2CppType().FullName})]");
finalMessage.Append(CultureInfo.InvariantCulture, $" {message.ToString()} ");
_log.Log(
level switch
{
Logger.Level.Debug => LogLevel.Debug,
Logger.Level.Error => LogLevel.Error,
Logger.Level.Warning => LogLevel.Warning,
Logger.Level.Info => LogLevel.Info,
_ => throw new ArgumentOutOfRangeException(nameof(level), level, null),
},
finalMessage
);
}
[HarmonyPatch(nameof(Logger.Debug))]
[HarmonyPrefix]
public static bool DebugPatch(Logger __instance, Il2CppSystem.Object message, Object? context)
{
if (!Enabled) return true;
Log(__instance, Logger.Level.Debug, message, context);
return false;
}
[HarmonyPatch(nameof(Logger.Info))]
[HarmonyPrefix]
public static bool InfoPatch(Logger __instance, Il2CppSystem.Object message, Object? context)
{
if (!Enabled) return true;
Log(__instance, Logger.Level.Info, message, context);
return false;
}
[HarmonyPatch(nameof(Logger.Warning))]
[HarmonyPrefix]
public static bool WarningPatch(Logger __instance, Il2CppSystem.Object message, Object? context)
{
if (!Enabled) return true;
Log(__instance, Logger.Level.Warning, message, context);
return false;
}
[HarmonyPatch(nameof(Logger.Error))]
[HarmonyPrefix]
public static bool ErrorPatch(Logger __instance, Il2CppSystem.Object message, Object? context)
{
if (!Enabled) return true;
Log(__instance, Logger.Level.Error, message, context);
return false;
}
}
-36
View File
@@ -1,36 +0,0 @@
using System;
using System.Collections;
using Il2CppInterop.Runtime;
using InnerNet;
namespace Reactor.Debugger.Utilities;
internal static class Extensions
{
public static IEnumerator CoCreateLocalGame(this AmongUsClient client)
{
try
{
client.NetworkMode = NetworkModes.LocalGame;
InnerNetServer.Instance.StartAsServer();
client.SetEndpoint(Constants.LocalNetAddress, Constants.GamePlayPort, false);
client.MainMenuScene = "MatchMaking";
client.OnlineScene = "OnlineGame";
}
catch (Il2CppException e)
{
Error(e);
DisconnectPopup.Instance.ShowCustom(e.Message[..e.Message.IndexOf("\n--- BEGIN IL2CPP STACK TRACE ---\n", StringComparison.Ordinal)]);
MatchMaker.Instance.NotConnecting();
yield break;
}
client.Connect(MatchMakerModes.HostAndClient, null);
yield return client.WaitForConnectionOrFail();
DestroyableSingleton<MatchMaker>.Instance.NotConnecting();
}
}
-70
View File
@@ -1,70 +0,0 @@
using System;
using AmongUs.Data;
using Il2CppInterop.Runtime.Attributes;
using Reactor.Debugger.Window.Tabs;
using Reactor.Utilities.Attributes;
using Reactor.Utilities.ImGui;
using UnityEngine;
namespace Reactor.Debugger.Window;
[RegisterInIl2Cpp]
internal sealed class DebuggerWindow : MonoBehaviour
{
private readonly DragWindow _window;
[HideFromIl2Cpp]
public BaseTab[] Tabs { get; } =
{
new ConfigTab(),
new GameTab(),
new AutoJoinTab(),
};
[HideFromIl2Cpp]
public BaseTab SelectedTab { get; private set; }
public DebuggerWindow(IntPtr ptr) : base(ptr)
{
SelectedTab = Tabs[0];
_window = new DragWindow(new Rect(20, 20, 0, 0), "Reactor.Debugger", () =>
{
var clientName = DataManager.Player.Customization.Name;
if (AmongUsClient.Instance && AmongUsClient.Instance.AmHost) clientName += " (host)";
GUILayout.Label("Name: " + clientName);
GUILayout.BeginHorizontal();
{
foreach (var tab in Tabs)
{
if (GUILayout.Toggle(tab == SelectedTab, tab.Name, new GUIStyle(GUI.skin.button)))
{
SelectedTab = tab;
}
}
}
GUILayout.EndHorizontal();
GUILayout.Space(5f);
SelectedTab.OnGUI();
})
{
Enabled = false,
};
}
public void Update()
{
if (Input.GetKeyDown(KeyCode.F1))
{
_window.Enabled = !_window.Enabled;
}
}
public void OnGUI()
{
_window.OnGUI();
}
}
@@ -1,68 +0,0 @@
using BepInEx.Unity.IL2CPP.Utils;
using Reactor.Debugger.AutoJoin;
using Reactor.Debugger.Utilities;
using UnityEngine;
namespace Reactor.Debugger.Window.Tabs;
internal sealed class AutoJoinTab : BaseTab
{
public override string Name => "AutoJoin";
public override void OnGUI()
{
if (AutoJoinConnectionManager.Server is { } server)
{
GUILayout.Label($"Hosting ({server.Clients.Count} clients)");
if (GUILayout.Button("Stop"))
{
server.Dispose();
}
if (AmongUsClient.Instance)
{
if (GUILayout.Button("Create an online game"))
{
AmongUsClient.Instance.StartCoroutine(AmongUsClient.Instance.CoCreateOnlineGame());
}
if (GUILayout.Button("Create a local game"))
{
AmongUsClient.Instance.StartCoroutine(AmongUsClient.Instance.CoCreateLocalGame());
}
if (
AmongUsClient.Instance.AmConnected &&
AmongUsClient.Instance.NetworkMode != NetworkModes.FreePlay &&
GUILayout.Button("Join me")
)
{
server.SendJoinMe(AmongUsClient.Instance);
}
}
}
else if (AutoJoinConnectionManager.Client is { } client)
{
GUILayout.Label("Connected");
if (GUILayout.Button("Disconnect"))
{
AutoJoinConnectionManager.Client = null;
client.Dispose();
}
if (GUILayout.Button("Request join"))
{
client.SendRequestJoin();
}
}
else
{
if (GUILayout.Button("Connect"))
{
AutoJoinConnectionManager.StartOrConnect();
}
}
}
}
-8
View File
@@ -1,8 +0,0 @@
namespace Reactor.Debugger.Window.Tabs;
internal abstract class BaseTab
{
public abstract string Name { get; }
public abstract void OnGUI();
}
-29
View File
@@ -1,29 +0,0 @@
using System.Linq;
using BepInEx.Configuration;
using Reactor.Utilities;
using UnityEngine;
namespace Reactor.Debugger.Window.Tabs;
internal sealed class ConfigTab : BaseTab
{
public override string Name => "Config";
public override void OnGUI()
{
var configs = PluginSingleton<ReactorPlugin>.Instance.Config.Concat(PluginSingleton<DebuggerPlugin>.Instance.Config);
foreach (var section in configs.GroupBy(e => e.Key.Section))
{
GUILayout.Label(section.Key);
foreach (var (definition, entry) in section)
{
if (entry is ConfigEntry<bool> booleanEntry)
{
booleanEntry.Value = GUILayout.Toggle(booleanEntry.Value, definition.Key);
}
}
}
}
}
-97
View File
@@ -1,97 +0,0 @@
using AmongUs.GameOptions;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using UnityEngine;
using Object = UnityEngine.Object;
namespace Reactor.Debugger.Window.Tabs;
internal sealed class GameTab : BaseTab
{
public override string Name => "Game";
public override void OnGUI()
{
var localPlayer = PlayerControl.LocalPlayer;
if (!localPlayer)
{
return;
}
var amHost = AmongUsClient.Instance.AmHost;
var position = localPlayer.transform.position;
GUILayout.Label($"Position: ({position.x:F3}, {position.y:F3})");
var physics = localPlayer.MyPhysics;
GUILayout.Label($"Speed: {physics.Speed}");
physics.Speed = GUILayout.HorizontalSlider(physics.Speed, 0, 25);
localPlayer.Collider.enabled = GUILayout.Toggle(localPlayer.Collider.enabled, "Collisions");
if (ShipStatus.Instance)
{
if (amHost && GUILayout.Button("Force game end"))
{
ShipStatus.Instance.enabled = false;
GameManager.Instance.RpcEndGame(GameOverReason.ImpostorDisconnect, false);
}
if (MeetingHud.Instance)
{
if (GUILayout.Button("Stop the meeting"))
{
MeetingHud.Instance.RpcClose();
}
}
else
{
if (GUILayout.Button("Call a meeting"))
{
localPlayer.CmdReportDeadBody(null);
}
}
if (TutorialManager.InstanceExists)
{
var newIsImpostor = GUILayout.Toggle(localPlayer.Data.Role.IsImpostor, "Is Impostor");
if (localPlayer.Data.Role.IsImpostor != newIsImpostor)
{
localPlayer.RpcSetRole(newIsImpostor ? RoleTypes.Impostor : RoleTypes.Crewmate);
}
if (GUILayout.Button("Spawn a dummy"))
{
SpawnDummy();
}
}
}
}
private static void SpawnDummy()
{
var playerControl = Object.Instantiate(AmongUsClient.Instance.PlayerPrefab);
var playerId = playerControl.PlayerId = (byte) GameData.Instance.GetAvailableId();
var data = GameData.Instance.AddDummy(playerControl);
AmongUsClient.Instance.Spawn(data);
AmongUsClient.Instance.Spawn(playerControl);
playerControl.isDummy = true;
playerControl.transform.position = PlayerControl.LocalPlayer.transform.position;
playerControl.GetComponent<DummyBehaviour>().enabled = true;
playerControl.NetTransform.enabled = false;
playerControl.SetName($"{TranslationController.Instance.GetString(StringNames.Dummy)} {playerId}");
var color = (byte) (playerId % Palette.PlayerColors.Length);
playerControl.SetColor(color);
playerControl.SetHat(HatManager.Instance.allHats[playerId % HatManager.Instance.allHats.Count].ProdId, playerControl.Data.DefaultOutfit.ColorId);
playerControl.SetPet(HatManager.Instance.allPets[playerId % HatManager.Instance.allPets.Count].ProdId);
playerControl.SetSkin(HatManager.Instance.allSkins[playerId % HatManager.Instance.allSkins.Count].ProdId, color);
playerControl.SetVisor(HatManager.Instance.allVisors[playerId % HatManager.Instance.allVisors.Count].ProdId, color);
playerControl.SetNamePlate(HatManager.Instance.allNamePlates[playerId % HatManager.Instance.allNamePlates.Count].ProdId);
data.PlayerLevel = playerId;
data.RpcSetTasks(new Il2CppStructArray<byte>(0));
}
}
+91 -118
View File
@@ -4,9 +4,9 @@
"net6.0": {
"AmongUs.GameLibs.Steam": {
"type": "Direct",
"requested": "[2024.6.18, )",
"resolved": "2024.6.18",
"contentHash": "xb+HP1xXn4/ES8AgXpk9xeoW568LFYw5NTjY6bHwd6vQjHDf2kT1xHMmQ1me5Vfee/Gp69YIMZDXUAUToG7Elg=="
"requested": "[2022.10.25, )",
"resolved": "2022.10.25",
"contentHash": "PWgkH/VvMlShVhZB8G432q0tnMaNVZrbIdbEMCZN/fETUlT/ch+qQj4PdTcZhPHREbnJHH3ijHxlca1d7QMBcQ=="
},
"BepInEx.AutoPlugin": {
"type": "Direct",
@@ -22,93 +22,58 @@
},
"BepInEx.Unity.IL2CPP": {
"type": "Direct",
"requested": "[6.0.0-be.679, )",
"resolved": "6.0.0-be.679",
"contentHash": "KnfMjWSXI5+dxbkLCy8VssEnZtTN3MXUHDdBkvPbMiZ6oR1RGZWdLlA90/XQkY/4kMA5P4OCZP4eQ1o0XftbSQ==",
"requested": "[6.0.0-be.662, )",
"resolved": "6.0.0-be.662",
"contentHash": "fn7jQ88IBmjssoY9XjGBTg3cULkS+N/le/eUijYf2VV8raWok/6cU/GbU9bejkJS8g+2MvzIwnROAhAxvrGI2Q==",
"dependencies": {
"BepInEx.Core": "6.0.0-be.679",
"BepInEx.Unity.Common": "6.0.0-be.679",
"HarmonyX": "2.10.1",
"Iced": "1.18.0",
"Il2CppInterop.Generator": "1.4.6-ci.389",
"Il2CppInterop.HarmonySupport": "1.4.6-ci.389",
"Il2CppInterop.Runtime": "1.4.6-ci.389",
"BepInEx.Core": "6.0.0-be.662",
"BepInEx.Unity.Common": "6.0.0-be.662",
"HarmonyX": "2.10.0",
"Iced": "1.17.0",
"Il2CppInterop.Generator": "1.3.0",
"Il2CppInterop.HarmonySupport": "1.3.0",
"Il2CppInterop.Runtime": "1.3.0",
"MonoMod.RuntimeDetour": "22.5.1.1",
"Samboy063.Cpp2IL.Core": "2022.1.0-development.866"
"Samboy063.Cpp2IL.Core": "2022.0.7.2"
}
},
"StyleCop.Analyzers": {
"type": "Direct",
"requested": "[1.2.0-beta.507, )",
"resolved": "1.2.0-beta.507",
"contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==",
"requested": "[1.2.0-beta.435, )",
"resolved": "1.2.0-beta.435",
"contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==",
"dependencies": {
"StyleCop.Analyzers.Unstable": "1.2.0.507"
}
},
"AsmResolver": {
"type": "Transitive",
"resolved": "5.1.0",
"contentHash": "7PjujQzgQ3wjzqZYT4CY8SV6zx7FY6swIwj3Yk4QLolLqo9sBPb7FLF3W30QFvCsCkNfiVWXlSbeZKs4xGgQOQ=="
},
"AsmResolver.DotNet": {
"type": "Transitive",
"resolved": "5.1.0",
"contentHash": "oKrBU94OaSrbbTwydvpLRFalYxozrNXGkl13nIkm823ZFQtPNYOiOMJb5DQLvkCJlWyis7q865tg803T5zg9IA==",
"dependencies": {
"AsmResolver.PE": "5.1.0",
"System.Text.Json": "6.0.7"
}
},
"AsmResolver.PE": {
"type": "Transitive",
"resolved": "5.1.0",
"contentHash": "XD3iAgLSInJIODKUUlpHWXf8MR9H1SFMb1lsmabb4GxxxnDQRPjMxjglv2NOCjQQuNB2Oh0bvjHE7ewf82UqyQ==",
"dependencies": {
"AsmResolver.PE.File": "5.1.0"
}
},
"AsmResolver.PE.File": {
"type": "Transitive",
"resolved": "5.1.0",
"contentHash": "YituBYe0Fh471sXQMfu+f4tWKX/JZvRwrX6g/SVsr4XkUIUzYi/aGT3/QvjHoYx19fE1KYOB6zBKqPkkOK7HPw==",
"dependencies": {
"AsmResolver": "5.1.0"
"StyleCop.Analyzers.Unstable": "1.2.0.435"
}
},
"AssetRipper.VersionUtilities": {
"type": "Transitive",
"resolved": "1.3.1",
"contentHash": "/1D18NOpqm7rS7+qVUbAReVMNWwgDuYpsnf0RkX1Aah/I0a0irqldoFJ+Kku7YdbSm0zqD+Z6iYUGKoP3GwTNQ=="
"resolved": "1.2.1",
"contentHash": "knQ/W1YwTZS2AbdaZh+nhyyBEZQPQDcahhSOnh88i+cdg4/FEoFJiCwaavgFvCMNuUeHTbcZc4qttF8WQ8xLIA=="
},
"BepInEx.Core": {
"type": "Transitive",
"resolved": "6.0.0-be.679",
"contentHash": "yg6NSGeevv86P2ERe3VDEa7W/l0lmM7m+AdPSW78dcBOe36Zc3QK/vmNEq57txGa+1kwv+macXLSwkL4UpucjA==",
"resolved": "6.0.0-be.662",
"contentHash": "VVBeCD/KQVy0/TK3V6SD8QZ/es35Xb1mEz/+PbBs3ST1yUC1r7k2JOymhSnmghVqf6UsvlMglOO9pljqhuE/Pw==",
"dependencies": {
"HarmonyX": "2.10.1",
"HarmonyX": "2.10.0",
"MonoMod.Utils": "22.5.1.1",
"SemanticVersioning": "2.0.2"
}
},
"BepInEx.Unity.Common": {
"type": "Transitive",
"resolved": "6.0.0-be.679",
"contentHash": "q4Sux3ULBDasSQAtlAWzAKpAfCyV3ujxVJpK7ydV1bUIksaHNqw9yYTLCUrw8p4DQ/wHvShECFjzeMGHi+wylA==",
"resolved": "6.0.0-be.662",
"contentHash": "BgETw6+snwY//3xjQxLiiEAFRmXaMTcSkg+1UQz6fVBG0YA5Usm/m4GflhTc3nwF61KO3Iznn1AORi5CwLJoUw==",
"dependencies": {
"AssetRipper.VersionUtilities": "1.2.1",
"MonoMod.Utils": "22.5.1.1"
}
},
"Disarm": {
"type": "Transitive",
"resolved": "2022.1.0-master.26",
"contentHash": "YnZEbRGr0nG+N3G8WbRQ4Lkg8dTD3oso9iJlCVBmyhEyhLyqs+drBs1kWQbQqFPnb9mi/RJ++R9bPb+L3HF03Q=="
},
"HarmonyX": {
"type": "Transitive",
"resolved": "2.10.1",
"contentHash": "9LodMC9Y0u1TW96eKJoWrFJFpmzbgojEO38/Q+e7c1mFPhmHt8xcR8qhI06iF1rf0Dnsk+hqENFVSgbtwl/bEw==",
"resolved": "2.10.0",
"contentHash": "4ayiy/dlCiW86K2N7Jvbf+VpI5wvP7dncv/6oRmfwRi32UCmCRzCGzsxdMfzJZkp6/26oBW+DrD8vi4UejzVAg==",
"dependencies": {
"MonoMod.RuntimeDetour": "22.3.23.4",
"System.Reflection.Emit": "4.7.0"
@@ -116,13 +81,13 @@
},
"Iced": {
"type": "Transitive",
"resolved": "1.18.0",
"contentHash": "G60lZOvbvqttA+SBSv/yY6/wUboXKJlkffhSNR9iOrx0M5gpcK1TRr6xrFR+qAhqIAhvrsPF1jkn9fYb4lEufQ=="
"resolved": "1.17.0",
"contentHash": "8x+HCVTl/HHTGpscH3vMBhV8sknN/muZFw9s3TsI8SA6+c43cOTCi2+jE4KsU8pNLbJ++iF2ZFcpcXHXtDglnw=="
},
"Il2CppInterop.Common": {
"type": "Transitive",
"resolved": "1.4.6-ci.389",
"contentHash": "KTyf2f66Q2mS9a6xhvoPWwD0VzRIoskPMVQehaVMo1dx4Di1FPFsKqukQ+ob6wgP5Rbnx53kiH0PY+IRSb35XA==",
"resolved": "1.3.0",
"contentHash": "IR3BrZXvL2nvJAn4pruPMgC78Y87hVa5xTYZCuHN67OzRD6WDl5dTO55vtvTl8dXFALKvlN+spja2tXhVuquOw==",
"dependencies": {
"Iced": "1.17.0",
"Microsoft.Extensions.Logging.Abstractions": "6.0.1",
@@ -131,36 +96,63 @@
},
"Il2CppInterop.Generator": {
"type": "Transitive",
"resolved": "1.4.6-ci.389",
"contentHash": "XJX4sn/RzAEBNIZZXuyDcLZrFx5tCoahujDu5aKWjApiMj/nTRQAxZn17daIIvd9aHqLaAfiWWth5QDLIt2bKw==",
"resolved": "1.3.0",
"contentHash": "FuhPxbh/K4K94U3xac/ClMaaBp+MZ4aIaqi5dR0QihyGQoombT+OM/A22RwAIzbaCTbFbvabWaAuOSgB69ZwWQ==",
"dependencies": {
"Il2CppInterop.Common": "1.4.6-ci.389",
"Il2CppInterop.Common": "1.3.0",
"Mono.Cecil": "0.11.3"
}
},
"Il2CppInterop.HarmonySupport": {
"type": "Transitive",
"resolved": "1.4.6-ci.389",
"contentHash": "Xd2zK6sLqwA0ReyUy83SWKcALwY99fq6vVL5gFOMN5Ct8OOVhtNIws0ysCWsfx1GL0RJiRYfR4pza/MmWRz4PQ==",
"resolved": "1.3.0",
"contentHash": "VppBnXtbMNGFhX8a1gg/85E883t2pW/+FZyV7eOaOXMNQyorg++u+kUFOIYwNpzTVqxWmMeoPS0DH0toVpjoKA==",
"dependencies": {
"HarmonyX": "2.10.0",
"Il2CppInterop.Runtime": "1.4.6-ci.389"
"Il2CppInterop.Runtime": "1.3.0"
}
},
"Il2CppInterop.Runtime": {
"type": "Transitive",
"resolved": "1.4.6-ci.389",
"contentHash": "nzYjuVzDG/O8+AQ8ax3WVHf+ZVsQKrVtp/yvuW8XoEPLdkbgryIrMo75dvN+tPqxOU3o2MPt9MZ9j25P5aVJMw==",
"resolved": "1.3.0",
"contentHash": "8A+N2yvja960Ap+s2RpW7Nb6HSpyuXJy2ipIlU+1erYU9SWHMyU9JZzUZGOhwWXJChKGvRmDdTZAg12k1+72dg==",
"dependencies": {
"Iced": "1.17.0",
"Il2CppInterop.Common": "1.4.6-ci.389"
"Il2CppInterop.Common": "1.3.0"
}
},
"IndexRange": {
"type": "Transitive",
"resolved": "1.0.0",
"contentHash": "6TgS1JLSUkpmPLfXBPaAgB39ZUix8E4soXWk2XSDcscVe84i1JKzIAtA7jHbRHSkOOrcr6YA0MpLCeq98y9mYQ=="
},
"js6pak.Gee.External.Capstone": {
"type": "Transitive",
"resolved": "2.1.0",
"contentHash": "YYpq7NM50bSSVUDjXyV/eiITk6syXqItPjKBOb3jEWS6RFsk0DNhpWMPW6b3hKDmArARuWDU6S2pVu1IeVrvIA=="
},
"Linguini.Bundle": {
"type": "Transitive",
"resolved": "0.3.1",
"contentHash": "k3D0IBSsS91T0G9rYACRYtAS27NDTGz4T3ygHhbhaFdA9i3cCfCpR39MqYEpoA1Ark3lzmvklHePmRCX5EQi1A==",
"dependencies": {
"Linguini.Shared": "0.3.0",
"Linguini.Syntax": "0.3.0"
}
},
"Linguini.Shared": {
"type": "Transitive",
"resolved": "0.3.0",
"contentHash": "rEYA9jWU1Nc9iDuPKar+4IVXjFbGrcNyYZCeU6hiWQoS4nA2UecHu36Rp4bxzasvRGda4FB2JZqty75m4e26VQ=="
},
"Linguini.Syntax": {
"type": "Transitive",
"resolved": "0.3.0",
"contentHash": "v8YV3xPFZfP+OSWjMd6yysp+o7cNnQXxq/slN8Yekoi+dFjsTNF0YiQWJIwg1j2FUbs6claJxY9R1FFlc4s6MA==",
"dependencies": {
"Linguini.Shared": "0.3.0"
}
},
"Microsoft.Extensions.Logging.Abstractions": {
"type": "Transitive",
"resolved": "6.0.1",
@@ -310,45 +302,42 @@
},
"Samboy063.Cpp2IL.Core": {
"type": "Transitive",
"resolved": "2022.1.0-development.866",
"contentHash": "QPMuix/3jRngWBdNSLhAbm9BHYf95Ln1Ph1eCK/cDZdVibxFDFP3a6Yczyx1p7GbN7bRQwrhs2skPJSS/z3m2w==",
"resolved": "2022.0.7.2",
"contentHash": "e17CAhKSxdAp7vFcYEVxjSc7t7rcvVGBipGhgE9tAjRXY85wZXLlHEVO0AEvMRkLmf9U+if4wK/nZEC1AX6VqQ==",
"dependencies": {
"AsmResolver.DotNet": "5.1.0",
"Disarm": "2022.1.0-master.26",
"Iced": "1.18.0",
"Samboy063.LibCpp2IL": "2022.1.0-development.866",
"StableNameDotNet": "0.1.0-development.866",
"HarmonyX": "2.5.5",
"Iced": "1.11.1",
"IndexRange": "1.0.0",
"Mono.Cecil": "0.11.4",
"Samboy063.LibCpp2IL": "2022.0.7.2",
"System.Runtime.InteropServices": "4.3.0",
"System.ValueTuple": "4.5.0",
"js6pak.Gee.External.Capstone": "2.1.0"
}
},
"Samboy063.LibCpp2IL": {
"type": "Transitive",
"resolved": "2022.1.0-development.866",
"contentHash": "EcJSWTfQko8SQozozoUT+aQJVWC8wj8C0YUiPBF4rNRId19yTKp2IXcXnI747v+8/aal222QR6WHfoBK2WlVLg==",
"resolved": "2022.0.7.2",
"contentHash": "DpVeU0dQkUJCpbw0f1xKOG8vimdK2oYhrVABC7HDE3/ikGjhnMZd3i5b1joKDHZ+AiL90TWOaEXPcy24rCZ0dA==",
"dependencies": {
"AssetRipper.VersionUtilities": "1.3.1",
"Samboy063.WasmDisassembler": "2022.1.0-development.866"
"IndexRange": "1.0.0",
"Samboy063.WasmDisassembler": "2022.0.2"
}
},
"Samboy063.WasmDisassembler": {
"type": "Transitive",
"resolved": "2022.1.0-development.866",
"contentHash": "2QK8F3eISkLcoW/Nt7wtxyQh31EXAqEMBVXXjEnuxyvXpBXxOIGpjmE3pWhGwxQwDCbe4zBsLF1zUiqq3/pXRA=="
"resolved": "2022.0.2",
"contentHash": "2uu+xBb7M3HKfBx9tAY6jiDieAf0hRnQjSmGX+7IdE6i24dYsx6TYgtrLvRx5lOuF2M8DijZ5H8yQ1pcuCs2SA=="
},
"SemanticVersioning": {
"type": "Transitive",
"resolved": "2.0.2",
"contentHash": "4EQgYdNZ92SyaO7YFk6olVnebF5V+jrHyMUjvPq89tLeMo8NSfgDF+6Zwq/lgh9j/0yfQp9Lkm0ZA0rUATCZFA=="
},
"StableNameDotNet": {
"type": "Transitive",
"resolved": "0.1.0-development.866",
"contentHash": "DJb8x4dV3ucDgM12sU28HxCdeqY/JudJbeJG6mgXWDJzpFZw2Jd7JF1pKFRNLzh/0gpo8bCGLQS9gOWZmBjdtg=="
},
"StyleCop.Analyzers.Unstable": {
"type": "Transitive",
"resolved": "1.2.0.507",
"contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw=="
"resolved": "1.2.0.435",
"contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg=="
},
"System.Collections": {
"type": "Transitive",
@@ -675,11 +664,6 @@
"Microsoft.NETCore.Targets": "1.1.0"
}
},
"System.Runtime.CompilerServices.Unsafe": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg=="
},
"System.Runtime.Extensions": {
"type": "Transitive",
"resolved": "4.3.0",
@@ -878,23 +862,6 @@
"System.Runtime": "4.3.0"
}
},
"System.Text.Encodings.Web": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "Vg8eB5Tawm1IFqj4TVK1czJX89rhFxJo9ELqc/Eiq0eXy13RK00eubyU6TJE6y+GQXjyV5gSfiewDUZjQgSE0w==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
},
"System.Text.Json": {
"type": "Transitive",
"resolved": "6.0.7",
"contentHash": "/Tf/9XjprpHolbcDOrxsKVYy/mUG/FS7aGd9YUgBVEiHeQH4kAE0T1sMbde7q6B5xcrNUsJ5iW7D1RvHudQNqA==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0",
"System.Text.Encodings.Web": "6.0.0"
}
},
"System.Threading": {
"type": "Transitive",
"resolved": "4.3.0",
@@ -914,10 +881,16 @@
"System.Runtime": "4.3.0"
}
},
"System.ValueTuple": {
"type": "Transitive",
"resolved": "4.5.0",
"contentHash": "okurQJO6NRE/apDIP23ajJ0hpiNmJ+f0BwOlB/cSqTLQlw5upkf+5+96+iG2Jw40G1fCVCyPz/FhIABUjMR+RQ=="
},
"reactor": {
"type": "Project",
"dependencies": {
"BepInEx.Unity.IL2CPP": "[6.0.0-be.679, )"
"BepInEx.Unity.IL2CPP": "[6.0.0-be.662, )",
"Linguini.Bundle": "[0.3.1, )"
}
}
}
+91 -118
View File
@@ -4,9 +4,9 @@
"net6.0": {
"AmongUs.GameLibs.Steam": {
"type": "Direct",
"requested": "[2024.6.18, )",
"resolved": "2024.6.18",
"contentHash": "xb+HP1xXn4/ES8AgXpk9xeoW568LFYw5NTjY6bHwd6vQjHDf2kT1xHMmQ1me5Vfee/Gp69YIMZDXUAUToG7Elg=="
"requested": "[2022.10.25, )",
"resolved": "2022.10.25",
"contentHash": "PWgkH/VvMlShVhZB8G432q0tnMaNVZrbIdbEMCZN/fETUlT/ch+qQj4PdTcZhPHREbnJHH3ijHxlca1d7QMBcQ=="
},
"BepInEx.AutoPlugin": {
"type": "Direct",
@@ -22,93 +22,58 @@
},
"BepInEx.Unity.IL2CPP": {
"type": "Direct",
"requested": "[6.0.0-be.679, )",
"resolved": "6.0.0-be.679",
"contentHash": "KnfMjWSXI5+dxbkLCy8VssEnZtTN3MXUHDdBkvPbMiZ6oR1RGZWdLlA90/XQkY/4kMA5P4OCZP4eQ1o0XftbSQ==",
"requested": "[6.0.0-be.662, )",
"resolved": "6.0.0-be.662",
"contentHash": "fn7jQ88IBmjssoY9XjGBTg3cULkS+N/le/eUijYf2VV8raWok/6cU/GbU9bejkJS8g+2MvzIwnROAhAxvrGI2Q==",
"dependencies": {
"BepInEx.Core": "6.0.0-be.679",
"BepInEx.Unity.Common": "6.0.0-be.679",
"HarmonyX": "2.10.1",
"Iced": "1.18.0",
"Il2CppInterop.Generator": "1.4.6-ci.389",
"Il2CppInterop.HarmonySupport": "1.4.6-ci.389",
"Il2CppInterop.Runtime": "1.4.6-ci.389",
"BepInEx.Core": "6.0.0-be.662",
"BepInEx.Unity.Common": "6.0.0-be.662",
"HarmonyX": "2.10.0",
"Iced": "1.17.0",
"Il2CppInterop.Generator": "1.3.0",
"Il2CppInterop.HarmonySupport": "1.3.0",
"Il2CppInterop.Runtime": "1.3.0",
"MonoMod.RuntimeDetour": "22.5.1.1",
"Samboy063.Cpp2IL.Core": "2022.1.0-development.866"
"Samboy063.Cpp2IL.Core": "2022.0.7.2"
}
},
"StyleCop.Analyzers": {
"type": "Direct",
"requested": "[1.2.0-beta.507, )",
"resolved": "1.2.0-beta.507",
"contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==",
"requested": "[1.2.0-beta.435, )",
"resolved": "1.2.0-beta.435",
"contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==",
"dependencies": {
"StyleCop.Analyzers.Unstable": "1.2.0.507"
}
},
"AsmResolver": {
"type": "Transitive",
"resolved": "5.1.0",
"contentHash": "7PjujQzgQ3wjzqZYT4CY8SV6zx7FY6swIwj3Yk4QLolLqo9sBPb7FLF3W30QFvCsCkNfiVWXlSbeZKs4xGgQOQ=="
},
"AsmResolver.DotNet": {
"type": "Transitive",
"resolved": "5.1.0",
"contentHash": "oKrBU94OaSrbbTwydvpLRFalYxozrNXGkl13nIkm823ZFQtPNYOiOMJb5DQLvkCJlWyis7q865tg803T5zg9IA==",
"dependencies": {
"AsmResolver.PE": "5.1.0",
"System.Text.Json": "6.0.7"
}
},
"AsmResolver.PE": {
"type": "Transitive",
"resolved": "5.1.0",
"contentHash": "XD3iAgLSInJIODKUUlpHWXf8MR9H1SFMb1lsmabb4GxxxnDQRPjMxjglv2NOCjQQuNB2Oh0bvjHE7ewf82UqyQ==",
"dependencies": {
"AsmResolver.PE.File": "5.1.0"
}
},
"AsmResolver.PE.File": {
"type": "Transitive",
"resolved": "5.1.0",
"contentHash": "YituBYe0Fh471sXQMfu+f4tWKX/JZvRwrX6g/SVsr4XkUIUzYi/aGT3/QvjHoYx19fE1KYOB6zBKqPkkOK7HPw==",
"dependencies": {
"AsmResolver": "5.1.0"
"StyleCop.Analyzers.Unstable": "1.2.0.435"
}
},
"AssetRipper.VersionUtilities": {
"type": "Transitive",
"resolved": "1.3.1",
"contentHash": "/1D18NOpqm7rS7+qVUbAReVMNWwgDuYpsnf0RkX1Aah/I0a0irqldoFJ+Kku7YdbSm0zqD+Z6iYUGKoP3GwTNQ=="
"resolved": "1.2.1",
"contentHash": "knQ/W1YwTZS2AbdaZh+nhyyBEZQPQDcahhSOnh88i+cdg4/FEoFJiCwaavgFvCMNuUeHTbcZc4qttF8WQ8xLIA=="
},
"BepInEx.Core": {
"type": "Transitive",
"resolved": "6.0.0-be.679",
"contentHash": "yg6NSGeevv86P2ERe3VDEa7W/l0lmM7m+AdPSW78dcBOe36Zc3QK/vmNEq57txGa+1kwv+macXLSwkL4UpucjA==",
"resolved": "6.0.0-be.662",
"contentHash": "VVBeCD/KQVy0/TK3V6SD8QZ/es35Xb1mEz/+PbBs3ST1yUC1r7k2JOymhSnmghVqf6UsvlMglOO9pljqhuE/Pw==",
"dependencies": {
"HarmonyX": "2.10.1",
"HarmonyX": "2.10.0",
"MonoMod.Utils": "22.5.1.1",
"SemanticVersioning": "2.0.2"
}
},
"BepInEx.Unity.Common": {
"type": "Transitive",
"resolved": "6.0.0-be.679",
"contentHash": "q4Sux3ULBDasSQAtlAWzAKpAfCyV3ujxVJpK7ydV1bUIksaHNqw9yYTLCUrw8p4DQ/wHvShECFjzeMGHi+wylA==",
"resolved": "6.0.0-be.662",
"contentHash": "BgETw6+snwY//3xjQxLiiEAFRmXaMTcSkg+1UQz6fVBG0YA5Usm/m4GflhTc3nwF61KO3Iznn1AORi5CwLJoUw==",
"dependencies": {
"AssetRipper.VersionUtilities": "1.2.1",
"MonoMod.Utils": "22.5.1.1"
}
},
"Disarm": {
"type": "Transitive",
"resolved": "2022.1.0-master.26",
"contentHash": "YnZEbRGr0nG+N3G8WbRQ4Lkg8dTD3oso9iJlCVBmyhEyhLyqs+drBs1kWQbQqFPnb9mi/RJ++R9bPb+L3HF03Q=="
},
"HarmonyX": {
"type": "Transitive",
"resolved": "2.10.1",
"contentHash": "9LodMC9Y0u1TW96eKJoWrFJFpmzbgojEO38/Q+e7c1mFPhmHt8xcR8qhI06iF1rf0Dnsk+hqENFVSgbtwl/bEw==",
"resolved": "2.10.0",
"contentHash": "4ayiy/dlCiW86K2N7Jvbf+VpI5wvP7dncv/6oRmfwRi32UCmCRzCGzsxdMfzJZkp6/26oBW+DrD8vi4UejzVAg==",
"dependencies": {
"MonoMod.RuntimeDetour": "22.3.23.4",
"System.Reflection.Emit": "4.7.0"
@@ -116,13 +81,13 @@
},
"Iced": {
"type": "Transitive",
"resolved": "1.18.0",
"contentHash": "G60lZOvbvqttA+SBSv/yY6/wUboXKJlkffhSNR9iOrx0M5gpcK1TRr6xrFR+qAhqIAhvrsPF1jkn9fYb4lEufQ=="
"resolved": "1.17.0",
"contentHash": "8x+HCVTl/HHTGpscH3vMBhV8sknN/muZFw9s3TsI8SA6+c43cOTCi2+jE4KsU8pNLbJ++iF2ZFcpcXHXtDglnw=="
},
"Il2CppInterop.Common": {
"type": "Transitive",
"resolved": "1.4.6-ci.389",
"contentHash": "KTyf2f66Q2mS9a6xhvoPWwD0VzRIoskPMVQehaVMo1dx4Di1FPFsKqukQ+ob6wgP5Rbnx53kiH0PY+IRSb35XA==",
"resolved": "1.3.0",
"contentHash": "IR3BrZXvL2nvJAn4pruPMgC78Y87hVa5xTYZCuHN67OzRD6WDl5dTO55vtvTl8dXFALKvlN+spja2tXhVuquOw==",
"dependencies": {
"Iced": "1.17.0",
"Microsoft.Extensions.Logging.Abstractions": "6.0.1",
@@ -131,36 +96,63 @@
},
"Il2CppInterop.Generator": {
"type": "Transitive",
"resolved": "1.4.6-ci.389",
"contentHash": "XJX4sn/RzAEBNIZZXuyDcLZrFx5tCoahujDu5aKWjApiMj/nTRQAxZn17daIIvd9aHqLaAfiWWth5QDLIt2bKw==",
"resolved": "1.3.0",
"contentHash": "FuhPxbh/K4K94U3xac/ClMaaBp+MZ4aIaqi5dR0QihyGQoombT+OM/A22RwAIzbaCTbFbvabWaAuOSgB69ZwWQ==",
"dependencies": {
"Il2CppInterop.Common": "1.4.6-ci.389",
"Il2CppInterop.Common": "1.3.0",
"Mono.Cecil": "0.11.3"
}
},
"Il2CppInterop.HarmonySupport": {
"type": "Transitive",
"resolved": "1.4.6-ci.389",
"contentHash": "Xd2zK6sLqwA0ReyUy83SWKcALwY99fq6vVL5gFOMN5Ct8OOVhtNIws0ysCWsfx1GL0RJiRYfR4pza/MmWRz4PQ==",
"resolved": "1.3.0",
"contentHash": "VppBnXtbMNGFhX8a1gg/85E883t2pW/+FZyV7eOaOXMNQyorg++u+kUFOIYwNpzTVqxWmMeoPS0DH0toVpjoKA==",
"dependencies": {
"HarmonyX": "2.10.0",
"Il2CppInterop.Runtime": "1.4.6-ci.389"
"Il2CppInterop.Runtime": "1.3.0"
}
},
"Il2CppInterop.Runtime": {
"type": "Transitive",
"resolved": "1.4.6-ci.389",
"contentHash": "nzYjuVzDG/O8+AQ8ax3WVHf+ZVsQKrVtp/yvuW8XoEPLdkbgryIrMo75dvN+tPqxOU3o2MPt9MZ9j25P5aVJMw==",
"resolved": "1.3.0",
"contentHash": "8A+N2yvja960Ap+s2RpW7Nb6HSpyuXJy2ipIlU+1erYU9SWHMyU9JZzUZGOhwWXJChKGvRmDdTZAg12k1+72dg==",
"dependencies": {
"Iced": "1.17.0",
"Il2CppInterop.Common": "1.4.6-ci.389"
"Il2CppInterop.Common": "1.3.0"
}
},
"IndexRange": {
"type": "Transitive",
"resolved": "1.0.0",
"contentHash": "6TgS1JLSUkpmPLfXBPaAgB39ZUix8E4soXWk2XSDcscVe84i1JKzIAtA7jHbRHSkOOrcr6YA0MpLCeq98y9mYQ=="
},
"js6pak.Gee.External.Capstone": {
"type": "Transitive",
"resolved": "2.1.0",
"contentHash": "YYpq7NM50bSSVUDjXyV/eiITk6syXqItPjKBOb3jEWS6RFsk0DNhpWMPW6b3hKDmArARuWDU6S2pVu1IeVrvIA=="
},
"Linguini.Bundle": {
"type": "Transitive",
"resolved": "0.3.1",
"contentHash": "k3D0IBSsS91T0G9rYACRYtAS27NDTGz4T3ygHhbhaFdA9i3cCfCpR39MqYEpoA1Ark3lzmvklHePmRCX5EQi1A==",
"dependencies": {
"Linguini.Shared": "0.3.0",
"Linguini.Syntax": "0.3.0"
}
},
"Linguini.Shared": {
"type": "Transitive",
"resolved": "0.3.0",
"contentHash": "rEYA9jWU1Nc9iDuPKar+4IVXjFbGrcNyYZCeU6hiWQoS4nA2UecHu36Rp4bxzasvRGda4FB2JZqty75m4e26VQ=="
},
"Linguini.Syntax": {
"type": "Transitive",
"resolved": "0.3.0",
"contentHash": "v8YV3xPFZfP+OSWjMd6yysp+o7cNnQXxq/slN8Yekoi+dFjsTNF0YiQWJIwg1j2FUbs6claJxY9R1FFlc4s6MA==",
"dependencies": {
"Linguini.Shared": "0.3.0"
}
},
"Microsoft.Extensions.Logging.Abstractions": {
"type": "Transitive",
"resolved": "6.0.1",
@@ -310,45 +302,42 @@
},
"Samboy063.Cpp2IL.Core": {
"type": "Transitive",
"resolved": "2022.1.0-development.866",
"contentHash": "QPMuix/3jRngWBdNSLhAbm9BHYf95Ln1Ph1eCK/cDZdVibxFDFP3a6Yczyx1p7GbN7bRQwrhs2skPJSS/z3m2w==",
"resolved": "2022.0.7.2",
"contentHash": "e17CAhKSxdAp7vFcYEVxjSc7t7rcvVGBipGhgE9tAjRXY85wZXLlHEVO0AEvMRkLmf9U+if4wK/nZEC1AX6VqQ==",
"dependencies": {
"AsmResolver.DotNet": "5.1.0",
"Disarm": "2022.1.0-master.26",
"Iced": "1.18.0",
"Samboy063.LibCpp2IL": "2022.1.0-development.866",
"StableNameDotNet": "0.1.0-development.866",
"HarmonyX": "2.5.5",
"Iced": "1.11.1",
"IndexRange": "1.0.0",
"Mono.Cecil": "0.11.4",
"Samboy063.LibCpp2IL": "2022.0.7.2",
"System.Runtime.InteropServices": "4.3.0",
"System.ValueTuple": "4.5.0",
"js6pak.Gee.External.Capstone": "2.1.0"
}
},
"Samboy063.LibCpp2IL": {
"type": "Transitive",
"resolved": "2022.1.0-development.866",
"contentHash": "EcJSWTfQko8SQozozoUT+aQJVWC8wj8C0YUiPBF4rNRId19yTKp2IXcXnI747v+8/aal222QR6WHfoBK2WlVLg==",
"resolved": "2022.0.7.2",
"contentHash": "DpVeU0dQkUJCpbw0f1xKOG8vimdK2oYhrVABC7HDE3/ikGjhnMZd3i5b1joKDHZ+AiL90TWOaEXPcy24rCZ0dA==",
"dependencies": {
"AssetRipper.VersionUtilities": "1.3.1",
"Samboy063.WasmDisassembler": "2022.1.0-development.866"
"IndexRange": "1.0.0",
"Samboy063.WasmDisassembler": "2022.0.2"
}
},
"Samboy063.WasmDisassembler": {
"type": "Transitive",
"resolved": "2022.1.0-development.866",
"contentHash": "2QK8F3eISkLcoW/Nt7wtxyQh31EXAqEMBVXXjEnuxyvXpBXxOIGpjmE3pWhGwxQwDCbe4zBsLF1zUiqq3/pXRA=="
"resolved": "2022.0.2",
"contentHash": "2uu+xBb7M3HKfBx9tAY6jiDieAf0hRnQjSmGX+7IdE6i24dYsx6TYgtrLvRx5lOuF2M8DijZ5H8yQ1pcuCs2SA=="
},
"SemanticVersioning": {
"type": "Transitive",
"resolved": "2.0.2",
"contentHash": "4EQgYdNZ92SyaO7YFk6olVnebF5V+jrHyMUjvPq89tLeMo8NSfgDF+6Zwq/lgh9j/0yfQp9Lkm0ZA0rUATCZFA=="
},
"StableNameDotNet": {
"type": "Transitive",
"resolved": "0.1.0-development.866",
"contentHash": "DJb8x4dV3ucDgM12sU28HxCdeqY/JudJbeJG6mgXWDJzpFZw2Jd7JF1pKFRNLzh/0gpo8bCGLQS9gOWZmBjdtg=="
},
"StyleCop.Analyzers.Unstable": {
"type": "Transitive",
"resolved": "1.2.0.507",
"contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw=="
"resolved": "1.2.0.435",
"contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg=="
},
"System.Collections": {
"type": "Transitive",
@@ -675,11 +664,6 @@
"Microsoft.NETCore.Targets": "1.1.0"
}
},
"System.Runtime.CompilerServices.Unsafe": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg=="
},
"System.Runtime.Extensions": {
"type": "Transitive",
"resolved": "4.3.0",
@@ -878,23 +862,6 @@
"System.Runtime": "4.3.0"
}
},
"System.Text.Encodings.Web": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "Vg8eB5Tawm1IFqj4TVK1czJX89rhFxJo9ELqc/Eiq0eXy13RK00eubyU6TJE6y+GQXjyV5gSfiewDUZjQgSE0w==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
},
"System.Text.Json": {
"type": "Transitive",
"resolved": "6.0.7",
"contentHash": "/Tf/9XjprpHolbcDOrxsKVYy/mUG/FS7aGd9YUgBVEiHeQH4kAE0T1sMbde7q6B5xcrNUsJ5iW7D1RvHudQNqA==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0",
"System.Text.Encodings.Web": "6.0.0"
}
},
"System.Threading": {
"type": "Transitive",
"resolved": "4.3.0",
@@ -914,10 +881,16 @@
"System.Runtime": "4.3.0"
}
},
"System.ValueTuple": {
"type": "Transitive",
"resolved": "4.5.0",
"contentHash": "okurQJO6NRE/apDIP23ajJ0hpiNmJ+f0BwOlB/cSqTLQlw5upkf+5+96+iG2Jw40G1fCVCyPz/FhIABUjMR+RQ=="
},
"reactor": {
"type": "Project",
"dependencies": {
"BepInEx.Unity.IL2CPP": "[6.0.0-be.679, )"
"BepInEx.Unity.IL2CPP": "[6.0.0-be.662, )",
"Linguini.Bundle": "[0.3.1, )"
}
}
}
@@ -0,0 +1,36 @@
using System.Text;
using System.Text.RegularExpressions;
using Linguini.Syntax.Ast;
namespace Reactor.Linguinitor;
internal static class FluentCommentParser
{
private static readonly Regex _variableCommentRegex = new(@"^\$(?<id>[\w-]+) \((?<type>String|Number|Date)\)( - (?<description>.+))?$", RegexOptions.Compiled);
public static MessageInfo Parse(AstComment astComment)
{
var descriptionBuilder = new StringBuilder();
var variables = new Dictionary<string, VariableInfo>();
foreach (var s in astComment.AsStr().Split("\n"))
{
var line = s.Trim();
if (_variableCommentRegex.Match(line) is { Success: true } match)
{
variables.Add(match.Groups["id"].Value, new VariableInfo(match.Groups["type"].Value, match.Groups["description"].Value));
}
else
{
descriptionBuilder.AppendLine(line);
}
}
return new MessageInfo(descriptionBuilder.ToString(), variables);
}
public record MessageInfo(string Description, Dictionary<string, VariableInfo> Variables);
public record VariableInfo(string Type, string? Description);
}
+166
View File
@@ -0,0 +1,166 @@
using CSharpPoet;
using Linguini.Syntax.Ast;
using Linguini.Syntax.Parser;
using Microsoft.CodeAnalysis;
namespace Reactor.Linguinitor;
[Generator(LanguageNames.CSharp)]
public class LinguinitorGenerator : IIncrementalGenerator
{
private static CSharpFile CreateTranslateFile(string @namespace, params CSharpType.IMember[] members)
{
return new CSharpFile(@namespace)
{
new CSharpClass(Visibility.Internal, "Translate")
{
IsStatic = true,
IsPartial = true,
Members = members,
},
};
}
private static IEnumerable<Identifier> GetVariables(AstMessage astMessage)
{
foreach (var placeable in astMessage.Value!.Elements.OfType<Placeable>())
{
switch (placeable.Expression)
{
case VariableReference variableReference:
yield return variableReference.Id;
break;
}
}
}
public void Initialize(IncrementalGeneratorInitializationContext context)
{
var rootNamespaceProvider =
context.AnalyzerConfigOptionsProvider
.Select((options, _) => options.GlobalOptions.TryGetValue("build_property.RootNamespace", out var rootNamespace) ? rootNamespace : throw new InvalidOperationException("Failed to get RootNamespace"));
context.RegisterSourceOutput(rootNamespaceProvider, (spc, rootNamespace) =>
{
const string ProviderType = "Reactor.Localization.Providers.FluentLocalizationProvider";
spc.AddSource("Translate", CreateTranslateFile(
rootNamespace,
new CSharpField(Visibility.Private, ProviderType + "?", "_provider") { IsStatic = true },
new CSharpProperty(ProviderType, "Provider")
{
IsStatic = true,
Getter = new CSharpProperty.Accessor
{
Body = writer => writer.Write("_provider ?? throw new System.InvalidOperationException(\"Provider must be set before using Translate\");"),
},
Setter = new CSharpProperty.Accessor
{
Body = writer => writer.Write("_provider = value;"),
},
}
).ToString());
});
var textFiles = context.AdditionalTextsProvider.Where(static file => file.Path.EndsWith(".ftl", StringComparison.Ordinal));
var namesAndContents = textFiles.Select((text, cancellationToken) => (
Name: Path.GetFileNameWithoutExtension(text.Path),
Content: text.GetText(cancellationToken)!.ToString()
));
context.RegisterSourceOutput(namesAndContents.Combine(rootNamespaceProvider), (spc, pair) =>
{
var ((name, content), rootNamespace) = pair;
var fixedName = name.ToPascalCase();
var idsClass = new CSharpClass("Ids")
{
IsStatic = true,
};
var fileClass = new CSharpClass(fixedName)
{
IsStatic = true,
Members = { idsClass },
};
var resource = new LinguiniParser(content).ParseWithComments();
foreach (var message in resource.Entries.OfType<AstMessage>())
{
var id = message.GetId();
var fixedId = id.ToPascalCase();
idsClass.Members.Add(new CSharpField(Visibility.Public, "string", fixedId)
{
IsConst = true,
DefaultValue = $"\"{id}\"",
});
var messageInfo = message.Comment != null ? FluentCommentParser.Parse(message.Comment) : null;
var variables = GetVariables(message).Select(m => m.ToString()).ToDictionary(
m => m,
m =>
{
if (messageInfo != null && messageInfo.Variables.TryGetValue(m, out var variableInfo))
{
return variableInfo.Type switch
{
"String" => "string",
"Number" => "double",
_ => throw new NotSupportedException($"Variable type {variableInfo.Type} is not supported"),
};
}
return "string";
}
);
void WriteComment(CodeWriter writer)
{
if (messageInfo == null) return;
writer.WriteLine("<summary>");
foreach (var line in messageInfo.Description.Trim().Split("\n"))
{
writer.WriteLine(line);
}
writer.WriteLine("</summary>");
foreach (var (variableId, info) in messageInfo.Variables)
{
writer.WriteLine($"<param name=\"{variableId}\">{info.Description}</param>");
}
}
if (variables.Count <= 0)
{
fileClass.Members.Add(new CSharpProperty("string", fixedId)
{
XmlComment = WriteComment,
IsStatic = true,
Getter = new CSharpProperty.Accessor
{
Body = writer => writer.Write($"Provider.GetText(Ids.{fixedId});"),
},
});
}
else
{
fileClass.Members.Add(new CSharpMethod("string", fixedId)
{
XmlComment = WriteComment,
IsStatic = true,
Parameters = variables.Select(v => new CSharpParameter(v.Value, v.Key)).ToArray(),
BodyType = BodyType.Expression,
Body = writer => writer.WriteLine($"Provider.GetText(Ids.{fixedId}, {string.Join(", ", variables.Select(v => $"(\"{v.Key}\", {v.Key.ToCamelCase()})"))});"),
});
}
}
spc.AddSource("Translate." + fixedName, CreateTranslateFile(rootNamespace, fileClass).ToString());
});
}
}
@@ -0,0 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<EnableDynamicLoading>true</EnableDynamicLoading>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CSharpPoet" Version="0.2.0-dev" Private="true" GeneratePathProperty="true" />
<PackageReference Include="Linguini.Shared" Version="0.3.0" Private="true" GeneratePathProperty="true" />
<PackageReference Include="Linguini.Syntax" Version="0.3.0" Private="true" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.3.1" PrivateAssets="all" />
</ItemGroup>
<PropertyGroup>
<GetTargetPathDependsOn>$(GetTargetPathDependsOn);GetDependencyTargetPaths</GetTargetPathDependsOn>
</PropertyGroup>
<Target Name="GetDependencyTargetPaths">
<PropertyGroup>
<_LinguiniTargetFramework Condition="'$(TargetFramework)' == 'net6.0'">netstandard2.1</_LinguiniTargetFramework>
<_LinguiniTargetFramework Condition="'$(TargetFramework)' == 'net472'">net451</_LinguiniTargetFramework>
</PropertyGroup>
<ItemGroup>
<TargetPathWithTargetPlatformMoniker Include="$(PkgCSharpPoet)\lib\netstandard2.0\CSharpPoet.dll" IncludeRuntimeDependency="false" />
<TargetPathWithTargetPlatformMoniker Include="$(PkgLinguini_Shared)\lib\$(_LinguiniTargetFramework)\Linguini.Shared.dll" IncludeRuntimeDependency="false" />
<TargetPathWithTargetPlatformMoniker Include="$(PkgLinguini_Syntax)\lib\$(_LinguiniTargetFramework)\Linguini.Syntax.dll" IncludeRuntimeDependency="false" />
</ItemGroup>
</Target>
</Project>
+38
View File
@@ -0,0 +1,38 @@
using System.Text;
namespace Reactor.Linguinitor;
internal static class StringExtensions
{
private static string ToCase(this string value, bool capitalizeFirst)
{
var stringBuilder = new StringBuilder();
for (var i = 0; i < value.Length; i++)
{
var c = value[i];
if (c == '-')
{
i++;
stringBuilder.Append(char.ToUpperInvariant(value[i]));
}
else
{
stringBuilder.Append(capitalizeFirst && i == 0 ? char.ToUpperInvariant(c) : c);
}
}
return stringBuilder.ToString();
}
public static string ToPascalCase(this string value)
{
return value.ToCase(true);
}
public static string ToCamelCase(this string value)
{
return value.ToCase(false);
}
}
+105
View File
@@ -0,0 +1,105 @@
{
"version": 1,
"dependencies": {
"net6.0": {
"CSharpPoet": {
"type": "Direct",
"requested": "[0.2.0-dev, )",
"resolved": "0.2.0-dev"
},
"Linguini.Shared": {
"type": "Direct",
"requested": "[0.3.0, )",
"resolved": "0.3.0",
"contentHash": "rEYA9jWU1Nc9iDuPKar+4IVXjFbGrcNyYZCeU6hiWQoS4nA2UecHu36Rp4bxzasvRGda4FB2JZqty75m4e26VQ=="
},
"Linguini.Syntax": {
"type": "Direct",
"requested": "[0.3.0, )",
"resolved": "0.3.0",
"contentHash": "v8YV3xPFZfP+OSWjMd6yysp+o7cNnQXxq/slN8Yekoi+dFjsTNF0YiQWJIwg1j2FUbs6claJxY9R1FFlc4s6MA==",
"dependencies": {
"Linguini.Shared": "0.3.0"
}
},
"Microsoft.CodeAnalysis.CSharp": {
"type": "Direct",
"requested": "[4.3.1, )",
"resolved": "4.3.1",
"contentHash": "5C9VHvahL98tumlyaT/loB5rW+K/6q0UU7uLyT1Dv15YjZraRkqML9u2t2e8GaO7XqEOtBVqK/SlxXOPqwzxog==",
"dependencies": {
"Microsoft.CodeAnalysis.Common": "[4.3.1]"
}
},
"StyleCop.Analyzers": {
"type": "Direct",
"requested": "[1.2.0-beta.435, )",
"resolved": "1.2.0-beta.435",
"contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==",
"dependencies": {
"StyleCop.Analyzers.Unstable": "1.2.0.435"
}
},
"Microsoft.CodeAnalysis.Analyzers": {
"type": "Transitive",
"resolved": "3.3.3",
"contentHash": "j/rOZtLMVJjrfLRlAMckJLPW/1rze9MT1yfWqSIbUPGRu1m1P0fuo9PmqapwsmePfGB5PJrudQLvmUOAMF0DqQ=="
},
"Microsoft.CodeAnalysis.Common": {
"type": "Transitive",
"resolved": "4.3.1",
"contentHash": "wexpJffSEEwptwe6UTMxRDZCCtz+XubI4Qewl4JECnNhcQrtb0anhSUEV9Nz7WkoNfWkx1fptR8xh1egoxYrqw==",
"dependencies": {
"Microsoft.CodeAnalysis.Analyzers": "3.3.3",
"System.Collections.Immutable": "6.0.0",
"System.Memory": "4.5.4",
"System.Reflection.Metadata": "5.0.0",
"System.Runtime.CompilerServices.Unsafe": "6.0.0",
"System.Text.Encoding.CodePages": "6.0.0",
"System.Threading.Tasks.Extensions": "4.5.4"
}
},
"StyleCop.Analyzers.Unstable": {
"type": "Transitive",
"resolved": "1.2.0.435",
"contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg=="
},
"System.Collections.Immutable": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "l4zZJ1WU2hqpQQHXz1rvC3etVZN+2DLmQMO79FhOTZHMn8tDRr+WU287sbomD0BETlmKDn0ygUgVy9k5xkkJdA==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
},
"System.Memory": {
"type": "Transitive",
"resolved": "4.5.4",
"contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw=="
},
"System.Reflection.Metadata": {
"type": "Transitive",
"resolved": "5.0.0",
"contentHash": "5NecZgXktdGg34rh1OenY1rFNDCI8xSjFr+Z4OU4cU06AQHUdRnIIEeWENu3Wl4YowbzkymAIMvi3WyK9U53pQ=="
},
"System.Runtime.CompilerServices.Unsafe": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg=="
},
"System.Text.Encoding.CodePages": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "ZFCILZuOvtKPauZ/j/swhvw68ZRi9ATCfvGbk1QfydmcXBkIWecWKn/250UH7rahZ5OoDBaiAudJtPvLwzw85A==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
},
"System.Threading.Tasks.Extensions": {
"type": "Transitive",
"resolved": "4.5.4",
"contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg=="
}
}
}
}
+3 -3
View File
@@ -94,18 +94,18 @@ public readonly struct Mod : IEquatable<Mod>
var clientMissing = hostMods.Where(mod => mod.IsRequiredOnAllClients && !clientMods.Contains(mod)).ToArray();
var hostMissing = clientMods.Where(mod => mod.IsRequiredOnAllClients && !hostMods.Contains(mod)).ToArray();
if (clientMissing.Length != 0 || hostMissing.Length != 0)
if (clientMissing.Any() || hostMissing.Any())
{
var message = new StringBuilder();
if (clientMissing.Length != 0)
if (clientMissing.Any())
{
message.Append("You are missing: ");
message.AppendJoin(", ", clientMissing.Select(x => x.ToString()));
message.AppendLine();
}
if (hostMissing.Length != 0)
if (hostMissing.Any())
{
message.Append("Host is missing: ");
message.AppendJoin(", ", hostMissing.Select(x => x.ToString()));
-5
View File
@@ -27,9 +27,4 @@ public enum ModFlags : ushort
/// Requires the host of the lobby to have the mod.
/// </summary>
RequireOnHost = 1 << 2,
/// <summary>
/// Notifies the game server that the host has authority over game logic.
/// </summary>
DisableServerAuthority = 1 << 3,
}
+6
View File
@@ -18,6 +18,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Reactor.Networking.Shared", "Reactor.Networking.Shared\Reactor.Networking.Shared.csproj", "{1E68CA20-22EB-4E57-B525-81970BE6363D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Reactor.Linguinitor", "Reactor.Linguinitor\Reactor.Linguinitor.csproj", "{B4740F75-B657-4515-A8F6-8A84D64E8814}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -44,6 +46,10 @@ Global
{1E68CA20-22EB-4E57-B525-81970BE6363D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E68CA20-22EB-4E57-B525-81970BE6363D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E68CA20-22EB-4E57-B525-81970BE6363D}.Release|Any CPU.Build.0 = Release|Any CPU
{B4740F75-B657-4515-A8F6-8A84D64E8814}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B4740F75-B657-4515-A8F6-8A84D64E8814}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B4740F75-B657-4515-A8F6-8A84D64E8814}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B4740F75-B657-4515-A8F6-8A84D64E8814}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
EndGlobalSection
@@ -0,0 +1,10 @@
-for-more-info-see = For more info see https://reactor.gg/handshake
vanilla-server-warning =
This server doesn't support Reactor protocol.
The lobbies shown may not be compatible with your current mods.
{ -for-more-info-see }
public-lobby-warning =
You can't make public lobbies on servers that don't support Reactor protocol.
{ -for-more-info-see }
@@ -0,0 +1,10 @@
-for-more-info-see = Voor meer informatie, zie https://reactor.gg/handshake
vanilla-server-warning =
Deze server ondersteunt het Reactor protocol niet.
De lobbies die je ziet passen mogelijk niet bij jouw huidige mods.
{ -for-more-info-see }
public-lobby-warning =
Je kan geen publieke lobbies maken op servers die het Reactor protocol niet ondersteunen.
{ -for-more-info-see }
@@ -0,0 +1,10 @@
-for-more-info-see = Dla więcej informacji, zobacz https://reactor.gg/handshake
vanilla-server-warning =
Ten serwer nie wspiera protokołu Reactor.
Pokazane gry mogą nie być kompatibline z twoimi modami.
{ -for-more-info-see }
public-lobby-warning =
Nie możesz tworzyć publicznych gier w serwerach, które nie wspierają protokołu Reactor.
{ -for-more-info-see }
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,258 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Linguini.Bundle;
using Linguini.Bundle.Builder;
using Linguini.Bundle.Errors;
using Linguini.Shared.Types.Bundle;
using Linguini.Syntax.Ast;
using Reactor.Localization.Extensions;
using Reactor.Localization.Utilities;
using Reactor.Utilities;
using Object = Il2CppSystem.Object;
namespace Reactor.Localization.Providers;
/// <summary>
/// Represents a localization provider that uses Fluent.
/// </summary>
public class FluentLocalizationProvider : LocalizationProvider
{
private readonly Func<CultureInfo, IEnumerable<Resource>> _loadResources;
private readonly List<FluentBundle> _bundles = new();
private readonly Dictionary<StringNames, string> _ids = new();
private readonly Dictionary<StringNames, string[]> _arguments = new();
/// <summary>
/// Gets or sets the fallback language.
/// </summary>
public SupportedLangs FallbackLanguage { get; set; } = SupportedLangs.English;
/// <summary>
/// Initializes a new instance of the <see cref="FluentLocalizationProvider"/> class.
/// </summary>
/// <param name="loadResources">The implementation of resource loading.</param>
public FluentLocalizationProvider(Func<CultureInfo, IEnumerable<Resource>> loadResources)
{
_loadResources = loadResources;
}
/// <summary>
/// Initializes a new instance of the <see cref="FluentLocalizationProvider"/> class that loads resources from the calling assembly.
/// </summary>
/// <param name="prefix">The prefix of resource file names to load.</param>
/// <returns>a <see cref="FluentLocalizationProvider"/>.</returns>
public static FluentLocalizationProvider FromEmbeddedResources(string prefix) => FromEmbeddedResources(Assembly.GetCallingAssembly(), prefix);
/// <summary>
/// Initializes a new instance of the <see cref="FluentLocalizationProvider"/> class that loads resources from the specified <paramref name="assembly"/>.
/// </summary>
/// <param name="assembly">The assembly to load resources from.</param>
/// <param name="prefix">The prefix of resource file names to load.</param>
/// <returns>a <see cref="FluentLocalizationProvider"/>.</returns>
public static FluentLocalizationProvider FromEmbeddedResources(Assembly assembly, string prefix)
{
return new FluentLocalizationProvider(cultureInfo =>
{
return assembly.GetManifestResourceNames()
.Where(n => n.StartsWith($"{prefix}.{cultureInfo.Name}.", StringComparison.Ordinal) && n.EndsWith(".ftl", StringComparison.Ordinal))
.Select(n => (Resource) new StreamReader(assembly.GetManifestResourceStream(n)!));
});
}
/// <summary>
/// Registers a <see cref="StringNames"/> for use with base game apis.
/// </summary>
/// <param name="id">The id of a Fluent message.</param>
/// <returns>A <see cref="StringNames"/>.</returns>
public StringNames Register(string id)
{
var stringNames = CustomStringName.Create();
_ids[stringNames] = id;
return stringNames;
}
/// <summary>
/// Registers a <see cref="StringNames"/> for use with base game apis with overriden format argument names.
/// </summary>
/// <param name="id">The id of a Fluent message.</param>
/// <param name="argumentNames">An array of Fluent variable names in the same order as format arguments.</param>
/// <returns>A <see cref="StringNames"/>.</returns>
public StringNames Register(string id, params string[] argumentNames)
{
var stringNames = Register(id);
_arguments[stringNames] = argumentNames;
return stringNames;
}
/// <inheritdoc/>
public override int Priority => ReactorPriority.Normal;
/// <inheritdoc />
public override void OnLanguageChanged(SupportedLangs newLanguage)
{
if (CurrentLanguage == newLanguage) return;
_bundles.Clear();
_bundles.Add(Load(newLanguage.ToCultureInfo()));
if (newLanguage != FallbackLanguage) _bundles.Add(Load(FallbackLanguage.ToCultureInfo()));
}
private FluentBundle Load(CultureInfo culture)
{
return LinguiniBuilder.Builder()
.CultureInfo(culture)
.AddResources(_loadResources(culture))
.SetUseIsolating(false)
.UncheckedBuild();
}
private string GetMsg(string id, IDictionary<string, IFluentType>? args)
{
foreach (var bundle in _bundles)
{
if (bundle.TryGetMsg(id, null, args, out var errors, out var message))
{
if (errors.Count > 0)
{
throw new LinguiniException(errors);
}
return message;
}
}
throw new KeyNotFoundException();
}
private static bool Is<T>(Il2CppObjectBase o)
{
return IL2CPP.il2cpp_class_is_assignable_from(Il2CppClassPointerStore<T>.NativeClassPtr, IL2CPP.il2cpp_object_get_class(o.Pointer));
}
private static bool TryUnbox<T>(Il2CppObjectBase o, [NotNullWhen(true)] out T? result) where T : unmanaged
{
if (!Is<T>(o))
{
result = null;
return false;
}
result = o.Unbox<T>();
return true;
}
private static IFluentType ToFluentType(Object o)
{
if (Is<string>(o)) return new FluentString(IL2CPP.Il2CppStringToManaged(o.Pointer));
if (TryUnbox<byte>(o, out var @byte)) return (FluentNumber) @byte;
if (TryUnbox<sbyte>(o, out var @sbyte)) return (FluentNumber) @sbyte;
if (TryUnbox<short>(o, out var @short)) return (FluentNumber) @short;
if (TryUnbox<int>(o, out var @int)) return (FluentNumber) @int;
if (TryUnbox<long>(o, out var @long)) return (FluentNumber) @long;
if (TryUnbox<ushort>(o, out var @ushort)) return (FluentNumber) @ushort;
if (TryUnbox<uint>(o, out var @uint)) return (FluentNumber) @uint;
if (TryUnbox<ulong>(o, out var @ulong)) return (FluentNumber) @ulong;
if (TryUnbox<float>(o, out var @float)) return (FluentNumber) @float;
if (TryUnbox<double>(o, out var @double)) return (FluentNumber) @double;
return new FluentString(o.ToString());
}
private static IFluentType ToFluentType(object o)
{
return o switch
{
string str => (FluentString) str,
byte num => (FluentNumber) num,
sbyte num => (FluentNumber) num,
short num => (FluentNumber) num,
ushort num => (FluentNumber) num,
int num => (FluentNumber) num,
uint num => (FluentNumber) num,
long num => (FluentNumber) num,
ulong num => (FluentNumber) num,
double num => (FluentNumber) num,
float num => (FluentNumber) num,
_ => (FluentString) o.ToString()!,
};
}
/// <summary>
/// Returns the localized text for the given fluent message <paramref name="id"/>.
/// </summary>
/// <param name="id">The id of the message.</param>
/// <param name="args">The arguments used for formatting.</param>
/// <returns>Text localized and formatted by fluent.</returns>
public string GetText(string id, params (string, object)[] args)
{
var fluentArgs = new Dictionary<string, IFluentType>(args.Length);
foreach (var (key, value) in args)
{
fluentArgs[key] = ToFluentType(value);
}
return GetMsg(id, fluentArgs);
}
/// <inheritdoc/>
public override bool TryGetTextFormatted(StringNames stringName, Il2CppReferenceArray<Object> parts, [NotNullWhen(true)] out string? result)
{
if (_ids.TryGetValue(stringName, out var id))
{
var hasArgumentsOverride = _arguments.TryGetValue(stringName, out var arguments);
if (hasArgumentsOverride)
{
if (arguments!.Length != parts.Length)
throw new InvalidOperationException($"Arguments override for {id} has an invalid count of arguments");
}
var args = new Dictionary<string, IFluentType>(parts.Length);
for (var i = 0; i < parts.Count; i++)
{
var part = parts[i];
if (hasArgumentsOverride)
{
args[arguments![i]] = ToFluentType(part);
}
else
{
// Fluent doesn't allow positional variables nor starting variable names with numbers so we have to use a,b,c,d... instead
if (i > 25) throw new InvalidOperationException("Too many format parts");
var c = (char) ('a' + i);
args[c.ToString()] = ToFluentType(part);
}
}
result = GetMsg(id, args);
return true;
}
result = null;
return false;
}
/// <inheritdoc/>
public override bool TryGetText(StringNames stringName, [NotNullWhen(true)] out string? result)
{
if (_ids.TryGetValue(stringName, out var id))
{
result = GetMsg(id, null);
return true;
}
result = null;
return false;
}
}
-35
View File
@@ -1,35 +0,0 @@
using Reactor.Utilities.UI;
using UnityEngine;
namespace Reactor.Networking;
internal static class HandshakePopup
{
public const string Message =
"""
This server doesn't support Reactor's modded handshake.
The lobbies shown could be incompatible with your current mods.
For more info see <link=https://reactor.gg/handshake>reactor.gg/handshake</link>
""";
private static ReactorPopup? _popup;
public static void Show()
{
if (_popup == null)
{
_popup = ReactorPopup.Create(nameof(HandshakePopup));
_popup.Background.transform.localPosition = new Vector3(0, 0.20f, 0);
_popup.Background.size = new Vector2(6.5f, 1.7f);
_popup.BackButton.transform.SetLocalY(-0.2f);
}
var message = ReactorConfig.HandshakePopupMessage.Value;
if (string.IsNullOrEmpty(message))
{
message = Message;
}
_popup.Show(message);
}
}
@@ -1,34 +0,0 @@
using Reactor.Utilities.UI;
using UnityEngine;
namespace Reactor.Networking;
internal static class MakePublicDisallowedPopup
{
public const string Message =
"""
You can't make public lobbies on servers that don't support modded handshake.
For more info see <link=https://reactor.gg/handshake>reactor.gg/handshake</link>
""";
private static ReactorPopup? _popup;
public static void Show()
{
if (_popup == null)
{
_popup = ReactorPopup.Create(nameof(MakePublicDisallowedPopup));
_popup.Background.transform.localPosition = new Vector3(0, 0.25f, 0);
_popup.Background.size = new Vector2(7.5f, 1.5f);
_popup.BackButton.transform.SetLocalY(-0.1f);
}
var message = ReactorConfig.MakePublicDisallowedPopupMessage.Value;
if (string.IsNullOrEmpty(message))
{
message = Message;
}
_popup.Show(message);
}
}
+1 -7
View File
@@ -39,9 +39,6 @@ public static class ModList
return _modByPluginType[pluginType];
}
internal static bool IsAnyModRequiredOnAllClients { get; private set; }
internal static bool IsAnyModDisableServerAuthority { get; private set; }
private static readonly Dictionary<uint, Mod> _modByNetId = new();
private static readonly Dictionary<Mod, uint> _netIdByMod = new();
@@ -101,7 +98,7 @@ public static class ModList
.Select(pluginInfo => GetById(pluginInfo.Metadata.GUID))
.OrderByDescending(x => x.Id == ReactorPlugin.Id)
.ThenBy(x => x.Id, StringComparer.Ordinal)
.ToArray();
.ToHashSet();
_modByNetId.Clear();
_netIdByMod.Clear();
@@ -116,9 +113,6 @@ public static class ModList
netId++;
}
IsAnyModRequiredOnAllClients = Current.Any(m => m.IsRequiredOnAllClients);
IsAnyModDisableServerAuthority = Current.Any(m => (m.Flags & ModFlags.DisableServerAuthority) != 0);
var debug = new StringBuilder("Mod list:");
foreach (var mod in Current)
{
+22 -73
View File
@@ -1,7 +1,4 @@
using System;
using System.Linq;
using AmongUs.Data;
using BepInEx.Unity.IL2CPP.Utils;
using HarmonyLib;
using Hazel;
using Il2CppInterop.Runtime;
@@ -10,7 +7,6 @@ using InnerNet;
using Reactor.Networking.Extensions;
using Reactor.Networking.Messages;
using UnityEngine;
using IEnumerator = System.Collections.IEnumerator;
namespace Reactor.Networking.Patches;
@@ -29,10 +25,10 @@ internal static class ClientPatches
}
}
[HarmonyPatch(typeof(InnerNetClient._HandleGameDataInner_d__41), nameof(InnerNetClient._HandleGameDataInner_d__41.MoveNext))]
[HarmonyPatch(typeof(InnerNetClient._HandleGameDataInner_d__39), nameof(InnerNetClient._HandleGameDataInner_d__39.MoveNext))]
public static class HandleGameDataInnerPatch
{
public static bool Prefix(InnerNetClient._HandleGameDataInner_d__41 __instance, ref bool __result)
public static bool Prefix(InnerNetClient._HandleGameDataInner_d__39 __instance, ref bool __result)
{
var innerNetClient = __instance.__4__this;
var reader = __instance.reader;
@@ -63,7 +59,7 @@ internal static class ClientPatches
return false;
}
if (reader.Tag == InnerNetClient.SceneChangeFlag && ReactorConnection.Instance?.Syncer == Syncer.Host)
if (ReactorConnection.Instance!.Syncer == Syncer.Host && reader.Tag == InnerNetClient.SceneChangeFlag)
{
var clientId = reader.ReadPackedInt32();
var clientData = innerNetClient.FindClientById(clientId);
@@ -87,56 +83,17 @@ internal static class ClientPatches
if (innerNetClient.AmHost)
{
if (reactorClientData == null && ModList.IsAnyModRequiredOnAllClients)
if (reactorClientData == null)
{
IEnumerator CoKick()
{
var startTime = DateTimeOffset.UtcNow;
string? playerName;
Warning("Kicking " + clientData.PlayerName + " for not having Reactor installed");
PlayerControl.LocalPlayer.RpcSendChat(clientData.PlayerName + " tried joining without Reactor installed");
innerNetClient.KickPlayer(clientData.Id, false);
do
{
yield return null;
if (DateTimeOffset.UtcNow - startTime > TimeSpan.FromSeconds(2))
{
playerName = "(unknown)";
break;
}
playerName = GameData.Instance.GetPlayerByClient(clientData)?.PlayerName;
} while (string.IsNullOrEmpty(playerName));
Warning("Kicking " + playerName + " for not having Reactor installed");
const int ChatMessageLimit = 100;
var chatText = $"{playerName} tried joining without the following mods:";
foreach (var mod in ModList.Current.Where(m => m.IsRequiredOnAllClients))
{
chatText += $"\n- {mod}";
}
HudManager.Instance.Chat.AddChat(PlayerControl.LocalPlayer, chatText, false);
if (DataManager.Settings.Multiplayer.ChatMode == QuickChatModes.FreeChatOrQuickChat)
{
var truncatedChatText = chatText.Length > ChatMessageLimit
? chatText[..(ChatMessageLimit - 3)] + "..."
: chatText;
// Write SendChat directly instead of using RpcSendChat so we can call AddChat ourselves
var messageWriter = AmongUsClient.Instance.StartRpc(PlayerControl.LocalPlayer.NetId, (byte) RpcCalls.SendChat);
messageWriter.Write(truncatedChatText);
messageWriter.EndMessage();
}
innerNetClient.KickPlayer(clientData.Id, false);
}
innerNetClient.StartCoroutine(CoKick());
__result = false;
return false;
}
else if (!Mod.Validate(reactorClientData?.Mods ?? Array.Empty<Mod>(), ModList.Current, out var reason))
if (!Mod.Validate(reactorClientData.Mods, ModList.Current, out var reason))
{
innerNetClient.KickWithReason(clientData.Id, reason);
__result = false;
@@ -161,22 +118,18 @@ internal static class ClientPatches
}
}
[HarmonyPatch(typeof(InnerNetClient._CoSendSceneChange_d__32), nameof(InnerNetClient._CoSendSceneChange_d__32.MoveNext))]
[HarmonyPatch(typeof(InnerNetClient._CoSendSceneChange_d__30), nameof(InnerNetClient._CoSendSceneChange_d__30.MoveNext))]
public static class CoSendSceneChangePatch
{
public static bool Prefix(InnerNetClient._CoSendSceneChange_d__32 __instance, ref bool __result)
public static bool Prefix(InnerNetClient._CoSendSceneChange_d__30 __instance, ref bool __result)
{
if (ReactorConnection.Instance!.Syncer != Syncer.Host) return true;
var innerNetClient = __instance.__4__this;
// Check for the conditions when the scene change message should be sent
if (!innerNetClient.AmHost &&
innerNetClient.connection.State == ConnectionState.Connected &&
innerNetClient.ClientId >= 0)
if (__instance.__1__state == 2)
{
var clientData = innerNetClient.FindClientById(innerNetClient.ClientId);
if (clientData != null)
if (!innerNetClient.AmHost && innerNetClient.connection.State == ConnectionState.Connected)
{
var writer = MessageWriter.Get(SendOption.Reliable);
writer.StartMessage(Tags.GameData);
@@ -194,25 +147,21 @@ internal static class ClientPatches
writer.EndMessage();
innerNetClient.SendOrDisconnect(writer);
writer.Recycle();
// Create a new coroutine to let AmongUsClient handle scene changes too
innerNetClient.StartCoroutine(innerNetClient.CoOnPlayerChangedScene(clientData, __instance.sceneName));
// Cancel this coroutine
__instance.__1__state = -1;
__result = false;
return false;
}
__instance.__1__state = -1;
__result = false;
return false;
}
return true;
}
}
[HarmonyPatch(typeof(InnerNetClient._CoHandleSpawn_d__42), nameof(InnerNetClient._CoHandleSpawn_d__42.MoveNext))]
[HarmonyPatch(typeof(InnerNetClient._CoHandleSpawn_d__40), nameof(InnerNetClient._CoHandleSpawn_d__40.MoveNext))]
public static class CoHandleSpawnPatch
{
public static void Postfix(InnerNetClient._CoHandleSpawn_d__42 __instance, bool __result)
public static void Postfix(InnerNetClient._CoHandleSpawn_d__40 __instance, bool __result)
{
if (ReactorConnection.Instance!.Syncer != Syncer.Host) return;
@@ -285,7 +234,7 @@ internal static class ClientPatches
{
public static bool Prefix(InnerNetClient __instance, [HarmonyArgument(0)] MessageReader reader)
{
if (__instance.NetworkMode == NetworkModes.FreePlay) return true;
if (__instance.GameMode == GameModes.FreePlay) return true;
var isFirst = false;
+25 -8
View File
@@ -5,6 +5,7 @@ using HarmonyLib;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;
using Object = UnityEngine.Object;
namespace Reactor.Networking.Patches;
@@ -84,9 +85,9 @@ internal static class HttpPatches
if (__instance.GetMethod() == UnityWebRequest.UnityWebRequestMethod.Get)
{
if (responseHeader == null && ModList.IsAnyModRequiredOnAllClients)
if (responseHeader == null)
{
HandshakePopup.Show();
DisconnectPopup.Instance.ShowCustom(Translate.Messages.VanillaServerWarning);
}
}
@@ -101,16 +102,32 @@ internal static class HttpPatches
{
public static void Postfix(GameStartManager __instance)
{
if (AmongUsClient.Instance.NetworkMode != NetworkModes.OnlineGame) return;
if (ModList.IsAnyModRequiredOnAllClients && !IsCurrentRegionModded())
if (AmongUsClient.Instance.GameMode != GameModes.OnlineGame) return;
if (ModList.Current.Any(m => m.IsRequiredOnAllClients) && !IsCurrentRegionModded())
{
Warning("Vanilla region, locking public toggle");
__instance.HostPublicButton.enabled = false;
__instance.HostPrivateButton.transform.FindChild("Inactive").GetComponent<SpriteRenderer>().color = new Color(1, 1, 1, 0.5f);
__instance.MakePublicButtonBehaviour.enabled = false;
var actionMapGlyphDisplay = __instance.MakePublicButton.GetComponentInChildren<ActionMapGlyphDisplay>(includeInactive: true);
if (actionMapGlyphDisplay)
{
actionMapGlyphDisplay.gameObject.SetActive(value: false);
}
var onClick = __instance.HostPrivateButton.OnClick = new Button.ButtonClickedEvent();
onClick.AddListener((Action) MakePublicDisallowedPopup.Show);
__instance.MakePublicButton.color = new Color(1, 1, 1, 0.5f);
__instance.MakePublicButton.sprite = __instance.PrivateGameImage;
var onClick = __instance.MakePublicButton.GetComponent<PassiveButton>().OnClick = new Button.ButtonClickedEvent();
onClick.AddListener((Action) (() =>
{
var popup = Object.Instantiate(DiscordManager.Instance.discordPopup, Camera.main!.transform);
var background = popup.transform.Find("Background").GetComponent<SpriteRenderer>();
var size = background.size;
size.x *= 2.5f;
background.size = size;
popup.TextAreaTMP.fontSizeMin = 2;
popup.Show(Translate.Messages.PublicLobbyWarning);
}));
if (AmongUsClient.Instance.AmHost && AmongUsClient.Instance.IsGamePublic)
{
@@ -4,7 +4,7 @@ using InnerNet;
namespace Reactor.Networking.Patches;
internal sealed class ReactorClientData
internal class ReactorClientData
{
public ClientData ClientData { get; }
+1 -1
View File
@@ -96,7 +96,7 @@ public abstract class UnsafeCustomRpc
/// <param name="ackCallback">The callback to invoke when this packet is acknowledged.</param>
public void UnsafeSend(InnerNetObject innerNetObject, object? data, bool immediately = false, int targetClientId = -1, Action? ackCallback = null)
{
ArgumentNullException.ThrowIfNull(innerNetObject);
if (innerNetObject == null) throw new ArgumentNullException(nameof(innerNetObject));
if (Manager == null)
{
-18
View File
@@ -1,18 +0,0 @@
using HarmonyLib;
namespace Reactor.Patches.Fixes;
/// <summary>
/// Fixes Game Lists not working on servers using legacy matchmaking.
/// </summary>
[HarmonyPatch(typeof(AmongUsClient._CoFindGame_d__3), nameof(AmongUsClient._CoFindGame_d__3.MoveNext))]
internal static class CoFindGamePatch
{
public static void Prefix()
{
if (AmongUsClient.Instance.LastDisconnectReason == DisconnectReasons.Unknown)
{
AmongUsClient.Instance.LastDisconnectReason = DisconnectReasons.ExitGame;
}
}
}
@@ -1,5 +1,3 @@
using System;
using System.Linq;
using HarmonyLib;
namespace Reactor.Patches.Miscellaneous;
@@ -7,25 +5,11 @@ namespace Reactor.Patches.Miscellaneous;
[HarmonyPatch]
internal static class CustomServersPatch
{
private static bool IsCurrentServerOfficial()
{
const string Domain = "among.us";
return ServerManager.Instance.CurrentRegion?.TryCast<StaticHttpRegionInfo>() is { } regionInfo &&
regionInfo.PingServer.EndsWith(Domain, StringComparison.Ordinal) &&
regionInfo.Servers.All(serverInfo => serverInfo.Ip.EndsWith(Domain, StringComparison.Ordinal));
}
[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 DisableAuthServer(ref bool __result)
public static bool DisableAuthServer(out bool __result)
{
if (IsCurrentServerOfficial())
{
return true;
}
__result = false;
return false;
}
@@ -1,41 +0,0 @@
using HarmonyLib;
using Reactor.Networking;
namespace Reactor.Patches.Miscellaneous;
[HarmonyPatch]
internal static class DisableServerAuthorityPatch
{
private const int DisableServerAuthorityFlag = 25;
public static bool Enabled => ModList.IsAnyModDisableServerAuthority || ReactorConfig.ForceDisableServerAuthority.Value;
[HarmonyPatch(typeof(Constants), nameof(Constants.GetBroadcastVersion))]
[HarmonyPostfix]
public static void GetBroadcastVersionPatch(ref int __result)
{
if (!Enabled) return;
if (AmongUsClient.Instance.NetworkMode != NetworkModes.OnlineGame) return;
Debug("Sending the DisableServerAuthority flag");
var revision = __result % 50;
if (revision < DisableServerAuthorityFlag)
{
__result += DisableServerAuthorityFlag;
}
}
[HarmonyPatch(typeof(Constants), nameof(Constants.IsVersionModded))]
[HarmonyPrefix]
public static bool IsVersionModdedPatch(ref bool __result)
{
if (Enabled)
{
__result = true;
return false;
}
return true;
}
}
@@ -30,7 +30,7 @@ internal static class FreeNamePatch
var editName = DestroyableSingleton<AccountManager>.Instance.accountTab.editNameScreen;
var nameText = Object.Instantiate(editName.nameText.gameObject);
nameText.transform.localPosition += Vector3.up * (AccountManager.Instance.isActiveAndEnabled ? 1.85f : 2.2f);
nameText.transform.localPosition += Vector3.up * 2.2f;
var textBox = nameText.GetComponent<TextBoxTMP>();
textBox.outputText.alignment = TextAlignmentOptions.CenterGeoAligned;
@@ -56,10 +56,10 @@ internal static class FreeNamePatch
"JoinGameButton",
};
var yStart = Vector3.up * (AccountManager.Instance.isActiveAndEnabled ? 0.9f : 1.1f);
var yStart = Vector3.up;
var yOffset = Vector3.down * 1.5f;
var gameObjects = toMove.Select(x => GameObject.Find("NormalMenu/Buttons/" + x)).ToList();
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++)
+20 -48
View File
@@ -25,65 +25,37 @@ public static class ReactorVersionShower
/// </summary>
public static event Action<TextMeshPro>? TextUpdated;
private static void SetMainMenuPositionFromAspect(float aspectRatio)
{
if (Text == null) return;
var pos = new Vector3(-1.2287f * aspectRatio + 10.9f, -0.57f, 4.5f);
Text.transform.position = pos;
}
private static readonly ResolutionManager.ResolutionChangedHandler _resolutionChangedHandler = (Action<float, int, int, bool>) ((aspectRatio, _, _, _) =>
{
SetMainMenuPositionFromAspect(aspectRatio);
});
internal static void Initialize()
{
SceneManager.add_sceneLoaded((Action<Scene, LoadSceneMode>) ((scene, _) =>
SceneManager.add_sceneLoaded((Action<Scene, LoadSceneMode>) ((_, _) =>
{
var original = UnityEngine.Object.FindObjectOfType<VersionShower>();
if (!original)
return;
var originalAspectPosition = original.GetComponent<AspectPosition>();
var originalText = original.GetComponentInChildren<TextMeshPro>();
var gameObject = new GameObject("ReactorVersion " + Guid.NewGuid());
gameObject.transform.parent = original.transform.parent;
var gameObject = new GameObject("ReactorVersion");
var aspectPosition = gameObject.AddComponent<AspectPosition>();
aspectPosition.Alignment = AspectPosition.EdgeAlignments.LeftTop;
var originalAspectPosition = original.GetComponent<AspectPosition>();
var originalPosition = originalAspectPosition.DistanceFromEdge;
originalPosition.y = 0.15f;
originalAspectPosition.DistanceFromEdge = originalPosition;
originalAspectPosition.AdjustPosition();
var position = originalPosition;
position.x += 10.075f - 0.1f;
position.y += 2.75f - 0.15f;
position.z -= 1;
aspectPosition.DistanceFromEdge = position;
aspectPosition.AdjustPosition();
Text = gameObject.AddComponent<TextMeshPro>();
Text.font = originalText.font;
Text.fontMaterial = originalText.fontMaterial;
Text.UpdateFontAsset();
Text.overflowMode = TextOverflowModes.Overflow;
Text.fontSize = 2;
Text.outlineWidth = 0.1f;
Text.enableWordWrapping = false;
Text.alignment = TextAlignmentOptions.TopLeft;
if (scene.name == "MainMenu")
{
ResolutionManager.add_ResolutionChanged(_resolutionChangedHandler);
SetMainMenuPositionFromAspect(Screen.width / (float) Screen.height);
}
else
{
ResolutionManager.remove_ResolutionChanged(_resolutionChangedHandler);
var aspectPosition = gameObject.AddComponent<AspectPosition>();
var distanceFromEdge = new Vector3(10.13f, 2.55f, -1);
if (originalAspectPosition.Alignment == AspectPosition.EdgeAlignments.LeftTop)
{
distanceFromEdge.y += 0.2f;
}
else if (AccountManager.Instance.isActiveAndEnabled)
{
distanceFromEdge.x += 0.2f;
distanceFromEdge.y += 0.575f;
}
aspectPosition.Alignment = AspectPosition.EdgeAlignments.LeftTop;
aspectPosition.DistanceFromEdge = distanceFromEdge;
aspectPosition.AdjustPosition();
}
UpdateText();
}));
+11
View File
@@ -1,19 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<LangVersion>latest</LangVersion>
<EnableDynamicLoading>true</EnableDynamicLoading>
<Description>Core mod and API for Among Us</Description>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!-- SourceLink -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<Compile Include="..\Reactor.Networking.Shared\**\*.cs" LinkBase="Networking" Visible="false" />
<PackageReference Include="Linguini.Bundle" Version="0.3.1" />
<ProjectReference Include="..\Reactor.Linguinitor\Reactor.Linguinitor.csproj" ReferenceOutputAssembly="false" OutputItemType="Analyzer" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Assets\**\*" Exclude="Assets\icon.png" />
<AdditionalFiles Include="Assets\Localization\en\*.ftl" />
</ItemGroup>
<Import Project="../AmongUs.props" />
-22
View File
@@ -1,22 +0,0 @@
using BepInEx.Configuration;
namespace Reactor;
internal static class ReactorConfig
{
public const string FeaturesSection = "Features";
public const string MessagesSection = "Messages";
public static ConfigEntry<bool> ForceDisableServerAuthority { get; private set; } = null!;
public static ConfigEntry<string> HandshakePopupMessage { get; private set; } = null!;
public static ConfigEntry<string> MakePublicDisallowedPopupMessage { get; private set; } = null!;
public static void Bind(ConfigFile config)
{
ForceDisableServerAuthority = config.Bind(FeaturesSection, nameof(ForceDisableServerAuthority), false, "Enables the DisableServerAuthority flag even when no mods declare it");
HandshakePopupMessage = config.Bind(MessagesSection, nameof(HandshakePopupMessage), string.Empty);
MakePublicDisallowedPopupMessage = config.Bind(MessagesSection, nameof(MakePublicDisallowedPopupMessage), string.Empty);
}
}
+10 -5
View File
@@ -1,6 +1,8 @@
global using static Reactor.Utilities.Logger<Reactor.ReactorPlugin>;
using System;
using System.Linq;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Il2CppInterop.Runtime.Attributes;
@@ -35,13 +37,15 @@ public partial class ReactorPlugin : BasePlugin
/// </summary>
public CustomRpcManager CustomRpcManager { get; } = new();
internal ConfigEntry<bool>? AllowVanillaServers { get; private set; }
internal RegionInfoWatcher RegionInfoWatcher { get; } = new();
internal FluentLocalizationProvider LocalizationProvider { get; } = FluentLocalizationProvider.FromEmbeddedResources("Reactor.Assets.Localization");
/// <inheritdoc />
public ReactorPlugin()
{
Log.LogMessage($"Among Us {Application.version} {Constants.GetCurrentPlatformName()}");
PluginSingleton<ReactorPlugin>.Instance = this;
PluginSingleton<BasePlugin>.Initialize();
@@ -53,12 +57,13 @@ public partial class ReactorPlugin : BasePlugin
MethodRpcAttribute.Initialize();
LocalizationManager.Register(new HardCodedLocalizationProvider());
LocalizationManager.Register(Translate.Provider = LocalizationProvider);
}
/// <inheritdoc />
public override void Load()
{
ReactorConfig.Bind(Config);
AllowVanillaServers = Config.Bind("Features", "Allow vanilla servers", false, "Whether reactor should ignore servers not responding to modded handshake. This config is ignored if any plugin uses custom rpcs!");
Harmony.PatchAll();
@@ -89,7 +94,7 @@ public partial class ReactorPlugin : BasePlugin
}
[RegisterInIl2Cpp]
private sealed class ReactorComponent : MonoBehaviour
private class ReactorComponent : MonoBehaviour
{
[HideFromIl2Cpp]
public ReactorPlugin? Plugin { get; internal set; }
@@ -107,7 +112,7 @@ public partial class ReactorPlugin : BasePlugin
foreach (var pluginInfo in IL2CPPChainloader.Instance.Plugins.Values)
{
var config = ((BasePlugin) pluginInfo.Instance).Config;
if (config.Count == 0)
if (!config.Any())
{
continue;
}
+30 -62
View File
@@ -3,8 +3,8 @@ using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using MonoMod.Utils;
using Reactor.Utilities.Extensions;
using UnityEngine;
@@ -23,48 +23,38 @@ public static class AssetBundleManager
/// <summary>
/// Gets the target name of the current system.
/// </summary>
[Obsolete("Use AssetBundleManager#GetTargetName instead")]
public static string TargetName { get; } = GetTargetName(true);
public static string TargetName { get; }
/// <summary>
/// Gets the target name of the current system.
/// </summary>
/// <param name="includeArchitecture">A value indicating whether to include the process architecture.</param>
/// <returns>Target name of the current system.</returns>
public static string GetTargetName(bool includeArchitecture)
static AssetBundleManager()
{
string operatingSystem;
if (OperatingSystem.IsWindows())
if (PlatformHelper.Is(Platform.Android))
{
operatingSystem = "win";
}
else if (OperatingSystem.IsLinux())
{
operatingSystem = "linux";
}
else if (OperatingSystem.IsAndroid())
{
operatingSystem = "android";
TargetName = "android";
}
else
{
throw new PlatformNotSupportedException();
}
if (PlatformHelper.Is(Platform.Windows))
{
TargetName = "win";
}
else if (PlatformHelper.Is(Platform.Linux))
{
TargetName = "linux";
}
else
{
throw new PlatformNotSupportedException();
}
if (!includeArchitecture)
{
return operatingSystem;
if (PlatformHelper.Is(Platform.ARM))
{
TargetName += Environment.Is64BitProcess ? "-arm64" : "-arm";
}
else
{
TargetName += Environment.Is64BitProcess ? "-x64" : "-x86";
}
}
return $"{operatingSystem}-{RuntimeInformation.ProcessArchitecture switch
{
Architecture.X86 => "x86",
Architecture.X64 => "x64",
Architecture.Arm => "arm",
Architecture.Arm64 => "arm64",
_ => throw new PlatformNotSupportedException(),
}}";
}
/// <summary>
@@ -72,16 +62,7 @@ public static class AssetBundleManager
/// </summary>
/// <param name="assetBundleName">The name of the asset bundle.</param>
/// <returns>File name of the asset bundle.</returns>
[Obsolete("Use the overload with includeArchitecture instead")]
public static string GetFileName(string assetBundleName) => GetFileName(assetBundleName, true);
/// <summary>
/// Gets the file name for an asset bundle named <paramref name="assetBundleName"/>.
/// </summary>
/// <param name="assetBundleName">The name of the asset bundle.</param>
/// <param name="includeArchitecture">A value indicating whether to include the process architecture.</param>
/// <returns>File name of the asset bundle.</returns>
public static string GetFileName(string assetBundleName, bool includeArchitecture) => $"{assetBundleName}-{GetTargetName(includeArchitecture)}{BundleExtension}";
public static string GetFileName(string assetBundleName) => $"{assetBundleName}-{TargetName}{BundleExtension}";
private static bool TryFindFile(Assembly assembly, string fileName, [NotNullWhen(true)] out string? path)
{
@@ -91,7 +72,6 @@ public static class AssetBundleManager
var filePath = Path.Combine(pluginDirectoryPath, fileName);
if (File.Exists(filePath))
{
Debug($"Loading an asset bundle from {filePath}");
path = filePath;
return true;
}
@@ -106,8 +86,6 @@ public static class AssetBundleManager
var resourceName = assembly.GetManifestResourceNames().SingleOrDefault(n => n.EndsWith(fileName, StringComparison.Ordinal));
if (resourceName != null)
{
Debug($"Loading an asset bundle from {resourceName}");
using var stream = assembly.GetManifestResourceStream(resourceName) ?? throw new InvalidOperationException("Resource stream was null");
var length = (int) stream.Length;
@@ -141,13 +119,8 @@ public static class AssetBundleManager
/// <exception cref="AssetBundleNotFoundException">Couldn't find an assetbundle named <paramref name="name"/>.</exception>
public static AssetBundle Load(Assembly assembly, string name)
{
return TryLoad(assembly, GetFileName(name, includeArchitecture: true))
?? TryLoad(assembly, GetFileName(name, includeArchitecture: false))
?? throw new AssetBundleNotFoundException(name);
}
var fileName = GetFileName(name);
private static AssetBundle? TryLoad(Assembly assembly, string fileName)
{
if (TryFindFile(assembly, fileName, out var filePath))
{
return AssetBundle.LoadFromFile(filePath);
@@ -158,7 +131,7 @@ public static class AssetBundleManager
return AssetBundle.LoadFromMemory(data);
}
return null;
throw new AssetBundleNotFoundException(name);
}
/// <summary>
@@ -181,13 +154,8 @@ public static class AssetBundleManager
/// <exception cref="AssetBundleNotFoundException">Couldn't find an assetbundle named <paramref name="name"/>.</exception>
public static AssetBundleCreateRequest LoadAsync(Assembly assembly, string name)
{
return TryLoadAsync(assembly, GetFileName(name, includeArchitecture: true))
?? TryLoadAsync(assembly, GetFileName(name, includeArchitecture: false))
?? throw new AssetBundleNotFoundException(name);
}
var fileName = GetFileName(name);
private static AssetBundleCreateRequest? TryLoadAsync(Assembly assembly, string fileName)
{
if (TryFindFile(assembly, fileName, out var filePath))
{
return AssetBundle.LoadFromFileAsync(filePath);
@@ -198,7 +166,7 @@ public static class AssetBundleManager
return AssetBundle.LoadFromMemoryAsync(data);
}
return null;
throw new AssetBundleNotFoundException(name);
}
}
+1 -1
View File
@@ -14,7 +14,7 @@ namespace Reactor.Utilities;
public static class Coroutines
{
[RegisterInIl2Cpp]
internal sealed class Component : MonoBehaviour
internal class Component : MonoBehaviour
{
internal static Component? Instance { get; set; }
+1 -2
View File
@@ -75,8 +75,7 @@ public class Window
Rect = Rect.ResetSize();
}
GUI.skin.label.wordWrap = false;
Rect = GUILayout.Window(Id, Rect, Func, Title, GUILayout.MinWidth(GUI.skin.label.CalcSize(new GUIContent(Title)).x * 2));
Rect = GUILayout.Window(Id, Rect, Func, Title);
if ((Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1)) && Rect.Contains(new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y)))
{
+1 -1
View File
@@ -7,7 +7,7 @@ using Object = UnityEngine.Object;
namespace Reactor.Utilities;
internal sealed class RegionInfoWatcher : IDisposable
internal class RegionInfoWatcher : IDisposable
{
private FileSystemWatcher Watcher { get; }
-58
View File
@@ -1,58 +0,0 @@
using Il2CppInterop.Runtime.Attributes;
using Reactor.Utilities.Attributes;
using TMPro;
using UnityEngine;
namespace Reactor.Utilities.UI;
/// <summary>
/// Wrapper over <see cref="GenericPopup"/> that adds hyperlink and controller support.
/// </summary>
[RegisterInIl2Cpp]
internal sealed class ReactorPopup : MonoBehaviour
{
private readonly Il2CppSystem.Collections.Generic.List<SelectableHyperLink> _selectableHyperLinks = new();
public GenericPopup Popup { get; private set; } = null!;
public TextMeshPro TextArea { get; private set; } = null!;
public PassiveButton BackButton { get; private set; } = null!;
public SpriteRenderer Background { get; private set; } = null!;
[HideFromIl2Cpp]
public void Show(string text)
{
Popup.Show(text);
ControllerManager.Instance.OpenOverlayMenu(name, BackButton);
SelectableHyperLinkHelper.AddSelectableUiForHyperlinks(_selectableHyperLinks, name);
TextArea.text = SelectableHyperLinkHelper.DecomposeAnnouncementText(TextArea, _selectableHyperLinks, name, TextArea.text);
SelectableHyperLinkHelper.UpdateHyperlinkPositions(TextArea, _selectableHyperLinks, name);
ControllerManager.Instance.AddSelectableUiElement(BackButton, true);
}
public void OnDisable()
{
ControllerManager.Instance.CloseOverlayMenu(name);
}
[HideFromIl2Cpp]
public static ReactorPopup Create(string name)
{
var genericPopup = Instantiate(DiscordManager.Instance.discordPopup, Camera.main!.transform);
var gameObject = genericPopup.gameObject;
var reactorPopup = gameObject.AddComponent<ReactorPopup>();
reactorPopup.Popup = genericPopup;
reactorPopup.TextArea = genericPopup.TextAreaTMP;
reactorPopup.BackButton = gameObject.transform.Find("ExitGame").GetComponent<PassiveButton>();
reactorPopup.Background = gameObject.transform.Find("Background").GetComponent<SpriteRenderer>();
gameObject.name = name;
genericPopup.destroyOnClose = true;
reactorPopup.TextArea.fontSizeMin = 2;
return reactorPopup;
}
}
+110 -117
View File
@@ -4,9 +4,9 @@
"net6.0": {
"AmongUs.GameLibs.Steam": {
"type": "Direct",
"requested": "[2024.6.18, )",
"resolved": "2024.6.18",
"contentHash": "xb+HP1xXn4/ES8AgXpk9xeoW568LFYw5NTjY6bHwd6vQjHDf2kT1xHMmQ1me5Vfee/Gp69YIMZDXUAUToG7Elg=="
"requested": "[2022.10.25, )",
"resolved": "2022.10.25",
"contentHash": "PWgkH/VvMlShVhZB8G432q0tnMaNVZrbIdbEMCZN/fETUlT/ch+qQj4PdTcZhPHREbnJHH3ijHxlca1d7QMBcQ=="
},
"BepInEx.AutoPlugin": {
"type": "Direct",
@@ -22,93 +22,78 @@
},
"BepInEx.Unity.IL2CPP": {
"type": "Direct",
"requested": "[6.0.0-be.679, )",
"resolved": "6.0.0-be.679",
"contentHash": "KnfMjWSXI5+dxbkLCy8VssEnZtTN3MXUHDdBkvPbMiZ6oR1RGZWdLlA90/XQkY/4kMA5P4OCZP4eQ1o0XftbSQ==",
"requested": "[6.0.0-be.662, )",
"resolved": "6.0.0-be.662",
"contentHash": "fn7jQ88IBmjssoY9XjGBTg3cULkS+N/le/eUijYf2VV8raWok/6cU/GbU9bejkJS8g+2MvzIwnROAhAxvrGI2Q==",
"dependencies": {
"BepInEx.Core": "6.0.0-be.679",
"BepInEx.Unity.Common": "6.0.0-be.679",
"HarmonyX": "2.10.1",
"Iced": "1.18.0",
"Il2CppInterop.Generator": "1.4.6-ci.389",
"Il2CppInterop.HarmonySupport": "1.4.6-ci.389",
"Il2CppInterop.Runtime": "1.4.6-ci.389",
"BepInEx.Core": "6.0.0-be.662",
"BepInEx.Unity.Common": "6.0.0-be.662",
"HarmonyX": "2.10.0",
"Iced": "1.17.0",
"Il2CppInterop.Generator": "1.3.0",
"Il2CppInterop.HarmonySupport": "1.3.0",
"Il2CppInterop.Runtime": "1.3.0",
"MonoMod.RuntimeDetour": "22.5.1.1",
"Samboy063.Cpp2IL.Core": "2022.1.0-development.866"
"Samboy063.Cpp2IL.Core": "2022.0.7.2"
}
},
"Linguini.Bundle": {
"type": "Direct",
"requested": "[0.3.1, )",
"resolved": "0.3.1",
"contentHash": "k3D0IBSsS91T0G9rYACRYtAS27NDTGz4T3ygHhbhaFdA9i3cCfCpR39MqYEpoA1Ark3lzmvklHePmRCX5EQi1A==",
"dependencies": {
"Linguini.Shared": "0.3.0",
"Linguini.Syntax": "0.3.0"
}
},
"Microsoft.SourceLink.GitHub": {
"type": "Direct",
"requested": "[1.1.1, )",
"resolved": "1.1.1",
"contentHash": "IaJGnOv/M7UQjRJks7B6p7pbPnOwisYGOIzqCz5ilGFTApZ3ktOR+6zJ12ZRPInulBmdAf1SrGdDG2MU8g6XTw==",
"dependencies": {
"Microsoft.Build.Tasks.Git": "1.1.1",
"Microsoft.SourceLink.Common": "1.1.1"
}
},
"StyleCop.Analyzers": {
"type": "Direct",
"requested": "[1.2.0-beta.507, )",
"resolved": "1.2.0-beta.507",
"contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==",
"requested": "[1.2.0-beta.435, )",
"resolved": "1.2.0-beta.435",
"contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==",
"dependencies": {
"StyleCop.Analyzers.Unstable": "1.2.0.507"
}
},
"AsmResolver": {
"type": "Transitive",
"resolved": "5.1.0",
"contentHash": "7PjujQzgQ3wjzqZYT4CY8SV6zx7FY6swIwj3Yk4QLolLqo9sBPb7FLF3W30QFvCsCkNfiVWXlSbeZKs4xGgQOQ=="
},
"AsmResolver.DotNet": {
"type": "Transitive",
"resolved": "5.1.0",
"contentHash": "oKrBU94OaSrbbTwydvpLRFalYxozrNXGkl13nIkm823ZFQtPNYOiOMJb5DQLvkCJlWyis7q865tg803T5zg9IA==",
"dependencies": {
"AsmResolver.PE": "5.1.0",
"System.Text.Json": "6.0.7"
}
},
"AsmResolver.PE": {
"type": "Transitive",
"resolved": "5.1.0",
"contentHash": "XD3iAgLSInJIODKUUlpHWXf8MR9H1SFMb1lsmabb4GxxxnDQRPjMxjglv2NOCjQQuNB2Oh0bvjHE7ewf82UqyQ==",
"dependencies": {
"AsmResolver.PE.File": "5.1.0"
}
},
"AsmResolver.PE.File": {
"type": "Transitive",
"resolved": "5.1.0",
"contentHash": "YituBYe0Fh471sXQMfu+f4tWKX/JZvRwrX6g/SVsr4XkUIUzYi/aGT3/QvjHoYx19fE1KYOB6zBKqPkkOK7HPw==",
"dependencies": {
"AsmResolver": "5.1.0"
"StyleCop.Analyzers.Unstable": "1.2.0.435"
}
},
"AssetRipper.VersionUtilities": {
"type": "Transitive",
"resolved": "1.3.1",
"contentHash": "/1D18NOpqm7rS7+qVUbAReVMNWwgDuYpsnf0RkX1Aah/I0a0irqldoFJ+Kku7YdbSm0zqD+Z6iYUGKoP3GwTNQ=="
"resolved": "1.2.1",
"contentHash": "knQ/W1YwTZS2AbdaZh+nhyyBEZQPQDcahhSOnh88i+cdg4/FEoFJiCwaavgFvCMNuUeHTbcZc4qttF8WQ8xLIA=="
},
"BepInEx.Core": {
"type": "Transitive",
"resolved": "6.0.0-be.679",
"contentHash": "yg6NSGeevv86P2ERe3VDEa7W/l0lmM7m+AdPSW78dcBOe36Zc3QK/vmNEq57txGa+1kwv+macXLSwkL4UpucjA==",
"resolved": "6.0.0-be.662",
"contentHash": "VVBeCD/KQVy0/TK3V6SD8QZ/es35Xb1mEz/+PbBs3ST1yUC1r7k2JOymhSnmghVqf6UsvlMglOO9pljqhuE/Pw==",
"dependencies": {
"HarmonyX": "2.10.1",
"HarmonyX": "2.10.0",
"MonoMod.Utils": "22.5.1.1",
"SemanticVersioning": "2.0.2"
}
},
"BepInEx.Unity.Common": {
"type": "Transitive",
"resolved": "6.0.0-be.679",
"contentHash": "q4Sux3ULBDasSQAtlAWzAKpAfCyV3ujxVJpK7ydV1bUIksaHNqw9yYTLCUrw8p4DQ/wHvShECFjzeMGHi+wylA==",
"resolved": "6.0.0-be.662",
"contentHash": "BgETw6+snwY//3xjQxLiiEAFRmXaMTcSkg+1UQz6fVBG0YA5Usm/m4GflhTc3nwF61KO3Iznn1AORi5CwLJoUw==",
"dependencies": {
"AssetRipper.VersionUtilities": "1.2.1",
"MonoMod.Utils": "22.5.1.1"
}
},
"Disarm": {
"type": "Transitive",
"resolved": "2022.1.0-master.26",
"contentHash": "YnZEbRGr0nG+N3G8WbRQ4Lkg8dTD3oso9iJlCVBmyhEyhLyqs+drBs1kWQbQqFPnb9mi/RJ++R9bPb+L3HF03Q=="
},
"HarmonyX": {
"type": "Transitive",
"resolved": "2.10.1",
"contentHash": "9LodMC9Y0u1TW96eKJoWrFJFpmzbgojEO38/Q+e7c1mFPhmHt8xcR8qhI06iF1rf0Dnsk+hqENFVSgbtwl/bEw==",
"resolved": "2.10.0",
"contentHash": "4ayiy/dlCiW86K2N7Jvbf+VpI5wvP7dncv/6oRmfwRi32UCmCRzCGzsxdMfzJZkp6/26oBW+DrD8vi4UejzVAg==",
"dependencies": {
"MonoMod.RuntimeDetour": "22.3.23.4",
"System.Reflection.Emit": "4.7.0"
@@ -116,13 +101,13 @@
},
"Iced": {
"type": "Transitive",
"resolved": "1.18.0",
"contentHash": "G60lZOvbvqttA+SBSv/yY6/wUboXKJlkffhSNR9iOrx0M5gpcK1TRr6xrFR+qAhqIAhvrsPF1jkn9fYb4lEufQ=="
"resolved": "1.17.0",
"contentHash": "8x+HCVTl/HHTGpscH3vMBhV8sknN/muZFw9s3TsI8SA6+c43cOTCi2+jE4KsU8pNLbJ++iF2ZFcpcXHXtDglnw=="
},
"Il2CppInterop.Common": {
"type": "Transitive",
"resolved": "1.4.6-ci.389",
"contentHash": "KTyf2f66Q2mS9a6xhvoPWwD0VzRIoskPMVQehaVMo1dx4Di1FPFsKqukQ+ob6wgP5Rbnx53kiH0PY+IRSb35XA==",
"resolved": "1.3.0",
"contentHash": "IR3BrZXvL2nvJAn4pruPMgC78Y87hVa5xTYZCuHN67OzRD6WDl5dTO55vtvTl8dXFALKvlN+spja2tXhVuquOw==",
"dependencies": {
"Iced": "1.17.0",
"Microsoft.Extensions.Logging.Abstractions": "6.0.1",
@@ -131,36 +116,59 @@
},
"Il2CppInterop.Generator": {
"type": "Transitive",
"resolved": "1.4.6-ci.389",
"contentHash": "XJX4sn/RzAEBNIZZXuyDcLZrFx5tCoahujDu5aKWjApiMj/nTRQAxZn17daIIvd9aHqLaAfiWWth5QDLIt2bKw==",
"resolved": "1.3.0",
"contentHash": "FuhPxbh/K4K94U3xac/ClMaaBp+MZ4aIaqi5dR0QihyGQoombT+OM/A22RwAIzbaCTbFbvabWaAuOSgB69ZwWQ==",
"dependencies": {
"Il2CppInterop.Common": "1.4.6-ci.389",
"Il2CppInterop.Common": "1.3.0",
"Mono.Cecil": "0.11.3"
}
},
"Il2CppInterop.HarmonySupport": {
"type": "Transitive",
"resolved": "1.4.6-ci.389",
"contentHash": "Xd2zK6sLqwA0ReyUy83SWKcALwY99fq6vVL5gFOMN5Ct8OOVhtNIws0ysCWsfx1GL0RJiRYfR4pza/MmWRz4PQ==",
"resolved": "1.3.0",
"contentHash": "VppBnXtbMNGFhX8a1gg/85E883t2pW/+FZyV7eOaOXMNQyorg++u+kUFOIYwNpzTVqxWmMeoPS0DH0toVpjoKA==",
"dependencies": {
"HarmonyX": "2.10.0",
"Il2CppInterop.Runtime": "1.4.6-ci.389"
"Il2CppInterop.Runtime": "1.3.0"
}
},
"Il2CppInterop.Runtime": {
"type": "Transitive",
"resolved": "1.4.6-ci.389",
"contentHash": "nzYjuVzDG/O8+AQ8ax3WVHf+ZVsQKrVtp/yvuW8XoEPLdkbgryIrMo75dvN+tPqxOU3o2MPt9MZ9j25P5aVJMw==",
"resolved": "1.3.0",
"contentHash": "8A+N2yvja960Ap+s2RpW7Nb6HSpyuXJy2ipIlU+1erYU9SWHMyU9JZzUZGOhwWXJChKGvRmDdTZAg12k1+72dg==",
"dependencies": {
"Iced": "1.17.0",
"Il2CppInterop.Common": "1.4.6-ci.389"
"Il2CppInterop.Common": "1.3.0"
}
},
"IndexRange": {
"type": "Transitive",
"resolved": "1.0.0",
"contentHash": "6TgS1JLSUkpmPLfXBPaAgB39ZUix8E4soXWk2XSDcscVe84i1JKzIAtA7jHbRHSkOOrcr6YA0MpLCeq98y9mYQ=="
},
"js6pak.Gee.External.Capstone": {
"type": "Transitive",
"resolved": "2.1.0",
"contentHash": "YYpq7NM50bSSVUDjXyV/eiITk6syXqItPjKBOb3jEWS6RFsk0DNhpWMPW6b3hKDmArARuWDU6S2pVu1IeVrvIA=="
},
"Linguini.Shared": {
"type": "Transitive",
"resolved": "0.3.0",
"contentHash": "rEYA9jWU1Nc9iDuPKar+4IVXjFbGrcNyYZCeU6hiWQoS4nA2UecHu36Rp4bxzasvRGda4FB2JZqty75m4e26VQ=="
},
"Linguini.Syntax": {
"type": "Transitive",
"resolved": "0.3.0",
"contentHash": "v8YV3xPFZfP+OSWjMd6yysp+o7cNnQXxq/slN8Yekoi+dFjsTNF0YiQWJIwg1j2FUbs6claJxY9R1FFlc4s6MA==",
"dependencies": {
"Linguini.Shared": "0.3.0"
}
},
"Microsoft.Build.Tasks.Git": {
"type": "Transitive",
"resolved": "1.1.1",
"contentHash": "AT3HlgTjsqHnWpBHSNeR0KxbLZD7bztlZVj7I8vgeYG9SYqbeFGh0TM/KVtC6fg53nrWHl3VfZFvb5BiQFcY6Q=="
},
"Microsoft.Extensions.Logging.Abstractions": {
"type": "Transitive",
"resolved": "6.0.1",
@@ -176,6 +184,11 @@
"resolved": "1.1.0",
"contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
"resolved": "1.1.1",
"contentHash": "WMcGpWKrmJmzrNeuaEb23bEMnbtR/vLmvZtkAP5qWu7vQsY59GqfRJd65sFpBszbd2k/bQ8cs8eWawQKAabkVg=="
},
"Mono.Cecil": {
"type": "Transitive",
"resolved": "0.11.4",
@@ -310,45 +323,42 @@
},
"Samboy063.Cpp2IL.Core": {
"type": "Transitive",
"resolved": "2022.1.0-development.866",
"contentHash": "QPMuix/3jRngWBdNSLhAbm9BHYf95Ln1Ph1eCK/cDZdVibxFDFP3a6Yczyx1p7GbN7bRQwrhs2skPJSS/z3m2w==",
"resolved": "2022.0.7.2",
"contentHash": "e17CAhKSxdAp7vFcYEVxjSc7t7rcvVGBipGhgE9tAjRXY85wZXLlHEVO0AEvMRkLmf9U+if4wK/nZEC1AX6VqQ==",
"dependencies": {
"AsmResolver.DotNet": "5.1.0",
"Disarm": "2022.1.0-master.26",
"Iced": "1.18.0",
"Samboy063.LibCpp2IL": "2022.1.0-development.866",
"StableNameDotNet": "0.1.0-development.866",
"HarmonyX": "2.5.5",
"Iced": "1.11.1",
"IndexRange": "1.0.0",
"Mono.Cecil": "0.11.4",
"Samboy063.LibCpp2IL": "2022.0.7.2",
"System.Runtime.InteropServices": "4.3.0",
"System.ValueTuple": "4.5.0",
"js6pak.Gee.External.Capstone": "2.1.0"
}
},
"Samboy063.LibCpp2IL": {
"type": "Transitive",
"resolved": "2022.1.0-development.866",
"contentHash": "EcJSWTfQko8SQozozoUT+aQJVWC8wj8C0YUiPBF4rNRId19yTKp2IXcXnI747v+8/aal222QR6WHfoBK2WlVLg==",
"resolved": "2022.0.7.2",
"contentHash": "DpVeU0dQkUJCpbw0f1xKOG8vimdK2oYhrVABC7HDE3/ikGjhnMZd3i5b1joKDHZ+AiL90TWOaEXPcy24rCZ0dA==",
"dependencies": {
"AssetRipper.VersionUtilities": "1.3.1",
"Samboy063.WasmDisassembler": "2022.1.0-development.866"
"IndexRange": "1.0.0",
"Samboy063.WasmDisassembler": "2022.0.2"
}
},
"Samboy063.WasmDisassembler": {
"type": "Transitive",
"resolved": "2022.1.0-development.866",
"contentHash": "2QK8F3eISkLcoW/Nt7wtxyQh31EXAqEMBVXXjEnuxyvXpBXxOIGpjmE3pWhGwxQwDCbe4zBsLF1zUiqq3/pXRA=="
"resolved": "2022.0.2",
"contentHash": "2uu+xBb7M3HKfBx9tAY6jiDieAf0hRnQjSmGX+7IdE6i24dYsx6TYgtrLvRx5lOuF2M8DijZ5H8yQ1pcuCs2SA=="
},
"SemanticVersioning": {
"type": "Transitive",
"resolved": "2.0.2",
"contentHash": "4EQgYdNZ92SyaO7YFk6olVnebF5V+jrHyMUjvPq89tLeMo8NSfgDF+6Zwq/lgh9j/0yfQp9Lkm0ZA0rUATCZFA=="
},
"StableNameDotNet": {
"type": "Transitive",
"resolved": "0.1.0-development.866",
"contentHash": "DJb8x4dV3ucDgM12sU28HxCdeqY/JudJbeJG6mgXWDJzpFZw2Jd7JF1pKFRNLzh/0gpo8bCGLQS9gOWZmBjdtg=="
},
"StyleCop.Analyzers.Unstable": {
"type": "Transitive",
"resolved": "1.2.0.507",
"contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw=="
"resolved": "1.2.0.435",
"contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg=="
},
"System.Collections": {
"type": "Transitive",
@@ -675,11 +685,6 @@
"Microsoft.NETCore.Targets": "1.1.0"
}
},
"System.Runtime.CompilerServices.Unsafe": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg=="
},
"System.Runtime.Extensions": {
"type": "Transitive",
"resolved": "4.3.0",
@@ -878,23 +883,6 @@
"System.Runtime": "4.3.0"
}
},
"System.Text.Encodings.Web": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "Vg8eB5Tawm1IFqj4TVK1czJX89rhFxJo9ELqc/Eiq0eXy13RK00eubyU6TJE6y+GQXjyV5gSfiewDUZjQgSE0w==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
},
"System.Text.Json": {
"type": "Transitive",
"resolved": "6.0.7",
"contentHash": "/Tf/9XjprpHolbcDOrxsKVYy/mUG/FS7aGd9YUgBVEiHeQH4kAE0T1sMbde7q6B5xcrNUsJ5iW7D1RvHudQNqA==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0",
"System.Text.Encodings.Web": "6.0.0"
}
},
"System.Threading": {
"type": "Transitive",
"resolved": "4.3.0",
@@ -913,6 +901,11 @@
"Microsoft.NETCore.Targets": "1.1.0",
"System.Runtime": "4.3.0"
}
},
"System.ValueTuple": {
"type": "Transitive",
"resolved": "4.5.0",
"contentHash": "okurQJO6NRE/apDIP23ajJ0hpiNmJ+f0BwOlB/cSqTLQlw5upkf+5+96+iG2Jw40G1fCVCyPz/FhIABUjMR+RQ=="
}
}
}
-6
View File
@@ -1,6 +0,0 @@
{
"sdk": {
"version": "8.0.0",
"rollForward": "latestFeature"
}
}
-1
View File
@@ -3,6 +3,5 @@
<configuration>
<packageSources>
<add key="BepInEx" value="https://nuget.bepinex.dev/v3/index.json" />
<add key="Samboy" value="https://nuget.samboy.dev/v3/index.json" />
</packageSources>
</configuration>