Decompiled source of YapAdmin v1.3.2

YapAdmin.dll

Decompiled 4 days ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Mirror;
using Mirror.RemoteCalls;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.UI;
using YAPYAP;
using YapAdmin.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("YapAdmin")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("YapAdmin")]
[assembly: AssemblyTitle("YapAdmin")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace YapAdmin
{
	internal static class AdminInputFocus
	{
		private static readonly object FocusToken = new object();

		private static bool _active;

		internal static void Acquire()
		{
			if (!_active)
			{
				if ((Object)(object)InputManager.Instance != (Object)null)
				{
					InputManager.Instance.IsInputLocked = true;
					InputManager.Instance.AddToInputFocusStack(FocusToken);
				}
				Cursor.visible = true;
				Cursor.lockState = (CursorLockMode)0;
				_active = true;
			}
		}

		internal static void Release()
		{
			if (_active)
			{
				if ((Object)(object)InputManager.Instance != (Object)null)
				{
					InputManager.Instance.RemoveFromInputFocusStack(FocusToken);
					InputManager.Instance.IsInputLocked = false;
				}
				_active = false;
			}
		}

		internal static void Maintain()
		{
			if (_active)
			{
				Cursor.visible = true;
				Cursor.lockState = (CursorLockMode)0;
			}
		}
	}
	internal static class AdminNetworkCommands
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static RemoteCallDelegate <0>__InvokeModifyGold;

			public static RemoteCallDelegate <1>__InvokeHealPawn;

			public static RemoteCallDelegate <2>__InvokeSetGodMode;

			public static RemoteCallDelegate <3>__InvokeSetNoCooldown;

			public static RemoteCallDelegate <4>__InvokeKillPawn;

			public static RemoteCallDelegate <5>__InvokeTeleportPawn;

			public static RemoteCallDelegate <6>__InvokeSetAlertMeter;

			public static RemoteCallDelegate <7>__InvokeSetTotalScore;

			public static RemoteCallDelegate <8>__InvokeKillAllPlayers;

			public static RemoteCallDelegate <9>__InvokeKillEntity;

			public static RemoteCallDelegate <10>__InvokeRefillStamina;
		}

		private const string CmdModifyGoldName = "System.Void YapAdmin.AdminNetworkCommands::CmdModifyGold(System.Int32)";

		private const string CmdHealPawnName = "System.Void YapAdmin.AdminNetworkCommands::CmdHealPawn(System.UInt32)";

		private const string CmdSetGodModeName = "System.Void YapAdmin.AdminNetworkCommands::CmdSetGodMode(System.UInt32,System.Boolean)";

		private const string CmdSetNoCooldownName = "System.Void YapAdmin.AdminNetworkCommands::CmdSetNoCooldown(System.UInt32,System.Boolean)";

		private const string CmdKillPawnName = "System.Void YapAdmin.AdminNetworkCommands::CmdKillPawn(System.UInt32)";

		private const string CmdTeleportPawnName = "System.Void YapAdmin.AdminNetworkCommands::CmdTeleportPawn(System.UInt32,UnityEngine.Vector3)";

		private const string CmdSetAlertMeterName = "System.Void YapAdmin.AdminNetworkCommands::CmdSetAlertMeter(System.Single)";

		private const string CmdSetTotalScoreName = "System.Void YapAdmin.AdminNetworkCommands::CmdSetTotalScore(System.Int32)";

		private const string CmdKillAllPlayersName = "System.Void YapAdmin.AdminNetworkCommands::CmdKillAllPlayers()";

		private const string CmdRefillStaminaName = "System.Void YapAdmin.AdminNetworkCommands::CmdRefillStamina(System.UInt32)";

		private const string CmdKillEntityName = "System.Void YapAdmin.AdminNetworkCommands::CmdKillEntity(System.UInt32)";

		private static readonly MethodInfo SendCommandInternal = AccessTools.Method(typeof(NetworkBehaviour), "SendCommandInternal", (Type[])null, (Type[])null);

		private static bool _registered;

		internal static void Register()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Expected O, but got Unknown
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Expected O, but got Unknown
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Expected O, but got Unknown
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Expected O, but got Unknown
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Expected O, but got Unknown
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Expected O, but got Unknown
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Expected O, but got Unknown
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Expected O, but got Unknown
			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Expected O, but got Unknown
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0213: Expected O, but got Unknown
			if (_registered)
			{
				return;
			}
			try
			{
				Type? typeFromHandle = typeof(GameManager);
				object obj = <>O.<0>__InvokeModifyGold;
				if (obj == null)
				{
					RemoteCallDelegate val = InvokeModifyGold;
					<>O.<0>__InvokeModifyGold = val;
					obj = (object)val;
				}
				RemoteProcedureCalls.RegisterCommand(typeFromHandle, "System.Void YapAdmin.AdminNetworkCommands::CmdModifyGold(System.Int32)", (RemoteCallDelegate)obj, false);
				Type? typeFromHandle2 = typeof(GameManager);
				object obj2 = <>O.<1>__InvokeHealPawn;
				if (obj2 == null)
				{
					RemoteCallDelegate val2 = InvokeHealPawn;
					<>O.<1>__InvokeHealPawn = val2;
					obj2 = (object)val2;
				}
				RemoteProcedureCalls.RegisterCommand(typeFromHandle2, "System.Void YapAdmin.AdminNetworkCommands::CmdHealPawn(System.UInt32)", (RemoteCallDelegate)obj2, false);
				Type? typeFromHandle3 = typeof(GameManager);
				object obj3 = <>O.<2>__InvokeSetGodMode;
				if (obj3 == null)
				{
					RemoteCallDelegate val3 = InvokeSetGodMode;
					<>O.<2>__InvokeSetGodMode = val3;
					obj3 = (object)val3;
				}
				RemoteProcedureCalls.RegisterCommand(typeFromHandle3, "System.Void YapAdmin.AdminNetworkCommands::CmdSetGodMode(System.UInt32,System.Boolean)", (RemoteCallDelegate)obj3, false);
				Type? typeFromHandle4 = typeof(GameManager);
				object obj4 = <>O.<3>__InvokeSetNoCooldown;
				if (obj4 == null)
				{
					RemoteCallDelegate val4 = InvokeSetNoCooldown;
					<>O.<3>__InvokeSetNoCooldown = val4;
					obj4 = (object)val4;
				}
				RemoteProcedureCalls.RegisterCommand(typeFromHandle4, "System.Void YapAdmin.AdminNetworkCommands::CmdSetNoCooldown(System.UInt32,System.Boolean)", (RemoteCallDelegate)obj4, false);
				Type? typeFromHandle5 = typeof(GameManager);
				object obj5 = <>O.<4>__InvokeKillPawn;
				if (obj5 == null)
				{
					RemoteCallDelegate val5 = InvokeKillPawn;
					<>O.<4>__InvokeKillPawn = val5;
					obj5 = (object)val5;
				}
				RemoteProcedureCalls.RegisterCommand(typeFromHandle5, "System.Void YapAdmin.AdminNetworkCommands::CmdKillPawn(System.UInt32)", (RemoteCallDelegate)obj5, false);
				Type? typeFromHandle6 = typeof(GameManager);
				object obj6 = <>O.<5>__InvokeTeleportPawn;
				if (obj6 == null)
				{
					RemoteCallDelegate val6 = InvokeTeleportPawn;
					<>O.<5>__InvokeTeleportPawn = val6;
					obj6 = (object)val6;
				}
				RemoteProcedureCalls.RegisterCommand(typeFromHandle6, "System.Void YapAdmin.AdminNetworkCommands::CmdTeleportPawn(System.UInt32,UnityEngine.Vector3)", (RemoteCallDelegate)obj6, false);
				Type? typeFromHandle7 = typeof(GameManager);
				object obj7 = <>O.<6>__InvokeSetAlertMeter;
				if (obj7 == null)
				{
					RemoteCallDelegate val7 = InvokeSetAlertMeter;
					<>O.<6>__InvokeSetAlertMeter = val7;
					obj7 = (object)val7;
				}
				RemoteProcedureCalls.RegisterCommand(typeFromHandle7, "System.Void YapAdmin.AdminNetworkCommands::CmdSetAlertMeter(System.Single)", (RemoteCallDelegate)obj7, false);
				Type? typeFromHandle8 = typeof(GameManager);
				object obj8 = <>O.<7>__InvokeSetTotalScore;
				if (obj8 == null)
				{
					RemoteCallDelegate val8 = InvokeSetTotalScore;
					<>O.<7>__InvokeSetTotalScore = val8;
					obj8 = (object)val8;
				}
				RemoteProcedureCalls.RegisterCommand(typeFromHandle8, "System.Void YapAdmin.AdminNetworkCommands::CmdSetTotalScore(System.Int32)", (RemoteCallDelegate)obj8, false);
				Type? typeFromHandle9 = typeof(GameManager);
				object obj9 = <>O.<8>__InvokeKillAllPlayers;
				if (obj9 == null)
				{
					RemoteCallDelegate val9 = InvokeKillAllPlayers;
					<>O.<8>__InvokeKillAllPlayers = val9;
					obj9 = (object)val9;
				}
				RemoteProcedureCalls.RegisterCommand(typeFromHandle9, "System.Void YapAdmin.AdminNetworkCommands::CmdKillAllPlayers()", (RemoteCallDelegate)obj9, false);
				Type? typeFromHandle10 = typeof(GameManager);
				object obj10 = <>O.<9>__InvokeKillEntity;
				if (obj10 == null)
				{
					RemoteCallDelegate val10 = InvokeKillEntity;
					<>O.<9>__InvokeKillEntity = val10;
					obj10 = (object)val10;
				}
				RemoteProcedureCalls.RegisterCommand(typeFromHandle10, "System.Void YapAdmin.AdminNetworkCommands::CmdKillEntity(System.UInt32)", (RemoteCallDelegate)obj10, false);
				Type? typeFromHandle11 = typeof(GameManager);
				object obj11 = <>O.<10>__InvokeRefillStamina;
				if (obj11 == null)
				{
					RemoteCallDelegate val11 = InvokeRefillStamina;
					<>O.<10>__InvokeRefillStamina = val11;
					obj11 = (object)val11;
				}
				RemoteProcedureCalls.RegisterCommand(typeFromHandle11, "System.Void YapAdmin.AdminNetworkCommands::CmdRefillStamina(System.UInt32)", (RemoteCallDelegate)obj11, false);
				_registered = true;
				Plugin.Log.LogInfo((object)"YapAdmin network commands registered.");
			}
			catch (Exception ex)
			{
				Plugin.Log.LogError((object)("Failed to register YapAdmin network commands: " + ex.Message));
			}
		}

		internal static void SendModifyGold(int delta)
		{
			SendCommand("System.Void YapAdmin.AdminNetworkCommands::CmdModifyGold(System.Int32)", delegate(NetworkWriter writer)
			{
				NetworkWriterExtensions.WriteInt(writer, delta);
			});
		}

		internal static void SendHealPawn(uint netId)
		{
			SendCommand("System.Void YapAdmin.AdminNetworkCommands::CmdHealPawn(System.UInt32)", delegate(NetworkWriter writer)
			{
				NetworkWriterExtensions.WriteVarUInt(writer, netId);
			});
		}

		internal static void SendSetGodMode(uint netId, bool enabled)
		{
			SendCommand("System.Void YapAdmin.AdminNetworkCommands::CmdSetGodMode(System.UInt32,System.Boolean)", delegate(NetworkWriter writer)
			{
				NetworkWriterExtensions.WriteVarUInt(writer, netId);
				NetworkWriterExtensions.WriteBool(writer, enabled);
			});
		}

		internal static void SendSetNoCooldown(uint netId, bool enabled)
		{
			SendCommand("System.Void YapAdmin.AdminNetworkCommands::CmdSetNoCooldown(System.UInt32,System.Boolean)", delegate(NetworkWriter writer)
			{
				NetworkWriterExtensions.WriteVarUInt(writer, netId);
				NetworkWriterExtensions.WriteBool(writer, enabled);
			});
		}

		internal static void SendKillPawn(uint netId)
		{
			SendCommand("System.Void YapAdmin.AdminNetworkCommands::CmdKillPawn(System.UInt32)", delegate(NetworkWriter writer)
			{
				NetworkWriterExtensions.WriteVarUInt(writer, netId);
			});
		}

		internal static void SendTeleportPawn(uint netId, Vector3 position)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			SendCommand("System.Void YapAdmin.AdminNetworkCommands::CmdTeleportPawn(System.UInt32,UnityEngine.Vector3)", delegate(NetworkWriter writer)
			{
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				NetworkWriterExtensions.WriteVarUInt(writer, netId);
				NetworkWriterExtensions.WriteVector3(writer, position);
			});
		}

		internal static void SendSetAlertMeter(float value)
		{
			SendCommand("System.Void YapAdmin.AdminNetworkCommands::CmdSetAlertMeter(System.Single)", delegate(NetworkWriter writer)
			{
				NetworkWriterExtensions.WriteFloat(writer, value);
			});
		}

		internal static void SendSetTotalScore(int score)
		{
			SendCommand("System.Void YapAdmin.AdminNetworkCommands::CmdSetTotalScore(System.Int32)", delegate(NetworkWriter writer)
			{
				NetworkWriterExtensions.WriteInt(writer, score);
			});
		}

		internal static void SendKillAllPlayers()
		{
			SendCommand("System.Void YapAdmin.AdminNetworkCommands::CmdKillAllPlayers()", delegate
			{
			});
		}

		internal static void SendKillEntity(uint netId)
		{
			SendCommand("System.Void YapAdmin.AdminNetworkCommands::CmdKillEntity(System.UInt32)", delegate(NetworkWriter writer)
			{
				NetworkWriterExtensions.WriteVarUInt(writer, netId);
			});
		}

		internal static void SendRefillStamina(uint netId)
		{
			SendCommand("System.Void YapAdmin.AdminNetworkCommands::CmdRefillStamina(System.UInt32)", delegate(NetworkWriter writer)
			{
				NetworkWriterExtensions.WriteVarUInt(writer, netId);
			});
		}

		private static void SendCommand(string fullName, Action<NetworkWriter> writePayload)
		{
			GameManager instance = GameManager.Instance;
			if ((Object)(object)instance == (Object)null)
			{
				Plugin.Log.LogWarning((object)"YapAdmin command skipped: GameManager not available.");
				return;
			}
			NetworkWriterPooled val = NetworkWriterPool.Get();
			try
			{
				writePayload((NetworkWriter)(object)val);
				int stableHashCode = MirrorHash.GetStableHashCode(fullName);
				SendCommandInternal.Invoke(instance, new object[5] { fullName, stableHashCode, val, 0, false });
			}
			catch (Exception ex)
			{
				Plugin.Log.LogError((object)("Failed to send admin command " + fullName + ": " + ex.Message));
			}
			finally
			{
				NetworkWriterPool.Return(val);
			}
		}

		private static void InvokeModifyGold(NetworkBehaviour obj, NetworkReader reader, NetworkConnectionToClient sender)
		{
			if (NetworkServer.active)
			{
				GameManager instance = GameManager.Instance;
				if (instance != null)
				{
					instance.ModifyGold(NetworkReaderExtensions.ReadInt(reader));
				}
			}
		}

		private static void InvokeHealPawn(NetworkBehaviour obj, NetworkReader reader, NetworkConnectionToClient sender)
		{
			if (NetworkServer.active)
			{
				AdminService.ApplyHealOnServer(NetworkReaderExtensions.ReadVarUInt(reader));
			}
		}

		private static void InvokeSetGodMode(NetworkBehaviour obj, NetworkReader reader, NetworkConnectionToClient sender)
		{
			if (NetworkServer.active)
			{
				AdminService.ApplyGodModeOnServer(NetworkReaderExtensions.ReadVarUInt(reader), NetworkReaderExtensions.ReadBool(reader));
			}
		}

		private static void InvokeSetNoCooldown(NetworkBehaviour obj, NetworkReader reader, NetworkConnectionToClient sender)
		{
			if (NetworkServer.active)
			{
				AdminService.ApplyNoCooldownOnServer(NetworkReaderExtensions.ReadVarUInt(reader), NetworkReaderExtensions.ReadBool(reader));
			}
		}

		private static void InvokeKillPawn(NetworkBehaviour obj, NetworkReader reader, NetworkConnectionToClient sender)
		{
			if (NetworkServer.active)
			{
				AdminService.ApplyKillOnServer(NetworkReaderExtensions.ReadVarUInt(reader));
			}
		}

		private static void InvokeTeleportPawn(NetworkBehaviour obj, NetworkReader reader, NetworkConnectionToClient sender)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkServer.active)
			{
				AdminService.ApplyTeleportOnServer(NetworkReaderExtensions.ReadVarUInt(reader), NetworkReaderExtensions.ReadVector3(reader));
			}
		}

		private static void InvokeSetAlertMeter(NetworkBehaviour obj, NetworkReader reader, NetworkConnectionToClient sender)
		{
			if (NetworkServer.active)
			{
				AdminService.ApplyAlertMeterOnServer(NetworkReaderExtensions.ReadFloat(reader));
			}
		}

		private static void InvokeSetTotalScore(NetworkBehaviour obj, NetworkReader reader, NetworkConnectionToClient sender)
		{
			if (NetworkServer.active)
			{
				AdminService.ApplyTotalScoreOnServer(NetworkReaderExtensions.ReadInt(reader));
			}
		}

		private static void InvokeKillAllPlayers(NetworkBehaviour obj, NetworkReader reader, NetworkConnectionToClient sender)
		{
			if (NetworkServer.active)
			{
				AdminService.ApplyKillAllOnServer();
			}
		}

		private static void InvokeKillEntity(NetworkBehaviour obj, NetworkReader reader, NetworkConnectionToClient sender)
		{
			if (NetworkServer.active)
			{
				AdminService.ApplyKillEntityOnServer(NetworkReaderExtensions.ReadVarUInt(reader));
			}
		}

		private static void InvokeRefillStamina(NetworkBehaviour obj, NetworkReader reader, NetworkConnectionToClient sender)
		{
			if (NetworkServer.active)
			{
				AdminService.ApplyRefillStaminaOnServer(NetworkReaderExtensions.ReadVarUInt(reader));
			}
		}
	}
	internal readonly struct PlayerInfo
	{
		internal Pawn Pawn { get; }

		internal uint NetId { get; }

		internal string Name { get; }

		internal bool IsDead { get; }

		internal bool IsExtracted { get; }

		internal int Health { get; }

		internal int MaxHealth { get; }

		internal string StatusLabel
		{
			get
			{
				if (IsExtracted)
				{
					return "Extracted";
				}
				if (IsDead)
				{
					return "Dead";
				}
				return $"Alive ({Health}/{MaxHealth})";
			}
		}

		internal PlayerInfo(Pawn pawn)
		{
			Pawn = pawn;
			NetId = ((NetworkBehaviour)pawn).netId;
			Name = pawn.PlayerName;
			IsDead = pawn.IsDead;
			IsExtracted = pawn.IsExtracted;
			Health = (((Object)(object)pawn.Hurtbox != (Object)null) ? pawn.Hurtbox.Health : 0);
			MaxHealth = (((Object)(object)pawn.Hurtbox != (Object)null) ? pawn.Hurtbox.MaxHealth : 0);
		}
	}
	internal static class AdminService
	{
		private static readonly MethodInfo CmdReviveTarget = AccessTools.Method(typeof(ReviveSpell), "CmdReviveTarget", (Type[])null, (Type[])null);

		private static readonly HashSet<uint> GodModePawns = new HashSet<uint>();

		private static readonly HashSet<uint> NoCooldownPawns = new HashSet<uint>();

		private static bool _infiniteStaminaEnabled;

		private static bool _noclipEnabled;

		private static bool _infiniteJumpsEnabled;

		private static bool _superSpeedEnabled;

		private static bool _superStrengthEnabled;

		private static float _appliedStrengthBonus;

		private const int InfiniteJumpBonus = 999;

		private const float SuperSpeedWalkBonus = 30f;

		private const float SuperSpeedSprintBonus = 45f;

		private const float SuperFlyMoveSpeed = 55f;

		private const float SuperFlySprintSpeed = 110f;

		private const float DefaultFlyMoveSpeed = 10f;

		private const float DefaultFlySprintSpeed = 20f;

		private const float SuperStrengthForceBonus = 15000f;

		private const float SuperMaxDragVelocity = 80f;

		private const float DefaultMaxDragVelocity = 10f;

		private const float SuperMaxConstraintForce = 80000f;

		private const float DefaultMaxConstraintForce = 2000f;

		private const float SuperConstraintSpringForce = 12000f;

		private const float DefaultConstraintSpringForce = 1000f;

		private const float SuperPlayerConstraintDistance = 8f;

		private const float DefaultPlayerConstraintDistance = 3f;

		private const float SuperGrabReleaseDistance = 14f;

		private const float DefaultGrabReleaseDistance = 6f;

		private static readonly FieldInfo FlySettingsField = AccessTools.Field(typeof(ControllerStateFlying), "_flySettings");

		private static readonly FieldInfo FlyCurrentSpeedField = AccessTools.Field(typeof(ControllerStateFlying), "_currentSpeed");

		private static readonly FieldInfo FlyMoveSpeedField = AccessTools.Field(typeof(NoClipFlySettings), "moveSpeed");

		private static readonly FieldInfo FlySprintSpeedField = AccessTools.Field(typeof(NoClipFlySettings), "sprintSpeed");

		private static readonly FieldInfo GrabMaxDragVelocityField = AccessTools.Field(typeof(PawnGrabInteractions), "maxDragVelocity");

		private static readonly FieldInfo GrabMaxConstraintForceField = AccessTools.Field(typeof(PawnGrabInteractions), "maxConstraintForce");

		private static readonly FieldInfo GrabConstraintSpringForceField = AccessTools.Field(typeof(PawnGrabInteractions), "constraintSpringForce");

		private static readonly FieldInfo GrabPlayerConstraintMaxDistanceField = AccessTools.Field(typeof(PawnGrabInteractions), "playerConstraintMaxDistance");

		private static readonly FieldInfo GrabReleaseDistanceField = AccessTools.Field(typeof(PawnGrabInteractions), "grabReleaseDistance");

		private static readonly FieldInfo GrabAlwaysIgnoreCollisionField = AccessTools.Field(typeof(PawnGrabInteractions), "alwaysIgnoreCollision");

		internal static bool IsInRound => (Object)(object)GameManager.Instance != (Object)null;

		internal static int CurrentGold
		{
			get
			{
				GameManager instance = GameManager.Instance;
				if (instance == null)
				{
					return 0;
				}
				return instance.Gold;
			}
		}

		internal static int CurrentScore
		{
			get
			{
				GameManager instance = GameManager.Instance;
				if (instance == null)
				{
					return 0;
				}
				return instance.TotalScore;
			}
		}

		internal static int QuotaGoal
		{
			get
			{
				GameManager instance = GameManager.Instance;
				if (instance == null)
				{
					return 0;
				}
				return instance.CurrentQuotaScoreGoal;
			}
		}

		internal static float AlertMeter
		{
			get
			{
				GameManager instance = GameManager.Instance;
				if (instance == null)
				{
					return 0f;
				}
				return instance.AlertLevelMeter;
			}
		}

		internal static AlertLevel AlertLevel
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				GameManager instance = GameManager.Instance;
				if (instance == null)
				{
					return (AlertLevel)0;
				}
				return instance.CurrentAlertLevel;
			}
		}

		internal static Pawn? LocalPawn => Pawn.LocalInstance;

		internal static bool IsGodModeEnabled
		{
			get
			{
				if ((Object)(object)LocalPawn != (Object)null)
				{
					return GodModePawns.Contains(((NetworkBehaviour)LocalPawn).netId);
				}
				return false;
			}
		}

		internal static bool IsNoCooldownEnabled
		{
			get
			{
				if ((Object)(object)LocalPawn != (Object)null)
				{
					return NoCooldownPawns.Contains(((NetworkBehaviour)LocalPawn).netId);
				}
				return false;
			}
		}

		internal static bool IsInfiniteStaminaEnabled => _infiniteStaminaEnabled;

		internal static bool IsNoclipEnabled => _noclipEnabled;

		internal static bool IsInfiniteJumpsEnabled => _infiniteJumpsEnabled;

		internal static bool IsSuperSpeedEnabled => _superSpeedEnabled;

		internal static bool IsSuperStrengthEnabled => _superStrengthEnabled;

		internal static IReadOnlyList<PlayerInfo> GetPlayers()
		{
			List<PlayerInfo> list = new List<PlayerInfo>();
			GameManager instance = GameManager.Instance;
			if ((Object)(object)instance == (Object)null)
			{
				return list;
			}
			foreach (Pawn value in instance.playersByPlayerId.Values)
			{
				if (!((Object)(object)value == (Object)null) && !value.IsAI)
				{
					list.Add(new PlayerInfo(value));
				}
			}
			list.Sort((PlayerInfo a, PlayerInfo b) => string.CompareOrdinal(a.Name, b.Name));
			return list;
		}

		internal static bool TryRevive(Pawn pawn)
		{
			if ((Object)(object)pawn == (Object)null)
			{
				return false;
			}
			if (NetworkServer.active)
			{
				PawnHurtbox hurtbox = pawn.Hurtbox;
				if (hurtbox != null)
				{
					hurtbox.SvDoRevive();
				}
				return true;
			}
			ReviveSpell val = Object.FindObjectOfType<ReviveSpell>();
			if ((Object)(object)val == (Object)null)
			{
				return false;
			}
			CmdReviveTarget.Invoke(val, new object[1] { ((NetworkBehaviour)pawn).netId });
			return true;
		}

		internal static void TryReviveAll()
		{
			if (NetworkServer.active && (Object)(object)GameManager.Instance != (Object)null)
			{
				GameManager.Instance.ResetAllPlayers();
				return;
			}
			foreach (PlayerInfo player in GetPlayers())
			{
				if (player.IsDead)
				{
					TryRevive(player.Pawn);
				}
			}
		}

		internal static void TryHeal(Pawn pawn)
		{
			if (!((Object)(object)pawn == (Object)null))
			{
				if (NetworkServer.active)
				{
					ApplyHealOnServer(((NetworkBehaviour)pawn).netId);
				}
				else
				{
					AdminNetworkCommands.SendHealPawn(((NetworkBehaviour)pawn).netId);
				}
			}
		}

		internal static void TryKill(Pawn pawn)
		{
			if (!((Object)(object)pawn == (Object)null))
			{
				TryKillEntity(((NetworkBehaviour)pawn).netId);
			}
		}

		internal static void TryKillEntity(uint netId)
		{
			if (netId != 0)
			{
				if (NetworkServer.active)
				{
					ApplyKillEntityOnServer(netId);
				}
				else
				{
					AdminNetworkCommands.SendKillEntity(netId);
				}
			}
		}

		internal static void TryKillAll()
		{
			if (NetworkServer.active)
			{
				ApplyKillAllOnServer();
			}
			else
			{
				AdminNetworkCommands.SendKillAllPlayers();
			}
		}

		internal static void TryTeleportToMe(Pawn pawn)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			Pawn localPawn = LocalPawn;
			if (!((Object)(object)pawn == (Object)null) && !((Object)(object)localPawn == (Object)null))
			{
				Vector3 position = ((Component)localPawn).transform.position + ((Component)localPawn).transform.right * 1.5f + Vector3.up * 0.25f;
				TryTeleport(pawn, position);
			}
		}

		internal static void TryTeleportRandom(Pawn pawn)
		{
			if (!((Object)(object)pawn == (Object)null) && !((Object)(object)GameManager.Instance == (Object)null))
			{
				GameManager.Instance.CmdTeleportPlayerToRandomSpawnPoint(pawn);
			}
		}

		internal static void TryTeleport(Pawn pawn, Vector3 position)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)pawn == (Object)null))
			{
				if (NetworkServer.active)
				{
					ApplyTeleportOnServer(((NetworkBehaviour)pawn).netId, position);
				}
				else
				{
					AdminNetworkCommands.SendTeleportPawn(((NetworkBehaviour)pawn).netId, position);
				}
			}
		}

		internal static void TryModifyGold(int delta)
		{
			if (delta != 0 && !((Object)(object)GameManager.Instance == (Object)null))
			{
				if (NetworkServer.active)
				{
					GameManager.Instance.ModifyGold(delta);
				}
				else
				{
					AdminNetworkCommands.SendModifyGold(delta);
				}
			}
		}

		internal static void TrySetGodMode(Pawn pawn, bool enabled)
		{
			if (!((Object)(object)pawn == (Object)null))
			{
				if (enabled)
				{
					GodModePawns.Add(((NetworkBehaviour)pawn).netId);
				}
				else
				{
					GodModePawns.Remove(((NetworkBehaviour)pawn).netId);
				}
				if (NetworkServer.active)
				{
					ApplyGodModeOnServer(((NetworkBehaviour)pawn).netId, enabled);
				}
				else
				{
					AdminNetworkCommands.SendSetGodMode(((NetworkBehaviour)pawn).netId, enabled);
				}
			}
		}

		internal static void TrySetNoCooldown(Pawn pawn, bool enabled)
		{
			if (!((Object)(object)pawn == (Object)null))
			{
				if (enabled)
				{
					NoCooldownPawns.Add(((NetworkBehaviour)pawn).netId);
				}
				else
				{
					NoCooldownPawns.Remove(((NetworkBehaviour)pawn).netId);
				}
				if (NetworkServer.active)
				{
					ApplyNoCooldownOnServer(((NetworkBehaviour)pawn).netId, enabled);
				}
				else
				{
					AdminNetworkCommands.SendSetNoCooldown(((NetworkBehaviour)pawn).netId, enabled);
				}
			}
		}

		internal static void TrySetInfiniteStamina(bool enabled)
		{
			_infiniteStaminaEnabled = enabled;
			Pawn localPawn = LocalPawn;
			if ((Object)(object)localPawn == (Object)null)
			{
				return;
			}
			PawnControllerStateMachine controllerStateMachine = localPawn.ControllerStateMachine;
			if (controllerStateMachine == null)
			{
				return;
			}
			ControllerStateMoveJump moveJumpState = controllerStateMachine.MoveJumpState;
			if (moveJumpState != null)
			{
				ControllerStaminaComponent staminaComponent = moveJumpState.StaminaComponent;
				if (staminaComponent != null)
				{
					staminaComponent.SetInfiniteStamina(enabled);
				}
			}
		}

		internal static void TrySetNoclip(bool enabled)
		{
			_noclipEnabled = enabled;
			Pawn localPawn = LocalPawn;
			if (!((Object)(object)localPawn == (Object)null))
			{
				ApplyNoclip(localPawn, enabled);
			}
		}

		internal static void TrySetInfiniteJumps(bool enabled)
		{
			_infiniteJumpsEnabled = enabled;
			Pawn localPawn = LocalPawn;
			if (!((Object)(object)localPawn == (Object)null))
			{
				ApplyInfiniteJumps(localPawn, enabled);
			}
		}

		internal static void TrySetSuperSpeed(bool enabled)
		{
			_superSpeedEnabled = enabled;
			Pawn localPawn = LocalPawn;
			if (!((Object)(object)localPawn == (Object)null))
			{
				ApplySuperSpeed(localPawn, enabled);
			}
		}

		internal static void TrySetSuperStrength(bool enabled)
		{
			Pawn localPawn = LocalPawn;
			if (!enabled && (Object)(object)localPawn != (Object)null)
			{
				ApplySuperStrength(localPawn, enabled: false);
			}
			_superStrengthEnabled = enabled;
			if (!((Object)(object)localPawn == (Object)null))
			{
				ApplySuperStrength(localPawn, enabled);
			}
		}

		internal static void RefreshLocalCheats()
		{
			Pawn localPawn = LocalPawn;
			if ((Object)(object)localPawn == (Object)null)
			{
				return;
			}
			if (_infiniteStaminaEnabled)
			{
				PawnControllerStateMachine controllerStateMachine = localPawn.ControllerStateMachine;
				if (controllerStateMachine != null)
				{
					ControllerStateMoveJump moveJumpState = controllerStateMachine.MoveJumpState;
					if (moveJumpState != null)
					{
						ControllerStaminaComponent staminaComponent = moveJumpState.StaminaComponent;
						if (staminaComponent != null)
						{
							staminaComponent.SetInfiniteStamina(true);
						}
					}
				}
			}
			if (_infiniteJumpsEnabled)
			{
				ApplyInfiniteJumps(localPawn, enabled: true);
			}
			if (_noclipEnabled)
			{
				ApplyNoclip(localPawn, enabled: true);
			}
			if (_superSpeedEnabled)
			{
				ApplySuperSpeed(localPawn, enabled: true);
			}
			if (_superStrengthEnabled)
			{
				ApplySuperStrength(localPawn, enabled: true);
			}
		}

		internal static void TryRefillStamina(Pawn pawn)
		{
			if (!((Object)(object)pawn == (Object)null))
			{
				if (NetworkServer.active)
				{
					ApplyRefillStaminaOnServer(((NetworkBehaviour)pawn).netId);
				}
				else
				{
					AdminNetworkCommands.SendRefillStamina(((NetworkBehaviour)pawn).netId);
				}
			}
		}

		internal static void TrySetAlertMeter(float value)
		{
			if (NetworkServer.active)
			{
				ApplyAlertMeterOnServer(value);
			}
			else
			{
				AdminNetworkCommands.SendSetAlertMeter(value);
			}
		}

		internal static void TrySetTotalScore(int score)
		{
			if (NetworkServer.active)
			{
				ApplyTotalScoreOnServer(score);
			}
			else
			{
				AdminNetworkCommands.SendSetTotalScore(score);
			}
		}

		internal static void TryFillQuota()
		{
			GameManager instance = GameManager.Instance;
			if (!((Object)(object)instance == (Object)null))
			{
				TrySetTotalScore(instance.CurrentQuotaScoreGoal);
			}
		}

		internal static bool TrySpawnPrefab(uint assetId, int count)
		{
			return TrySpawnPrefab(assetId, count, null);
		}

		internal static bool TrySpawnMonster(string query, int count = 1)
		{
			if (!PrefabCatalog.TryFindFirst(query, out var entry))
			{
				return false;
			}
			return TrySpawnPrefab(entry.AssetId, count, null);
		}

		internal static bool TrySpawnPrefab(uint assetId, int count, Vector3? positionOverride)
		{
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			GameManager instance = GameManager.Instance;
			Pawn localPawn = LocalPawn;
			if ((Object)(object)instance == (Object)null || (Object)(object)localPawn == (Object)null || count <= 0)
			{
				return false;
			}
			NetworkIdentity val = default(NetworkIdentity);
			if (!instance.TryGetNetworkPrefabFromAssetId(assetId, ref val))
			{
				return false;
			}
			Vector3 val2 = (Vector3)(((??)positionOverride) ?? (((Component)localPawn).transform.position + ((Component)localPawn).transform.forward * 3f + Vector3.up * 0.5f));
			Quaternion val3 = Quaternion.LookRotation(((Component)localPawn).transform.forward, Vector3.up);
			for (int i = 0; i < count; i++)
			{
				Vector3 val4 = Vector3.right * (float)(i % 3 - 1) * 1f + Vector3.forward * (float)(i / 3) * 1f;
				instance.CmdRequestSpawnNetworkPrefab(assetId, val2 + val4, val3);
			}
			return true;
		}

		internal static void ApplyHealOnServer(uint netId)
		{
			if (TryGetPawn(netId, out Pawn pawn) && !((Object)(object)((pawn != null) ? pawn.Hurtbox : null) == (Object)null))
			{
				pawn.Hurtbox.SvSetHealth(pawn.Hurtbox.MaxHealth);
			}
		}

		internal static void ApplyKillOnServer(uint netId)
		{
			ApplyKillEntityOnServer(netId);
		}

		internal static void ApplyKillEntityOnServer(uint netId)
		{
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkServer.active && NetworkServer.spawned.TryGetValue(netId, out var value))
			{
				NpcBehaviour val = default(NpcBehaviour);
				Pawn val2 = default(Pawn);
				NetworkPhysicsPropDestroy val3 = default(NetworkPhysicsPropDestroy);
				if (((Component)value).TryGetComponent<NpcBehaviour>(ref val) && !val.IsKilled)
				{
					val.SvKill(true, (NetworkIdentity)null);
				}
				else if (((Component)value).TryGetComponent<Pawn>(ref val2) && (Object)(object)val2.Hurtbox != (Object)null && !val2.IsDead)
				{
					val2.Hurtbox.SvDoKill();
				}
				else if (((Component)value).TryGetComponent<NetworkPhysicsPropDestroy>(ref val3))
				{
					val3.SvDoDestroy(default(Vector3), true, (NetworkIdentity)null);
				}
				else if ((Object)(object)GameManager.Instance != (Object)null)
				{
					NetworkServer.Destroy(((Component)value).gameObject);
				}
			}
		}

		internal static void ApplyKillAllOnServer()
		{
			if (!NetworkServer.active || (Object)(object)GameManager.Instance == (Object)null)
			{
				return;
			}
			foreach (Pawn value in GameManager.Instance.playersByPlayerId.Values)
			{
				if (!((Object)(object)value == (Object)null) && !value.IsAI && !value.IsDead)
				{
					PawnHurtbox hurtbox = value.Hurtbox;
					if (hurtbox != null)
					{
						hurtbox.SvDoKill();
					}
				}
			}
		}

		internal static void ApplyTeleportOnServer(uint netId, Vector3 position)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			if (TryGetPawn(netId, out Pawn pawn))
			{
				pawn.SvTeleport(position, true, false);
			}
		}

		internal static void ApplyGodModeOnServer(uint netId, bool enabled)
		{
			if (!TryGetPawn(netId, out Pawn pawn) || (Object)(object)((pawn != null) ? pawn.Hurtbox : null) == (Object)null)
			{
				return;
			}
			PawnHurtbox hurtbox = pawn.Hurtbox;
			if (enabled)
			{
				hurtbox.SvIncreaseInvulnerableLocks();
				hurtbox.DeathInvulnerableLocks += 1;
				return;
			}
			hurtbox.SvDecreaseInvulnerableLocks();
			if (hurtbox.DeathInvulnerableLocks > 0)
			{
				hurtbox.DeathInvulnerableLocks -= 1;
			}
		}

		internal static void ApplyNoCooldownOnServer(uint netId, bool enabled)
		{
			if (TryGetPawn(netId, out Pawn pawn))
			{
				pawn.NoCooldown = enabled;
			}
		}

		internal static void ApplyRefillStaminaOnServer(uint netId)
		{
			if (TryGetPawn(netId, out Pawn pawn) && !((Object)(object)((pawn != null) ? pawn.Blackboard : null) == (Object)null))
			{
				pawn.Blackboard.Stamina = pawn.Blackboard.MaxStamina;
			}
		}

		internal static void ApplyAlertMeterOnServer(float value)
		{
			if (NetworkServer.active && !((Object)(object)GameManager.Instance == (Object)null))
			{
				GameManager.Instance.NetworkalertMeter = Mathf.Clamp(value, 0f, 3f);
			}
		}

		internal static void ApplyTotalScoreOnServer(int score)
		{
			GameManager instance = GameManager.Instance;
			if (instance != null)
			{
				instance.SetTotalScore(score);
			}
		}

		private static bool TryGetPawn(uint netId, out Pawn? pawn)
		{
			pawn = null;
			if (!NetworkServer.active || !NetworkServer.spawned.TryGetValue(netId, out var value))
			{
				return false;
			}
			pawn = ((Component)value).GetComponent<Pawn>();
			return (Object)(object)pawn != (Object)null;
		}

		private static void ApplyNoclip(Pawn pawn, bool enabled)
		{
			if (!pawn.HasAuthority)
			{
				return;
			}
			PawnControllerStateMachine controllerStateMachine = pawn.ControllerStateMachine;
			if ((Object)(object)controllerStateMachine == (Object)null)
			{
				return;
			}
			if (enabled)
			{
				((NetworkStateMachine<ControllerState>)(object)controllerStateMachine).EnqueueTransition<ControllerStateFlying>();
				if (_superSpeedEnabled)
				{
					ApplyFlySpeedBoost(pawn, enabled: true);
				}
			}
			else if (((NetworkStateMachine<ControllerState>)(object)controllerStateMachine).CurrentState is ControllerStateFlying)
			{
				controllerStateMachine.ForceTransitionDefaultState();
			}
		}

		private static void ApplyInfiniteJumps(Pawn pawn, bool enabled)
		{
			PawnControllerStateMachine controllerStateMachine = pawn.ControllerStateMachine;
			ControllerJumpComponent val = ((controllerStateMachine != null) ? controllerStateMachine.JumpComponent : null);
			if (val != null)
			{
				val.AdditiveMaxInAirJumpCount = (enabled ? 999 : pawn.EffectiveAdditiveExtraAirJumps);
			}
		}

		private static void ApplySuperSpeed(Pawn pawn, bool enabled)
		{
			PawnControllerStateMachine controllerStateMachine = pawn.ControllerStateMachine;
			object obj;
			if (controllerStateMachine == null)
			{
				obj = null;
			}
			else
			{
				ControllerStateMoveJump moveJumpState = controllerStateMachine.MoveJumpState;
				obj = ((moveJumpState != null) ? moveJumpState.MovementComponent : null);
			}
			ControllerMovementComponent val = (ControllerMovementComponent)obj;
			if (val != null)
			{
				val.AdditiveWalkSpeed = (enabled ? 30f : 0f);
				val.AdditiveSprintSpeed = (enabled ? 45f : 0f);
			}
			ApplyFlySpeedBoost(pawn, enabled);
		}

		private static void ApplyFlySpeedBoost(Pawn pawn, bool enabled)
		{
			ControllerState obj = ((NetworkStateMachine<ControllerState>)(object)pawn.ControllerStateMachine)?.CurrentState;
			ControllerStateFlying val = (ControllerStateFlying)(object)((obj is ControllerStateFlying) ? obj : null);
			if (val != null)
			{
				object value = FlySettingsField.GetValue(val);
				if (value != null)
				{
					float num = (enabled ? 55f : 10f);
					float num2 = (enabled ? 110f : 20f);
					FlyMoveSpeedField.SetValue(value, num);
					FlySprintSpeedField.SetValue(value, num2);
					FlyCurrentSpeedField.SetValue(val, num);
				}
			}
		}

		private static void ApplySuperStrength(Pawn pawn, bool enabled)
		{
			PawnGrabInteractions grabInteractions = pawn.GrabInteractions;
			if ((Object)(object)grabInteractions == (Object)null)
			{
				return;
			}
			if (enabled)
			{
				if (_appliedStrengthBonus == 0f)
				{
					grabInteractions.ModifyForce(15000f);
					_appliedStrengthBonus = 15000f;
				}
				SetGrabPowerFields(grabInteractions, super: true);
				GrabAlwaysIgnoreCollisionField.SetValue(grabInteractions, true);
			}
			else
			{
				if (_appliedStrengthBonus != 0f)
				{
					grabInteractions.ModifyForce(0f - _appliedStrengthBonus);
					_appliedStrengthBonus = 0f;
				}
				SetGrabPowerFields(grabInteractions, super: false);
				GrabAlwaysIgnoreCollisionField.SetValue(grabInteractions, false);
			}
		}

		private static void SetGrabPowerFields(PawnGrabInteractions grab, bool super)
		{
			GrabMaxDragVelocityField.SetValue(grab, super ? 80f : 10f);
			GrabMaxConstraintForceField.SetValue(grab, super ? 80000f : 2000f);
			GrabConstraintSpringForceField.SetValue(grab, super ? 12000f : 1000f);
			GrabPlayerConstraintMaxDistanceField.SetValue(grab, super ? 8f : 3f);
			GrabReleaseDistanceField.SetValue(grab, super ? 14f : 6f);
		}
	}
	internal sealed class EspRenderer : MonoBehaviour
	{
		private static Material? _lineMaterial;

		private readonly List<EspTarget> _visibleTargets = new List<EspTarget>();

		private GUIStyle? _labelStyle;

		private void OnEnable()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			Camera.onPostRender = (CameraCallback)Delegate.Combine((Delegate?)(object)Camera.onPostRender, (Delegate?)new CameraCallback(DrawEspGeometry));
		}

		private void OnDisable()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			Camera.onPostRender = (CameraCallback)Delegate.Remove((Delegate?)(object)Camera.onPostRender, (Delegate?)new CameraCallback(DrawEspGeometry));
		}

		private void OnGUI()
		{
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Expected O, but got Unknown
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			if (!EspSettings.Enabled || !EspSettings.ShowLabels)
			{
				return;
			}
			Camera camera = GetCamera();
			if ((Object)(object)camera == (Object)null)
			{
				return;
			}
			EnsureLabelStyle();
			_visibleTargets.Clear();
			CollectVisibleTargets(_visibleTargets);
			foreach (EspTarget visibleTarget in _visibleTargets)
			{
				Vector3 val = camera.WorldToScreenPoint(visibleTarget.Position);
				if (!(val.z <= 0f))
				{
					float num = Vector3.Distance(EspScanner.GetLocalOrigin(), visibleTarget.Position);
					Color color = GetColor(visibleTarget.Type);
					string arg = visibleTarget.Type switch
					{
						EspEntityType.Player => "[P]", 
						EspEntityType.Mob => "[M]", 
						_ => "[I]", 
					};
					_labelStyle.normal.textColor = color;
					string text = $"{arg} {visibleTarget.Label} ({num:0}m)";
					Vector2 val2 = _labelStyle.CalcSize(new GUIContent(text));
					float num2 = val.x - val2.x * 0.5f;
					float num3 = (float)Screen.height - val.y - val2.y;
					GUI.Label(new Rect(num2, num3, val2.x + 4f, val2.y + 2f), text, _labelStyle);
				}
			}
		}

		private void DrawEspGeometry(Camera camera)
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			if (!EspSettings.Enabled)
			{
				return;
			}
			Camera camera2 = GetCamera();
			if ((Object)(object)camera2 == (Object)null || (Object)(object)camera != (Object)(object)camera2)
			{
				return;
			}
			EnsureLineMaterial();
			_visibleTargets.Clear();
			CollectVisibleTargets(_visibleTargets);
			if (_visibleTargets.Count == 0)
			{
				return;
			}
			Vector3 localOrigin = EspScanner.GetLocalOrigin();
			GL.PushMatrix();
			GL.LoadProjectionMatrix(camera.projectionMatrix);
			GL.MultMatrix(camera.worldToCameraMatrix);
			_lineMaterial.SetPass(0);
			if (EspSettings.ShowTracers)
			{
				GL.Begin(1);
				foreach (EspTarget visibleTarget in _visibleTargets)
				{
					GL.Color(GetColor(visibleTarget.Type));
					GL.Vertex(localOrigin);
					GL.Vertex(visibleTarget.Position);
				}
				GL.End();
			}
			if (EspSettings.ShowBoxes)
			{
				GL.Begin(1);
				foreach (EspTarget visibleTarget2 in _visibleTargets)
				{
					DrawBounds(visibleTarget2.Bounds, GetColor(visibleTarget2.Type));
				}
				GL.End();
			}
			GL.PopMatrix();
		}

		private static void CollectVisibleTargets(List<EspTarget> output)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			Vector3 localOrigin = EspScanner.GetLocalOrigin();
			float maxDistance = EspSettings.MaxDistance;
			foreach (EspTarget target in EspScanner.GetTargets())
			{
				if ((target.Type != EspEntityType.Player || EspSettings.ShowPlayers) && (target.Type != EspEntityType.Mob || EspSettings.ShowMobs) && (target.Type != EspEntityType.Prop || EspSettings.ShowProps) && !(Vector3.Distance(localOrigin, target.Position) > maxDistance))
				{
					output.Add(target);
				}
			}
		}

		private static void DrawBounds(Bounds bounds, Color color)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			Vector3 min = ((Bounds)(ref bounds)).min;
			Vector3 max = ((Bounds)(ref bounds)).max;
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(min.x, min.y, min.z);
			Vector3 val2 = default(Vector3);
			((Vector3)(ref val2))..ctor(min.x, min.y, max.z);
			Vector3 val3 = default(Vector3);
			((Vector3)(ref val3))..ctor(min.x, max.y, min.z);
			Vector3 val4 = default(Vector3);
			((Vector3)(ref val4))..ctor(min.x, max.y, max.z);
			Vector3 val5 = default(Vector3);
			((Vector3)(ref val5))..ctor(max.x, min.y, min.z);
			Vector3 val6 = default(Vector3);
			((Vector3)(ref val6))..ctor(max.x, min.y, max.z);
			Vector3 val7 = default(Vector3);
			((Vector3)(ref val7))..ctor(max.x, max.y, min.z);
			Vector3 val8 = default(Vector3);
			((Vector3)(ref val8))..ctor(max.x, max.y, max.z);
			GL.Color(color);
			DrawEdge(val, val5);
			DrawEdge(val5, val6);
			DrawEdge(val6, val2);
			DrawEdge(val2, val);
			DrawEdge(val3, val7);
			DrawEdge(val7, val8);
			DrawEdge(val8, val4);
			DrawEdge(val4, val3);
			DrawEdge(val, val3);
			DrawEdge(val5, val7);
			DrawEdge(val6, val8);
			DrawEdge(val2, val4);
		}

		private static void DrawEdge(Vector3 a, Vector3 b)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			GL.Vertex(a);
			GL.Vertex(b);
		}

		private static Color GetColor(EspEntityType type)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			return (Color)(type switch
			{
				EspEntityType.Player => EspSettings.PlayerColor, 
				EspEntityType.Mob => EspSettings.MobColor, 
				_ => EspSettings.PropColor, 
			});
		}

		private static Camera? GetCamera()
		{
			CameraManager instance = CameraManager.Instance;
			if ((Object)(object)((instance != null) ? instance.MainCamera : null) != (Object)null)
			{
				return CameraManager.Instance.MainCamera;
			}
			return Camera.main;
		}

		private void EnsureLabelStyle()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Expected O, but got Unknown
			if (_labelStyle == null)
			{
				_labelStyle = new GUIStyle(GUI.skin.label)
				{
					fontSize = 12,
					fontStyle = (FontStyle)1,
					alignment = (TextAnchor)0
				};
			}
		}

		private static void EnsureLineMaterial()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			if (!((Object)(object)_lineMaterial != (Object)null))
			{
				_lineMaterial = new Material(Shader.Find("Hidden/Internal-Colored"))
				{
					hideFlags = (HideFlags)61
				};
				_lineMaterial.SetInt("_SrcBlend", 5);
				_lineMaterial.SetInt("_DstBlend", 10);
				_lineMaterial.SetInt("_Cull", 0);
				_lineMaterial.SetInt("_ZWrite", 0);
				_lineMaterial.SetInt("_ZTest", 8);
			}
		}
	}
	internal enum EspEntityType
	{
		Player,
		Mob,
		Prop
	}
	internal readonly struct EspTarget
	{
		internal uint NetId { get; }

		internal string Label { get; }

		internal Vector3 Position { get; }

		internal Bounds Bounds { get; }

		internal EspEntityType Type { get; }

		internal bool IsDead { get; }

		internal bool CanKill
		{
			get
			{
				if (Type == EspEntityType.Player)
				{
					return !IsDead;
				}
				return true;
			}
		}

		internal EspTarget(uint netId, string label, Vector3 position, Bounds bounds, EspEntityType type, bool isDead)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			NetId = netId;
			Label = label;
			Position = position;
			Bounds = bounds;
			Type = type;
			IsDead = isDead;
		}
	}
	internal static class EspScanner
	{
		private static readonly List<EspTarget> Cached = new List<EspTarget>();

		private static float _nextRefreshTime;

		internal static IReadOnlyList<EspTarget> GetTargets(bool forceRefresh = false)
		{
			if (forceRefresh || Time.unscaledTime >= _nextRefreshTime)
			{
				Refresh();
				_nextRefreshTime = Time.unscaledTime + 0.25f;
			}
			return Cached;
		}

		internal static IReadOnlyList<EspTarget> GetKillableEntities()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			GetTargets();
			List<EspTarget> list = new List<EspTarget>();
			Vector3 origin = GetLocalOrigin();
			foreach (EspTarget item in Cached)
			{
				if (item.Type != EspEntityType.Player && !(Vector3.Distance(origin, item.Position) > EspSettings.MaxDistance))
				{
					list.Add(item);
				}
			}
			list.Sort((EspTarget a, EspTarget b) => Vector3.Distance(origin, a.Position).CompareTo(Vector3.Distance(origin, b.Position)));
			return list;
		}

		internal static void Refresh()
		{
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			Cached.Clear();
			if (!AdminService.IsInRound)
			{
				return;
			}
			HashSet<uint> hashSet = new HashSet<uint>();
			Pawn[] array = Object.FindObjectsOfType<Pawn>();
			NetworkIdentity val2 = default(NetworkIdentity);
			foreach (Pawn val in array)
			{
				if (!((Object)(object)val == (Object)null) && ((Component)val).TryGetComponent<NetworkIdentity>(ref val2) && hashSet.Add(val2.netId))
				{
					EspEntityType espEntityType = (val.IsAI ? EspEntityType.Mob : EspEntityType.Player);
					string text;
					if (espEntityType != EspEntityType.Player)
					{
						string name = ((Object)((Component)val).gameObject).name;
						PawnHurtbox hurtbox = val.Hurtbox;
						text = $"{name} [{((hurtbox != null) ? hurtbox.Health : 0)}hp]";
					}
					else
					{
						string playerName = val.PlayerName;
						PawnHurtbox hurtbox2 = val.Hurtbox;
						text = $"{playerName} [{((hurtbox2 != null) ? hurtbox2.Health : 0)}hp]";
					}
					string label = text;
					Cached.Add(new EspTarget(val2.netId, label, GetEntityPosition(((Component)val).transform), GetEntityBounds(((Component)val).gameObject), espEntityType, val.IsDead));
				}
			}
			NpcBehaviour[] array2 = Object.FindObjectsOfType<NpcBehaviour>();
			NetworkIdentity val4 = default(NetworkIdentity);
			foreach (NpcBehaviour val3 in array2)
			{
				if (!((Object)(object)val3 == (Object)null) && !val3.IsKilled && ((Component)val3).TryGetComponent<NetworkIdentity>(ref val4) && hashSet.Add(val4.netId))
				{
					Cached.Add(new EspTarget(val4.netId, ((Object)((Component)val3).gameObject).name, GetEntityPosition(((Component)val3).transform), GetEntityBounds(((Component)val3).gameObject), EspEntityType.Mob, isDead: false));
				}
			}
			NetworkPhysicsPropDestroy[] array3 = Object.FindObjectsOfType<NetworkPhysicsPropDestroy>();
			NetworkIdentity val6 = default(NetworkIdentity);
			foreach (NetworkPhysicsPropDestroy val5 in array3)
			{
				if (!((Object)(object)val5 == (Object)null) && ((Component)val5).TryGetComponent<NetworkIdentity>(ref val6) && hashSet.Add(val6.netId))
				{
					Cached.Add(new EspTarget(val6.netId, ((Object)((Component)val5).gameObject).name, GetEntityPosition(((Component)val5).transform), GetEntityBounds(((Component)val5).gameObject), EspEntityType.Prop, isDead: false));
				}
			}
		}

		internal static Vector3 GetLocalOrigin()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			Pawn localInstance = Pawn.LocalInstance;
			if ((Object)(object)localInstance != (Object)null)
			{
				return ((Component)localInstance).transform.position + Vector3.up * 1.6f;
			}
			CameraManager instance = CameraManager.Instance;
			if ((Object)(object)((instance != null) ? instance.MainCamera : null) != (Object)null)
			{
				return ((Component)CameraManager.Instance.MainCamera).transform.position;
			}
			if (!((Object)(object)Camera.main != (Object)null))
			{
				return Vector3.zero;
			}
			return ((Component)Camera.main).transform.position;
		}

		private static Vector3 GetEntityPosition(Transform transform)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			return transform.position + Vector3.up * 1.2f;
		}

		private static Bounds GetEntityBounds(GameObject gameObject)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			Renderer[] componentsInChildren = gameObject.GetComponentsInChildren<Renderer>();
			if (componentsInChildren.Length == 0)
			{
				return new Bounds(gameObject.transform.position, Vector3.one * 1.5f);
			}
			Bounds bounds = componentsInChildren[0].bounds;
			for (int i = 1; i < componentsInChildren.Length; i++)
			{
				((Bounds)(ref bounds)).Encapsulate(componentsInChildren[i].bounds);
			}
			return bounds;
		}
	}
	internal static class EspSettings
	{
		internal static readonly Color PlayerColor = new Color(0.35f, 0.75f, 1f, 0.95f);

		internal static readonly Color MobColor = new Color(1f, 0.35f, 0.35f, 0.95f);

		internal static readonly Color PropColor = new Color(0.95f, 0.85f, 0.25f, 0.95f);

		internal static bool Enabled
		{
			get
			{
				if (Plugin.Instance.EspEnabled.Value)
				{
					return AdminService.IsInRound;
				}
				return false;
			}
		}

		internal static bool ShowPlayers => Plugin.Instance.EspShowPlayers.Value;

		internal static bool ShowMobs => Plugin.Instance.EspShowMobs.Value;

		internal static bool ShowProps => Plugin.Instance.EspShowProps.Value;

		internal static bool ShowTracers => Plugin.Instance.EspShowTracers.Value;

		internal static bool ShowLabels => Plugin.Instance.EspShowLabels.Value;

		internal static bool ShowBoxes => Plugin.Instance.EspShowBoxes.Value;

		internal static float MaxDistance => Plugin.Instance.EspMaxDistance.Value;
	}
	internal static class MirrorHash
	{
		internal static int GetStableHashCode(string text)
		{
			int num = 23;
			foreach (char c in text)
			{
				num = num * 31 + c;
			}
			return num;
		}
	}
	[BepInPlugin("nulled.yapadmin", "YapAdmin", "1.3.2")]
	public sealed class Plugin : BaseUnityPlugin
	{
		public const string PluginGuid = "nulled.yapadmin";

		public const string PluginName = "YapAdmin";

		public const string PluginVersion = "1.3.2";

		private GameObject? _controllerObject;

		internal static ManualLogSource Log { get; private set; }

		internal static Plugin Instance { get; private set; }

		internal ConfigEntry<bool> Enabled { get; private set; }

		internal ConfigEntry<KeyCode> MenuKey { get; private set; }

		internal ConfigEntry<bool> EspEnabled { get; private set; }

		internal ConfigEntry<bool> EspShowPlayers { get; private set; }

		internal ConfigEntry<bool> EspShowMobs { get; private set; }

		internal ConfigEntry<bool> EspShowProps { get; private set; }

		internal ConfigEntry<bool> EspShowTracers { get; private set; }

		internal ConfigEntry<bool> EspShowLabels { get; private set; }

		internal ConfigEntry<bool> EspShowBoxes { get; private set; }

		internal ConfigEntry<float> EspMaxDistance { get; private set; }

		private void Awake()
		{
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Expected O, but got Unknown
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			Instance = this;
			Log = ((BaseUnityPlugin)this).Logger;
			Enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", true, "Enable the YapAdmin panel.");
			MenuKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "MenuKey", (KeyCode)292, "Open the YapAdmin panel.");
			EspEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Overlay", "Enabled", true, "Enable ESP overlay in round.");
			EspShowPlayers = ((BaseUnityPlugin)this).Config.Bind<bool>("Overlay", "ShowPlayers", true, "Draw overlay for players.");
			EspShowMobs = ((BaseUnityPlugin)this).Config.Bind<bool>("Overlay", "ShowMobs", true, "Draw overlay for mobs.");
			EspShowProps = ((BaseUnityPlugin)this).Config.Bind<bool>("Overlay", "ShowProps", true, "Draw overlay for movable props.");
			EspShowTracers = ((BaseUnityPlugin)this).Config.Bind<bool>("Overlay", "ShowTracers", true, "Draw tracer lines to entities.");
			EspShowLabels = ((BaseUnityPlugin)this).Config.Bind<bool>("Overlay", "ShowLabels", true, "Draw name labels.");
			EspShowBoxes = ((BaseUnityPlugin)this).Config.Bind<bool>("Overlay", "ShowBoxes", true, "Draw bounding boxes.");
			EspMaxDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Overlay", "MaxDistance", 120f, "Max ESP draw distance in meters (10-1000).");
			AdminNetworkCommands.Register();
			_controllerObject = new GameObject("YapAdminController");
			Object.DontDestroyOnLoad((Object)(object)_controllerObject);
			((Object)_controllerObject).hideFlags = (HideFlags)61;
			_controllerObject.AddComponent<AdminMenuUI>();
			_controllerObject.AddComponent<EspRenderer>();
			Log.LogInfo((object)string.Format("{0} {1} loaded. Menu: {2}", "YapAdmin", "1.3.2", MenuKey.Value));
		}

		private void OnDestroy()
		{
			if ((Object)(object)_controllerObject != (Object)null)
			{
				Object.Destroy((Object)(object)_controllerObject);
			}
		}
	}
	internal enum PrefabCategory
	{
		All,
		Monsters,
		Items
	}
	internal readonly struct PrefabEntry
	{
		internal uint AssetId { get; }

		internal string Name { get; }

		internal PrefabCategory Category { get; }

		internal PrefabEntry(uint assetId, string name, PrefabCategory category)
		{
			AssetId = assetId;
			Name = name;
			Category = category;
		}
	}
	internal static class PrefabCatalog
	{
		private static readonly List<PrefabEntry> Cached = new List<PrefabEntry>();

		private static float _lastRefreshTime = -999f;

		private static readonly string[] MonsterKeywords = new string[23]
		{
			"Goblin", "Ghost", "Spider", "Slime", "Gargoyle", "Fairy", "Eye", "Knight", "Jester", "Angel",
			"Enemy", "Npc", "Merchant", "Catacomb", "UsEnemy", "Goatman", "Mimic", "Boss", "Monster", "AI",
			"Husk", "Wraith", "Demon"
		};

		private static readonly string[] ItemKeywords = new string[16]
		{
			"Gold", "Wand", "Prop", "Item", "Valuable", "Loot", "Chest", "Potion", "Scroll", "Book",
			"Key", "Coin", "Gem", "Pickup", "Interactable", "Shop"
		};

		internal static readonly string[] QuickMonsterQueries = new string[8] { "Goblin", "Ghost", "Spider", "Slime", "Gargoyle", "Eye", "Knight", "Jester" };

		internal static IReadOnlyList<PrefabEntry> GetAll(bool forceRefresh = false)
		{
			if (forceRefresh || Cached.Count == 0 || Time.unscaledTime - _lastRefreshTime > 30f)
			{
				Refresh();
			}
			return Cached;
		}

		internal static IReadOnlyList<PrefabEntry> Search(string query, PrefabCategory category = PrefabCategory.All)
		{
			GetAll();
			string text = (string.IsNullOrWhiteSpace(query) ? string.Empty : query.Trim());
			List<PrefabEntry> list = new List<PrefabEntry>();
			foreach (PrefabEntry item in Cached)
			{
				if ((category == PrefabCategory.All || item.Category == category) && (text.Length == 0 || item.Name.IndexOf(text, StringComparison.OrdinalIgnoreCase) >= 0))
				{
					list.Add(item);
				}
			}
			return list;
		}

		internal static bool TryFindFirst(string query, out PrefabEntry entry)
		{
			IReadOnlyList<PrefabEntry> readOnlyList = Search(query, PrefabCategory.Monsters);
			if (readOnlyList.Count > 0)
			{
				entry = readOnlyList[0];
				return true;
			}
			readOnlyList = Search(query);
			if (readOnlyList.Count > 0)
			{
				entry = readOnlyList[0];
				return true;
			}
			entry = default(PrefabEntry);
			return false;
		}

		internal static void Refresh()
		{
			Cached.Clear();
			_lastRefreshTime = Time.unscaledTime;
			YapNetworkManager val = default(YapNetworkManager);
			if (!Service.Get<YapNetworkManager>(ref val))
			{
				return;
			}
			NetworkIdentity val2 = default(NetworkIdentity);
			foreach (GameObject spawnPrefab in ((NetworkManager)val).spawnPrefabs)
			{
				if (!((Object)(object)spawnPrefab == (Object)null) && spawnPrefab.TryGetComponent<NetworkIdentity>(ref val2))
				{
					Cached.Add(new PrefabEntry(val2.assetId, ((Object)spawnPrefab).name, Classify(((Object)spawnPrefab).name)));
				}
			}
			Cached.Sort((PrefabEntry a, PrefabEntry b) => string.CompareOrdinal(a.Name, b.Name));
		}

		private static PrefabCategory Classify(string name)
		{
			if (MatchesAny(name, MonsterKeywords))
			{
				return PrefabCategory.Monsters;
			}
			if (MatchesAny(name, ItemKeywords))
			{
				return PrefabCategory.Items;
			}
			return PrefabCategory.All;
		}

		private static bool MatchesAny(string name, IReadOnlyList<string> keywords)
		{
			foreach (string keyword in keywords)
			{
				if (name.IndexOf(keyword, StringComparison.OrdinalIgnoreCase) >= 0)
				{
					return true;
				}
			}
			return false;
		}
	}
}
namespace YapAdmin.UI
{
	internal sealed class AdminMenuUI : MonoBehaviour
	{
		private enum Tab
		{
			Players,
			Self,
			Economy,
			World,
			Overlay,
			Spawn
		}

