mirror of
https://github.com/NuclearPowered/Reactor.git
synced 2026-10-19 15:51:54 +00:00
Reformat code
This commit is contained in:
52 files changed
+125
-179
No files matched your search
@@ -9,15 +9,15 @@ using UnhollowerBaseLib;
|
||||
using UnhollowerBaseLib.Attributes;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Reactor.Debugger
|
||||
{
|
||||
namespace Reactor.Debugger;
|
||||
|
||||
[BepInAutoPlugin("gg.reactor.debugger")]
|
||||
[BepInProcess("Among Us.exe")]
|
||||
[BepInDependency(ReactorPlugin.Id)]
|
||||
[ReactorPluginSide(PluginSide.ClientOnly)]
|
||||
public partial class DebuggerPlugin : BasePlugin
|
||||
{
|
||||
public Harmony Harmony { get; } = new Harmony(Id);
|
||||
public Harmony Harmony { get; } = new(Id);
|
||||
public DebuggerComponent Component { get; private set; }
|
||||
|
||||
public override void Load()
|
||||
@@ -97,7 +97,7 @@ namespace Reactor.Debugger
|
||||
}
|
||||
})
|
||||
{
|
||||
Enabled = false
|
||||
Enabled = false,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -115,4 +115,3 @@ namespace Reactor.Debugger
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@ using HarmonyLib;
|
||||
using UnhollowerBaseLib;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Reactor.Debugger
|
||||
{
|
||||
namespace Reactor.Debugger;
|
||||
|
||||
internal static class Patches
|
||||
{
|
||||
[HarmonyPatch(typeof(GameStartManager), nameof(GameStartManager.Update))]
|
||||
@@ -67,4 +67,3 @@ namespace Reactor.Debugger
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
namespace Reactor.Example
|
||||
{
|
||||
namespace Reactor.Example;
|
||||
|
||||
public enum CustomRpcCalls : uint
|
||||
{
|
||||
Example,
|
||||
MethodRpcExample
|
||||
}
|
||||
MethodRpcExample,
|
||||
}
|
||||
@@ -8,8 +8,8 @@ using UnhollowerBaseLib.Attributes;
|
||||
using UnityEngine;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
namespace Reactor.Example
|
||||
{
|
||||
namespace Reactor.Example;
|
||||
|
||||
[BepInAutoPlugin("gg.reactor.Example")]
|
||||
[BepInProcess("Among Us.exe")]
|
||||
[BepInDependency(ReactorPlugin.Id)]
|
||||
@@ -56,4 +56,3 @@ namespace Reactor.Example
|
||||
Logger<ExamplePlugin>.Info($"{player.Data.PlayerName} text: {text} number: {number} testPlayer: {testPlayer.NetId}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
using Hazel;
|
||||
using Reactor.Networking;
|
||||
|
||||
namespace Reactor.Example
|
||||
{
|
||||
namespace Reactor.Example;
|
||||
|
||||
[RegisterCustomRpc((uint) CustomRpcCalls.Example)]
|
||||
public class ExampleRpc : PlayerCustomRpc<ExamplePlugin, ExampleRpc.Data>
|
||||
{
|
||||
@@ -37,4 +37,3 @@ namespace Reactor.Example
|
||||
Plugin.Log.LogWarning($"Handle: {innerNetObject.Data.PlayerName} sent \"{data.Message}\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
using System;
|
||||
|
||||
namespace Reactor.Networking
|
||||
{
|
||||
namespace Reactor.Networking;
|
||||
|
||||
public class Mod
|
||||
{
|
||||
public Mod(uint netId, string id, string version, PluginSide side)
|
||||
@@ -37,4 +37,3 @@ namespace Reactor.Networking
|
||||
return HashCode.Combine(Id, Version);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
namespace Reactor.Networking
|
||||
{
|
||||
namespace Reactor.Networking;
|
||||
|
||||
public enum ReactorMessageFlags : byte
|
||||
{
|
||||
Handshake,
|
||||
ModDeclaration,
|
||||
PluginDeclaration
|
||||
}
|
||||
PluginDeclaration,
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
namespace Reactor.Networking
|
||||
{
|
||||
namespace Reactor.Networking;
|
||||
|
||||
/// <summary>
|
||||
/// Version of the Reactor.Net protocol format.
|
||||
/// </summary>
|
||||
@@ -15,4 +15,3 @@ namespace Reactor.Networking
|
||||
/// </summary>
|
||||
Latest = Initial,
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
namespace Reactor
|
||||
{
|
||||
namespace Reactor;
|
||||
|
||||
/// <summary>
|
||||
/// Plugin side used in modded handshake
|
||||
/// </summary>
|
||||
@@ -13,6 +13,5 @@ namespace Reactor
|
||||
/// <summary>
|
||||
/// Required only by client
|
||||
/// </summary>
|
||||
ClientOnly
|
||||
}
|
||||
ClientOnly,
|
||||
}
|
||||
@@ -3,8 +3,8 @@ using System.Reflection.Emit;
|
||||
using BepInEx.IL2CPP;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace Reactor
|
||||
{
|
||||
namespace Reactor;
|
||||
|
||||
public static class ChainloaderHooks
|
||||
{
|
||||
public delegate void PluginLoadHandler(BasePlugin plugin);
|
||||
@@ -31,4 +31,3 @@ namespace Reactor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,8 @@ using System.Runtime.CompilerServices;
|
||||
using BepInEx.IL2CPP.Utils;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Reactor
|
||||
{
|
||||
namespace Reactor;
|
||||
|
||||
public static class Coroutines
|
||||
{
|
||||
[RegisterInIl2Cpp]
|
||||
@@ -50,4 +50,3 @@ namespace Reactor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,13 +3,13 @@ using System.Linq;
|
||||
using HarmonyLib;
|
||||
using UnhollowerBaseLib;
|
||||
|
||||
namespace Reactor
|
||||
{
|
||||
namespace Reactor;
|
||||
|
||||
public class CustomStringName
|
||||
{
|
||||
private static int _lastId = -1;
|
||||
|
||||
private static readonly List<CustomStringName> _list = new List<CustomStringName>();
|
||||
private static readonly List<CustomStringName> _list = new();
|
||||
|
||||
public static IReadOnlyList<CustomStringName> List => _list.AsReadOnly();
|
||||
|
||||
@@ -51,4 +51,3 @@ namespace Reactor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,8 +11,8 @@ using UnityEngine.Networking;
|
||||
using UnityEngine.SceneManagement;
|
||||
using Il2CppType = UnhollowerRuntimeLib.Il2CppType;
|
||||
|
||||
namespace Reactor.Extensions
|
||||
{
|
||||
namespace Reactor.Extensions;
|
||||
|
||||
/// <summary>
|
||||
/// General utilities
|
||||
/// </summary>
|
||||
@@ -120,4 +120,3 @@ namespace Reactor.Extensions
|
||||
return assetBundle.LoadAsset(name, Il2CppType.Of<T>())?.Cast<T>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@ using Hazel;
|
||||
using Hazel.Udp;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Reactor.Extensions
|
||||
{
|
||||
namespace Reactor.Extensions;
|
||||
|
||||
public static class ExtraMessageExtensions
|
||||
{
|
||||
private const float MIN = -50f;
|
||||
@@ -46,4 +46,3 @@ namespace Reactor.Extensions
|
||||
connection.WriteBytesToConnection(buffer, buffer.Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,8 @@ using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Reactor.Extensions
|
||||
{
|
||||
namespace Reactor.Extensions;
|
||||
|
||||
/// <summary>
|
||||
/// GUI utilities
|
||||
/// </summary>
|
||||
@@ -146,4 +146,3 @@ namespace Reactor.Extensions
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,8 @@ using UnhollowerBaseLib;
|
||||
using UnhollowerBaseLib.Attributes;
|
||||
using UnhollowerRuntimeLib;
|
||||
|
||||
namespace Reactor.Extensions
|
||||
{
|
||||
namespace Reactor.Extensions;
|
||||
|
||||
[RegisterInIl2Cpp]
|
||||
public class StreamWrapper : Il2CppSystem.IO.Stream
|
||||
{
|
||||
@@ -62,7 +62,7 @@ namespace Reactor.Extensions
|
||||
Il2CppSystem.IO.SeekOrigin.Begin => SeekOrigin.Begin,
|
||||
Il2CppSystem.IO.SeekOrigin.Current => SeekOrigin.Current,
|
||||
Il2CppSystem.IO.SeekOrigin.End => SeekOrigin.End,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(origin), origin, null)
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(origin), origin, null),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -90,4 +90,3 @@ namespace Reactor.Extensions
|
||||
/// </summary>
|
||||
public static StreamWrapper AsIl2Cpp(this Stream stream) => new(stream);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Reactor.Extensions
|
||||
{
|
||||
namespace Reactor.Extensions;
|
||||
|
||||
public static class UnityObjectExtensions
|
||||
{
|
||||
/// <summary>
|
||||
@@ -40,4 +40,3 @@ namespace Reactor.Extensions
|
||||
Object.DestroyImmediate(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
using Il2CppSystem.Runtime.CompilerServices;
|
||||
|
||||
namespace Reactor
|
||||
{
|
||||
namespace Reactor;
|
||||
|
||||
public sealed class Il2CppEqualityComparer<T> : IEqualityComparer<T> where T : Il2CppSystem.Object
|
||||
{
|
||||
private static Il2CppEqualityComparer<T>? _instance;
|
||||
@@ -35,4 +35,3 @@ namespace Reactor
|
||||
return left.Equals(right);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,9 +3,8 @@
|
||||
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
namespace System.Runtime.CompilerServices
|
||||
{
|
||||
namespace System.Runtime.CompilerServices;
|
||||
|
||||
public static class IsExternalInit
|
||||
{
|
||||
}
|
||||
}
|
||||
+2
-3
@@ -1,8 +1,8 @@
|
||||
using BepInEx.IL2CPP;
|
||||
using BepInEx.Logging;
|
||||
|
||||
namespace Reactor
|
||||
{
|
||||
namespace Reactor;
|
||||
|
||||
public static class Logger<T> where T : BasePlugin
|
||||
{
|
||||
public static ManualLogSource Instance => PluginSingleton<T>.Instance.Log;
|
||||
@@ -25,4 +25,3 @@ namespace Reactor
|
||||
/// <inheritdoc cref="ManualLogSource.LogDebug"/>
|
||||
public static void Debug(object data) => Instance.LogDebug(data);
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@ using BepInEx.IL2CPP;
|
||||
using Hazel;
|
||||
using InnerNet;
|
||||
|
||||
namespace Reactor.Networking
|
||||
{
|
||||
namespace Reactor.Networking;
|
||||
|
||||
public abstract class CustomRpc<TPlugin, TInnerNetObject, TData> : UnsafeCustomRpc where TPlugin : BasePlugin where TInnerNetObject : InnerNetObject
|
||||
{
|
||||
protected CustomRpc(TPlugin plugin, uint id) : base(plugin, id)
|
||||
@@ -79,4 +79,3 @@ namespace Reactor.Networking
|
||||
UnsafeSend(netObject, null, true, targetId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,21 +6,21 @@ using HarmonyLib;
|
||||
using Hazel;
|
||||
using InnerNet;
|
||||
|
||||
namespace Reactor.Networking
|
||||
{
|
||||
namespace Reactor.Networking;
|
||||
|
||||
public enum RpcLocalHandling
|
||||
{
|
||||
None,
|
||||
Before,
|
||||
After
|
||||
After,
|
||||
}
|
||||
|
||||
public class CustomRpcManager
|
||||
{
|
||||
public const byte CallId = byte.MaxValue;
|
||||
|
||||
private readonly List<UnsafeCustomRpc> _list = new List<UnsafeCustomRpc>();
|
||||
private readonly Dictionary<Type, List<UnsafeCustomRpc>> _map = new Dictionary<Type, List<UnsafeCustomRpc>>();
|
||||
private readonly List<UnsafeCustomRpc> _list = new();
|
||||
private readonly Dictionary<Type, List<UnsafeCustomRpc>> _map = new();
|
||||
|
||||
public IReadOnlyList<UnsafeCustomRpc> List => _list.AsReadOnly();
|
||||
|
||||
@@ -115,4 +115,3 @@ namespace Reactor.Networking
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,8 +12,8 @@ using MonoMod.RuntimeDetour;
|
||||
using MonoMod.Utils;
|
||||
using Reactor.Networking.Serialization;
|
||||
|
||||
namespace Reactor.Networking.MethodRpc
|
||||
{
|
||||
namespace Reactor.Networking.MethodRpc;
|
||||
|
||||
public class MethodRpc : UnsafeCustomRpc
|
||||
{
|
||||
public delegate object HandleDelegate(InnerNetObject innerNetObject, object[] args);
|
||||
@@ -210,4 +210,3 @@ namespace Reactor.Networking.MethodRpc
|
||||
return GenerateHandler((DynamicMethod) detour.GenerateTrampoline());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,8 @@ using BepInEx.IL2CPP;
|
||||
using HarmonyLib;
|
||||
using Hazel;
|
||||
|
||||
namespace Reactor.Networking.MethodRpc
|
||||
{
|
||||
namespace Reactor.Networking.MethodRpc;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class MethodRpcAttribute : Attribute
|
||||
{
|
||||
@@ -50,4 +50,3 @@ namespace Reactor.Networking.MethodRpc
|
||||
ChainloaderHooks.PluginLoad += plugin => Register(plugin.GetType().Assembly, plugin);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
using Hazel;
|
||||
|
||||
namespace Reactor.Networking
|
||||
{
|
||||
namespace Reactor.Networking;
|
||||
|
||||
public static class ModDeclaration
|
||||
{
|
||||
public static void Serialize(MessageWriter writer, Mod mod)
|
||||
@@ -14,4 +14,3 @@ namespace Reactor.Networking
|
||||
writer.Write((byte) mod.Side);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BepInEx.IL2CPP;
|
||||
|
||||
namespace Reactor.Networking
|
||||
{
|
||||
namespace Reactor.Networking;
|
||||
|
||||
public static class ModList
|
||||
{
|
||||
private static Dictionary<string, Mod>? _mapById;
|
||||
@@ -41,4 +41,3 @@ namespace Reactor.Networking
|
||||
return Current;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
using Hazel;
|
||||
|
||||
namespace Reactor.Networking
|
||||
{
|
||||
namespace Reactor.Networking;
|
||||
|
||||
public static class ModdedHandshakeC2S
|
||||
{
|
||||
public static void Serialize(MessageWriter writer, int modCount)
|
||||
@@ -10,4 +10,3 @@ namespace Reactor.Networking
|
||||
writer.WritePacked(modCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
using Hazel;
|
||||
|
||||
namespace Reactor.Networking
|
||||
{
|
||||
namespace Reactor.Networking;
|
||||
|
||||
public static class ModdedHandshakeS2C
|
||||
{
|
||||
public static void Serialize(MessageWriter writer, string serverName, string serverVersion, int pluginCount)
|
||||
@@ -21,4 +21,3 @@ namespace Reactor.Networking
|
||||
pluginCount = reader.ReadPackedInt32();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,8 @@ using Reactor.Extensions;
|
||||
using UnhollowerBaseLib;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Reactor.Networking.Patches
|
||||
{
|
||||
namespace Reactor.Networking.Patches;
|
||||
|
||||
internal static class ClientPatches
|
||||
{
|
||||
[HarmonyPatch(typeof(InnerNetClient), nameof(InnerNetClient.HandleMessage))]
|
||||
@@ -181,4 +181,3 @@ namespace Reactor.Networking.Patches
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@ using Hazel;
|
||||
using InnerNet;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Reactor.Networking.Patches
|
||||
{
|
||||
namespace Reactor.Networking.Patches;
|
||||
|
||||
internal static class ServerPatches
|
||||
{
|
||||
[HarmonyPatch(typeof(InnerNetServer), nameof(InnerNetServer.OnServerConnect))]
|
||||
@@ -19,4 +19,3 @@ namespace Reactor.Networking.Patches
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
using BepInEx.IL2CPP;
|
||||
|
||||
namespace Reactor.Networking
|
||||
{
|
||||
namespace Reactor.Networking;
|
||||
|
||||
public abstract class PlayerCustomRpc<TPlugin, TData> : CustomRpc<TPlugin, PlayerControl, TData> where TPlugin : BasePlugin
|
||||
{
|
||||
protected PlayerCustomRpc(TPlugin plugin, uint id) : base(plugin, id)
|
||||
@@ -35,4 +35,3 @@ namespace Reactor.Networking
|
||||
SendTo(PlayerControl.LocalPlayer, targetId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,15 +4,14 @@ using System.Reflection;
|
||||
using HarmonyLib;
|
||||
using Hazel;
|
||||
using InnerNet;
|
||||
using MonoMod.Utils;
|
||||
|
||||
namespace Reactor.Networking.Serialization
|
||||
{
|
||||
namespace Reactor.Networking.Serialization;
|
||||
|
||||
[MessageConverter]
|
||||
public class InnerNetObjectConverter : MessageConverter<InnerNetObject>
|
||||
{
|
||||
private static readonly MethodInfo _readNetObject = AccessTools.Method(typeof(MessageExtensions), nameof(MessageExtensions.ReadNetObject));
|
||||
private static readonly Dictionary<Type, Func<MessageReader, InnerNetObject>> _readNetObjectMap = new Dictionary<Type, Func<MessageReader, InnerNetObject>>();
|
||||
private static readonly Dictionary<Type, Func<MessageReader, InnerNetObject>> _readNetObjectMap = new();
|
||||
|
||||
public static InnerNetObject ReadNetObject(MessageReader reader, Type t)
|
||||
{
|
||||
@@ -36,4 +35,3 @@ namespace Reactor.Networking.Serialization
|
||||
return ReadNetObject(reader, objectType);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using Hazel;
|
||||
|
||||
namespace Reactor.Networking.Serialization
|
||||
{
|
||||
namespace Reactor.Networking.Serialization;
|
||||
|
||||
public abstract class UnsafeMessageConverter
|
||||
{
|
||||
public abstract void UnsafeWrite(MessageWriter writer, object value);
|
||||
@@ -26,4 +26,3 @@ namespace Reactor.Networking.Serialization
|
||||
|
||||
public override object UnsafeRead(MessageReader reader, Type objectType) => Read(reader, objectType)!;
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@ using System;
|
||||
using System.Reflection;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace Reactor.Networking.Serialization
|
||||
{
|
||||
namespace Reactor.Networking.Serialization;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class MessageConverterAttribute : Attribute
|
||||
{
|
||||
@@ -38,4 +38,3 @@ namespace Reactor.Networking.Serialization
|
||||
ChainloaderHooks.PluginLoad += plugin => Register(plugin.GetType().Assembly);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,13 +5,13 @@ using Hazel;
|
||||
using Reactor.Extensions;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Reactor.Networking.Serialization
|
||||
{
|
||||
namespace Reactor.Networking.Serialization;
|
||||
|
||||
public static class MessageSerializer
|
||||
{
|
||||
private static List<UnsafeMessageConverter> MessageConverters { get; } = new List<UnsafeMessageConverter>();
|
||||
private static List<UnsafeMessageConverter> MessageConverters { get; } = new();
|
||||
|
||||
private static Dictionary<Type, UnsafeMessageConverter> MessageConverterMap { get; } = new Dictionary<Type, UnsafeMessageConverter>();
|
||||
private static Dictionary<Type, UnsafeMessageConverter> MessageConverterMap { get; } = new();
|
||||
|
||||
public static void Register(UnsafeMessageConverter messageConverter)
|
||||
{
|
||||
@@ -153,4 +153,3 @@ namespace Reactor.Networking.Serialization
|
||||
throw new NotSupportedException("Couldn't deserialize " + t);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,8 @@ using BepInEx.IL2CPP;
|
||||
using Hazel;
|
||||
using InnerNet;
|
||||
|
||||
namespace Reactor.Networking
|
||||
{
|
||||
namespace Reactor.Networking;
|
||||
|
||||
public abstract class UnsafeCustomRpc
|
||||
{
|
||||
internal CustomRpcManager? Manager { get; set; }
|
||||
@@ -48,7 +48,7 @@ namespace Reactor.Networking
|
||||
var writer = immediately switch
|
||||
{
|
||||
false => AmongUsClient.Instance.StartRpc(innerNetObject.NetId, CustomRpcManager.CallId, SendOption),
|
||||
true => AmongUsClient.Instance.StartRpcImmediately(innerNetObject.NetId, CustomRpcManager.CallId, SendOption, targetClientId)
|
||||
true => AmongUsClient.Instance.StartRpcImmediately(innerNetObject.NetId, CustomRpcManager.CallId, SendOption, targetClientId),
|
||||
};
|
||||
|
||||
var pluginNetId = ModList.GetById(PluginId).NetId;
|
||||
@@ -74,4 +74,3 @@ namespace Reactor.Networking
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
using HarmonyLib;
|
||||
using InnerNet;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Reactor.Patches
|
||||
{
|
||||
namespace Reactor.Patches;
|
||||
|
||||
internal static class BetterGuestPatch
|
||||
{
|
||||
[HarmonyPatch(typeof(SaveManager), nameof(SaveManager.ChatModeType), MethodType.Getter)]
|
||||
@@ -16,4 +15,3 @@ namespace Reactor.Patches
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@ using HarmonyLib;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Reactor.Patches
|
||||
{
|
||||
namespace Reactor.Patches;
|
||||
|
||||
/// <summary>
|
||||
/// "Fixes" an issue where empty TextBoxes have wrong cursor positions
|
||||
/// </summary>
|
||||
@@ -22,4 +22,3 @@ namespace Reactor.Patches
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
using HarmonyLib;
|
||||
|
||||
namespace Reactor.Patches
|
||||
{
|
||||
namespace Reactor.Patches;
|
||||
|
||||
[HarmonyPatch]
|
||||
internal static class CustomServersPatch
|
||||
{
|
||||
@@ -29,4 +29,3 @@ namespace Reactor.Patches
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,8 @@ using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace Reactor.Patches
|
||||
{
|
||||
namespace Reactor.Patches;
|
||||
|
||||
public static class FreeNamePatch
|
||||
{
|
||||
[HarmonyPatch(typeof(AccountManager), nameof(AccountManager.CheckAndRegenerateName))]
|
||||
@@ -37,7 +37,8 @@ namespace Reactor.Patches
|
||||
textBox.outputText.transform.position = nameText.transform.position;
|
||||
textBox.outputText.fontSize = 4f;
|
||||
|
||||
textBox.OnChange.AddListener((Action) (() => {
|
||||
textBox.OnChange.AddListener((Action) (() =>
|
||||
{
|
||||
SaveManager.PlayerName = textBox.text;
|
||||
}));
|
||||
textBox.OnEnter = textBox.OnFocusLost = textBox.OnChange;
|
||||
@@ -52,7 +53,7 @@ namespace Reactor.Patches
|
||||
{
|
||||
"HostGameButton",
|
||||
"FindGameButton",
|
||||
"JoinGameButton"
|
||||
"JoinGameButton",
|
||||
};
|
||||
|
||||
var yStart = Vector3.up;
|
||||
@@ -69,4 +70,3 @@ namespace Reactor.Patches
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
using System.Linq;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace Reactor.Patches
|
||||
{
|
||||
namespace Reactor.Patches;
|
||||
|
||||
internal static class PlayerIdPatch
|
||||
{
|
||||
[HarmonyPatch(typeof(GameData), nameof(GameData.GetAvailableId))]
|
||||
@@ -23,4 +23,3 @@ namespace Reactor.Patches
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using BepInEx;
|
||||
using BepInEx.IL2CPP;
|
||||
using HarmonyLib;
|
||||
@@ -8,8 +7,8 @@ using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace Reactor.Patches
|
||||
{
|
||||
namespace Reactor.Patches;
|
||||
|
||||
public static class ReactorVersionShower
|
||||
{
|
||||
public static TextMeshPro? Text { get; private set; }
|
||||
@@ -72,4 +71,3 @@ namespace Reactor.Patches
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,8 @@ using Reactor.Extensions;
|
||||
using UnityEngine;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace Reactor.Patches
|
||||
{
|
||||
namespace Reactor.Patches;
|
||||
|
||||
internal class RegionInfoWatcher : IDisposable
|
||||
{
|
||||
private FileSystemWatcher Watcher { get; }
|
||||
@@ -85,4 +85,3 @@ namespace Reactor.Patches
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,8 @@ using System.Net.Sockets;
|
||||
using HarmonyLib;
|
||||
using InnerNet;
|
||||
|
||||
namespace Reactor.Patches
|
||||
{
|
||||
namespace Reactor.Patches;
|
||||
|
||||
[HarmonyPatch(typeof(InnerNetClient), nameof(InnerNetClient.Connect))]
|
||||
public static class ConnectPatch
|
||||
{
|
||||
@@ -48,4 +48,3 @@ namespace Reactor.Patches
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
using System.Reflection;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace Reactor.Patches
|
||||
{
|
||||
namespace Reactor.Patches;
|
||||
|
||||
[HarmonyPatch(typeof(SplashManager), nameof(SplashManager.Start))]
|
||||
internal static class SplashSkip
|
||||
{
|
||||
@@ -40,4 +40,3 @@ namespace Reactor.Patches
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@ using System.IO;
|
||||
using System.Reflection;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace Reactor.Patches
|
||||
{
|
||||
namespace Reactor.Patches;
|
||||
|
||||
internal static class SteamPatch
|
||||
{
|
||||
[HarmonyPatch]
|
||||
@@ -36,4 +36,3 @@ namespace Reactor.Patches
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@ using System.Linq;
|
||||
using System.Reflection;
|
||||
using BepInEx.IL2CPP;
|
||||
|
||||
namespace Reactor
|
||||
{
|
||||
namespace Reactor;
|
||||
|
||||
public static class PluginSingleton<T> where T : BasePlugin
|
||||
{
|
||||
private static T? _instance;
|
||||
@@ -20,4 +20,3 @@ namespace Reactor
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,18 +14,18 @@ using UnhollowerBaseLib.Attributes;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace Reactor
|
||||
{
|
||||
namespace Reactor;
|
||||
|
||||
[BepInAutoPlugin("gg.reactor.api")]
|
||||
[BepInProcess("Among Us.exe")]
|
||||
public partial class ReactorPlugin : BasePlugin
|
||||
{
|
||||
public Harmony Harmony { get; } = new Harmony(Id);
|
||||
public CustomRpcManager CustomRpcManager { get; } = new CustomRpcManager();
|
||||
public Harmony Harmony { get; } = new(Id);
|
||||
public CustomRpcManager CustomRpcManager { get; } = new();
|
||||
|
||||
public ConfigEntry<bool>? AllowVanillaServers { get; private set; }
|
||||
|
||||
internal RegionInfoWatcher RegionInfoWatcher { get; } = new RegionInfoWatcher();
|
||||
internal RegionInfoWatcher RegionInfoWatcher { get; } = new();
|
||||
|
||||
public ReactorPlugin()
|
||||
{
|
||||
@@ -106,4 +106,3 @@ namespace Reactor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@ using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Reactor
|
||||
{
|
||||
namespace Reactor;
|
||||
|
||||
/// <summary>
|
||||
/// This attribute specifies plugin's side
|
||||
/// </summary>
|
||||
@@ -34,4 +34,3 @@ namespace Reactor
|
||||
return PluginSide.Both;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,8 @@ using BepInEx.IL2CPP;
|
||||
using HarmonyLib;
|
||||
using Reactor.Networking;
|
||||
|
||||
namespace Reactor
|
||||
{
|
||||
namespace Reactor;
|
||||
|
||||
/// <summary>
|
||||
/// Utility attribute for automatically registering CustomRpc
|
||||
/// </summary>
|
||||
@@ -48,4 +48,3 @@ namespace Reactor
|
||||
ChainloaderHooks.PluginLoad += plugin => Register(plugin.GetType().Assembly, plugin);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@ using System.Reflection;
|
||||
using HarmonyLib;
|
||||
using UnhollowerRuntimeLib;
|
||||
|
||||
namespace Reactor
|
||||
{
|
||||
namespace Reactor;
|
||||
|
||||
/// <summary>
|
||||
/// Utility attribute for automatically calling <see cref="ClassInjector.RegisterTypeInIl2Cpp{T}()"/>
|
||||
/// </summary>
|
||||
@@ -68,4 +68,3 @@ namespace Reactor
|
||||
ChainloaderHooks.PluginLoad += plugin => Register(plugin.GetType().Assembly);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@ using Reactor.Extensions;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Reactor.Unstrip
|
||||
{
|
||||
namespace Reactor.Unstrip;
|
||||
|
||||
internal static class DefaultBundle
|
||||
{
|
||||
public static void Load()
|
||||
@@ -26,10 +26,9 @@ namespace Reactor.Unstrip
|
||||
knob = bundle.LoadAsset<Sprite>("Knob")!.DontUnload(),
|
||||
mask = bundle.LoadAsset<Sprite>("UIMask")!.DontUnload(),
|
||||
standard = bundle.LoadAsset<Sprite>("UISprite")!.DontUnload(),
|
||||
inputField = bundle.LoadAsset<Sprite>("InputFieldBackground")!.DontUnload()
|
||||
inputField = bundle.LoadAsset<Sprite>("InputFieldBackground")!.DontUnload(),
|
||||
};
|
||||
|
||||
bundle.Unload(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user