diff --git a/.editorconfig b/.editorconfig index ddd66f4..b4300b8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,11 +13,11 @@ indent_size = 4 # XML project files [*.{csproj, vbproj, vcxproj, vcxproj.filters, proj, projitems, shproj}] -indent_size = 2 +indent_size = 4 # XML config files [*.{props, targets, ruleset, config, nuspec, resx, vsixmanifest, vsct}] -indent_size = 2 +indent_size = 4 # Dotnet code style settings: [*.{cs, vb}] diff --git a/AmongUs.props b/AmongUs.props index 39624bb..8ae9251 100644 --- a/AmongUs.props +++ b/AmongUs.props @@ -1,11 +1,15 @@ - 2021.6.30s - 2021.6.30i + Steam + 2021.6.30-s + 2021.6.30-i - + + + + diff --git a/Reactor.Debugger/DebuggerPlugin.cs b/Reactor.Debugger/DebuggerPlugin.cs index d0e6fa6..462f5b4 100644 --- a/Reactor.Debugger/DebuggerPlugin.cs +++ b/Reactor.Debugger/DebuggerPlugin.cs @@ -11,21 +11,18 @@ using UnityEngine; namespace Reactor.Debugger { - [BepInPlugin(Id)] + [BepInAutoPlugin("gg.reactor.debugger")] [BepInProcess("Among Us.exe")] [BepInDependency(ReactorPlugin.Id)] [ReactorPluginSide(PluginSide.ClientOnly)] - public class DebuggerPlugin : BasePlugin + public partial class DebuggerPlugin : BasePlugin { - public const string Id = "gg.reactor.debugger"; - public Harmony Harmony { get; } = new Harmony(Id); public DebuggerComponent Component { get; private set; } public override void Load() { - var gameObject = new GameObject(nameof(DebuggerPlugin)).DontDestroy(); - Component = gameObject.AddComponent(); + Component = this.AddComponent(); GameOptionsData.MaxImpostors = GameOptionsData.RecommendedImpostors = Enumerable.Repeat((int) byte.MaxValue, byte.MaxValue).ToArray(); GameOptionsData.MinPlayers = Enumerable.Repeat(1, 4).ToArray(); diff --git a/Reactor.Example/ExamplePlugin.cs b/Reactor.Example/ExamplePlugin.cs index 2ffa382..55e5714 100644 --- a/Reactor.Example/ExamplePlugin.cs +++ b/Reactor.Example/ExamplePlugin.cs @@ -1,32 +1,24 @@ using System; using BepInEx; using BepInEx.IL2CPP; -using Reactor.Extensions; using Reactor.Networking; -using UnhollowerBaseLib.Attributes; using UnityEngine; namespace Reactor.Example { - [BepInPlugin(Id)] + [BepInAutoPlugin("gg.reactor.Example")] [BepInProcess("Among Us.exe")] [BepInDependency(ReactorPlugin.Id)] - public class ExamplePlugin : BasePlugin + public partial class ExamplePlugin : BasePlugin { - public const string Id = "gg.reactor.Example"; - public override void Load() { - var gameObject = new GameObject(nameof(ReactorPlugin)).DontDestroy(); - gameObject.AddComponent().Plugin = this; + this.AddComponent(); } [RegisterInIl2Cpp] public class ExampleComponent : MonoBehaviour { - [HideFromIl2Cpp] - public ExamplePlugin Plugin { get; internal set; } - public ExampleComponent(IntPtr ptr) : base(ptr) { } diff --git a/Reactor/ReactorPlugin.cs b/Reactor/ReactorPlugin.cs index 80be6ee..c6907bb 100644 --- a/Reactor/ReactorPlugin.cs +++ b/Reactor/ReactorPlugin.cs @@ -4,7 +4,6 @@ using BepInEx; using BepInEx.Configuration; using BepInEx.IL2CPP; using HarmonyLib; -using Reactor.Extensions; using Reactor.Networking; using Reactor.Patches; using Reactor.Unstrip; @@ -13,27 +12,19 @@ using UnityEngine; namespace Reactor { - [BepInPlugin(Id)] + [BepInAutoPlugin("gg.reactor.api")] [BepInProcess("Among Us.exe")] - public class ReactorPlugin : BasePlugin + public partial class ReactorPlugin : BasePlugin { - public const string Id = "gg.reactor.api"; - public Harmony Harmony { get; } = new Harmony(Id); public CustomRpcManager CustomRpcManager { get; } = new CustomRpcManager(); - public ConfigEntry AllowVanillaServers; + public ConfigEntry AllowVanillaServers { get; private set; } - private GameObject _gameObject; private RegionInfoWatcher RegionInfoWatcher { get; } = new RegionInfoWatcher(); public ReactorPlugin() { - if (Paths.BepInExVersion < new SemVer.Version("6.0.0-reactor.23")) - { - throw new NotSupportedException("This version of BepInEx is not supported!"); - } - PluginSingleton.Initialize(); RegisterInIl2CppAttribute.Initialize(); RegisterCustomRpcAttribute.Initialize(); @@ -47,9 +38,8 @@ namespace Reactor Harmony.PatchAll(); - _gameObject = new GameObject(nameof(ReactorPlugin)).DontDestroy(); - _gameObject.AddComponent().Plugin = this; - _gameObject.AddComponent(); + this.AddComponent().Plugin = this; + this.AddComponent(); ReactorVersionShower.Initialize(); SplashSkip.Initialize(); @@ -59,7 +49,6 @@ namespace Reactor public override bool Unload() { Harmony.UnpatchSelf(); - _gameObject.Destroy(); RegionInfoWatcher?.Dispose(); return base.Unload(); diff --git a/nuget.config b/nuget.config index 4b1385e..3ee52a2 100644 --- a/nuget.config +++ b/nuget.config @@ -1,6 +1,7 @@ + - - - - \ No newline at end of file + + + +