		private const float PlayerCardHeight = 96f;

		private Canvas? _canvas;

		private GameObject? _root;

		private RectTransform? _contentArea;

		private TMP_Text? _statusLabel;

		private TMP_Text? _goldLabel;

		private TMP_Text? _worldLabel;

		private GameObject? _playersTab;

		private GameObject? _selfTab;

		private GameObject? _economyTab;

		private GameObject? _worldTab;

		private GameObject? _overlayTab;

		private GameObject? _spawnTab;

		private RectTransform? _playerListContent;

		private RectTransform? _spawnListContent;

		private RectTransform? _entityListContent;

		private TMP_Text? _espDistanceLabel;

		private TMP_InputField? _espDistanceInput;

		private TMP_InputField? _goldInput;

		private TMP_InputField? _spawnSearchInput;

		private Toggle? _godModeToggle;

		private Toggle? _noCooldownToggle;

		private Toggle? _infiniteStaminaToggle;

		private Toggle? _noclipToggle;

		private Toggle? _infiniteJumpsToggle;

		private Toggle? _superSpeedToggle;

		private Toggle? _superStrengthToggle;

		private readonly Dictionary<Tab, Image> _tabButtonImages = new Dictionary<Tab, Image>();

		private readonly Dictionary<Tab, TMP_Text> _tabLabels = new Dictionary<Tab, TMP_Text>();

