diff --git a/Reactor.Benchmarks/BenchmarksPlugin.cs b/Reactor.Benchmarks/BenchmarksPlugin.cs index 8641713..d10641b 100644 --- a/Reactor.Benchmarks/BenchmarksPlugin.cs +++ b/Reactor.Benchmarks/BenchmarksPlugin.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using BenchmarkDotNet.Running; using BepInEx; using BepInEx.Unity.IL2CPP; diff --git a/Reactor.Example/ExamplePlugin.cs b/Reactor.Example/ExamplePlugin.cs index 24b8d9f..fc1922d 100644 --- a/Reactor.Example/ExamplePlugin.cs +++ b/Reactor.Example/ExamplePlugin.cs @@ -1,4 +1,4 @@ -using System; +using System; using BepInEx; using BepInEx.Unity.IL2CPP; using Il2CppInterop.Runtime.Attributes; diff --git a/Reactor/Networking/Attributes/MessageConverterAttribute.cs b/Reactor/Networking/Attributes/MessageConverterAttribute.cs index 513ca86..dda11c4 100644 --- a/Reactor/Networking/Attributes/MessageConverterAttribute.cs +++ b/Reactor/Networking/Attributes/MessageConverterAttribute.cs @@ -11,7 +11,7 @@ namespace Reactor.Networking.Attributes; public class MessageConverterAttribute : Attribute { private static readonly HashSet _registeredAssemblies = new(); - + public static void Register(Assembly assembly) { if (_registeredAssemblies.Contains(assembly)) return; diff --git a/Reactor/Networking/Attributes/ReactorModFlagsAttribute.cs b/Reactor/Networking/Attributes/ReactorModFlagsAttribute.cs index bfc862e..e41c546 100644 --- a/Reactor/Networking/Attributes/ReactorModFlagsAttribute.cs +++ b/Reactor/Networking/Attributes/ReactorModFlagsAttribute.cs @@ -21,7 +21,7 @@ public class ReactorModFlagsAttribute : Attribute { return attribute.Flags; } - + var metadataAttribute = type.Assembly.GetCustomAttributes().SingleOrDefault(x => x.Key == "Reactor.ModFlags"); if (metadataAttribute is { Value: not null }) { diff --git a/Reactor/Networking/ModList.cs b/Reactor/Networking/ModList.cs index 0b01ca9..84c2adf 100644 --- a/Reactor/Networking/ModList.cs +++ b/Reactor/Networking/ModList.cs @@ -120,7 +120,7 @@ public static class ModList foreach (var existingPlugin in IL2CPPChainloader.Instance.Plugins.Values) { if (existingPlugin.Instance == null) continue; - OnPluginLoad(existingPlugin, (BasePlugin)existingPlugin.Instance); + OnPluginLoad(existingPlugin, (BasePlugin) existingPlugin.Instance); } IL2CPPChainloader.Instance.PluginLoad += (pluginInfo, _, plugin) => OnPluginLoad(pluginInfo, plugin); diff --git a/Reactor/Networking/Patches/ClientPatches.cs b/Reactor/Networking/Patches/ClientPatches.cs index d28f764..58e4f13 100644 --- a/Reactor/Networking/Patches/ClientPatches.cs +++ b/Reactor/Networking/Patches/ClientPatches.cs @@ -6,7 +6,6 @@ using Il2CppInterop.Runtime.InteropTypes.Arrays; using InnerNet; using Reactor.Networking.Extensions; using Reactor.Networking.Messages; -using Reactor.Networking.Serialization; using UnityEngine; namespace Reactor.Networking.Patches; @@ -183,7 +182,7 @@ internal static class ClientPatches msg.Write((byte) flags); InnerNetObject[] componentsInChildren = netObjParent.GetComponentsInChildren(); msg.WritePacked(componentsInChildren.Length); - foreach (InnerNetObject innerNetObject in componentsInChildren) + foreach (var innerNetObject in componentsInChildren) { innerNetObject.OwnerId = ownerId; innerNetObject.SpawnFlags = flags; diff --git a/Reactor/Networking/Rpc/MethodRpc.cs b/Reactor/Networking/Rpc/MethodRpc.cs index 7322ff4..ebcb76f 100644 --- a/Reactor/Networking/Rpc/MethodRpc.cs +++ b/Reactor/Networking/Rpc/MethodRpc.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Linq; using System.Reflection; diff --git a/Reactor/Networking/Rpc/Rpc.cs b/Reactor/Networking/Rpc/Rpc.cs index c16451f..e1f7c18 100644 --- a/Reactor/Networking/Rpc/Rpc.cs +++ b/Reactor/Networking/Rpc/Rpc.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Reactor.Networking.Rpc; diff --git a/Reactor/Networking/Rpc/RpcLocalHandling.cs b/Reactor/Networking/Rpc/RpcLocalHandling.cs index 8e1d3a9..ee4aafb 100644 --- a/Reactor/Networking/Rpc/RpcLocalHandling.cs +++ b/Reactor/Networking/Rpc/RpcLocalHandling.cs @@ -1,4 +1,4 @@ -namespace Reactor.Networking.Rpc; +namespace Reactor.Networking.Rpc; public enum RpcLocalHandling { diff --git a/Reactor/Patches/Miscellaneous/FreeNamePatch.cs b/Reactor/Patches/Miscellaneous/FreeNamePatch.cs index 1c7046f..37c869a 100644 --- a/Reactor/Patches/Miscellaneous/FreeNamePatch.cs +++ b/Reactor/Patches/Miscellaneous/FreeNamePatch.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using HarmonyLib; diff --git a/Reactor/ReactorPlugin.cs b/Reactor/ReactorPlugin.cs index b9f1f0e..fe5b3cd 100644 --- a/Reactor/ReactorPlugin.cs +++ b/Reactor/ReactorPlugin.cs @@ -1,12 +1,12 @@ -global using static Reactor.Utilities.Logger; +global using static Reactor.Utilities.Logger; using System; using System.Linq; using BepInEx; using BepInEx.Configuration; using BepInEx.Unity.IL2CPP; using HarmonyLib; -using Reactor.Networking; using Il2CppInterop.Runtime.Attributes; +using Reactor.Networking; using Reactor.Networking.Attributes; using Reactor.Networking.Rpc; using Reactor.Patches; diff --git a/Reactor/Utilities/Attributes/RegisterInIl2CppAttribute.cs b/Reactor/Utilities/Attributes/RegisterInIl2CppAttribute.cs index 95d3926..47ec0f6 100644 --- a/Reactor/Utilities/Attributes/RegisterInIl2CppAttribute.cs +++ b/Reactor/Utilities/Attributes/RegisterInIl2CppAttribute.cs @@ -11,7 +11,7 @@ namespace Reactor.Utilities.Attributes; /// Utility attribute for automatically calling /// [AttributeUsage(AttributeTargets.Class)] -public class RegisterInIl2CppAttribute : Attribute +public sealed class RegisterInIl2CppAttribute : Attribute { private static readonly HashSet _registeredAssemblies = new(); @@ -58,7 +58,7 @@ public class RegisterInIl2CppAttribute : Attribute { if (_registeredAssemblies.Contains(assembly)) return; _registeredAssemblies.Add(assembly); - + foreach (var type in assembly.GetTypes()) { var attribute = type.GetCustomAttribute(); diff --git a/Reactor/Utilities/CanvasUtilities.cs b/Reactor/Utilities/CanvasUtilities.cs index 13a7bec..7c8b0dc 100644 --- a/Reactor/Utilities/CanvasUtilities.cs +++ b/Reactor/Utilities/CanvasUtilities.cs @@ -1,4 +1,4 @@ -using System; +using System; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; @@ -32,7 +32,7 @@ public static class CanvasUtilities return gameObject; } - + /// /// Shortcut for empty texture /// diff --git a/Reactor/Utilities/Extensions/AssetBundleExtensions.cs b/Reactor/Utilities/Extensions/AssetBundleExtensions.cs index befd04f..596361a 100644 --- a/Reactor/Utilities/Extensions/AssetBundleExtensions.cs +++ b/Reactor/Utilities/Extensions/AssetBundleExtensions.cs @@ -1,4 +1,4 @@ -using Il2CppInterop.Runtime; +using Il2CppInterop.Runtime; using UnityEngine; namespace Reactor.Utilities.Extensions; diff --git a/Reactor/Utilities/Extensions/RandomExtensions.cs b/Reactor/Utilities/Extensions/RandomExtensions.cs index a0c43bc..fb6ea0d 100644 --- a/Reactor/Utilities/Extensions/RandomExtensions.cs +++ b/Reactor/Utilities/Extensions/RandomExtensions.cs @@ -20,7 +20,7 @@ public static class RandomExtensions { return random.NextDouble() * (maxValue - minValue) + minValue; } - + /// /// Returns random from /// diff --git a/Reactor/Utilities/Extensions/ReflectionExtensions.cs b/Reactor/Utilities/Extensions/ReflectionExtensions.cs index 3c3ccde..cde4408 100644 --- a/Reactor/Utilities/Extensions/ReflectionExtensions.cs +++ b/Reactor/Utilities/Extensions/ReflectionExtensions.cs @@ -8,9 +8,9 @@ using Il2CppInterop.Common.Attributes; using Il2CppInterop.Runtime; using Il2CppSystem.Runtime.CompilerServices; using Il2CppCustomAttributeExtensions = Il2CppSystem.Reflection.CustomAttributeExtensions; -using MethodInfo = System.Reflection.MethodInfo; using Il2CppMethodInfo = Il2CppSystem.Reflection.MethodInfo; using Il2CppSystemType = Il2CppSystem.Type; +using MethodInfo = System.Reflection.MethodInfo; namespace Reactor.Utilities.Extensions; @@ -55,7 +55,7 @@ public static class ReflectionExtensions { return AccessTools.Method(AccessTools.Method(type, methodName).ToIl2CppMethodInfo().GetEnumeratorMoveNextType().ToSystemType(), "MoveNext"); } - + public static IEnumerable GetMethods(this Type type, BindingFlags bindingAttr, Type returnType, params Type[] parameterTypes) { return type.GetMethods(bindingAttr).Where(x => x.ReturnType == returnType && x.GetParameters().Select(x => x.ParameterType).SequenceEqual(parameterTypes)); diff --git a/Reactor/Utilities/Extensions/StreamExtensions.cs b/Reactor/Utilities/Extensions/StreamExtensions.cs index f17b668..0c73bfc 100644 --- a/Reactor/Utilities/Extensions/StreamExtensions.cs +++ b/Reactor/Utilities/Extensions/StreamExtensions.cs @@ -90,7 +90,7 @@ public static class StreamExtensions /// Wraps a System Stream into an Il2Cpp Stream /// public static StreamWrapper AsIl2Cpp(this Stream stream) => new(stream); - + /// /// Fully read stream, can be used as workaround for il2cpp streams. /// diff --git a/Reactor/Utilities/Extensions/UnityExtensions.cs b/Reactor/Utilities/Extensions/UnityExtensions.cs index 09a6b87..e12b2f4 100644 --- a/Reactor/Utilities/Extensions/UnityExtensions.cs +++ b/Reactor/Utilities/Extensions/UnityExtensions.cs @@ -1,4 +1,4 @@ -using UnityEngine; +using UnityEngine; namespace Reactor.Utilities.Extensions; diff --git a/Reactor/Utilities/ImGui/DragWindow.cs b/Reactor/Utilities/ImGui/DragWindow.cs index ea1ca7f..6635ea6 100644 --- a/Reactor/Utilities/ImGui/DragWindow.cs +++ b/Reactor/Utilities/ImGui/DragWindow.cs @@ -1,4 +1,4 @@ -using System; +using System; using Reactor.Utilities.Extensions; using UnityEngine; diff --git a/Reactor/Utilities/ImGui/Window.cs b/Reactor/Utilities/ImGui/Window.cs index db88875..9b19466 100644 --- a/Reactor/Utilities/ImGui/Window.cs +++ b/Reactor/Utilities/ImGui/Window.cs @@ -1,4 +1,4 @@ -using System; +using System; using Reactor.Utilities.Extensions; using UnityEngine; diff --git a/Reactor/Utilities/Logger.cs b/Reactor/Utilities/Logger.cs index 95d2e6e..abcab0b 100644 --- a/Reactor/Utilities/Logger.cs +++ b/Reactor/Utilities/Logger.cs @@ -10,11 +10,11 @@ public static class Logger where T : BasePlugin public static ManualLogSource Instance => PluginSingleton.Instance.Log; /// - public static void Log(LogLevel level, object data) => Instance.Log(level,data); + public static void Log(LogLevel level, object data) => Instance.Log(level, data); /// public static void Log(LogLevel level, [InterpolatedStringHandlerArgument("level")] BepInExLogInterpolatedStringHandler logHandler) => Instance.Log(level, logHandler); - + /// public static void Fatal(object data) => Instance.LogFatal(data);