Decompiled source of AntroServerControl v3.0.1

Antro.ServerControl.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.IL2CPP;
using BepInEx.Logging;
using HarmonyLib;
using Il2CppSystem;
using Il2CppSystem.Collections.Generic;
using Microsoft.CodeAnalysis;
using SteamworksNative;
using UnhollowerBaseLib;
using UnhollowerRuntimeLib;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("Antro.ServerControl")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Antro.ServerControl")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Antro.ServerControl")]
[assembly: AssemblyTitle("Antro.ServerControl")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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 Antro.ServerControl
{
	public class DocCategory
	{
		public string Name;

		public string ColorHex;

		public List<DocCommand> Commands = new List<DocCommand>();

		public DocCategory(string n, string c)
		{
			Name = n;
			ColorHex = c;
		}
	}
	public class DocCommand
	{
		public string Name;

		public string Args;

		public string Desc;

		public string Example;

		public bool IsSpecialList;

		public DocCommand(string n, string a, string d, string e, bool special = false)
		{
			Name = n;
			Args = a;
			Desc = d;
			Example = e;
			IsSpecialList = special;
		}
	}
	[BepInPlugin("Antro.ServerControl", "Antro Server Menu", "3.0.0.0")]
	public sealed class Plugin : BasePlugin
	{
		public class ZoneData
		{
			public Vector3 Pos;

			public float Radius;

			public string Type;
		}

		public class BanData
		{
			public string Name;

			public bool IsPermanent;

			public long UnbanTimeTicks;
		}

		public class WhitelistData
		{
			public string Name;

			public ulong SteamId;

			public string Role;
		}

		public static Plugin Instance;

		internal static ManualLogSource ConsoleLogger;

		public static ConfigEntry<bool> AntiSpamEnabled;

		public static ConfigEntry<bool> AutoBanEnabled;

		public static ConfigEntry<int> AutoBanWarnThreshold;

		public static ConfigEntry<int> AutoBanDays;

		public static float CurrentGravity = -9.81f;

		public static bool ScriptGravityActive = false;

		public static float ChaosPunchPower = 1f;

		public static bool MoonGravityEnabled = false;

		public static bool BouncyCastleEnabled = false;

		public static bool NametagsEnabled = false;

		public static bool FreezeAllEnabled = false;

		public static Dictionary<ulong, float> CustomSpeeds = new Dictionary<ulong, float>();

		public static Dictionary<ulong, float> CustomJumps = new Dictionary<ulong, float>();

		public static bool MatrixSlowMoEnabled = false;

		public static bool JetpackMeEnabled = false;

		public static bool JetpackAllEnabled = false;

		public static List<ZoneData> ActiveZones = new List<ZoneData>();

		public static bool ShowZones = false;

		public static Dictionary<KeyCode, string> PresetKeybinds = new Dictionary<KeyCode, string>();

		public static Dictionary<ulong, BanData> BannedPlayers = new Dictionary<ulong, BanData>();

		public static Dictionary<ulong, WhitelistData> WhitelistedPlayers = new Dictionary<ulong, WhitelistData>();

		public static Dictionary<ulong, int> Warns = new Dictionary<ulong, int>();

		public static string ScriptsPath = "";

		public static string BansFilePath = "";

		public static MethodInfo PunchMethod = null;

		public static int CurrentMapId = -1;

		public static int CurrentModeId = -1;

		public override void Load()
		{
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Expected O, but got Unknown
			Instance = this;
			ConsoleLogger = ((BasePlugin)this).Log;
			ConsoleLogger.LogInfo((object)">>> [Antro.ServerControl] Loading V3.0.0.0 (Fixes)...");
			ScriptsPath = Path.Combine(Paths.ConfigPath, "AntroScripts");
			if (!Directory.Exists(ScriptsPath))
			{
				Directory.CreateDirectory(ScriptsPath);
			}
			BansFilePath = Path.Combine(Paths.ConfigPath, "AntroBans.txt");
			AntiSpamEnabled = ((BasePlugin)this).Config.Bind<bool>("Protection", "AntiSpamEnabled", true, "Anti-Spam");
			AutoBanEnabled = ((BasePlugin)this).Config.Bind<bool>("Protection", "AutoBanEnabled", true, "Auto-Ban");
			AutoBanWarnThreshold = ((BasePlugin)this).Config.Bind<int>("Protection", "WarnsNeeded", 3, "Warns Limit");
			AutoBanDays = ((BasePlugin)this).Config.Bind<int>("Protection", "BanDuration", 1, "Ban Days");
			LoadBans();
			try
			{
				ClassInjector.RegisterTypeInIl2Cpp<ServerMenuController>();
			}
			catch
			{
			}
			GameObject val = new GameObject("AntroServerMenu_UI");
			Object.DontDestroyOnLoad((Object)(object)val);
			((Object)val).hideFlags = (HideFlags)61;
			val.AddComponent<ServerMenuController>();
			Harmony.CreateAndPatchAll(typeof(Patches), (string)null);
			try
			{
				PunchMethod = typeof(MonoBehaviourPublicObInCoIE85SiAwVoFoCoUnique).GetMethod("PunchPlayer", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			}
			catch
			{
			}
		}

		public static void SaveBans()
		{
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Expected O, but got Unknown
			try
			{
				List<string> list = new List<string>();
				foreach (KeyValuePair<ulong, BanData> bannedPlayer in BannedPlayers)
				{
					string item = $"{bannedPlayer.Key}|{bannedPlayer.Value.Name}|{bannedPlayer.Value.IsPermanent}|{bannedPlayer.Value.UnbanTimeTicks}";
					list.Add(item);
				}
				File.WriteAllLines(BansFilePath, list.ToArray());
			}
			catch (Exception ex)
			{
				ManualLogSource consoleLogger = ConsoleLogger;
				bool flag = default(bool);
				BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(21, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Failed to save bans: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message);
				}
				consoleLogger.LogError(val);
			}
		}

		public static void LoadBans()
		{
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Expected O, but got Unknown
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Expected O, but got Unknown
			if (!File.Exists(BansFilePath))
			{
				return;
			}
			bool flag = default(bool);
			try
			{
				string[] array = File.ReadAllLines(BansFilePath);
				BannedPlayers.Clear();
				string[] array2 = array;
				foreach (string text in array2)
				{
					if (!string.IsNullOrWhiteSpace(text))
					{
						string[] array3 = text.Split(new char[1] { '|' });
						if (array3.Length >= 4 && ulong.TryParse(array3[0], out var result))
						{
							BanData value = new BanData
							{
								Name = array3[1],
								IsPermanent = bool.Parse(array3[2]),
								UnbanTimeTicks = long.Parse(array3[3])
							};
							BannedPlayers[result] = value;
						}
					}
				}
				ManualLogSource consoleLogger = ConsoleLogger;
				BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(13, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Loaded ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(BannedPlayers.Count);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" bans.");
				}
				consoleLogger.LogInfo(val);
			}
			catch (Exception ex)
			{
				ManualLogSource consoleLogger2 = ConsoleLogger;
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(21, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Failed to load bans: ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				consoleLogger2.LogError(val2);
			}
		}

		public static bool IsWhitelisted(ulong steamId)
		{
			return WhitelistedPlayers.ContainsKey(steamId);
		}

		public static bool AmIHost()
		{
			//IL_001b: 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_0026: 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_002c: 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_0032: 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_003a: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance == (Object)null)
			{
				return false;
			}
			try
			{
				CSteamID currentLobby = MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance.currentLobby;
				CSteamID field_Private_CSteamID_ = MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance.field_Private_CSteamID_0;
				CSteamID lobbyOwner = SteamMatchmaking.GetLobbyOwner(currentLobby);
				return field_Private_CSteamID_.m_SteamID == lobbyOwner.m_SteamID;
			}
			catch
			{
				return false;
			}
		}
	}
	public static class Patches
	{
		[HarmonyPatch(typeof(MonoBehaviourPublicInfobaInlerijuIncrspUnique), "GetButton")]
		[HarmonyPrefix]
		public static bool BlockInputIfMenuOpen(string name, ref bool __result)
		{
			if (Plugin.AmIHost() && (Object)(object)ServerMenuController.Instance != (Object)null && (ServerMenuController.Instance.IsOpen || ServerMenuController.Instance.IsTyping))
			{
				switch (name)
				{
				default:
					if (!name.StartsWith("Mouse"))
					{
						break;
					}
					goto case "Fire";
				case "Fire":
				case "Fire1":
				case "Attack":
				case "Jump":
				case "Interact":
				case "Punch":
					__result = false;
					return false;
				}
			}
			return true;
		}

		[HarmonyPatch(typeof(MonoBehaviourPublicInfobaInlerijuIncrspUnique), "GetButtonDown")]
		[HarmonyPrefix]
		public static bool BlockInputDownIfMenuOpen(string name, ref bool __result)
		{
			if (Plugin.AmIHost() && (Object)(object)ServerMenuController.Instance != (Object)null && (ServerMenuController.Instance.IsOpen || ServerMenuController.Instance.IsTyping))
			{
				switch (name)
				{
				default:
					if (!"Punch".Equals(name))
					{
						break;
					}
					goto case "Fire";
				case "Fire":
				case "Fire1":
				case "Attack":
					__result = false;
					return false;
				}
			}
			return true;
		}

		[HarmonyPatch(typeof(MonoBehaviourPublicObInCoIE85SiAwVoFoCoUnique), "PunchPlayer")]
		[HarmonyPrefix]
		public static void PreServerSendPunchPlayer(ulong param_0, ref ulong param_1, ref Vector3 param_2)
		{
			//IL_0032: 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)
			if (Plugin.AmIHost() && Plugin.ChaosPunchPower != 1f)
			{
				MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique instance = MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance;
				if ((Object)(object)instance != (Object)null && param_0 == instance.field_Private_CSteamID_0.m_SteamID && (Object)(object)Camera.main != (Object)null)
				{
					param_2 = ((Component)Camera.main).transform.forward * Plugin.ChaosPunchPower;
				}
			}
		}

		[HarmonyPatch(typeof(MonoBehaviourPublicObInCoIE85SiAwVoFoCoUnique), "PlayerDied")]
		[HarmonyPostfix]
		public static void OnPlayerDied(ulong param_0, ulong param_1, Vector3 param_2)
		{
			if (Plugin.AmIHost() && (Object)(object)ServerMenuController.Instance != (Object)null)
			{
				ServerMenuController.Instance.SetTempVar("LAST_VICTIM_ID", param_0);
				ServerMenuController.Instance.SetTempVar("LAST_KILLER_ID", param_1);
				ServerMenuController.Instance.TriggerEvent("ON_PLAYER_DEATH");
				if (Plugin.MatrixSlowMoEnabled)
				{
					ServerMenuController.Instance.TriggerMatrixSlowMo();
				}
			}
		}

		[HarmonyPatch(typeof(GameMode), "StartRound")]
		[HarmonyPostfix]
		public static void OnRoundStart()
		{
			if (Plugin.AmIHost() && (Object)(object)ServerMenuController.Instance != (Object)null)
			{
				Plugin.ScriptGravityActive = false;
				Plugin.CurrentGravity = -9.81f;
				ServerMenuController.Instance.TriggerEvent("ON_ROUND_START");
			}
		}
	}
	public class ServerMenuController : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <TypingRoutine>d__159 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public string finalText;

			public ServerMenuController <>4__this;

			private string <original>5__1;

			private int <diffIndex>5__2;

			private string <toType>5__3;

			private string <>s__4;

			private int <>s__5;

			private char <c>5__6;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <TypingRoutine>d__159(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<original>5__1 = null;
				<toType>5__3 = null;
				<>s__4 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0144: Unknown result type (might be due to invalid IL or missing references)
				//IL_014e: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>4__this._isTypingEffectRunning = true;
					<original>5__1 = <>4__this._scriptInput;
					<diffIndex>5__2 = 0;
					while (<diffIndex>5__2 < <original>5__1.Length && <diffIndex>5__2 < finalText.Length && <original>5__1[<diffIndex>5__2] == finalText[<diffIndex>5__2])
					{
						<diffIndex>5__2++;
					}
					<toType>5__3 = finalText.Substring(<diffIndex>5__2);
					<>4__this._scriptInput = <original>5__1.Substring(0, <diffIndex>5__2);
					<>s__4 = <toType>5__3;
					<>s__5 = 0;
					break;
				case 1:
					<>1__state = -1;
					<>s__5++;
					break;
				}
				if (<>s__5 < <>s__4.Length)
				{
					<c>5__6 = <>s__4[<>s__5];
					<>4__this._scriptInput += <c>5__6;
					<>4__this.MoveCursorToEnd();
					<>2__current = (object)new WaitForSecondsRealtime(0.02f);
					<>1__state = 1;
					return true;
				}
				<>s__4 = null;
				<>4__this._scriptInput = finalText;
				<>4__this.MoveCursorToEnd();
				<>4__this._isTypingEffectRunning = false;
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public static ServerMenuController Instance;

		private bool _isOpen = false;

		private static bool _wasOpenBeforeLoad;

		private bool _isTyping = false;

		private Rect _windowRect;

		private int _selectedTab = 0;

		private string[] _toolbarStrings = new string[6] { "Players", "BanList", "Whitelist", "Game/Fun", "Scripting", "Settings" };

		private Vector2 _scrollPlayers;

		private Vector2 _scrollBans;

		private Vector2 _scrollWhitelist;

		private Vector2 _scrollMaps;

		private Vector2 _scrollModes;

		private Vector2 _scrollItems;

		private Vector2 _scrollGamePresets;

		private Vector2 _scrollGameFolders;

		private Vector2 _scrollToggleModes;

		private int _playerSortMode = 0;

		private string[] _sortModeNames = new string[4] { "Default", "Alive First", "Dead First", "Admins First" };

		private ulong _selectedSteamId = 0uL;

		private string _selectedPlayerName = "None";

		private bool _showItemSelectorPlayer = false;

		private bool _showItemSelectorAll = false;

		private int _selectedItemId = -1;

		private string _selectedItemName = "None";

		private int _selectedMapId = -1;

		private int _selectedModeId = -1;

		private string _bindingFile = null;

		private string _wlIdInput = "";

		private string _wlRoleInput = "Admin";

		private string _manualBanDaysInput = "1";

		private string _cfgAutoBanDays = "";

		private string _cfgWarnsThreshold = "";

		private string _chaosPunchInput = "1";

		private string _chatMessageInput = "";

		private string _fakeChatInput = "";

		private string _timerInput = "60";

		private string _ammoInput = "30";

		private float _loadMapTimer = 0f;

		private int _pendingMapId = -1;

		private int _pendingModeId = -1;

		private bool _wasBouncyEnabled = false;

		private List<GameModeData> _backedUpModeList = null;

		private float _matrixTimer = 0f;

		private bool _matrixActive = false;

		private float _bouncyCastleTimer = 0f;

		private Dictionary<int, string> _cachedItems = new Dictionary<int, string>();

		private bool _itemsLoaded = false;

		private GUIStyle _headerStyle;

		private GUIStyle _subHeaderStyle;

		private GUIStyle _textAreaStyle;

		private GUIStyle _codeStyle;

		private GUIStyle _espStyle;

		private GUIStyle _richTextStyle;

		private GUIStyle _invisibleTextStyle;

		private GUIStyle _docHeaderStyle;

		private GUIStyle _docDescStyle;

		private GUIStyle _docExStyle;

		private bool _stylesInitialized = false;

		private Dictionary<ulong, Vector3> _frozenPositions = new Dictionary<ulong, Vector3>();

		private int _lastPlayerCount = 0;

		private string _lastSceneName = "";

		private string _scriptInput = "// Script Editor\nSAY \"Hello\"\n";

		private bool _isScriptRunning = false;

		private List<string> _scriptLines = new List<string>();

		private int _scriptLineIndex = 0;

		private float _scriptWaitTimer = 0f;

		private Dictionary<string, int> _scriptLabels = new Dictionary<string, int>();

		private Dictionary<string, float> _scriptVars = new Dictionary<string, float>();

		private Dictionary<string, string> _scriptStringVars = new Dictionary<string, string>();

		private Dictionary<string, string> _localAliases = new Dictionary<string, string>();

		private List<string> _presetFiles = new List<string>();

		private List<string> _folderFiles = new List<string>();

		private List<ScriptTimer> _activeTimers = new List<ScriptTimer>();

		private Stack<LoopInfo> _loopStack = new Stack<LoopInfo>();

		private Vector2 _scrollScriptEditor;

		private List<string> _undoStack = new List<string>();

		private List<string> _redoStack = new List<string>();

		private string _lastSnapshot = "";

		private const int MAX_UNDO = 200;

		private string _presetNameInput = "NewScript";

		private List<DocCategory> _docCategories = new List<DocCategory>();

		private List<string> _allCommandsList = new List<string>();

		private Dictionary<string, string> _commandColors = new Dictionary<string, string>();

		private List<string> _currentSuggestions = new List<string>();

		private int _suggestionIndex = 0;

		private string _lastWordTyping = "";

		private DocCommand _selectedDocCommand = null;

		private string _selectedDocColor = "";

		private string _currentPath;

		private string _selectedFile = "";

		private Vector2 _scrollProjectView;

		private Vector2 _scrollSuggestions;

		private Vector2 _scrollHelp;

		private Vector2 _scrollDocDetails;

		private string _deleteConfirmTarget = "";

		private bool _showCreateFolder = false;

		private string _newFolderName = "NewFolder";

		private bool _isTypingEffectRunning = false;

		private string _targetTypingText = "";

		private float _typingTimer = 0f;

		public bool IsOpen => _isOpen;

		public bool IsTyping => _isTyping;

		private void ActionWarn(ulong id)
		{
			if (!Plugin.IsWhitelisted(id))
			{
				if (!Plugin.Warns.ContainsKey(id))
				{
					Plugin.Warns[id] = 0;
				}
				Plugin.Warns[id]++;
				if (Plugin.AutoBanEnabled.Value && Plugin.Warns[id] >= Plugin.AutoBanWarnThreshold.Value)
				{
					ActionBan(id, p: false, Plugin.AutoBanDays.Value);
				}
			}
		}

		private void ActionRemoveWarn(ulong id)
		{
			if (Plugin.Warns.ContainsKey(id) && Plugin.Warns[id] > 0)
			{
				Plugin.Warns[id]--;
			}
		}

		private void ActionAddToWhitelist(ulong id, string name, string role)
		{
			if (!Plugin.WhitelistedPlayers.ContainsKey(id))
			{
				Plugin.WhitelistedPlayers.Add(id, new Plugin.WhitelistData
				{
					Name = name,
					SteamId = id,
					Role = role
				});
			}
		}

		private void ActionKick(ulong id)
		{
			if (!Plugin.IsWhitelisted(id))
			{
				MonoBehaviourPublicCSDi2UIInstObUIloDiUnique instance = MonoBehaviourPublicCSDi2UIInstObUIloDiUnique.Instance;
				if (instance != null)
				{
					instance.KickPlayer(id);
				}
			}
		}

		private void ActionBan(ulong id, bool p, int d)
		{
			if (!Plugin.IsWhitelisted(id))
			{
				Plugin.BannedPlayers[id] = new Plugin.BanData
				{
					Name = "Player",
					IsPermanent = p,
					UnbanTimeTicks = (p ? 0 : DateTime.Now.AddDays(d).Ticks)
				};
				MonoBehaviourPublicCSDi2UIInstObUIloDiUnique instance = MonoBehaviourPublicCSDi2UIInstObUIloDiUnique.Instance;
				if (instance != null)
				{
					instance.BanPlayer(id);
				}
				Plugin.SaveBans();
			}
		}

		private void ActionUnban(ulong id)
		{
			Plugin.BannedPlayers.Remove(id);
			MonoBehaviourPublicCSDi2UIInstObUIloDiUnique.bannedPlayers?.Remove(id);
			Plugin.SaveBans();
		}

		private void CheckAutoUnbans()
		{
			if (Plugin.BannedPlayers.Count == 0)
			{
				return;
			}
			List<ulong> list = new List<ulong>();
			long ticks = DateTime.Now.Ticks;
			foreach (KeyValuePair<ulong, Plugin.BanData> bannedPlayer in Plugin.BannedPlayers)
			{
				if (!bannedPlayer.Value.IsPermanent && bannedPlayer.Value.UnbanTimeTicks != 0L && ticks > bannedPlayer.Value.UnbanTimeTicks)
				{
					list.Add(bannedPlayer.Key);
				}
			}
			foreach (ulong item in list)
			{
				ActionUnban(item);
			}
		}

		private void ActionKill(ulong id)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			MonoBehaviourPublicObInCoIE85SiAwVoFoCoUnique.PlayerDied(id, id, Vector3.zero);
			TriggerMatrixSlowMo();
		}

		private void ActionKillAll()
		{
			List<ulong> activePlayerIds = GetActivePlayerIds();
			foreach (ulong item in activePlayerIds)
			{
				ActionKill(item);
			}
			TriggerMatrixSlowMo();
		}

		private void ActionKillNonAdmins()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			List<ulong> activePlayerIds = GetActivePlayerIds();
			foreach (ulong item in activePlayerIds)
			{
				if (!Plugin.IsWhitelisted(item) && item != MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance.field_Private_CSteamID_0.m_SteamID)
				{
					ActionKill(item);
				}
			}
			TriggerMatrixSlowMo();
		}

		private void ActionExplode(ulong id)
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			if (MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers.ContainsKey(id) && !MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers[id].dead)
			{
				MonoBehaviourPublicObInCoIE85SiAwVoFoCoUnique.PlayerDied(id, 1uL, Vector3.zero);
				TriggerMatrixSlowMo();
			}
		}

		private void ActionExplodeAll()
		{
			List<ulong> activePlayerIds = GetActivePlayerIds();
			foreach (ulong item in activePlayerIds)
			{
				ActionExplode(item);
			}
			TriggerMatrixSlowMo();
		}

		private void ActionRespawn(ulong id)
		{
			//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_001f: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)MonoBehaviourPublicObInGaspUnique.Instance == (Object)null))
			{
				Vector3 val = MonoBehaviourPublicObInGaspUnique.Instance.FindGroundedSpawnPosition(id);
				MonoBehaviourPublicInInUnique.RespawnPlayer(id, val);
			}
		}

		private void ActionRespawnAll()
		{
			List<ulong> activePlayerIds = GetActivePlayerIds();
			foreach (ulong item in activePlayerIds)
			{
				ActionRespawn(item);
			}
		}

		private void ActionTeleportToMe(ulong id)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			ulong steamID = MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance.field_Private_CSteamID_0.m_SteamID;
			if (MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers.ContainsKey(steamID))
			{
				MonoBehaviourPublicInInUnique.RespawnPlayer(id, ((Component)MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers[steamID]).transform.position);
			}
		}

		private void ActionTeleportAllToMe()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: 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_006c: Unknown result type (might be due to invalid IL or missing references)
			ulong steamID = MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance.field_Private_CSteamID_0.m_SteamID;
			if (!MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers.ContainsKey(steamID))
			{
				return;
			}
			Vector3 position = ((Component)MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers[steamID]).transform.position;
			List<ulong> activePlayerIds = GetActivePlayerIds();
			foreach (ulong item in activePlayerIds)
			{
				if (item != steamID)
				{
					MonoBehaviourPublicInInUnique.RespawnPlayer(item, position);
				}
			}
		}

		private void ActionGiveItemCorrect(ulong id, int itemId, int ammo)
		{
			MonoBehaviourPublicDi2UIObacspDi2UIObUnique instance = MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance;
			if (instance != null && instance.activePlayers.ContainsKey(id) && !MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers[id].dead)
			{
				int nextId = MonoBehaviourPublicDi2InObInObInUnique.Instance.GetNextId();
				if (IsAmmoWeapon(itemId))
				{
					MonoBehaviourPublicInInUnique.DropItem(id, itemId, nextId, ammo);
				}
				else
				{
					MonoBehaviourPublicObInCoIE85SiAwVoFoCoUnique.ForceGiveWeapon(id, itemId, nextId);
				}
			}
		}

		private void ActionGiveItemAll(int itemId, int ammo = 30)
		{
			List<ulong> activePlayerIds = GetActivePlayerIds();
			foreach (ulong item in activePlayerIds)
			{
				ActionGiveItemCorrect(item, itemId, ammo);
			}
		}

		private void ActionKnockAll(Vector3 f)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: 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_0074: Unknown result type (might be due to invalid IL or missing references)
			List<ulong> activePlayerIds = GetActivePlayerIds();
			ulong steamID = MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance.field_Private_CSteamID_0.m_SteamID;
			foreach (ulong item in activePlayerIds)
			{
				if (Plugin.PunchMethod != null)
				{
					Vector3 val = ((Vector3)(ref f)).normalized * 80f;
					Plugin.PunchMethod.Invoke(MonoBehaviourPublicObInCoIE85SiAwVoFoCoUnique.Instance, new object[3] { steamID, item, val });
				}
			}
		}

		private void ActionGiveRandomToAll()
		{
			List<ulong> activePlayerIds = GetActivePlayerIds();
			int[] array = new int[7] { 0, 2, 3, 5, 6, 37, 38 };
			Random random = new Random();
			foreach (ulong item in activePlayerIds)
			{
				ActionGiveItemCorrect(item, array[random.Next(array.Length)], 30);
			}
		}

		private void ActionShufflePositions()
		{
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: 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_00a2: 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_00d2: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance == (Object)null)
			{
				return;
			}
			List<ulong> activePlayerIds = GetActivePlayerIds();
			List<Vector3> list = new List<Vector3>();
			foreach (ulong item in activePlayerIds)
			{
				list.Add(((Component)MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers[item]).transform.position);
			}
			Random random = new Random();
			int num = list.Count;
			while (num > 1)
			{
				num--;
				int index = random.Next(num + 1);
				Vector3 value = list[index];
				list[index] = list[num];
				list[num] = value;
			}
			for (int i = 0; i < activePlayerIds.Count; i++)
			{
				MonoBehaviourPublicInInUnique.RespawnPlayer(activePlayerIds[i], list[i]);
			}
		}

		private void ActionTeleportUp()
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: 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_0058: Unknown result type (might be due to invalid IL or missing references)
			List<ulong> activePlayerIds = GetActivePlayerIds();
			foreach (ulong item in activePlayerIds)
			{
				if (MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers.ContainsKey(item))
				{
					MonoBehaviourPublicInInUnique.RespawnPlayer(item, ((Component)MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers[item]).transform.position + Vector3.up * 10f);
				}
			}
		}

		private void ActionDropAll(ulong id)
		{
		}

		private void ActionClearChat()
		{
			for (int i = 0; i < 30; i++)
			{
				MonoBehaviourPublicInInUnique.SendChatMessage(1uL, " ");
			}
			MonoBehaviourPublicInInUnique.SendChatMessage(1uL, "--- Chat Cleared by Admin ---");
		}

		private void ActionClearItems(int limit = 0)
		{
			Il2CppArrayBase<Rigidbody> val = Object.FindObjectsOfType<Rigidbody>();
			List<GameObject> list = new List<GameObject>();
			foreach (Rigidbody item in val)
			{
				if (!((Object)(object)item == (Object)null) && !((Object)(object)((Component)item).gameObject == (Object)null))
				{
					string text = ((Object)((Component)item).gameObject).name.ToLower();
					if ((text.Contains("item") || text.Contains("pickup") || text.Contains("weapon") || text.Contains("gun") || text.Contains("clone") || text.Contains("prop")) && !text.Contains("player") && !text.Contains("ragdoll"))
					{
						list.Add(((Component)item).gameObject);
					}
				}
			}
			if (list.Count <= limit)
			{
				return;
			}
			int num = list.Count - limit;
			for (int i = 0; i < num; i++)
			{
				if ((Object)(object)list[i] != (Object)null)
				{
					Object.Destroy((Object)(object)list[i]);
				}
			}
		}

		private void ActionBouncyCastle()
		{
			//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)
			Il2CppArrayBase<Collider> val = Object.FindObjectsOfType<Collider>();
			foreach (Collider item in val)
			{
				if ((((Component)item).gameObject.layer == LayerMask.NameToLayer("Ground") || ((Component)item).gameObject.layer == LayerMask.NameToLayer("Default")) && Vector3.Dot(((Component)item).transform.up, Vector3.up) > 0.5f && (Object)(object)item.material != (Object)null)
				{
					item.material.bounciness = 1.2f;
					item.material.bounceCombine = (PhysicMaterialCombine)3;
					item.material.dynamicFriction = 0.6f;
					item.material.staticFriction = 0.6f;
				}
			}
		}

		private void DisableBouncyCastle()
		{
			Il2CppArrayBase<Collider> val = Object.FindObjectsOfType<Collider>();
			foreach (Collider item in val)
			{
				if ((((Component)item).gameObject.layer == LayerMask.NameToLayer("Ground") || ((Component)item).gameObject.layer == LayerMask.NameToLayer("Default")) && (Object)(object)item.material != (Object)null && item.material.bounciness > 1f)
				{
					item.material.bounciness = 0f;
					item.material.bounceCombine = (PhysicMaterialCombine)0;
					item.material.dynamicFriction = 0.6f;
					item.material.staticFriction = 0.6f;
				}
			}
		}

		private List<ulong> GetActivePlayerIds()
		{
			List<ulong> list = new List<ulong>();
			if ((Object)(object)MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance == (Object)null || MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers == null)
			{
				return list;
			}
			Enumerator<ulong, MonoBehaviourPublicCSstReshTrheObplBojuUnique> enumerator = MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers.Keys.GetEnumerator();
			while (enumerator.MoveNext())
			{
				ulong current = enumerator.Current;
				list.Add(current);
			}
			return list;
		}

		private bool IsAmmoWeapon(int id)
		{
			return id >= 0 && id <= 3;
		}

		public void TriggerMatrixSlowMo()
		{
			if (Plugin.MatrixSlowMoEnabled)
			{
				_matrixTimer = 3f;
				_matrixActive = true;
				Time.timeScale = 0.3f;
			}
		}

		private void ForceStartLevel(int mapId, int modeId)
		{
			if ((Object)(object)MonoBehaviourPublicGadealGaLi1pralObInUnique.Instance == (Object)null || (Object)(object)MonoBehaviourPublicObInMamaLi1plMadeMaUnique.Instance == (Object)null)
			{
				return;
			}
			MonoBehaviourPublicGadealGaLi1pralObInUnique instance = MonoBehaviourPublicGadealGaLi1pralObInUnique.Instance;
			bool flag = false;
			if ((Object)(object)MonoBehaviourPublicCSDi2UIInstObUIloDiUnique.Instance != (Object)null)
			{
				flag = !MonoBehaviourPublicCSDi2UIInstObUIloDiUnique.Instance.started;
			}
			GameModeData val = null;
			foreach (GameModeData item in (Il2CppArrayBase<GameModeData>)(object)instance.allGameModes)
			{
				if (item.id == modeId)
				{
					val = item;
					break;
				}
			}
			if ((Object)(object)val == (Object)null)
			{
				MonoBehaviourPublicInInUnique.SendChatMessage(1uL, "<color=red>[Error] Invalid Mode ID.</color>");
				return;
			}
			if ((Object)(object)val == (Object)(object)instance.defaultMode || (Object)(object)val == (Object)(object)instance.practiceMode)
			{
				MonoBehaviourPublicInInUnique.SendChatMessage(1uL, "<color=red>[Error] Cannot force start Waiting Room or Practice.</color>");
				return;
			}
			Map val2 = null;
			foreach (Map item2 in (Il2CppArrayBase<Map>)(object)MonoBehaviourPublicObInMamaLi1plMadeMaUnique.Instance.maps)
			{
				if (item2.id == mapId)
				{
					val2 = item2;
					break;
				}
			}
			if ((Object)(object)val2 == (Object)null)
			{
				MonoBehaviourPublicInInUnique.SendChatMessage(1uL, "<color=red>[Error] Invalid Map ID.</color>");
				return;
			}
			_backedUpModeList = new List<GameModeData>();
			Enumerator<GameModeData> enumerator3 = instance.allPlayableGameModes.GetEnumerator();
			while (enumerator3.MoveNext())
			{
				GameModeData current3 = enumerator3.Current;
				_backedUpModeList.Add(current3);
			}
			instance.allPlayableGameModes.Clear();
			instance.allPlayableGameModes.Add(val);
			Plugin.CurrentMapId = mapId;
			Plugin.CurrentModeId = modeId;
			MonoBehaviourPublicInInUnique.SendChatMessage(1uL, "<color=orange>[Server] Force loading: " + val.modeName + " on " + val2.mapName + "...</color>");
			if (flag)
			{
				MonoBehaviourPublicInInUnique.StartGame();
				if ((Object)(object)MonoBehaviourPublicObInLi1GagasmLi1GaUnique.Instance != (Object)null)
				{
					MonoBehaviourPublicObInLi1GagasmLi1GaUnique.Instance.StartGames();
				}
				_loadMapTimer = 0.5f;
			}
			else
			{
				_loadMapTimer = 0.1f;
			}
			_pendingMapId = mapId;
			_pendingModeId = modeId;
		}

		private void ToggleGameMode(GameModeData mode, bool enable)
		{
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)MonoBehaviourPublicGadealGaLi1pralObInUnique.Instance == (Object)null)
			{
				return;
			}
			MonoBehaviourPublicGadealGaLi1pralObInUnique instance = MonoBehaviourPublicGadealGaLi1pralObInUnique.Instance;
			if (enable)
			{
				if (!instance.allPlayableGameModes.Contains(mode))
				{
					instance.allPlayableGameModes.Add(mode);
				}
			}
			else if (instance.allPlayableGameModes.Contains(mode))
			{
				instance.allPlayableGameModes.Remove(mode);
			}
			if ((Object)(object)MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance != (Object)null && (Object)(object)MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance != (Object)null)
			{
				SteamMatchmaking.SetLobbyData(MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance.currentLobby, "Modes", instance.GetAvailableModesString());
			}
		}

		private void LoadItemsViaReflection()
		{
			try
			{
				_cachedItems.Clear();
				Enumerator<int, ItemData> enumerator = MonoBehaviourPublicDi2InItidGamoObInUnique.idToItem.GetEnumerator();
				while (enumerator.MoveNext())
				{
					KeyValuePair<int, ItemData> current = enumerator.Current;
					_cachedItems[current.Key] = current.Value.itemName;
				}
				_itemsLoaded = true;
			}
			catch
			{
			}
		}

		public ServerMenuController(IntPtr ptr)
			: base(ptr)
		{
		}

		private void Start()
		{
			//IL_001c: 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_0081: Unknown result type (might be due to invalid IL or missing references)
			Instance = this;
			_windowRect = new Rect(50f, 50f, 1400f, 900f);
			_cfgAutoBanDays = Plugin.AutoBanDays.Value.ToString();
			_cfgWarnsThreshold = Plugin.AutoBanWarnThreshold.Value.ToString();
			_chaosPunchInput = Plugin.ChaosPunchPower.ToString();
			InitDocs();
			LoadItemsViaReflection();
			RefreshPresets();
			try
			{
				ulong steamID = MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance.field_Private_CSteamID_0.m_SteamID;
				if (!Plugin.WhitelistedPlayers.ContainsKey(steamID))
				{
					Plugin.WhitelistedPlayers.Add(steamID, new Plugin.WhitelistData
					{
						Name = "You",
						SteamId = steamID,
						Role = "Owner"
					});
				}
			}
			catch
			{
			}
			if ((Object)(object)MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance != (Object)null && MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers != null)
			{
				_lastPlayerCount = MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers.Count;
			}
			((MonoBehaviour)this).InvokeRepeating("CheckAutoUnbans", 10f, 60f);
		}

		private void Update()
		{
			//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_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_0299: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Invalid comparison between Unknown and I4
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0404: Unknown result type (might be due to invalid IL or missing references)
			//IL_040b: Unknown result type (might be due to invalid IL or missing references)
			//IL_071a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0705: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_064c: Unknown result type (might be due to invalid IL or missing references)
			if (!Plugin.AmIHost())
			{
				if (_isOpen)
				{
					_isOpen = false;
				}
				return;
			}
			Scene activeScene = SceneManager.GetActiveScene();
			string name = ((Scene)(ref activeScene)).name;
			if (name != _lastSceneName)
			{
				if (_wasOpenBeforeLoad)
				{
					_isOpen = true;
					Cursor.lockState = (CursorLockMode)0;
					Cursor.visible = true;
				}
				_lastSceneName = name;
			}
			if (_isOpen)
			{
				Cursor.lockState = (CursorLockMode)0;
				Cursor.visible = true;
			}
			UpdateScriptEngine();
			if (!_isOpen && _bindingFile == null)
			{
				foreach (KeyValuePair<KeyCode, string> presetKeybind in Plugin.PresetKeybinds)
				{
					if (!Input.GetKeyDown(presetKeybind.Key))
					{
						continue;
					}
					string value = presetKeybind.Value;
					if (Directory.Exists(value))
					{
						string[] files = Directory.GetFiles(value, "*.txt");
						string[] array = files;
						foreach (string path in array)
						{
							RunScriptFromFile(path);
						}
					}
					else if (File.Exists(value))
					{
						RunScriptFromFile(value);
					}
				}
			}
			if (_bindingFile != null && Input.anyKeyDown)
			{
				foreach (KeyCode value2 in Enum.GetValues(typeof(KeyCode)))
				{
					if (Input.GetKeyDown(value2))
					{
						if ((int)value2 != 27)
						{
							Plugin.PresetKeybinds[value2] = _bindingFile;
							MonoBehaviourPublicInInUnique.SendChatMessage(1uL, $"<color=#44FF44>[BIND] {_bindingFile} bound to {(object)value2}</color>");
						}
						_bindingFile = null;
						break;
					}
				}
			}
			if (_matrixActive)
			{
				_matrixTimer -= Time.unscaledDeltaTime;
				if (_matrixTimer <= 0f)
				{
					Time.timeScale = 1f;
					_matrixActive = false;
				}
				else
				{
					Time.timeScale = 0.3f;
				}
			}
			if (Plugin.MoonGravityEnabled)
			{
				Physics.gravity = new Vector3(0f, -2.5f, 0f);
			}
			else if (Plugin.ScriptGravityActive)
			{
				Physics.gravity = new Vector3(0f, Plugin.CurrentGravity, 0f);
			}
			else
			{
				Physics.gravity = new Vector3(0f, -9.81f, 0f);
			}
			if (Plugin.BouncyCastleEnabled)
			{
				if (!_wasBouncyEnabled)
				{
					_wasBouncyEnabled = true;
				}
				_bouncyCastleTimer -= Time.deltaTime;
				if (_bouncyCastleTimer <= 0f)
				{
					_bouncyCastleTimer = 2f;
					ActionBouncyCastle();
				}
			}
			else if (_wasBouncyEnabled)
			{
				DisableBouncyCastle();
				_wasBouncyEnabled = false;
			}
			if (Plugin.ActiveZones.Count > 0)
			{
				MonoBehaviourPublicDi2UIObacspDi2UIObUnique instance = MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance;
				if (((instance != null) ? instance.activePlayers : null) != null)
				{
					foreach (Plugin.ZoneData activeZone in Plugin.ActiveZones)
					{
						Enumerator<ulong, MonoBehaviourPublicCSstReshTrheObplBojuUnique> enumerator4 = MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers.GetEnumerator();
						while (enumerator4.MoveNext())
						{
							KeyValuePair<ulong, MonoBehaviourPublicCSstReshTrheObplBojuUnique> current3 = enumerator4.Current;
							if ((Object)(object)current3.Value == (Object)null || current3.Value.dead || !(Vector3.Distance(((Component)current3.Value).transform.position, activeZone.Pos) <= activeZone.Radius))
							{
								continue;
							}
							switch (activeZone.Type)
							{
							case "KILL":
								ActionKill(current3.Key);
								break;
							case "KICK":
								ActionKick(current3.Key);
								break;
							case "BOUNCY":
							{
								Rigidbody component2 = ((Component)current3.Value).GetComponent<Rigidbody>();
								if ((Object)(object)component2 != (Object)null)
								{
									component2.AddForce(Vector3.up * 50f, (ForceMode)5);
								}
								break;
							}
							case "SLAP":
							{
								Rigidbody component = ((Component)current3.Value).GetComponent<Rigidbody>();
								if ((Object)(object)component != (Object)null)
								{
									component.AddForce(Random.onUnitSphere * 20f, (ForceMode)2);
								}
								break;
							}
							}
						}
					}
				}
			}
			if (_loadMapTimer > 0f)
			{
				_loadMapTimer -= Time.deltaTime;
				if (_loadMapTimer <= 0f)
				{
					_loadMapTimer = 0f;
					if (_pendingMapId != -1 && _pendingModeId != -1)
					{
						MonoBehaviourPublicInInUnique.LoadMap(_pendingMapId, _pendingModeId);
						if (_backedUpModeList != null && (Object)(object)MonoBehaviourPublicGadealGaLi1pralObInUnique.Instance != (Object)null)
						{
							MonoBehaviourPublicGadealGaLi1pralObInUnique instance2 = MonoBehaviourPublicGadealGaLi1pralObInUnique.Instance;
							instance2.allPlayableGameModes.Clear();
							foreach (GameModeData backedUpMode in _backedUpModeList)
							{
								instance2.allPlayableGameModes.Add(backedUpMode);
							}
							if ((Object)(object)MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance != (Object)null && (Object)(object)MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance != (Object)null)
							{
								SteamMatchmaking.SetLobbyData(MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance.currentLobby, "Modes", instance2.GetAvailableModesString());
							}
							_backedUpModeList = null;
						}
						_pendingMapId = -1;
						_pendingModeId = -1;
					}
				}
			}
			if (Plugin.FreezeAllEnabled && (Object)(object)MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance != (Object)null)
			{
				List<ulong> activePlayerIds = GetActivePlayerIds();
				foreach (ulong item in activePlayerIds)
				{
					if (MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers.ContainsKey(item))
					{
						if (!_frozenPositions.ContainsKey(item))
						{
							_frozenPositions[item] = ((Component)MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers[item]).transform.position;
						}
						MonoBehaviourPublicInInUnique.RespawnPlayer(item, _frozenPositions[item]);
					}
				}
			}
			else if (_frozenPositions.Count > 0)
			{
				_frozenPositions.Clear();
			}
			if ((Object)(object)MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance != (Object)null && MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers != null)
			{
				int count = MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers.Count;
				if (count > _lastPlayerCount)
				{
					TriggerEvent("ON_PLAYER_JOIN");
				}
				_lastPlayerCount = count;
			}
			if (!Input.GetKeyDown((KeyCode)291))
			{
				return;
			}
			_isOpen = !_isOpen;
			_wasOpenBeforeLoad = _isOpen;
			if (_isOpen)
			{
				Cursor.lockState = (CursorLockMode)0;
				Cursor.visible = true;
				if (!_itemsLoaded)
				{
					LoadItemsViaReflection();
				}
				RefreshPresets();
				return;
			}
			bool flag = false;
			MonoBehaviourPublicDi2UIObacspDi2UIObUnique instance3 = MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance;
			if (instance3 != null && instance3.activePlayers?.Count > 0)
			{
				flag = true;
			}
			if (flag)
			{
				Cursor.lockState = (CursorLockMode)1;
				Cursor.visible = false;
			}
			else
			{
				Cursor.lockState = (CursorLockMode)0;
				Cursor.visible = true;
			}
		}

		private void FixedUpdate()
		{
			//IL_0215: 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_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: 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_0283: Unknown result type (might be due to invalid IL or missing references)
			//IL_028d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0325: Unknown result type (might be due to invalid IL or missing references)
			if (!Plugin.AmIHost() || (Object)(object)MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance == (Object)null)
			{
				return;
			}
			if (Plugin.MoonGravityEnabled)
			{
				Enumerator<ulong, MonoBehaviourPublicCSstReshTrheObplBojuUnique> enumerator = MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers.Values.GetEnumerator();
				while (enumerator.MoveNext())
				{
					MonoBehaviourPublicCSstReshTrheObplBojuUnique current = enumerator.Current;
					if (!((Object)(object)current == (Object)null) && !current.dead)
					{
						Rigidbody component = ((Component)current).GetComponent<Rigidbody>();
						if ((Object)(object)component != (Object)null && Mathf.Abs(component.velocity.y) > 0.1f)
						{
							component.AddForce(Vector3.up * 20f * Time.fixedDeltaTime, (ForceMode)2);
						}
					}
				}
			}
			if (Plugin.CustomSpeeds.Count > 0)
			{
				Enumerator<ulong, MonoBehaviourPublicCSstReshTrheObplBojuUnique> enumerator2 = MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers.GetEnumerator();
				while (enumerator2.MoveNext())
				{
					KeyValuePair<ulong, MonoBehaviourPublicCSstReshTrheObplBojuUnique> current2 = enumerator2.Current;
					if ((Object)(object)current2.Value == (Object)null || current2.Value.dead)
					{
						continue;
					}
					Rigidbody component2 = ((Component)current2.Value).GetComponent<Rigidbody>();
					if (!((Object)(object)component2 != (Object)null) || !Plugin.CustomSpeeds.ContainsKey(current2.Key))
					{
						continue;
					}
					float num = Plugin.CustomSpeeds[current2.Key];
					Vector3 velocity = component2.velocity;
					if (((Vector3)(ref velocity)).magnitude > 0.1f)
					{
						velocity = component2.velocity;
						if (((Vector3)(ref velocity)).magnitude < num)
						{
							velocity = component2.velocity;
							Vector3 normalized = ((Vector3)(ref velocity)).normalized;
							normalized.y = 0f;
							component2.AddForce(normalized * (num * 5f), (ForceMode)5);
						}
					}
				}
			}
			if (Plugin.JetpackMeEnabled && Input.GetKey((KeyCode)32) && !_isTyping)
			{
				ulong steamID = MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance.field_Private_CSteamID_0.m_SteamID;
				if (MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers.ContainsKey(steamID))
				{
					MonoBehaviourPublicCSstReshTrheObplBojuUnique val = MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers[steamID];
					if ((Object)(object)val != (Object)null && !val.dead)
					{
						Rigidbody component3 = ((Component)val).GetComponent<Rigidbody>();
						if ((Object)(object)component3 != (Object)null)
						{
							component3.AddForce(Vector3.up * 45f, (ForceMode)5);
						}
					}
				}
			}
			if (!Plugin.JetpackAllEnabled)
			{
				return;
			}
			Enumerator<ulong, MonoBehaviourPublicCSstReshTrheObplBojuUnique> enumerator3 = MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers.Values.GetEnumerator();
			while (enumerator3.MoveNext())
			{
				MonoBehaviourPublicCSstReshTrheObplBojuUnique current3 = enumerator3.Current;
				if (!((Object)(object)current3 == (Object)null) && !current3.dead)
				{
					Rigidbody component4 = ((Component)current3).GetComponent<Rigidbody>();
					if ((Object)(object)component4 != (Object)null && component4.velocity.y > 0.1f)
					{
						component4.AddForce(Vector3.up * 40f, (ForceMode)5);
					}
				}
			}
		}

		private void OnGUI()
		{
			//IL_0082: 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_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			if (!Plugin.AmIHost())
			{
				return;
			}
			string nameOfFocusedControl = GUI.GetNameOfFocusedControl();
			_isTyping = !string.IsNullOrEmpty(nameOfFocusedControl);
			if (Plugin.NametagsEnabled)
			{
				DrawNametags();
			}
			if (Plugin.ShowZones)
			{
				DrawZones();
			}
			if (_isOpen)
			{
				if (!_stylesInitialized)
				{
					InitStyles();
				}
				GUI.backgroundColor = new Color(0.1f, 0.1f, 0.1f, 1f);
				GUI.contentColor = Color.white;
				GUI.Box(_windowRect, "");
				_windowRect = GUI.Window(1001, _windowRect, WindowFunction.op_Implicit((Action<int>)DrawWindowContent), "Admin Menu by Antropomeda 3.0.0.0");
			}
		}

		private void DrawWindowContent(int windowID)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			GUI.DragWindow(new Rect(0f, 0f, 10000f, 20f));
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			GUILayout.Space(5f);
			_selectedTab = GUILayout.Toolbar(_selectedTab, Il2CppStringArray.op_Implicit(_toolbarStrings), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) });
			GUILayout.Space(10f);
			switch (_selectedTab)
			{
			case 0:
				DrawPlayersTab();
				break;
			case 1:
				DrawBansTab();
				break;
			case 2:
				DrawWhitelistTab();
				break;
			case 3:
				DrawGameTab();
				break;
			case 4:
				DrawScriptingTab();
				break;
			case 5:
				DrawSettingsTab();
				break;
			}
			GUILayout.EndVertical();
		}

		private void DrawPlayersTab()
		{
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: 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_042d: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ef: 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_056f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_0285: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0717: Unknown result type (might be due to invalid IL or missing references)
			//IL_071c: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_0839: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a3: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(300f) });
			GUILayout.Label("Player List", _headerStyle, Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Sort:", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) });
			_playerSortMode = GUILayout.Toolbar(_playerSortMode, Il2CppStringArray.op_Implicit(_sortModeNames), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(20f) });
			GUILayout.EndHorizontal();
			_scrollPlayers = GUILayout.BeginScrollView(_scrollPlayers, GUIStyle.op_Implicit("box"));
			if ((Object)(object)MonoBehaviourPublicCSDi2UIInstObUIloDiUnique.Instance != (Object)null)
			{
				Il2CppReferenceArray<ObjectPublicBoInBoCSItBoInSiBySiUnique> field_Private_ArrayOf_ObjectPublicBoInBoCSItBoInSiBySiUnique_ = MonoBehaviourPublicCSDi2UIInstObUIloDiUnique.Instance.field_Private_ArrayOf_ObjectPublicBoInBoCSItBoInSiBySiUnique_0;
				if (field_Private_ArrayOf_ObjectPublicBoInBoCSItBoInSiBySiUnique_ != null)
				{
					List<ObjectPublicBoInBoCSItBoInSiBySiUnique> list = new List<ObjectPublicBoInBoCSItBoInSiBySiUnique>();
					foreach (ObjectPublicBoInBoCSItBoInSiBySiUnique item in (Il2CppArrayBase<ObjectPublicBoInBoCSItBoInSiBySiUnique>)(object)field_Private_ArrayOf_ObjectPublicBoInBoCSItBoInSiBySiUnique_)
					{
						if (item != null && item.field_Public_CSteamID_0.m_SteamID != 0)
						{
							list.Add(item);
						}
					}
					if (_playerSortMode == 1)
					{
						list = list.OrderByDescending((ObjectPublicBoInBoCSItBoInSiBySiUnique c) => MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers.ContainsKey(c.field_Public_CSteamID_0.m_SteamID) && !MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers[c.field_Public_CSteamID_0.m_SteamID].dead).ToList();
					}
					else if (_playerSortMode == 2)
					{
						list = list.OrderByDescending((ObjectPublicBoInBoCSItBoInSiBySiUnique c) => MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers.ContainsKey(c.field_Public_CSteamID_0.m_SteamID) && MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers[c.field_Public_CSteamID_0.m_SteamID].dead).ToList();
					}
					else if (_playerSortMode == 3)
					{
						list = list.OrderByDescending((ObjectPublicBoInBoCSItBoInSiBySiUnique c) => Plugin.IsWhitelisted(c.field_Public_CSteamID_0.m_SteamID)).ToList();
					}
					List<ulong> activePlayerIds = GetActivePlayerIds();
					ulong hostId = MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance.field_Private_CSteamID_0.m_SteamID;
					List<ulong> list2 = new List<ulong> { hostId };
					list2.AddRange(from id in activePlayerIds
						where id != hostId
						orderby id
						select id);
					foreach (ObjectPublicBoInBoCSItBoInSiBySiUnique item2 in list)
					{
						ulong steamID = item2.field_Public_CSteamID_0.m_SteamID;
						int num = list2.IndexOf(steamID) + 1;
						string text = ((num > 0) ? $"[#{num}] " : "[?] ");
						string friendPersonaName = SteamFriends.GetFriendPersonaName(item2.field_Public_CSteamID_0);
						string text2 = text + friendPersonaName;
						if (Plugin.Warns.TryGetValue(steamID, out var value) && value > 0)
						{
							text2 += $" <color=#FFAA00>[W:{value}]</color>";
						}
						if (Plugin.IsWhitelisted(steamID))
						{
							text2 += " <color=#44FFFF>[VIP]</color>";
						}
						if (Plugin.BannedPlayers.ContainsKey(steamID))
						{
							text2 += " <color=#FF4444>[BAN]</color>";
						}
						if (MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers.ContainsKey(steamID))
						{
							text2 = ((!MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers[steamID].dead) ? (text2 + " <color=green>(Alive)</color>") : (text2 + " <color=gray>(Dead)</color>"));
						}
						if (steamID == _selectedSteamId)
						{
							GUI.backgroundColor = Color.green;
						}
						else
						{
							GUI.backgroundColor = new Color(0.2f, 0.2f, 0.2f);
						}
						if (GUILayout.Button(text2, Array.Empty<GUILayoutOption>()))
						{
							_selectedSteamId = steamID;
							_selectedPlayerName = friendPersonaName;
							_showItemSelectorPlayer = false;
						}
					}
				}
			}
			GUI.backgroundColor = new Color(0.1f, 0.1f, 0.1f);
			GUILayout.EndScrollView();
			GUILayout.EndVertical();
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Selected: " + _selectedPlayerName, _headerStyle, Array.Empty<GUILayoutOption>());
			if (_selectedSteamId != 0)
			{
				GUILayout.Space(10f);
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				if (GUILayout.Button("WARN +1", Array.Empty<GUILayoutOption>()))
				{
					ActionWarn(_selectedSteamId);
				}
				if (GUILayout.Button("WARN -1", Array.Empty<GUILayoutOption>()))
				{
					ActionRemoveWarn(_selectedSteamId);
				}
				GUILayout.EndHorizontal();
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUI.backgroundColor = Color.red;
				if (GUILayout.Button("KICK", Array.Empty<GUILayoutOption>()))
				{
					ActionKick(_selectedSteamId);
				}
				if (GUILayout.Button("KILL", Array.Empty<GUILayoutOption>()))
				{
					ActionKill(_selectedSteamId);
				}
				if (GUILayout.Button("EXPLODE", Array.Empty<GUILayoutOption>()))
				{
					ActionExplode(_selectedSteamId);
				}
				GUI.backgroundColor = new Color(0.1f, 0.1f, 0.1f);
				GUILayout.EndHorizontal();
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				if (GUILayout.Button("BAN (Perm)", Array.Empty<GUILayoutOption>()))
				{
					ActionBan(_selectedSteamId, p: true, 0);
				}
				GUILayout.Label("Days:", Array.Empty<GUILayoutOption>());
				_manualBanDaysInput = GUILayout.TextField(_manualBanDaysInput, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) });
				if (GUILayout.Button("BAN(Temp)", Array.Empty<GUILayoutOption>()) && int.TryParse(_manualBanDaysInput, out var result))
				{
					ActionBan(_selectedSteamId, p: false, result);
				}
				GUILayout.EndHorizontal();
				if (!Plugin.IsWhitelisted(_selectedSteamId))
				{
					if (GUILayout.Button("Add WL", Array.Empty<GUILayoutOption>()))
					{
						ActionAddToWhitelist(_selectedSteamId, _selectedPlayerName, "Adm");
					}
				}
				else if (GUILayout.Button("Rem WL", Array.Empty<GUILayoutOption>()))
				{
					Plugin.WhitelistedPlayers.Remove(_selectedSteamId);
				}
				if (GUILayout.Button("Teleport To Me", Array.Empty<GUILayoutOption>()))
				{
					ActionTeleportToMe(_selectedSteamId);
				}
				if (GUILayout.Button(_showItemSelectorPlayer ? "Hide Items" : "Give Items", Array.Empty<GUILayoutOption>()))
				{
					_showItemSelectorPlayer = !_showItemSelectorPlayer;
				}
				if (_showItemSelectorPlayer)
				{
					_scrollItems = GUILayout.BeginScrollView(_scrollItems, GUIStyle.op_Implicit("box"), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(150f) });
					foreach (KeyValuePair<int, string> cachedItem in _cachedItems)
					{
						if (GUILayout.Button($"{cachedItem.Value} ({cachedItem.Key})", Array.Empty<GUILayoutOption>()))
						{
							_selectedItemId = cachedItem.Key;
							_selectedItemName = cachedItem.Value;
						}
					}
					GUILayout.EndScrollView();
					if (_selectedItemId != -1)
					{
						GUILayout.Label("Selected: " + _selectedItemName, _subHeaderStyle, Array.Empty<GUILayoutOption>());
						bool flag = IsAmmoWeapon(_selectedItemId);
						if (flag)
						{
							GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
							GUILayout.Label("Ammo Count:", Array.Empty<GUILayoutOption>());
							_ammoInput = GUILayout.TextField(_ammoInput, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(50f) });
							GUILayout.EndHorizontal();
						}
						GUI.backgroundColor = Color.green;
						if (GUILayout.Button(flag ? "GIVE WITH AMMO" : "GIVE ITEM", Array.Empty<GUILayoutOption>()))
						{
							int result2 = 1;
							if (flag)
							{
								int.TryParse(_ammoInput, out result2);
							}
							ActionGiveItemCorrect(_selectedSteamId, _selectedItemId, result2);
						}
						GUI.backgroundColor = new Color(0.1f, 0.1f, 0.1f);
					}
				}
				GUILayout.Space(15f);
				GUILayout.Label("Fake Chat", _subHeaderStyle, Array.Empty<GUILayoutOption>());
				GUILayout.Label("Send message as this player:", Array.Empty<GUILayoutOption>());
				GUI.SetNextControlName("FakeChat");
				_fakeChatInput = GUILayout.TextField(_fakeChatInput, Array.Empty<GUILayoutOption>());
				if (GUILayout.Button("Send as " + _selectedPlayerName, Array.Empty<GUILayoutOption>()))
				{
					MonoBehaviourPublicInInUnique.SendChatMessage(_selectedSteamId, _fakeChatInput);
				}
			}
			GUILayout.EndVertical();
			GUILayout.EndHorizontal();
		}

		private void DrawBansTab()
		{
			//IL_0019: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.Label("Bans", _headerStyle, Array.Empty<GUILayoutOption>());
			_scrollBans = GUILayout.BeginScrollView(_scrollBans, GUIStyle.op_Implicit("box"));
			foreach (KeyValuePair<ulong, Plugin.BanData> item in Plugin.BannedPlayers.ToList())
			{
				GUILayout.BeginHorizontal(GUIStyle.op_Implicit("box"), Array.Empty<GUILayoutOption>());
				GUILayout.Label(item.Value.Name ?? "", Array.Empty<GUILayoutOption>());
				if (GUILayout.Button("UNBAN", Array.Empty<GUILayoutOption>()))
				{
					ActionUnban(item.Key);
				}
				GUILayout.EndHorizontal();
			}
			GUILayout.EndScrollView();
		}

		private void DrawWhitelistTab()
		{
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//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)
			GUILayout.Label("Whitelist", _headerStyle, Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			_wlIdInput = GUILayout.TextField(_wlIdInput, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) });
			_wlRoleInput = GUILayout.TextField(_wlRoleInput, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) });
			if (GUILayout.Button("Add", Array.Empty<GUILayoutOption>()) && ulong.TryParse(_wlIdInput, out var result))
			{
				ActionAddToWhitelist(result, "Unk", _wlRoleInput);
			}
			GUILayout.EndHorizontal();
			_scrollWhitelist = GUILayout.BeginScrollView(_scrollWhitelist, GUIStyle.op_Implicit("box"));
			foreach (KeyValuePair<ulong, Plugin.WhitelistData> item in Plugin.WhitelistedPlayers.ToList())
			{
				GUILayout.BeginHorizontal(GUIStyle.op_Implicit("box"), Array.Empty<GUILayoutOption>());
				GUILayout.Label(item.Value.Name + " [" + item.Value.Role + "]", Array.Empty<GUILayoutOption>());
				if (GUILayout.Button("DEL", Array.Empty<GUILayoutOption>()))
				{
					Plugin.WhitelistedPlayers.Remove(item.Key);
				}
				GUILayout.EndHorizontal();
			}
			GUILayout.EndScrollView();
		}

		private void DrawGameTab()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Invalid comparison between Unknown and I4
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Expected I4, but got Unknown
			//IL_03bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0499: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0521: Unknown result type (might be due to invalid IL or missing references)
			//IL_0526: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0633: Unknown result type (might be due to invalid IL or missing references)
			//IL_0655: Unknown result type (might be due to invalid IL or missing references)
			//IL_065a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0440: Unknown result type (might be due to invalid IL or missing references)
			//IL_0439: Unknown result type (might be due to invalid IL or missing references)
			//IL_0762: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0585: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_07bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0707: Unknown result type (might be due to invalid IL or missing references)
			//IL_06eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0927: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b34: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b56: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b5b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c5e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cd5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d19: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d88: Unknown result type (might be due to invalid IL or missing references)
			//IL_0daa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0daf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fe6: Unknown result type (might be due to invalid IL or missing references)
			//IL_1008: Unknown result type (might be due to invalid IL or missing references)
			//IL_100d: Unknown result type (might be due to invalid IL or missing references)
			//IL_105b: Unknown result type (might be due to invalid IL or missing references)
			//IL_10c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e4d: Unknown result type (might be due to invalid IL or missing references)
			//IL_110e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f3f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ed5: Unknown result type (might be due to invalid IL or missing references)
			//IL_1200: Unknown result type (might be due to invalid IL or missing references)
			//IL_1196: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f8d: Unknown result type (might be due to invalid IL or missing references)
			//IL_125c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f05: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f0a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f26: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f29: Invalid comparison between Unknown and I4
			//IL_11c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_11cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_11e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_11ea: Invalid comparison between Unknown and I4
			//IL_0f36: Unknown result type (might be due to invalid IL or missing references)
			//IL_11f7: Unknown result type (might be due to invalid IL or missing references)
			if ((int)Event.current.type == 8)
			{
				RefreshPresets();
			}
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(200f) });
			GUILayout.Label("Game Control", _headerStyle, Array.Empty<GUILayoutOption>());
			if (GUILayout.Button("Force Start (Net)", Array.Empty<GUILayoutOption>()))
			{
				MonoBehaviourPublicInInUnique.StartGame();
				if ((Object)(object)MonoBehaviourPublicObInLi1GagasmLi1GaUnique.Instance != (Object)null)
				{
					MonoBehaviourPublicObInLi1GagasmLi1GaUnique.Instance.StartGames();
				}
			}
			if (GUILayout.Button("Restart Round", Array.Empty<GUILayoutOption>()))
			{
				MonoBehaviourPublicDi2UIObacspDi2UIObUnique instance = MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance;
				if (instance != null)
				{
					GameMode gameMode = instance.gameMode;
					if (gameMode != null)
					{
						gameMode.EndRound();
					}
				}
				MonoBehaviourPublicInInUnique.StartGame();
				ActionRespawnAll();
			}
			if (GUILayout.Button("Lobby", Array.Empty<GUILayoutOption>()))
			{
				MonoBehaviourPublicObInLi1GagasmLi1GaUnique.Instance.RestartLobby();
			}
			GUILayout.Space(5f);
			GUILayout.Label("Timer", _subHeaderStyle, Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			_timerInput = GUILayout.TextField(_timerInput, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(50f) });
			if (GUILayout.Button("Set", Array.Empty<GUILayoutOption>()) && float.TryParse(_timerInput, out var result))
			{
				MonoBehaviourPublicDi2UIObacspDi2UIObUnique instance2 = MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance;
				if ((Object)(object)((instance2 != null) ? instance2.gameMode : null) != (Object)null)
				{
					MonoBehaviourPublicInInUnique.SendGameModeTimer(result, (int)MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.gameMode.modeState);
				}
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(5f);
			GUI.backgroundColor = new Color(0.8f, 0.2f, 0.2f);
			if (GUILayout.Button("CLEAR CHAT", Array.Empty<GUILayoutOption>()))
			{
				ActionClearChat();
			}
			GUI.backgroundColor = new Color(0.1f, 0.1f, 0.1f);
			GUILayout.EndVertical();
			GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(180f) });
			GUILayout.Label("Fun Features", _headerStyle, Array.Empty<GUILayoutOption>());
			if (GUILayout.Button(Plugin.MoonGravityEnabled ? "Moon Grav: ON" : "Moon Grav: OFF", Array.Empty<GUILayoutOption>()))
			{
				Plugin.MoonGravityEnabled = !Plugin.MoonGravityEnabled;
			}
			if (GUILayout.Button(Plugin.BouncyCastleEnabled ? "Bouncy: ON" : "Bouncy: OFF", Array.Empty<GUILayoutOption>()))
			{
				Plugin.BouncyCastleEnabled = !Plugin.BouncyCastleEnabled;
				if (Plugin.BouncyCastleEnabled)
				{
					ActionBouncyCastle();
				}
				else
				{
					DisableBouncyCastle();
				}
			}
			if (GUILayout.Button(Plugin.NametagsEnabled ? "Nametags: ON" : "Nametags: OFF", Array.Empty<GUILayoutOption>()))
			{
				Plugin.NametagsEnabled = !Plugin.NametagsEnabled;
			}
			if (GUILayout.Button(Plugin.MatrixSlowMoEnabled ? "Matrix: ON" : "Matrix: OFF", Array.Empty<GUILayoutOption>()))
			{
				Plugin.MatrixSlowMoEnabled = !Plugin.MatrixSlowMoEnabled;
			}
			GUILayout.Label("Jetpack", _subHeaderStyle, Array.Empty<GUILayoutOption>());
			if (GUILayout.Button(Plugin.JetpackMeEnabled ? "JP Me: ON" : "JP Me: OFF", Array.Empty<GUILayoutOption>()))
			{
				Plugin.JetpackMeEnabled = !Plugin.JetpackMeEnabled;
			}
			if (GUILayout.Button(Plugin.JetpackAllEnabled ? "JP All: ON" : "JP All: OFF", Array.Empty<GUILayoutOption>()))
			{
				Plugin.JetpackAllEnabled = !Plugin.JetpackAllEnabled;
			}
			GUILayout.EndVertical();
			GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(220f) });
			GUILayout.Label("Mode Rotation", _headerStyle, Array.Empty<GUILayoutOption>());
			_scrollToggleModes = GUILayout.BeginScrollView(_scrollToggleModes, GUIStyle.op_Implicit("box"), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(200f) });
			if ((Object)(object)MonoBehaviourPublicGadealGaLi1pralObInUnique.Instance != (Object)null)
			{
				Il2CppReferenceArray<GameModeData> allGameModes = MonoBehaviourPublicGadealGaLi1pralObInUnique.Instance.allGameModes;
				List<GameModeData> allPlayableGameModes = MonoBehaviourPublicGadealGaLi1pralObInUnique.Instance.allPlayableGameModes;
				foreach (GameModeData item in (Il2CppArrayBase<GameModeData>)(object)allGameModes)
				{
					bool flag = allPlayableGameModes.Contains(item);
					GUI.backgroundColor = (flag ? Color.green : Color.red);
					if (GUILayout.Button(item.modeName, Array.Empty<GUILayoutOption>()))
					{
						ToggleGameMode(item, !flag);
					}
				}
			}
			GUI.backgroundColor = new Color(0.1f, 0.1f, 0.1f);
			GUILayout.EndScrollView();
			GUILayout.EndVertical();
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Force Load Level", _headerStyle, Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			GUILayout.Label("MAP", _subHeaderStyle, Array.Empty<GUILayoutOption>());
			_scrollMaps = GUILayout.BeginScrollView(_scrollMaps, GUIStyle.op_Implicit("box"), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(120f) });
			if ((Object)(object)MonoBehaviourPublicObInMamaLi1plMadeMaUnique.Instance != (Object)null && MonoBehaviourPublicObInMamaLi1plMadeMaUnique.Instance.maps != null)
			{
				foreach (Map item2 in (Il2CppArrayBase<Map>)(object)MonoBehaviourPublicObInMamaLi1plMadeMaUnique.Instance.maps)
				{
					if (item2.id == _selectedMapId)
					{
						GUI.backgroundColor = Color.green;
					}
					else
					{
						GUI.backgroundColor = new Color(0.2f, 0.2f, 0.2f);
					}
					if (GUILayout.Button(item2.mapName, Array.Empty<GUILayoutOption>()))
					{
						_selectedMapId = item2.id;
					}
				}
			}
			GUI.backgroundColor = new Color(0.1f, 0.1f, 0.1f);
			GUILayout.EndScrollView();
			GUILayout.EndVertical();
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			GUILayout.Label("MODE", _subHeaderStyle, Array.Empty<GUILayoutOption>());
			_scrollModes = GUILayout.BeginScrollView(_scrollModes, GUIStyle.op_Implicit("box"), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(120f) });
			if ((Object)(object)MonoBehaviourPublicGadealGaLi1pralObInUnique.Instance != (Object)null && MonoBehaviourPublicGadealGaLi1pralObInUnique.Instance.allGameModes != null)
			{
				foreach (GameModeData item3 in (Il2CppArrayBase<GameModeData>)(object)MonoBehaviourPublicGadealGaLi1pralObInUnique.Instance.allGameModes)
				{
					if (!((Object)(object)item3 == (Object)(object)MonoBehaviourPublicGadealGaLi1pralObInUnique.Instance.defaultMode) && !((Object)(object)item3 == (Object)(object)MonoBehaviourPublicGadealGaLi1pralObInUnique.Instance.practiceMode))
					{
						if (item3.id == _selectedModeId)
						{
							GUI.backgroundColor = Color.green;
						}
						else
						{
							GUI.backgroundColor = new Color(0.2f, 0.2f, 0.2f);
						}
						if (GUILayout.Button(item3.modeName, Array.Empty<GUILayoutOption>()))
						{
							_selectedModeId = item3.id;
						}
					}
				}
			}
			GUI.backgroundColor = new Color(0.1f, 0.1f, 0.1f);
			GUILayout.EndScrollView();
			GUILayout.EndVertical();
			GUILayout.EndHorizontal();
			bool flag2 = false;
			if ((Object)(object)MonoBehaviourPublicCSDi2UIInstObUIloDiUnique.Instance != (Object)null)
			{
				flag2 = !MonoBehaviourPublicCSDi2UIInstObUIloDiUnique.Instance.started;
			}
			GUI.backgroundColor = (Color)((_loadMapTimer > 0f) ? Color.yellow : new Color(0.5f, 1f, 0.5f));
			string text = "None";
			string text2 = "None";
			if ((Object)(object)MonoBehaviourPublicObInMamaLi1plMadeMaUnique.Instance != (Object)null)
			{
				Map val = ((IEnumerable<Map>)MonoBehaviourPublicObInMamaLi1plMadeMaUnique.Instance.maps).FirstOrDefault((Func<Map, bool>)((Map x) => x.id == _selectedMapId));
				if ((Object)(object)val != (Object)null)
				{
					text = val.mapName;
				}
			}
			if ((Object)(object)MonoBehaviourPublicGadealGaLi1pralObInUnique.Instance != (Object)null)
			{
				GameModeData val2 = ((IEnumerable<GameModeData>)MonoBehaviourPublicGadealGaLi1pralObInUnique.Instance.allGameModes).FirstOrDefault((Func<GameModeData, bool>)((GameModeData x) => x.id == _selectedModeId));
				if ((Object)(object)val2 != (Object)null)
				{
					text2 = val2.modeName;
				}
			}
			GUILayout.Label("Selected: <color=cyan>" + text2 + "</color> on <color=orange>" + text + "</color>", _subHeaderStyle, Array.Empty<GUILayoutOption>());
			string text3 = ((_loadMapTimer > 0f) ? "LOADING..." : (flag2 ? "LOAD (LOBBY)" : "LOAD (GAME)"));
			if (GUILayout.Button(text3, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }) && _selectedMapId != -1 && _selectedModeId != -1)
			{
				ForceStartLevel(_selectedMapId, _selectedModeId);
			}
			GUI.backgroundColor = new Color(0.1f, 0.1f, 0.1f);
			GUILayout.EndVertical();
			GUILayout.EndHorizontal();
			GUILayout.Space(10f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(300f) });
			GUILayout.Label("Mass Actions", _headerStyle, Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if (GUILayout.Button("Kill All", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
			{
				ActionKillAll();
			}
			if (GUILayout.Button("Explode All", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
			{
				ActionExplodeAll();
			}
			GUILayout.EndHorizontal();
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if (GUILayout.Button("Respawn All", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
			{
				ActionRespawnAll();
			}
			if (GUILayout.Button("Teleport All Here", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
			{
				ActionTeleportAllToMe();
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(5f);
			if (GUILayout.Button("Clear All Items (Drops)", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(25f) }))
			{
				ActionClearItems();
			}
			GUILayout.EndVertical();
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Give Items to ALL", _headerStyle, Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Sel: <b>" + _selectedItemName + "</b>", _subHeaderStyle, Array.Empty<GUILayoutOption>());
			if (GUILayout.Button(_showItemSelectorAll ? "Hide List" : "Select Item", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) }))
			{
				_showItemSelectorAll = !_showItemSelectorAll;
			}
			GUILayout.EndHorizontal();
			if (_showItemSelectorAll)
			{
				_scrollItems = GUILayout.BeginScrollView(_scrollItems, GUIStyle.op_Implicit("box"), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(150f) });
				foreach (KeyValuePair<int, string> cachedItem in _cachedItems)
				{
					if (GUILayout.Button(cachedItem.Value ?? "", Array.Empty<GUILayoutOption>()))
					{
						_selectedItemId = cachedItem.Key;
						_selectedItemName = cachedItem.Value;
						_showItemSelectorAll = false;
					}
				}
				GUILayout.EndScrollView();
			}
			if (_selectedItemId != -1 && IsAmmoWeapon(_selectedItemId))
			{
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.Label("Ammo (0-3):", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(80f) });
				_ammoInput = GUILayout.TextField(_ammoInput, Array.Empty<GUILayoutOption>());
				GUILayout.EndHorizontal();
			}
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUI.backgroundColor = new Color(0.5f, 1f, 0.5f);
			if (GUILayout.Button("GIVE TO ALL", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }) && _selectedItemId != -1)
			{
				int result2 = 30;
				if (IsAmmoWeapon(_selectedItemId))
				{
					int.TryParse(_ammoInput, out result2);
				}
				ActionGiveItemAll(_selectedItemId, result2);
			}
			GUI.backgroundColor = Color.cyan;
			if (GUILayout.Button("GIVE RANDOM", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
			{
				ActionGiveRandomToAll();
			}
			GUI.backgroundColor = new Color(0.1f, 0.1f, 0.1f);
			GUILayout.EndHorizontal();
			GUILayout.EndVertical();
			GUILayout.EndHorizontal();
			GUILayout.Space(15f);
			GUILayout.Label("Saved Scripts (Presets)", _headerStyle, Array.Empty<GUILayoutOption>());
			if (_bindingFile != null)
			{
				GUILayout.Label("<color=#44FFFF>BINDING: " + _bindingFile + "</color>", Array.Empty<GUILayoutOption>());
			}
			_scrollGamePresets = GUILayout.BeginScrollView(_scrollGamePresets, GUIStyle.op_Implicit("box"), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(120f) });
			if (_presetFiles != null)
			{
				foreach (string presetFile in _presetFiles)
				{
					string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(presetFile);
					GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
					if (GUILayout.Button(fileNameWithoutExtension, Array.Empty<GUILayoutOption>()))
					{
						RunScriptFromFile(presetFile);
					}
					string text4 = "";
					foreach (KeyValuePair<KeyCode, string> presetKeybind in Plugin.PresetKeybinds)
					{
						if (presetKeybind.Value == presetFile)
						{
							text4 = $"[{presetKeybind.Key}]";
						}
					}
					if (GUILayout.Button(string.IsNullOrEmpty(text4) ? "Bind" : text4, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(50f) }))
					{
						_bindingFile = presetFile;
					}
					if (GUILayout.Button("Unb", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(35f) }))
					{
						KeyCode val3 = (KeyCode)0;
						foreach (KeyValuePair<KeyCode, string> presetKeybind2 in Plugin.PresetKeybinds)
						{
							if (presetKeybind2.Value == presetFile)
							{
								val3 = presetKeybind2.Key;
							}
						}
						if ((int)val3 > 0)
						{
							Plugin.PresetKeybinds.Remove(val3);
						}
					}
					GUI.backgroundColor = Color.red;
					if (GUILayout.Button("X", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(25f) }))
					{
						File.Delete(presetFile);
						RefreshPresets();
					}
					GUI.backgroundColor = new Color(0.1f, 0.1f, 0.1f);
					GUILayout.EndHorizontal();
				}
			}
			GUILayout.EndScrollView();
			GUILayout.Space(5f);
			GUILayout.Label("Saved Folders", _headerStyle, Array.Empty<GUILayoutOption>());
			_scrollGameFolders = GUILayout.BeginScrollView(_scrollGameFolders, GUIStyle.op_Implicit("box"), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(120f) });
			if (_folderFiles != null)
			{
				foreach (string folderFile in _folderFiles)
				{
					string name = new DirectoryInfo(folderFile).Name;
					GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
					GUI.backgroundColor = Color.yellow;
					if (GUILayout.Button("Run All in " + name, Array.Empty<GUILayoutOption>()))
					{
						string[] files = Directory.GetFiles(folderFile, "*.txt");
						string[] array = files;
						foreach (string path in array)
						{
							RunScriptFromFile(path);
						}
					}
					GUI.backgroundColor = new Color(0.1f, 0.1f, 0.1f);
					string text5 = "";
					foreach (KeyValuePair<KeyCode, string> presetKeybind3 in Plugin.PresetKeybinds)
					{
						if (presetKeybind3.Value == folderFile)
						{
							text5 = $"[{presetKeybind3.Key}]";
						}
					}
					if (GUILayout.Button(string.IsNullOrEmpty(text5) ? "Bind" : text5, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(50f) }))
					{
						_bindingFile = folderFile;
					}
					if (GUILayout.Button("Unb", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(35f) }))
					{
						KeyCode val4 = (KeyCode)0;
						foreach (KeyValuePair<KeyCode, string> presetKeybind4 in Plugin.PresetKeybinds)
						{
							if (presetKeybind4.Value == folderFile)
							{
								val4 = presetKeybind4.Key;
							}
						}
						if ((int)val4 > 0)
						{
							Plugin.PresetKeybinds.Remove(val4);
						}
					}
					GUI.backgroundColor = Color.red;
					if (GUILayout.Button("X", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(25f) }))
					{
						if (Directory.Exists(folderFile))
						{
							Directory.Delete(folderFile, recursive: true);
						}
						RefreshPresets();
					}
					GUI.backgroundColor = new Color(0.1f, 0.1f, 0.1f);
					GUILayout.EndHorizontal();
				}
			}
			GUILayout.EndScrollView();
		}

		private void DrawSettingsTab()
		{
			GUILayout.Label("Settings", _headerStyle, Array.Empty<GUILayoutOption>());
			GUILayout.BeginVertical(GUIStyle.op_Implicit("box"), Array.Empty<GUILayoutOption>());
			GUILayout.Label("Protection", _subHeaderStyle, Array.Empty<GUILayoutOption>());
			Plugin.AntiSpamEnabled.Value = GUILayout.Toggle(Plugin.AntiSpamEnabled.Value, "Enable Anti-Spam", Array.Empty<GUILayoutOption>());
			Plugin.AutoBanEnabled.Value = GUILayout.Toggle(Plugin.AutoBanEnabled.Value, "Enable Auto-Ban", Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Warns:", Array.Empty<GUILayoutOption>());
			_cfgWarnsThreshold = GUILayout.TextField(_cfgWarnsThreshold, Array.Empty<GUILayoutOption>());
			GUILayout.EndHorizontal();
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("BanDays:", Array.Empty<GUILayoutOption>());
			_cfgAutoBanDays = GUILayout.TextField(_cfgAutoBanDays, Array.Empty<GUILayoutOption>());
			GUILayout.EndHorizontal();
			GUILayout.EndVertical();
			GUILayout.Space(10f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Chaos Punch:", Array.Empty<GUILayoutOption>());
			_chaosPunchInput = GUILayout.TextField(_chaosPunchInput, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(50f) });
			if (GUILayout.Button("Set", Array.Empty<GUILayoutOption>()) && float.TryParse(_chaosPunchInput, out var result))
			{
				Plugin.ChaosPunchPower = result;
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(10f);
			GUILayout.Label("Broadcast (No size):", Array.Empty<GUILayoutOption>());
			_chatMessageInput = GUILayout.TextField(_chatMessageInput, Array.Empty<GUILayoutOption>());
			if (GUILayout.Button("Send", Array.Empty<GUILayoutOption>()))
			{
				MonoBehaviourPublicInInUnique.SendChatMessage(1uL, _chatMessageInput);
			}
			GUILayout.Space(20f);
			if (GUILayout.Button("SAVE ALL SETTINGS", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(40f) }))
			{
				int.TryParse(_cfgWarnsThreshold, out var result2);
				Plugin.AutoBanWarnThreshold.Value = result2;
				int.TryParse(_cfgAutoBanDays, out var result3);
				Plugin.AutoBanDays.Value = result3;
				((BasePlugin)Plugin.Instance).Config.Save();
			}
		}

		private void DrawNametags()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: 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_00db: 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_00e2: 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_00fb: 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_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance == (Object)null || (Object)(object)Camera.main == (Object)null)
			{
				return;
			}
			List<ulong> activePlayerIds = GetActivePlayerIds();
			ulong steamID = MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance.field_Private_CSteamID_0.m_SteamID;
			foreach (ulong item in activePlayerIds)
			{
				if (item == steamID || !MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers.ContainsKey(item))
				{
					continue;
				}
				MonoBehaviourPublicCSstReshTrheObplBojuUnique val = MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers[item];
				if (!((Object)(object)val == (Object)null) && !val.dead)
				{
					Vector3 val2 = ((Component)val).transform.position + Vector3.up * 2.2f;
					Vector3 val3 = Camera.main.WorldToScreenPoint(val2);
					if (val3.z > 0f)
					{
						string friendPersonaName = SteamFriends.GetFriendPersonaName(new CSteamID(item));
						string text = friendPersonaName + "\n<color=#FF4444>[P]</color>";
						val3.y = (float)Screen.height - val3.y;
						GUI.Label(new Rect(val3.x - 75f, val3.y, 150f, 50f), text, _espStyle);
					}
				}
			}
		}

		private void DrawZones()
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: 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)
			//IL_0052: 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_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: 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)
			if ((Object)(object)Camera.main == (Object)null || Plugin.ActiveZones.Count == 0)
			{
				return;
			}
			foreach (Plugin.ZoneData activeZone in Plugin.ActiveZones)
			{
				Vector3 val = Camera.main.WorldToScreenPoint(activeZone.Pos);
				if (val.z > 0f)
				{
					string arg = "white";
					if (activeZone.Type == "KILL")
					{
						arg = "#FF4444";
					}
					if (activeZone.Type == "KICK")
					{
						arg = "#FFFF44";
					}
					if (activeZone.Type == "BOUNCY")
					{
						arg = "#44FFFF";
					}
					val.y = (float)Screen.height - val.y;
					GUI.Label(new Rect(val.x - 50f, val.y, 100f, 50f), $"<color={arg}>ZONE: {activeZone.Type}\n(R:{activeZone.Radius})</color>", _espStyle);
				}
			}
		}

		private void InitStyles()
		{
			//IL_000c: 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_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			//IL_003a: 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_0055: 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_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Expected O, but got Unknown
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: 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_00ae: Expected O, but got Unknown
			//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_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Expected O, but got Unknown
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: 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_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Expected O, but got Unknown
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Expected O, but got Unknown
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: 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_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Expected O, but got Unknown
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Expected O, but got Unknown
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01eb: Expected O, but got Unknown
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: Expected O, but got Unknown
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_0277: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: Expected O, but got Unknown
			//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02af: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cc: Expected O, but got Unknown
			//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0316: Unknown result type (might be due to invalid IL or missing references)
			//IL_0340: Unknown result type (might be due to invalid IL or missing references)
			//IL_036a: Unknown result type (might be due to invalid IL or missing references)
			_headerStyle = new GUIStyle(GUI.skin.label)
			{
				alignment = (TextAnchor)4,
				fontSize = 16,
				fontStyle = (FontStyle)1
			};
			_headerStyle.normal.textColor = Color.yellow;
			_subHeaderStyle = new GUIStyle(GUI.skin.label)
			{
				alignment = (TextAnchor)3,
				fontSize = 13,
				fontStyle = (FontStyle)1
			};
			_subHeaderStyle.normal.textColor = Color.cyan;
			_textAreaStyle = new GUIS