Merge pull request #58 from D1GQ/dev

Push to main for the last time
This commit is contained in:
D1GQ authored and GitHub committed 2026-01-09 21:45:10 -06:00
commit 86c7266f71
2 files changed
+6 -4

No files matched your search

+1
View File
@@ -1,4 +1,5 @@
using BetterAmongUs.Commands;
using BetterAmongUs.Modules.AntiCheat;
using System.Reflection;
namespace BetterAmongUs.Attributes;
+5 -4
View File
@@ -1,12 +1,13 @@
using BetterAmongUs.Attributes;
using BetterAmongUs.Enums;
using BetterAmongUs.Helpers;
using BetterAmongUs.Modules;
using BetterAmongUs.Mono;
using Hazel;
using InnerNet;
using UnityEngine;
namespace BetterAmongUs.Modules.AntiCheat;
internal abstract class RPCHandler
{
internal static readonly RPCHandler?[] allHandlers = [.. RegisterRPCHandlerAttribute.Instances];
@@ -14,7 +15,7 @@ internal abstract class RPCHandler
internal virtual byte CallId => byte.MaxValue;
internal virtual byte GameDataTag => byte.MaxValue;
internal virtual bool LocalHandling { get; set; }
protected static bool CancelAsHost => !(GameState.IsHost);
protected static bool CancelAsHost => !GameState.IsHost;
internal static bool CheckRange(Vector2 pos1, Vector2 pos2, float range) => Vector2.Distance(pos1, pos2) <= range;
internal virtual void Handle(PlayerControl? sender, MessageReader reader) { }
@@ -43,7 +44,7 @@ internal abstract class RPCHandler
else if (handlerFlag == HandlerFlag.AntiCheat) handler.HandleAntiCheat(sender, reader);
else if (handlerFlag == HandlerFlag.CheatRpcCheck) handler.HandleCheatRpcCheck(sender, reader);
else if (handlerFlag == HandlerFlag.BetterHost) cancel = !handler.BetterHandle(sender, reader);
if (!(cancel)) break;
if (!cancel) break;
}
catch
{
@@ -62,7 +63,7 @@ internal abstract class RPCHandler
}
}
return !(cancel);
return !cancel;
}
internal void LogRpcInfo(string info, PlayerControl? player = null)