		private readonly Dictionary<Tab, GameObject> _tabUnderlines = new Dictionary<Tab, GameObject>();

		private Tab _activeTab;

		private string _spawnSearch = string.Empty;

		private PrefabCategory _spawnCategory;

		private float _refreshTimer;

		internal static bool IsOpen { get; private set; }

		private void OnDestroy()
		{
			AdminInputFocus.Release();
		}

		private void Update()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			if (!Plugin.Instance.Enabled.Value)
			{
				return;
			}
			if (Input.GetKeyDown(Plugin.Instance.MenuKey.Value))
			{
				ToggleMenu();
			}
			if (!IsOpen)
			{
				return;
			}
			AdminInputFocus.Maintain();
			if (Input.GetKeyDown((KeyCode)27))
			{
				CloseMenu();
				return;
			}
			_refreshTimer += Time.unscaledDeltaTime;
			if (_refreshTimer >= 0.75f)
			{
				_refreshTimer = 0f;
				RefreshActiveTab();
			}
		}

		private void ToggleMenu()
		{
			if (IsOpen)
			{
				CloseMenu();
			}
			else if (AdminService.IsInRound)
			{
				OpenMenu();
			}
		}

		private void OpenMenu()
		{
			EnsureBuilt();
			_refreshTimer = 0f;
			RefreshActiveTab();
			SetStatus("F11 or Esc to close");
			_root.SetActive(true);
			IsOpen = true;
			AdminInputFocus.Acquire();
		}

		private void CloseMenu()
		{
			AdminInputFocus.Release();
			if ((Object)(object)_root != (Object)null)
			{
				_root.SetActive(false);
			}
			IsOpen = false;
		}

		private void EnsureBuilt()
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Expected O, but got Unknown
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Expected O, but got Unknown
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)_root != (Object)null))
			{
				_canvas = UiFactory.CreateCanvas("YapAdminMenuCanvas", 6100);
				_root = new GameObject("YapAdminMenuRoot");
				_root.transform.SetParent(((Component)_canvas).transform, false);
				RectTransform obj = _root.AddComponent<RectTransform>();
				UiFactory.Stretch(obj, Vector2.zero, Vector2.zero);
				RectTransform obj2 = UiFactory.CreatePanel((Transform)(object)obj, "Backdrop", Vector2.zero, AdminTheme.Backdrop);
				UiFactory.Stretch(obj2, Vector2.zero, Vector2.zero);
				((UnityEvent)((Component)obj2).gameObject.AddComponent<Button>().onClick).AddListener(new UnityAction(CloseMenu));
				RectTransform val = UiFactory.CreatePanel((Transform)(object)obj, "Panel", new Vector2(1000f, 700f), AdminTheme.Panel);
				val.anchorMin = new Vector2(0.5f, 0.5f);
				val.anchorMax = new Vector2(0.5f, 0.5f);
				val.pivot = new Vector2(0.5f, 0.5f);
				UiFactory.CreateBorder((Transform)(object)val, AdminTheme.PanelBorder, 1f);
				BuildHeader(val);
				BuildTabs(val);
				BuildFooter(val);
				_playersTab = BuildPlayersTab(_contentArea);
				_selfTab = BuildSelfTab(_contentArea);
				_economyTab = BuildEconomyTab(_contentArea);
				_worldTab = BuildWorldTab(_contentArea);
				_overlayTab = BuildOverlayTab(_contentArea);
				_spawnTab = BuildSpawnTab(_contentArea);
				SelectTab(Tab.Players);
				_root.SetActive(false);
			}
		}

		private void BuildHeader(RectTransform panel)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			RectTransform obj = UiFactory.CreatePanel((Transform)(object)panel, "Header", new Vector2(0f, 72f), AdminTheme.Header);
			obj.anchorMin = new Vector2(0f, 1f);
			obj.anchorMax = new Vector2(1f, 1f);
			obj.pivot = new Vector2(0.5f, 1f);
			obj.offsetMin = new Vector2(0f, -72f);
			obj.offsetMax = Vector2.zero;
			RectTransform obj2 = UiFactory.CreatePanel((Transform)(object)obj, "Accent", new Vector2(0f, 1f), AdminTheme.HeaderAccent);
			obj2.anchorMin = new Vector2(0f, 1f);
			obj2.anchorMax = new Vector2(1f, 1f);
			obj2.pivot = new Vector2(0.5f, 1f);
			obj2.offsetMin = new Vector2(0f, -1f);
			obj2.offsetMax = Vector2.zero;
			TMP_Text obj3 = UiFactory.CreateText((Transform)(object)obj, "YapAdmin", 28, AdminTheme.TextAccent, (TextAlignmentOptions)513);
			obj3.fontStyle = (FontStyles)1;
			obj3.rectTransform.anchorMin = new Vector2(0f, 0f);
			obj3.rectTransform.anchorMax = new Vector2(1f, 1f);
			obj3.rectTransform.offsetMin = new Vector2(28f, 8f);
			obj3.rectTransform.offsetMax = new Vector2(-28f, -8f);
		}

		private void BuildTabs(RectTransform panel)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			RectTransform obj = UiFactory.CreateUiObject("TabBar", (Transform)(object)panel);
			obj.anchorMin = new Vector2(0f, 1f);
			obj.anchorMax = new Vector2(1f, 1f);
			obj.pivot = new Vector2(0.5f, 1f);
			obj.offsetMin = new Vector2(24f, -128f);
			obj.offsetMax = new Vector2(-24f, -72f);
			HorizontalLayoutGroup val = ((Component)obj).gameObject.AddComponent<HorizontalLayoutGroup>();
			((HorizontalOrVerticalLayoutGroup)val).spacing = 8f;
			((LayoutGroup)val).childAlignment = (TextAnchor)3;
			((HorizontalOrVerticalLayoutGroup)val).childControlWidth = false;
			((HorizontalOrVerticalLayoutGroup)val).childForceExpandWidth = false;
			RegisterTabButton(((Component)val).transform, Tab.Players, "Players", new Vector2(96f, 40f));
			RegisterTabButton(((Component)val).transform, Tab.Self, "Self", new Vector2(76f, 40f));
			RegisterTabButton(((Component)val).transform, Tab.Economy, "Economy", new Vector2(96f, 40f));
			RegisterTabButton(((Component)val).transform, Tab.World, "World", new Vector2(86f, 40f));
			RegisterTabButton(((Component)val).transform, Tab.Overlay, "Overlay", new Vector2(96f, 40f));
			RegisterTabButton(((Component)val).transform, Tab.Spawn, "Spawn", new Vector2(86f, 40f));
			_contentArea = UiFactory.CreateUiObject("ContentArea", (Transform)(object)panel);
			_contentArea.anchorMin = new Vector2(0f, 0f);
			_contentArea.anchorMax = new Vector2(1f, 1f);
			_contentArea.offsetMin = new Vector2(20f, 72f);
			_contentArea.offsetMax = new Vector2(-20f, -128f);
			RectTransform obj2 = UiFactory.CreatePanel((Transform)(object)_contentArea, "ContentBg", Vector2.zero, AdminTheme.PanelInner);
			UiFactory.Stretch(obj2, Vector2.zero, Vector2.zero);
			((Component)obj2).transform.SetAsFirstSibling();
		}

		private void RegisterTabButton(Transform parent, Tab tab, string label, Vector2 size)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			Button val = UiFactory.CreateTabButton(parent, label, delegate
			{
				SelectTab(tab);
			}, size);
			_tabButtonImages[tab] = ((Component)val).GetComponent<Image>();
			Transform val2 = ((Component)val).transform.Find("Label");
			if ((Object)(object)val2 != (Object)null)
			{
				_tabLabels[tab] = ((Component)val2).GetComponent<TMP_Text>();
			}
			Transform val3 = ((Component)val).transform.Find("TabUnderline");
			if ((Object)(object)val3 != (Object)null)
			{
				_tabUnderlines[tab] = ((Component)val3).gameObject;
				((Component)val3).gameObject.SetActive(false);
			}
			AddTabHover(val, tab);
		}

		private void AddTabHover(Button button, Tab tab)
		{
			Image background = ((Component)button).GetComponent<Image>();
			TMP_Text label = _tabLabels.GetValueOrDefault(tab);
			GameObject underline = _tabUnderlines.GetValueOrDefault(tab);
			EventTrigger trigger = ((Component)button).gameObject.AddComponent<EventTrigger>();
			AddTabTrigger(trigger, (EventTriggerType)0, delegate
			{
				OnEnter();
			});
			AddTabTrigger(trigger, (EventTriggerType)1, delegate
			{
				OnExit();
			});
			void OnEnter()
			{
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				if (_activeTab != tab)
				{
					((Graphic)background).color = AdminTheme.TabHover;
					if ((Object)(object)label != (Object)null)
					{
						((Graphic)label).color = AdminTheme.TextHover;
					}
					if ((Object)(object)underline != (Object)null)
					{
						underline.SetActive(true);
					}
				}
			}
			void OnExit()
			{
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				if (_activeTab != tab)
				{
					((Graphic)background).color = AdminTheme.TabInactive;
					if ((Object)(object)label != (Object)null)
					{
						((Graphic)label).color = AdminTheme.TextMuted;
					}
					if ((Object)(object)underline != (Object)null)
					{
						underline.SetActive(false);
					}
				}
			}
		}

		private static void AddTabTrigger(EventTrigger trigger, EventTriggerType type, Action<BaseEventData> callback)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Expected O, but got Unknown
			Entry val = new Entry
			{
				eventID = type
			};
			((UnityEvent<BaseEventData>)(object)val.callback).AddListener((UnityAction<BaseEventData>)callback.Invoke);
			trigger.triggers.Add(val);
		}

		private void UpdateTabHighlights()
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			foreach (KeyValuePair<Tab, Image> tabButtonImage in _tabButtonImages)
			{
				bool flag = tabButtonImage.Key == _activeTab;
				((Graphic)tabButtonImage.Value).color = (flag ? AdminTheme.TabActive : AdminTheme.TabInactive);
				if (_tabLabels.TryGetValue(tabButtonImage.Key, out TMP_Text value) && (Object)(object)value != (Object)null)
				{
					((Graphic)value).color = (flag ? AdminTheme.TextAccent : AdminTheme.TextMuted);
				}
				if (_tabUnderlines.TryGetValue(tabButtonImage.Key, out GameObject value2) && (Object)(object)value2 != (Object)null)
				{
					value2.SetActive(flag);
				}
			}
		}

		private void BuildFooter(RectTransform panel)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			RectTransform obj = UiFactory.CreatePanel((Transform)(object)panel, "FooterLine", new Vector2(0f, 1f), AdminTheme.FooterLine);
			obj.anchorMin = new Vector2(0f, 0f);
			obj.anchorMax = new Vector2(1f, 0f);
			obj.pivot = new Vector2(0.5f, 0f);
			obj.offsetMin = new Vector2(20f, 64f);
			obj.offsetMax = new Vector2(-20f, 65f);
			((Graphic)((Component)obj).GetComponent<Image>()).raycastTarget = false;
			RectTransform val = UiFactory.CreateUiObject("Footer", (Transform)(object)panel);
			val.anchorMin = new Vector2(0f, 0f);
			val.anchorMax = new Vector2(1f, 0f);
			val.pivot = new Vector2(0.5f, 0f);
			val.anchoredPosition = new Vector2(0f, 16f);
			val.sizeDelta = new Vector2(-48f, 48f);
			val.offsetMin = new Vector2(24f, val.offsetMin.y);
			val.offsetMax = new Vector2(-24f, val.offsetMax.y);
			HorizontalLayoutGroup val2 = ((Component)val).gameObject.AddComponent<HorizontalLayoutGroup>();
			((HorizontalOrVerticalLayoutGroup)val2).spacing = 12f;
			((LayoutGroup)val2).childAlignment = (TextAnchor)3;
			((HorizontalOrVerticalLayoutGroup)val2).childControlWidth = false;
			((HorizontalOrVerticalLayoutGroup)val2).childForceExpandWidth = false;
			UiFactory.CreateButton(((Component)val2).transform, "Close", CloseMenu, new Vector2(120f, 40f), AdminTheme.ButtonDanger, AdminTheme.ButtonDangerHover);
			_statusLabel = UiFactory.CreateText(((Component)val2).transform, string.Empty, 13, AdminTheme.TextMuted, (TextAlignmentOptions)513);
			UiFactory.AddLayoutElement((Transform)(object)_statusLabel.rectTransform, 40f, 40f, 0f, 1f);
		}

		private GameObject BuildPlayersTab(RectTransform parent)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			RectTransform obj = UiFactory.CreateUiObject("PlayersTab", (Transform)(object)parent);
			ConfigureTabLayout(obj);
			UiFactory.CreateText((Transform)(object)obj, "Players in round", 17, AdminTheme.TextMuted, (TextAlignmentOptions)513);
			UiFactory.CreateFlexibleScrollView((Transform)(object)obj, out RectTransform content);
			_playerListContent = content;
			HorizontalLayoutGroup component = ((Component)UiFactory.CreateButtonRow((Transform)(object)obj, 44f)).GetComponent<HorizontalLayoutGroup>();
			((HorizontalOrVerticalLayoutGroup)component).spacing = 10f;
			UiFactory.CreateButton(((Component)component).transform, "Revive all", delegate
			{
				AdminService.TryReviveAll();
				SetStatus("Revive all sent");
				RebuildPlayerList();
			}, new Vector2(120f, 40f), AdminTheme.ButtonPrimary, AdminTheme.ButtonHover);
			UiFactory.CreateButton(((Component)component).transform, "Kill all", delegate
			{
				AdminService.TryKillAll();
				SetStatus("Kill all sent");
				RebuildPlayerList();
			}, new Vector2(100f, 40f), AdminTheme.ButtonDanger, AdminTheme.ButtonHover);
			return ((Component)obj).gameObject;
		}

		private GameObject BuildSelfTab(RectTransform parent)
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Expected O, but got Unknown
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
			RectTransform obj = UiFactory.CreateUiObject("SelfTab", (Transform)(object)parent);
			ConfigureTabLayout(obj);
			UiFactory.CreateFlexibleScrollView((Transform)(object)obj, out RectTransform content);
			VerticalLayoutGroup component = ((Component)content).GetComponent<VerticalLayoutGroup>();
			((HorizontalOrVerticalLayoutGroup)component).spacing = 10f;
			((LayoutGroup)component).padding = new RectOffset(10, 10, 10, 10);
			Pawn localPawn = AdminService.LocalPawn;
			UiFactory.CreateText(text: "Player: " + (((Object)(object)localPawn != (Object)null) ? localPawn.PlayerName : "Not in round"), parent: (Transform)(object)content, fontSize: 15, color: AdminTheme.TextMuted, alignment: (TextAlignmentOptions)513);
			UiFactory.CreateSectionHeader((Transform)(object)content, "Combat");
			_godModeToggle = UiFactory.CreateToggle((Transform)(object)content, "God mode (damage cannot kill)", AdminService.IsGodModeEnabled, delegate(bool value)
			{
				Pawn localPawn2 = AdminService.LocalPawn;
				if (!((Object)(object)localPawn2 == (Object)null))
				{
					AdminService.TrySetGodMode(localPawn2, value);
					SetStatus(value ? "God mode enabled" : "God mode disabled");
				}
			});
			_noCooldownToggle = UiFactory.CreateToggle((Transform)(object)content, "No spell cooldowns", AdminService.IsNoCooldownEnabled, delegate(bool value)
			{
				Pawn localPawn2 = AdminService.LocalPawn;
				if (!((Object)(object)localPawn2 == (Object)null))
				{
					AdminService.TrySetNoCooldown(localPawn2, value);
					SetStatus(value ? "Cooldowns disabled" : "Cooldowns enabled");
				}
			});
			UiFactory.CreateSectionHeader((Transform)(object)content, "Movement");
			_infiniteStaminaToggle = UiFactory.CreateToggle((Transform)(object)content, "Infinite stamina", AdminService.IsInfiniteStaminaEnabled, delegate(bool value)
			{
				AdminService.TrySetInfiniteStamina(value);
				SetStatus(value ? "Infinite stamina enabled" : "Infinite stamina disabled");
			});
			_superSpeedToggle = UiFactory.CreateToggle((Transform)(object)content, "Super speed (walk + fly)", AdminService.IsSuperSpeedEnabled, delegate(bool value)
			{
				AdminService.TrySetSuperSpeed(value);
				SetStatus(value ? "Super speed enabled" : "Super speed disabled");
			});
			_noclipToggle = UiFactory.CreateToggle((Transform)(object)content, "Noclip fly (WASD + Space/Ctrl)", AdminService.IsNoclipEnabled, delegate(bool value)
			{
				AdminService.TrySetNoclip(value);
				SetStatus(value ? "Noclip enabled" : "Noclip disabled");
			});
			_infiniteJumpsToggle = UiFactory.CreateToggle((Transform)(object)content, "Infinite air jumps", AdminService.IsInfiniteJumpsEnabled, delegate(bool value)
			{
				AdminService.TrySetInfiniteJumps(value);
				SetStatus(value ? "Infinite jumps enabled" : "Infinite jumps disabled");
			});
			_superStrengthToggle = UiFactory.CreateToggle((Transform)(object)content, "Super strength (grab anything)", AdminService.IsSuperStrengthEnabled, delegate(bool value)
			{
				AdminService.TrySetSuperStrength(value);
				SetStatus(value ? "Super strength enabled" : "Super strength disabled");
			});
			UiFactory.CreateSectionHeader((Transform)(object)content, "Quick actions");
			HorizontalLayoutGroup component2 = ((Component)UiFactory.CreateButtonRow((Transform)(object)content, 44f)).GetComponent<HorizontalLayoutGroup>();
			((HorizontalOrVerticalLayoutGroup)component2).spacing = 10f;
			UiFactory.CreateButton(((Component)component2).transform, "Full heal", delegate
			{
				Pawn localPawn2 = AdminService.LocalPawn;
				if (!((Object)(object)localPawn2 == (Object)null))
				{
					AdminService.TryHeal(localPawn2);
					SetStatus("Full heal sent");
				}
			}, new Vector2(100f, 4