Decompiled source of BanList v1.0.5

BepInEx/plugins/BanList/BanList.dll

Decompiled 4 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using FishNet.Connection;
using FishNet.Object;
using FishNet.Serializing;
using FishNet.Transporting;
using HarmonyLib;
using Steamworks;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

[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.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace PlayerBanMod;

[BepInPlugin("com.playerban.mod", "Player Ban Mod", "1.0.5")]
[BepInProcess("MageArena.exe")]
public class PlayerBanMod : BaseUnityPlugin
{
	[CompilerGenerated]
	private sealed class <CreateUIOnce>d__40 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public PlayerBanMod <>4__this;

		private object <>s__1;

		private bool <>s__2;

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

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

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

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			int num = <>1__state;
			if (num == -3 || num == 1)
			{
				try
				{
				}
				finally
				{
					<>m__Finally1();
				}
			}
			<>s__1 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			try
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>s__1 = uiCreationLock;
					<>s__2 = false;
					try
					{
						Monitor.Enter(<>s__1, ref <>s__2);
						if (<>4__this.isUICreationInProgress || BanUIManager.IsUICreated())
						{
							ModLogger.LogInfo((object)"UI creation skipped - already in progress or already exists");
							return false;
						}
						<>4__this.isUICreationInProgress = true;
					}
					finally
					{
						if (<>s__2)
						{
							Monitor.Exit(<>s__1);
						}
					}
					<>s__1 = null;
					<>1__state = -3;
					ModLogger.LogInfo((object)"Creating UI for the first time...");
					<>2__current = BanUIManager.CreateUI();
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -3;
					ModLogger.LogInfo((object)"Initial UI creation completed");
					<>m__Finally1();
					return false;
				}
			}
			catch
			{
				//try-fault
				((IDisposable)this).Dispose();
				throw;
			}
		}

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

		private void <>m__Finally1()
		{
			<>1__state = -1;
			<>4__this.isUICreationInProgress = false;
		}

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

	[CompilerGenerated]
	private sealed class <EnsureUIExistsOnLobbyEntry>d__54 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public PlayerBanMod <>4__this;

		private object <>s__1;

		private bool <>s__2;

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

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

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

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			int num = <>1__state;
			if (num == -3 || (uint)(num - 1) <= 1u)
			{
				try
				{
				}
				finally
				{
					<>m__Finally1();
				}
			}
			<>s__1 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Expected O, but got Unknown
			try
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>s__1 = uiCreationLock;
					<>s__2 = false;
					try
					{
						Monitor.Enter(<>s__1, ref <>s__2);
						if (<>4__this.isUICreationInProgress)
						{
							ModLogger.LogInfo((object)"UI creation already in progress - skipping lobby entry UI creation");
							return false;
						}
						<>4__this.isUICreationInProgress = true;
					}
					finally
					{
						if (<>s__2)
						{
							Monitor.Exit(<>s__1);
						}
					}
					<>s__1 = null;
					<>1__state = -3;
					ModLogger.LogInfo((object)"Creating UI on lobby entry...");
					BanUIManager.CleanupExistingUI();
					<>2__current = (object)new WaitForSeconds(0.1f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -3;
					<>2__current = BanUIManager.CreateUI();
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -3;
					<>4__this.EnsureRecentPlayersButtonExists();
					ModLogger.LogInfo((object)"UI creation on lobby entry completed");
					<>m__Finally1();
					return false;
				}
			}
			catch
			{
				//try-fault
				((IDisposable)this).Dispose();
				throw;
			}
		}

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

		private void <>m__Finally1()
		{
			<>1__state = -1;
			<>4__this.isUICreationInProgress = false;
		}

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

	[CompilerGenerated]
	private sealed class <InitializeMod>d__39 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public PlayerBanMod <>4__this;

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

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

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

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = (object)new WaitForSeconds(2f);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				_ = KillLogger.Instance;
				<>2__current = <>4__this.CreateUIOnce();
				<>1__state = 2;
				return true;
			case 2:
				<>1__state = -1;
				((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.MonitorLobbyStatus());
				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();
		}
	}

	[CompilerGenerated]
	private sealed class <MonitorGameStateWithLobbyMonitor>d__57 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public PlayerBanMod <>4__this;

		private bool <wasGameActive>5__1;

		private bool <isGameActive>5__2;

		private Exception <ex>5__3;

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

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

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

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

		private bool MoveNext()
		{
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<wasGameActive>5__1 = false;
				break;
			case 1:
				<>1__state = -1;
				break;
			}
			if (<>4__this.isInLobby)
			{
				try
				{
					<isGameActive>5__2 = <>4__this.lobbyMonitor.IsGameActive();
					if (<isGameActive>5__2 != <wasGameActive>5__1)
					{
						if (<isGameActive>5__2)
						{
							KillLogger.Instance.StartGameLogging();
						}
						else if (<wasGameActive>5__1)
						{
							KillLogger.Instance.StopGameLogging();
						}
						<wasGameActive>5__1 = <isGameActive>5__2;
					}
				}
				catch (Exception ex)
				{
					<ex>5__3 = ex;
					ModLogger.LogError((object)("Error monitoring game state: " + <ex>5__3.Message));
				}
				<>2__current = (object)new WaitForSeconds(1f);
				<>1__state = 1;
				return true;
			}
			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();
		}
	}

	[CompilerGenerated]
	private sealed class <MonitorLobbyStatus>d__41 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public PlayerBanMod <>4__this;

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

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

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

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = <>4__this.lobbyMonitor.MonitorLoop(delegate
				{
					<>4__this.isInLobby = true;
					<>4__this.OnEnterLobby();
				}, delegate
				{
					<>4__this.isInLobby = false;
					<>4__this.OnLeaveLobby();
				}, delegate(bool hostNow)
				{
					<>4__this.isHost = hostNow;
					<>4__this.UpdateUIForHostStatus();
				}, delegate
				{
					<>4__this.playerManager.UpdatePlayerList();
					<>4__this.CheckForBannedPlayersInLobby();
				});
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				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();
		}
	}

	[CompilerGenerated]
	private sealed class <ScheduleKickRetry>d__63 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public string steamId;

		public string playerName;

		public bool isBannedPlayer;

		public PlayerBanMod <>4__this;

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

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

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

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			if (<>1__state != 0)
			{
				return false;
			}
			<>1__state = -1;
			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();
		}
	}

	private static ManualLogSource ModLogger;

	private Harmony harmony;

	private static PlayerBanMod instance;

	private IBanDataManager banDataManager;

	private ConfigEntry<string> bannedPlayersConfig;

	private ConfigEntry<bool> autobanModdedRanksConfig;

	private ConfigEntry<bool> autobanOffensiveNamesConfig;

	private ConfigEntry<bool> autobanFormattedNamesConfig;

	private ConfigEntry<string> offensiveNamesConfig;

	private ConfigEntry<KeyCode> uiToggleKeyConfig;

	public Dictionary<string, string> bannedPlayers = new Dictionary<string, string>();

	private Dictionary<string, DateTime> banTimestamps = new Dictionary<string, DateTime>();

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

	private bool isHost = false;

	private bool isInLobby = false;

	private ILobbyMonitor lobbyMonitor;

	private IPlayerManager playerManager;

	private IKickSystem kickSystem;

	private const float RECENTLY_KICKED_DURATION = 10f;

	private bool needsSave = false;

	private float lastSaveTime = 0f;

	private const float SAVE_INTERVAL = 5f;

	private const int MAX_VISIBLE_BANNED_ITEMS = 50;

	private int bannedPlayersPageIndex = 0;

	private string bannedPlayersSearchQuery = "";

	private const string FIELD_DELIMITER = "◊";

	private const string ENTRY_DELIMITER = "※";

	private bool isUICreationInProgress = false;

	private static readonly object uiCreationLock = new object();

	private IAutoBanSystem autoBanSystem;

	public static PlayerBanMod Instance => instance;

	public bool IsPlayerHost(string steamId)
	{
		return playerManager.IsPlayerHost(steamId);
	}

	public bool IsCurrentHost()
	{
		return isHost;
	}

	public bool IsInCurrentLobby()
	{
		return isInLobby;
	}

	public bool IsBanned(string steamId)
	{
		return bannedPlayers.ContainsKey(steamId);
	}

	public void KickBannedNow(string steamId, string name)
	{
		KickPlayerWithRetry(steamId, name, isBannedPlayer: true);
	}

	public static void LogInfoStatic(string message)
	{
		ManualLogSource modLogger = ModLogger;
		if (modLogger != null)
		{
			modLogger.LogInfo((object)message);
		}
	}

	public static void LogErrorStatic(string message)
	{
		ManualLogSource modLogger = ModLogger;
		if (modLogger != null)
		{
			modLogger.LogError((object)message);
		}
	}

	private void Awake()
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Expected O, but got Unknown
		ModLogger = Logger.CreateLogSource("PlayerBanMod");
		harmony = new Harmony("com.playerban.mod");
		instance = this;
		bannedPlayersConfig = ((BaseUnityPlugin)this).Config.Bind<string>("BannedPlayers", "BannedSteamIds", "", "Comma-separated list of banned Steam IDs");
		autobanModdedRanksConfig = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "AutobanModdedRanks", false, "Automatically ban players with modded ranks");
		autobanOffensiveNamesConfig = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "AutobanOffensiveNames", false, "Automatically ban players with offensive names");
		autobanFormattedNamesConfig = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "AutobanFormattedNames", false, "Automatically ban players with formatted/rich-text names (e.g., <color>, <b>)");
		offensiveNamesConfig = ((BaseUnityPlugin)this).Config.Bind<string>("Settings", "OffensiveNames", "discord.gg,cheat", "Comma-separated list of offensive names to ban");
		uiToggleKeyConfig = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Settings", "UIToggleKey", (KeyCode)283, "Key to toggle the Player Management UI");
		if (string.IsNullOrEmpty(offensiveNamesConfig.Value))
		{
			offensiveNamesConfig.Value = "discord.gg,cheat";
		}
		banDataManager = new BanDataManager(bannedPlayers, banTimestamps, banReasons, bannedPlayersConfig, ModLogger, (string steamId) => IsPlayerHost(steamId), () => isHost, () => isInLobby, delegate(string id, string name, bool isBanned)
		{
			KickPlayerWithRetry(id, name, isBanned);
		}, delegate
		{
			needsSave = true;
		}, delegate
		{
			if (BanUIManager.IsActive)
			{
				BanUIManager.RefreshActivePlayers();
			}
		}, delegate
		{
			if (BanUIManager.IsActive)
			{
				BanUIManager.RefreshBannedPlayers();
			}
		}, delegate(string id)
		{
			kickSystem?.ClearKickTracking(id);
		}, delegate(string id)
		{
			playerManager?.RemoveRecentlyKicked(id);
		});
		playerManager = new PlayerManager(ModLogger);
		lobbyMonitor = new LobbyMonitor(ModLogger);
		kickSystem = new KickSystem(ModLogger, (MonoBehaviour)(object)this, () => IsGameActive(), () => isHost, () => isInLobby, playerManager);
		Softlock.Initialize(ModLogger, (MonoBehaviour)(object)this);
		autoBanSystem = new AutoBanSystem(ModLogger, () => IsInLobbyScreen(), () => IsGameActive(), autobanModdedRanksConfig, autobanOffensiveNamesConfig, autobanFormattedNamesConfig, offensiveNamesConfig, banDataManager, playerManager);
		RecentPlayersManager.Initialize(ModLogger);
		RecentPlayersManager.SetBanFunctions(() => bannedPlayers, delegate(string steamId, string playerName)
		{
			ToggleBanPlayer(steamId, playerName);
		});
		BanUIManager.Initialize(ModLogger, autobanModdedRanksConfig, autobanOffensiveNamesConfig, autobanFormattedNamesConfig, () => playerManager.GetConnectedPlayers(), () => bannedPlayers, () => banTimestamps, () => banReasons, delegate(string steamId, string playerName)
		{
			KickPlayer(steamId, playerName);
		}, delegate(string steamId, string playerName)
		{
			ToggleBanPlayer(steamId, playerName);
		}, delegate(string steamId, string playerName)
		{
			UnbanPlayer(steamId, playerName);
		}, delegate(string steamId, string playerName, string reason)
		{
			BanPlayer(steamId, playerName, reason);
		});
		((MonoBehaviour)this).StartCoroutine(banDataManager.LoadBansAsync());
		harmony.PatchAll();
		ModLogger.LogInfo((object)"Player Ban Mod loaded!");
		((MonoBehaviour)this).StartCoroutine(InitializeMod());
	}

	[IteratorStateMachine(typeof(<InitializeMod>d__39))]
	private IEnumerator InitializeMod()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <InitializeMod>d__39(0)
		{
			<>4__this = this
		};
	}

	[IteratorStateMachine(typeof(<CreateUIOnce>d__40))]
	private IEnumerator CreateUIOnce()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <CreateUIOnce>d__40(0)
		{
			<>4__this = this
		};
	}

	[IteratorStateMachine(typeof(<MonitorLobbyStatus>d__41))]
	private IEnumerator MonitorLobbyStatus()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <MonitorLobbyStatus>d__41(0)
		{
			<>4__this = this
		};
	}

	private void CheckForBannedPlayersInLobby()
	{
		if (!isHost || !isInLobby)
		{
			return;
		}
		try
		{
			MainMenuManager val = Object.FindFirstObjectByType<MainMenuManager>();
			if (!((Object)(object)val != (Object)null) || !((Object)(object)val.kickplayershold != (Object)null))
			{
				return;
			}
			foreach (KeyValuePair<string, string> item in val.kickplayershold.nametosteamid)
			{
				string key = item.Key;
				string value = item.Value;
				if (value == playerManager.LocalSteamId || IsPlayerHost(value))
				{
					continue;
				}
				lobbyMonitor.CheckBannedOrAutoBanPlayer(value, key, (string id) => bannedPlayers.ContainsKey(id), delegate(string id, string name)
				{
					KickPlayerWithRetry(id, name, isBannedPlayer: true);
				}, delegate(string id, string name)
				{
					autoBanSystem.ProcessPlayer(id, name, delegate(string bid, string bname)
					{
						BanPlayer(bid, bname, "Automatic");
					});
				});
			}
		}
		catch (Exception ex)
		{
			ModLogger.LogError((object)("Error checking for banned players: " + ex.Message));
		}
	}

	private bool HasModdedRank(string steamId, string playerName)
	{
		return false;
	}

	private bool HasOffensiveName(string playerName)
	{
		return false;
	}

	private bool IsInLobbyScreen()
	{
		return lobbyMonitor != null && lobbyMonitor.IsInLobbyScreen();
	}

	private bool IsGameActive()
	{
		return lobbyMonitor != null && lobbyMonitor.IsGameActive();
	}

	private void BanPlayer(string steamId, string playerName, string reason)
	{
		banDataManager.BanPlayer(steamId, playerName, reason);
		RecentPlayersManager.OnBanStatusChanged();
	}

	private void Update()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		if (Input.GetKeyDown(uiToggleKeyConfig.Value))
		{
			if (isHost && isInLobby)
			{
				bool flag = !BanUIManager.IsActive;
				BanUIManager.SetActive(flag);
				RecentPlayersManager.SetButtonVisible(flag);
				if (IsGameActive())
				{
					if (flag)
					{
						Cursor.lockState = (CursorLockMode)2;
						Cursor.visible = true;
					}
					else
					{
						Cursor.lockState = (CursorLockMode)1;
						Cursor.visible = false;
					}
				}
				if (flag)
				{
					BanUIManager.RefreshActivePlayers();
					BanUIManager.RefreshBannedPlayers();
				}
				string text = (IsGameActive() ? "in-game" : "in-lobby");
			}
			else if (BanUIManager.IsActive)
			{
				BanUIManager.SetActive(visible: false);
				RecentPlayersManager.SetButtonVisible(visible: false);
				if (IsGameActive())
				{
					Cursor.lockState = (CursorLockMode)1;
					Cursor.visible = false;
				}
			}
		}
		if (needsSave && Time.time - lastSaveTime > 5f)
		{
			banDataManager.SaveBans();
			needsSave = false;
			lastSaveTime = Time.time;
		}
		if (isHost && isInLobby && Time.frameCount % 1800 == 0)
		{
			CheckUIHealthConservative();
		}
		try
		{
			MainMenuManager val = Object.FindFirstObjectByType<MainMenuManager>();
			Dictionary<string, string> dict;
			if ((Object)(object)val != (Object)null && val.GameHasStarted && isHost && (Object)(object)val.kickplayershold != (Object)null)
			{
				dict = new Dictionary<string, string>(val.kickplayershold.nametosteamid);
				RecentPlayersManager.CaptureRecentPlayers(dict, GetTeamForSteam);
			}
			string GetTeamForSteam(string steamId)
			{
				PlayerMovement[] array = Object.FindObjectsByType<PlayerMovement>((FindObjectsSortMode)0);
				PlayerMovement[] array2 = array;
				foreach (PlayerMovement val2 in array2)
				{
					if (!string.IsNullOrEmpty(val2.playername) && dict.TryGetValue(val2.playername, out var value) && value == steamId)
					{
						try
						{
							FieldInfo field = typeof(PlayerMovement).GetField("playerTeam", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
							if (field != null)
							{
								return (int)field.GetValue(val2) switch
								{
									2 => "warlock", 
									0 => "sorcerer", 
									_ => "unknown", 
								};
							}
						}
						catch
						{
						}
						return "unknown";
					}
				}
				return "unknown";
			}
		}
		catch (Exception ex)
		{
			ModLogger.LogError((object)("Error capturing recent players: " + ex.Message));
		}
	}

	private bool CheckIfInLobby()
	{
		return lobbyMonitor != null && lobbyMonitor.IsInLobby;
	}

	private bool CheckIfHost()
	{
		return lobbyMonitor != null && lobbyMonitor.IsHost;
	}

	private void CheckUIHealthConservative()
	{
		try
		{
			if (!BanUIManager.IsUICreated())
			{
				ModLogger.LogWarning((object)"Conservative UI health check: UI not created - will recreate on next lobby entry");
			}
			else if (!BanUIManager.IsUIHealthy())
			{
				ModLogger.LogWarning((object)"Conservative UI health check: UI components missing - will recreate on next lobby entry");
				BanUIManager.DestroyUI();
			}
		}
		catch (Exception ex)
		{
			ModLogger.LogError((object)("Error during conservative UI health check: " + ex.Message));
		}
	}

	private void OnEnterLobby()
	{
		ModLogger.LogInfo((object)"Entered lobby");
		if (!BanUIManager.IsUICreated())
		{
			ModLogger.LogInfo((object)"UI not found on lobby entry - creating UI");
			((MonoBehaviour)this).StartCoroutine(EnsureUIExistsOnLobbyEntry());
		}
		else
		{
			ModLogger.LogInfo((object)"UI already exists on lobby entry - skipping recreation");
			EnsureRecentPlayersButtonExists();
		}
		UpdateUIForHostStatus();
		playerManager.UpdatePlayerList();
		((MonoBehaviour)this).StartCoroutine(MonitorGameStateWithLobbyMonitor());
	}

	[IteratorStateMachine(typeof(<EnsureUIExistsOnLobbyEntry>d__54))]
	private IEnumerator EnsureUIExistsOnLobbyEntry()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <EnsureUIExistsOnLobbyEntry>d__54(0)
		{
			<>4__this = this
		};
	}

	private void EnsureRecentPlayersButtonExists()
	{
		try
		{
			Canvas val = Object.FindFirstObjectByType<Canvas>();
			if ((Object)(object)val != (Object)null)
			{
				RecentPlayersManager.EnsureRecentPlayersButton(val);
				RecentPlayersManager.SetButtonVisible(BanUIManager.IsActive);
			}
		}
		catch (Exception ex)
		{
			ModLogger.LogError((object)("Error ensuring Recent Players button: " + ex.Message));
		}
	}

	private void OnLeaveLobby()
	{
		ModLogger.LogInfo((object)"Left lobby - clearing player data and UI");
		KillLogger.Instance.StopGameLogging();
		playerManager.ClearOnLeaveLobby();
		RecentPlayersManager.OnLeaveLobby();
		BanUIManager.SetActive(visible: false);
		RecentPlayersManager.SetButtonVisible(visible: false);
	}

	[IteratorStateMachine(typeof(<MonitorGameStateWithLobbyMonitor>d__57))]
	private IEnumerator MonitorGameStateWithLobbyMonitor()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <MonitorGameStateWithLobbyMonitor>d__57(0)
		{
			<>4__this = this
		};
	}

	private void UpdateUIForHostStatus()
	{
	}

	private void UpdatePlayerList()
	{
	}

	private void AddFakePlayersForTesting()
	{
	}

	private void ClearFakePlayersForTesting()
	{
	}

	private void KickPlayerWithRetry(string steamId, string playerName, bool isBannedPlayer = false)
	{
		kickSystem.KickPlayerWithRetry(steamId, playerName, isBannedPlayer);
	}

	[IteratorStateMachine(typeof(<ScheduleKickRetry>d__63))]
	private IEnumerator ScheduleKickRetry(string steamId, string playerName, bool isBannedPlayer = false)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <ScheduleKickRetry>d__63(0)
		{
			<>4__this = this,
			steamId = steamId,
			playerName = playerName,
			isBannedPlayer = isBannedPlayer
		};
	}

	private void KickPlayer(string steamId, string playerName)
	{
		KickPlayerWithRetry(steamId, playerName);
	}

	private void ToggleBanPlayer(string steamId, string playerName)
	{
		banDataManager.ToggleBanPlayer(steamId, playerName);
		RecentPlayersManager.OnBanStatusChanged();
	}

	private void UnbanPlayer(string steamId, string playerName)
	{
		banDataManager.UnbanPlayer(steamId);
		RecentPlayersManager.OnBanStatusChanged();
	}

	private void CheckBannedPlayer(string steamId, string playerName)
	{
		if (IsPlayerHost(steamId))
		{
			return;
		}
		lobbyMonitor.CheckBannedOrAutoBanPlayer(steamId, playerName, (string id) => bannedPlayers.ContainsKey(id), delegate(string id, string name)
		{
			KickPlayerWithRetry(id, name, isBannedPlayer: true);
		}, delegate(string id, string name)
		{
			autoBanSystem.ProcessPlayer(id, name, delegate(string bid, string bname)
			{
				BanPlayer(bid, bname, "Automatic");
			});
		});
	}

	private void OnDestroy()
	{
		try
		{
			if (needsSave)
			{
				banDataManager.SaveBans();
				needsSave = false;
			}
		}
		catch
		{
		}
		if (harmony != null)
		{
			harmony.UnpatchSelf();
		}
	}

	private IEnumerator LoadBannedPlayersAsync()
	{
		return banDataManager.LoadBansAsync();
	}

	private void ProcessBanEntry(string entry)
	{
	}
}
public interface IBanDataManager
{
	bool IsBanned(string steamId);

	void BanPlayer(string steamId, string playerName, string reason);

	void ToggleBanPlayer(string steamId, string playerName);

	void UnbanPlayer(string steamId);

	Dictionary<string, string> GetBannedPlayers();

	void SaveBans();

	IEnumerator LoadBansAsync();

	void LoadBans();
}
public sealed class BanDataManager : IBanDataManager
{
	[Serializable]
	private class BanRecord
	{
		public string Name;

		public string SteamID;

		public string Date;

		public string Reason;
	}

	[CompilerGenerated]
	private sealed class <LoadBansAsync>d__27 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public BanDataManager <>4__this;

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

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

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

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			if (<>1__state != 0)
			{
				return false;
			}
			<>1__state = -1;
			<>4__this.MigrateLegacyConfigIfNeeded();
			<>4__this.LoadFromFile();
			<>4__this.logger.LogInfo((object)$"Loaded {<>4__this.bannedPlayers.Count} banned players from file asynchronously");
			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();
		}
	}

	private readonly Dictionary<string, string> bannedPlayers;

	private readonly Dictionary<string, DateTime> banTimestamps;

	private readonly Dictionary<string, string> banReasons;

	private readonly ConfigEntry<string> bannedPlayersConfig;

	private readonly ManualLogSource logger;

	private readonly Func<string, bool> isPlayerHost;

	private readonly Func<bool> isHost;

	private readonly Func<bool> isInLobby;

	private readonly Action<string, string, bool> kickWithRetry;

	private readonly Action markNeedsSave;

	private readonly Action refreshActivePlayers;

	private readonly Action refreshBannedPlayers;

	private readonly Action<string> clearKickTracking;

	private readonly Action<string> removeRecentlyKicked;

	private const string FIELD_DELIMITER = "◊";

	private const string ENTRY_DELIMITER = "※";

	private readonly string bansFilePath;

	public BanDataManager(Dictionary<string, string> bannedPlayers, Dictionary<string, DateTime> banTimestamps, Dictionary<string, string> banReasons, ConfigEntry<string> bannedPlayersConfig, ManualLogSource logger, Func<string, bool> isPlayerHost = null, Func<bool> isHost = null, Func<bool> isInLobby = null, Action<string, string, bool> kickWithRetry = null, Action markNeedsSave = null, Action refreshActivePlayers = null, Action refreshBannedPlayers = null, Action<string> clearKickTracking = null, Action<string> removeRecentlyKicked = null)
	{
		this.bannedPlayers = bannedPlayers ?? throw new ArgumentNullException("bannedPlayers");
		this.banTimestamps = banTimestamps ?? throw new ArgumentNullException("banTimestamps");
		this.banReasons = banReasons ?? throw new ArgumentNullException("banReasons");
		this.bannedPlayersConfig = bannedPlayersConfig ?? throw new ArgumentNullException("bannedPlayersConfig");
		this.logger = logger ?? throw new ArgumentNullException("logger");
		this.isPlayerHost = isPlayerHost;
		this.isHost = isHost;
		this.isInLobby = isInLobby;
		this.kickWithRetry = kickWithRetry;
		this.markNeedsSave = markNeedsSave;
		this.refreshActivePlayers = refreshActivePlayers;
		this.refreshBannedPlayers = refreshBannedPlayers;
		this.clearKickTracking = clearKickTracking;
		this.removeRecentlyKicked = removeRecentlyKicked;
		try
		{
			string text = Path.Combine(Paths.PluginPath, "BanList", "Bans");
			if (!Directory.Exists(text))
			{
				Directory.CreateDirectory(text);
			}
			bansFilePath = Path.Combine(text, "banned_players.jsonl");
		}
		catch
		{
			bansFilePath = "banned_players.jsonl";
		}
	}

	public bool IsBanned(string steamId)
	{
		if (string.IsNullOrWhiteSpace(steamId))
		{
			return false;
		}
		return bannedPlayers.ContainsKey(steamId);
	}

	public void BanPlayer(string steamId, string playerName, string reason)
	{
		try
		{
			if (string.IsNullOrWhiteSpace(steamId))
			{
				return;
			}
			if (isPlayerHost != null && isPlayerHost(steamId))
			{
				logger.LogWarning((object)("Cannot ban host player " + playerName + " (Steam ID: " + steamId + ") - host is immune to bans"));
			}
			else if (!bannedPlayers.ContainsKey(steamId))
			{
				string text = SanitizePlayerNameForStorage(playerName);
				bannedPlayers[steamId] = text;
				banTimestamps[steamId] = DateTime.Now;
				banReasons[steamId] = (string.IsNullOrEmpty(reason) ? "Manual" : reason);
				logger.LogInfo((object)$"Banned player: {playerName} (stored as: {text}) (Steam ID: {steamId}) at {DateTime.Now} - Reason: {banReasons[steamId]}");
				if (isHost != null && isInLobby != null && isHost() && isInLobby() && kickWithRetry != null)
				{
					logger.LogInfo((object)("Immediately kicking newly banned player: " + playerName));
					kickWithRetry(steamId, playerName, arg3: true);
				}
				markNeedsSave?.Invoke();
				refreshActivePlayers?.Invoke();
				refreshBannedPlayers?.Invoke();
			}
		}
		catch (Exception ex)
		{
			logger.LogError((object)("Error banning player: " + ex.Message));
		}
	}

	public void UnbanPlayer(string steamId)
	{
		try
		{
			if (!string.IsNullOrWhiteSpace(steamId))
			{
				string text = (bannedPlayers.ContainsKey(steamId) ? bannedPlayers[steamId] : steamId);
				bannedPlayers.Remove(steamId);
				banTimestamps.Remove(steamId);
				banReasons.Remove(steamId);
				logger.LogInfo((object)("Unbanned player: " + text + " (Steam ID: " + steamId + ")"));
				clearKickTracking?.Invoke(steamId);
				removeRecentlyKicked?.Invoke(steamId);
				markNeedsSave?.Invoke();
				refreshActivePlayers?.Invoke();
				refreshBannedPlayers?.Invoke();
			}
		}
		catch (Exception ex)
		{
			logger.LogError((object)("Error unbanning player: " + ex.Message));
		}
	}

	public void ToggleBanPlayer(string steamId, string playerName)
	{
		try
		{
			if (isPlayerHost != null && isPlayerHost(steamId))
			{
				logger.LogWarning((object)("Cannot ban host player " + playerName + " (Steam ID: " + steamId + ") - host is immune to bans"));
			}
			else if (bannedPlayers.ContainsKey(steamId))
			{
				UnbanPlayer(steamId);
			}
			else
			{
				BanPlayer(steamId, playerName, "Manual");
			}
		}
		catch (Exception ex)
		{
			logger.LogError((object)("Error toggling ban for player: " + ex.Message));
		}
	}

	public Dictionary<string, string> GetBannedPlayers()
	{
		return bannedPlayers;
	}

	public void SaveBans()
	{
		try
		{
			using (FileStream stream = new FileStream(bansFilePath, FileMode.Create, FileAccess.Write, FileShare.Read))
			{
				using StreamWriter streamWriter = new StreamWriter(stream, Encoding.UTF8);
				foreach (KeyValuePair<string, string> bannedPlayer in bannedPlayers)
				{
					string key = bannedPlayer.Key;
					string name = bannedPlayer.Value ?? string.Empty;
					string date = (banTimestamps.ContainsKey(key) ? banTimestamps[key].ToString("yyyy-MM-dd HH:mm:ss") : DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
					string reason = (banReasons.ContainsKey(key) ? banReasons[key] : "Manual");
					BanRecord banRecord = new BanRecord
					{
						Name = name,
						SteamID = key,
						Date = date,
						Reason = reason
					};
					string value = JsonUtility.ToJson((object)banRecord);
					streamWriter.WriteLine(value);
				}
			}
			logger.LogInfo((object)$"Saved {bannedPlayers.Count} banned players to JSONL: {bansFilePath}");
		}
		catch (Exception ex)
		{
			logger.LogError((object)("Error saving banned players: " + ex.Message));
		}
	}

	private string SanitizePlayerNameForStorage(string name)
	{
		if (string.IsNullOrEmpty(name))
		{
			return string.Empty;
		}
		if (name.Contains("◊") || name.Contains("※"))
		{
			return "Player";
		}
		return name;
	}

	public void LoadBans()
	{
		bannedPlayers.Clear();
		banTimestamps.Clear();
		banReasons.Clear();
		MigrateLegacyConfigIfNeeded();
		LoadFromFile();
		logger.LogInfo((object)$"Loaded {bannedPlayers.Count} banned players from file");
	}

	[IteratorStateMachine(typeof(<LoadBansAsync>d__27))]
	public IEnumerator LoadBansAsync()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <LoadBansAsync>d__27(0)
		{
			<>4__this = this
		};
	}

	private void ProcessBanEntry(string entry)
	{
		if (entry.Contains("◊"))
		{
			string[] array = entry.Split(new string[1] { "◊" }, StringSplitOptions.None);
			if (array.Length < 2)
			{
				return;
			}
			string key = array[0].Trim();
			string value = array[1].Trim();
			bannedPlayers[key] = value;
			if (array.Length >= 3)
			{
				if (DateTime.TryParse(array[2].Trim(), out var result))
				{
					banTimestamps[key] = result;
				}
				else
				{
					banTimestamps[key] = DateTime.Now;
				}
			}
			else
			{
				banTimestamps[key] = DateTime.Now;
			}
			if (array.Length >= 4)
			{
				banReasons[key] = array[3].Trim();
			}
			else
			{
				banReasons[key] = "Manual";
			}
			return;
		}
		string[] array2 = entry.Split(new char[1] { ':' }, 4);
		if (array2.Length < 2)
		{
			return;
		}
		string key2 = array2[0].Trim();
		string value2 = array2[1].Trim();
		bannedPlayers[key2] = value2;
		if (array2.Length >= 3)
		{
			string text = array2[2].Trim();
			DateTime result3;
			if (array2.Length >= 4)
			{
				if (DateTime.TryParse(text, out var result2))
				{
					banTimestamps[key2] = result2;
				}
				else
				{
					banTimestamps[key2] = DateTime.Now;
				}
				banReasons[key2] = array2[3].Trim();
			}
			else if (DateTime.TryParse(text, out result3))
			{
				banTimestamps[key2] = result3;
				banReasons[key2] = "Manual";
			}
			else
			{
				banTimestamps[key2] = DateTime.Now;
				banReasons[key2] = text;
			}
		}
		else
		{
			banTimestamps[key2] = DateTime.Now;
			banReasons[key2] = "Manual";
		}
	}

	private void LoadOldFormat(string bannedData)
	{
		string[] array = bannedData.Split(new char[1] { '|' });
		string[] array2 = array;
		foreach (string text in array2)
		{
			if (string.IsNullOrEmpty(text))
			{
				continue;
			}
			string[] array3 = text.Split(new char[1] { ':' }, 4);
			if (array3.Length < 2)
			{
				continue;
			}
			string key = array3[0].Trim();
			string value = array3[1].Trim();
			bannedPlayers[key] = value;
			if (array3.Length >= 3)
			{
				string text2 = array3[2].Trim();
				DateTime result2;
				if (array3.Length >= 4)
				{
					if (DateTime.TryParse(text2, out var result))
					{
						banTimestamps[key] = result;
					}
					else
					{
						banTimestamps[key] = DateTime.Now;
					}
					banReasons[key] = array3[3].Trim();
				}
				else if (DateTime.TryParse(text2, out result2))
				{
					banTimestamps[key] = result2;
					banReasons[key] = "Manual";
				}
				else
				{
					banTimestamps[key] = DateTime.Now;
					banReasons[key] = text2;
				}
			}
			else
			{
				banTimestamps[key] = DateTime.Now;
				banReasons[key] = "Manual";
			}
		}
	}

	private void LoadNewFormat(string bannedData)
	{
		string[] array = bannedData.Split(new string[1] { "※" }, StringSplitOptions.RemoveEmptyEntries);
		string[] array2 = array;
		foreach (string text in array2)
		{
			if (string.IsNullOrEmpty(text))
			{
				continue;
			}
			string[] array3 = text.Split(new string[1] { "◊" }, StringSplitOptions.None);
			if (array3.Length < 2)
			{
				continue;
			}
			string key = array3[0].Trim();
			string value = array3[1].Trim();
			bannedPlayers[key] = value;
			if (array3.Length >= 3)
			{
				if (DateTime.TryParse(array3[2].Trim(), out var result))
				{
					banTimestamps[key] = result;
				}
				else
				{
					banTimestamps[key] = DateTime.Now;
				}
			}
			else
			{
				banTimestamps[key] = DateTime.Now;
			}
			if (array3.Length >= 4)
			{
				banReasons[key] = array3[3].Trim();
			}
			else
			{
				banReasons[key] = "Manual";
			}
		}
	}

	private void LoadFromFile()
	{
		try
		{
			string directoryName = Path.GetDirectoryName(bansFilePath);
			if (!string.IsNullOrEmpty(directoryName) && !Directory.Exists(directoryName))
			{
				Directory.CreateDirectory(directoryName);
				logger.LogInfo((object)("Created bans directory: " + directoryName));
			}
			if (!File.Exists(bansFilePath))
			{
				using (File.Create(bansFilePath))
				{
				}
				logger.LogInfo((object)("Created bans file: " + bansFilePath));
				return;
			}
			string[] array = File.ReadAllLines(bansFilePath);
			string[] array2 = array;
			foreach (string text in array2)
			{
				if (string.IsNullOrWhiteSpace(text))
				{
					continue;
				}
				try
				{
					BanRecord banRecord = JsonUtility.FromJson<BanRecord>(text);
					if (banRecord == null || string.IsNullOrEmpty(banRecord.SteamID))
					{
						continue;
					}
					bannedPlayers[banRecord.SteamID] = banRecord.Name ?? string.Empty;
					if (!string.IsNullOrEmpty(banRecord.Date))
					{
						if (DateTime.TryParse(banRecord.Date, out var result))
						{
							banTimestamps[banRecord.SteamID] = result;
						}
						else
						{
							banTimestamps[banRecord.SteamID] = DateTime.Now;
						}
					}
					else
					{
						banTimestamps[banRecord.SteamID] = DateTime.Now;
					}
					banReasons[banRecord.SteamID] = (string.IsNullOrEmpty(banRecord.Reason) ? "Manual" : banRecord.Reason);
				}
				catch (Exception ex)
				{
					logger.LogWarning((object)("Failed to parse ban record line: " + ex.Message));
				}
			}
		}
		catch (Exception ex2)
		{
			logger.LogError((object)("Error loading bans file: " + ex2.Message));
		}
	}

	private void MigrateLegacyConfigIfNeeded()
	{
		try
		{
			string value = bannedPlayersConfig.Value;
			if (!string.IsNullOrEmpty(value))
			{
				bannedPlayers.Clear();
				banTimestamps.Clear();
				banReasons.Clear();
				if (value.Contains("|") && !value.Contains("※"))
				{
					logger.LogInfo((object)"[Migration] Loading banned players from old format...");
					LoadOldFormat(value);
				}
				else
				{
					logger.LogInfo((object)"[Migration] Loading banned players from legacy config...");
					LoadNewFormat(value);
				}
				string directoryName = Path.GetDirectoryName(bansFilePath);
				if (!string.IsNullOrEmpty(directoryName) && !Directory.Exists(directoryName))
				{
					Directory.CreateDirectory(directoryName);
					logger.LogInfo((object)("Created bans directory for migration: " + directoryName));
				}
				SaveBans();
				bannedPlayersConfig.Value = string.Empty;
				logger.LogInfo((object)"[Migration] Migration complete. Cleared legacy config storage.");
			}
		}
		catch (Exception ex)
		{
			logger.LogError((object)("[Migration] Error migrating legacy config: " + ex.Message));
		}
	}
}
public static class BanUIManager
{
	[Serializable]
	[CompilerGenerated]
	private sealed class <>c
	{
		public static readonly <>c <>9 = new <>c();

		public static UnityAction <>9__41_0;

		public static UnityAction<string> <>9__65_0;

		public static Action <>9__67_0;

		public static Action <>9__67_1;

		public static Func<GameObject, bool> <>9__74_0;

		internal void <CreateUI>b__41_0()
		{
			banUI.SetActive(false);
		}

		internal void <CreateNavigationControlsWithSearch>b__65_0(string value)
		{
			bannedSearchQuery = value ?? string.Empty;
			bannedPlayersPageIndex = 0;
			Dictionary<string, string> banned = getBannedPlayers();
			Dictionary<string, DateTime> timestamps = getBanTimestamps();
			Dictionary<string, string> reasons = getBanReasons();
			RepopulateBannedList(banned, timestamps, reasons);
			GameObject bannedPlayersTab = BanUIManager.bannedPlayersTab;
			ScrollRect val = ((bannedPlayersTab != null) ? bannedPlayersTab.GetComponent<ScrollRect>() : null);
			if ((Object)(object)val != (Object)null)
			{
				val.verticalNormalizedPosition = 1f;
			}
		}

		internal void <UpdateNavigationButtons>b__67_0()
		{
			bannedPlayersPageIndex--;
			Dictionary<string, string> banned = getBannedPlayers();
			Dictionary<string, DateTime> timestamps = getBanTimestamps();
			Dictionary<string, string> reasons = getBanReasons();
			RepopulateBannedList(banned, timestamps, reasons);
			GameObject bannedPlayersTab = BanUIManager.bannedPlayersTab;
			ScrollRect val = ((bannedPlayersTab != null) ? bannedPlayersTab.GetComponent<ScrollRect>() : null);
			if ((Object)(object)val != (Object)null)
			{
				val.verticalNormalizedPosition = 1f;
			}
		}

		internal void <UpdateNavigationButtons>b__67_1()
		{
			bannedPlayersPageIndex++;
			Dictionary<string, string> banned = getBannedPlayers();
			Dictionary<string, DateTime> timestamps = getBanTimestamps();
			Dictionary<string, string> reasons = getBanReasons();
			RepopulateBannedList(banned, timestamps, reasons);
			GameObject bannedPlayersTab = BanUIManager.bannedPlayersTab;
			ScrollRect val = ((bannedPlayersTab != null) ? bannedPlayersTab.GetComponent<ScrollRect>() : null);
			if ((Object)(object)val != (Object)null)
			{
				val.verticalNormalizedPosition = 1f;
			}
		}

		internal bool <CleanupExistingUI>b__74_0(GameObject obj)
		{
			return ((Object)obj).name == "BanModCanvas";
		}
	}

	[CompilerGenerated]
	private sealed class <>c__DisplayClass41_0
	{
		public Image autoModToggleImage;

		public Color toggleOnColor;

		public Color toggleOffColor;

		public Image autoOffToggleImage;

		public Image autoFormattedToggleImage;

		public Image activeTabButtonImage;

		public Image bannedTabButtonImage;

		internal void <CreateUI>b__1(bool value)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			autobanModdedRanksConfig.Value = value;
			((Graphic)autoModToggleImage).color = (value ? toggleOnColor : toggleOffColor);
		}

		internal void <CreateUI>b__2(bool value)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			autobanOffensiveNamesConfig.Value = value;
			((Graphic)autoOffToggleImage).color = (value ? toggleOnColor : toggleOffColor);
		}

		internal void <CreateUI>b__3(bool value)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			autobanFormattedNamesConfig.Value = value;
			((Graphic)autoFormattedToggleImage).color = (value ? toggleOnColor : toggleOffColor);
			if (value)
			{
				BanPlayersWithFormattedNames();
			}
		}

		internal void <CreateUI>b__4()
		{
			//IL_0033: 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)
			activePlayersTab.SetActive(true);
			bannedPlayersTab.SetActive(false);
			((Graphic)activeTabButtonImage).color = new Color(0.4f, 0.4f, 0.4f, 0.9f);
			((Graphic)bannedTabButtonImage).color = new Color(0.3f, 0.3f, 0.3f, 0.9f);
			RefreshActivePlayers();
			ScrollRect val = (((Object)(object)activePlayersTab != (Object)null) ? activePlayersTab.GetComponent<ScrollRect>() : null);
			if ((Object)(object)val != (Object)null)
			{
				val.verticalNormalizedPosition = 1f;
			}
			RecentPlayersManager.OnTabChanged();
			OnTabChanged();
		}

		internal void <CreateUI>b__5()
		{
			//IL_0033: 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)
			activePlayersTab.SetActive(false);
			bannedPlayersTab.SetActive(true);
			((Graphic)activeTabButtonImage).color = new Color(0.3f, 0.3f, 0.3f, 0.9f);
			((Graphic)bannedTabButtonImage).color = new Color(0.4f, 0.4f, 0.4f, 0.9f);
			isFirstTimeOpeningBannedTab = true;
			RefreshBannedPlayers();
			ScrollRect val = (((Object)(object)bannedPlayersTab != (Object)null) ? bannedPlayersTab.GetComponent<ScrollRect>() : null);
			if ((Object)(object)val != (Object)null)
			{
				val.verticalNormalizedPosition = 1f;
			}
			RecentPlayersManager.OnTabChanged();
			OnTabChanged();
		}
	}

	[CompilerGenerated]
	private sealed class <CreateUI>d__41 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		private GameObject <existingCanvas>5__1;

		private <>c__DisplayClass41_0 <>8__2;

		private GameObject <canvasObj>5__3;

		private Canvas <canvas>5__4;

		private CanvasScaler <scaler>5__5;

		private RectTransform <mainRect>5__6;

		private Image <panelImage>5__7;

		private RectTransform <panelRect>5__8;

		private GameObject <titleObj>5__9;

		private RectTransform <titleRect>5__10;

		private Text <titleText>5__11;

		private GameObject <closeButtonObj>5__12;

		private Button <closeButton>5__13;

		private Image <closeButtonImage>5__14;

		private RectTransform <closeButtonRect>5__15;

		private GameObject <closeTextObj>5__16;

		private RectTransform <closeTextRect>5__17;

		private Text <closeText>5__18;

		private GameObject <activeTabButtonObj>5__19;

		private Button <activeTabButton>5__20;

		private RectTransform <activeTabButtonRect>5__21;

		private GameObject <activeTabTextObj>5__22;

		private Text <activeTabText>5__23;

		private RectTransform <activeTabTextRect>5__24;

		private GameObject <bannedTabButtonObj>5__25;

		private Button <bannedTabButton>5__26;

		private RectTransform <bannedTabButtonRect>5__27;

		private GameObject <bannedTabTextObj>5__28;

		private Text <bannedTabText>5__29;

		private RectTransform <bannedTabTextRect>5__30;

		private GameObject <autoModToggleObj>5__31;

		private RectTransform <autoModToggleRect>5__32;

		private GameObject <autoModLabelObj>5__33;

		private Text <autoModLabel>5__34;

		private RectTransform <autoModLabelRect>5__35;

		private GameObject <autoOffToggleObj>5__36;

		private RectTransform <autoOffToggleRect>5__37;

		private GameObject <autoOffLabelObj>5__38;

		private Text <autoOffLabel>5__39;

		private RectTransform <autoOffLabelRect>5__40;

		private GameObject <autoFormattedToggleObj>5__41;

		private Toggle <autoFormattedToggle>5__42;

		private RectTransform <autoFormattedToggleRect>5__43;

		private GameObject <autoFormattedLabelObj>5__44;

		private Text <autoFormattedLabel>5__45;

		private RectTransform <autoFormattedLabelRect>5__46;

		private RectTransform <activeTabRect>5__47;

		private GameObject <activeContentObj>5__48;

		private RectTransform <activeContentRect>5__49;

		private ScrollRect <activeScrollRect>5__50;

		private Image <activeMaskImage>5__51;

		private RectTransform <bannedTabRect>5__52;

		private GameObject <bannedContentObj>5__53;

		private RectTransform <bannedContentRect>5__54;

		private ScrollRect <bannedScrollRect>5__55;

		private Image <bannedMaskImage>5__56;

		private ScrollRect <initialScroll>5__57;

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

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

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

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			int num = <>1__state;
			if (num == -3 || num == 2)
			{
				try
				{
				}
				finally
				{
					<>m__Finally1();
				}
			}
			<existingCanvas>5__1 = null;
			<>8__2 = null;
			<canvasObj>5__3 = null;
			<canvas>5__4 = null;
			<scaler>5__5 = null;
			<mainRect>5__6 = null;
			<panelImage>5__7 = null;
			<panelRect>5__8 = null;
			<titleObj>5__9 = null;
			<titleRect>5__10 = null;
			<titleText>5__11 = null;
			<closeButtonObj>5__12 = null;
			<closeButton>5__13 = null;
			<closeButtonImage>5__14 = null;
			<closeButtonRect>5__15 = null;
			<closeTextObj>5__16 = null;
			<closeTextRect>5__17 = null;
			<closeText>5__18 = null;
			<activeTabButtonObj>5__19 = null;
			<activeTabButton>5__20 = null;
			<activeTabButtonRect>5__21 = null;
			<activeTabTextObj>5__22 = null;
			<activeTabText>5__23 = null;
			<activeTabTextRect>5__24 = null;
			<bannedTabButtonObj>5__25 = null;
			<bannedTabButton>5__26 = null;
			<bannedTabButtonRect>5__27 = null;
			<bannedTabTextObj>5__28 = null;
			<bannedTabText>5__29 = null;
			<bannedTabTextRect>5__30 = null;
			<autoModToggleObj>5__31 = null;
			<autoModToggleRect>5__32 = null;
			<autoModLabelObj>5__33 = null;
			<autoModLabel>5__34 = null;
			<autoModLabelRect>5__35 = null;
			<autoOffToggleObj>5__36 = null;
			<autoOffToggleRect>5__37 = null;
			<autoOffLabelObj>5__38 = null;
			<autoOffLabel>5__39 = null;
			<autoOffLabelRect>5__40 = null;
			<autoFormattedToggleObj>5__41 = null;
			<autoFormattedToggle>5__42 = null;
			<autoFormattedToggleRect>5__43 = null;
			<autoFormattedLabelObj>5__44 = null;
			<autoFormattedLabel>5__45 = null;
			<autoFormattedLabelRect>5__46 = null;
			<activeTabRect>5__47 = null;
			<activeContentObj>5__48 = null;
			<activeContentRect>5__49 = null;
			<activeScrollRect>5__50 = null;
			<activeMaskImage>5__51 = null;
			<bannedTabRect>5__52 = null;
			<bannedContentObj>5__53 = null;
			<bannedContentRect>5__54 = null;
			<bannedScrollRect>5__55 = null;
			<bannedMaskImage>5__56 = null;
			<initialScroll>5__57 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Expected O, but got Unknown
			//IL_017c: 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_01b9: Expected O, but got Unknown
			//IL_01f7: 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_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_023a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Expected O, but got Unknown
			//IL_0289: Unknown result type (might be due to invalid IL or missing references)
			//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f8: Expected O, but got Unknown
			//IL_0371: Unknown result type (might be due to invalid IL or missing references)
			//IL_0399: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f1: Expected O, but got Unknown
			//IL_0444: Unknown result type (might be due to invalid IL or missing references)
			//IL_0470: Unknown result type (might be due to invalid IL or missing references)
			//IL_048b: Unknown result type (might be due to invalid IL or missing references)
			//IL_049c: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_04be: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c8: Expected O, but got Unknown
			//IL_0542: Unknown result type (might be due to invalid IL or missing references)
			//IL_0560: Unknown result type (might be due to invalid IL or missing references)
			//IL_0571: Unknown result type (might be due to invalid IL or missing references)
			//IL_0582: Unknown result type (might be due to invalid IL or missing references)
			//IL_0593: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Expected O, but got Unknown
			//IL_05d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05de: Expected O, but got Unknown
			//IL_0640: Unknown result type (might be due to invalid IL or missing references)
			//IL_066c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0687: Unknown result type (might be due to invalid IL or missing references)
			//IL_0698: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c4: Expected O, but got Unknown
			//IL_072d: Unknown result type (might be due to invalid IL or missing references)
			//IL_075c: Unknown result type (might be due to invalid IL or missing references)
			//IL_076d: Unknown result type (might be due to invalid IL or missing references)
			//IL_077e: Unknown result type (might be due to invalid IL or missing references)
			//IL_078f: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07aa: Expected O, but got Unknown
			//IL_080c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0838: Unknown result type (might be due to invalid IL or missing references)
			//IL_0853: Unknown result type (might be due to invalid IL or missing references)
			//IL_0864: Unknown result type (might be due to invalid IL or missing references)
			//IL_0875: Unknown result type (might be due to invalid IL or missing references)
			//IL_0886: Unknown result type (might be due to invalid IL or missing references)
			//IL_0890: Expected O, but got Unknown
			//IL_08f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0928: Unknown result type (might be due to invalid IL or missing references)
			//IL_0939: Unknown result type (might be due to invalid IL or missing references)
			//IL_094a: Unknown result type (might be due to invalid IL or missing references)
			//IL_095b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0980: Unknown result type (might be due to invalid IL or missing references)
			//IL_0985: Unknown result type (might be due to invalid IL or missing references)
			//IL_09a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_09a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_09be: Expected O, but got Unknown
			//IL_0a11: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a3d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a58: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a69: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a7a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a8b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a95: Expected O, but got Unknown
			//IL_0afd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b36: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b51: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b6c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b87: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b98: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ba2: Expected O, but got Unknown
			//IL_0bf5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c21: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c3c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c4d: 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_0c6f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c79: Expected O, but got Unknown
			//IL_0ce1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d1a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d35: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d50: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d6b: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c8: Expected O, but got Unknown
			//IL_0dca: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dbd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0df2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Expected O, but got Unknown
			//IL_0e52: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e5c: Expected O, but got Unknown
			//IL_0eb0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0edc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ef7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f08: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f19: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f2a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f34: Expected O, but got Unknown
			//IL_0f9c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fd5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ff0: Unknown result type (might be due to invalid IL or missing references)
			//IL_100b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1026: Unknown result type (might be due to invalid IL or missing references)
			//IL_1072: Unknown result type (might be due to invalid IL or missing references)
			//IL_1065: Unknown result type (might be due to invalid IL or missing references)
			//IL_10a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_10ae: Expected O, but got Unknown
			//IL_10e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_1104: Unknown result type (might be due to invalid IL or missing references)
			//IL_1115: Unknown result type (might be due to invalid IL or missing references)
			//IL_1126: Unknown result type (might be due to invalid IL or missing references)
			//IL_1143: Unknown result type (might be due to invalid IL or missing references)
			//IL_114d: Expected O, but got Unknown
			//IL_1190: Unknown result type (might be due to invalid IL or missing references)
			//IL_11a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_11b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_11c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_1250: Unknown result type (might be due to invalid IL or missing references)
			//IL_1260: Unknown result type (might be due to invalid IL or missing references)
			//IL_126a: Expected O, but got Unknown
			//IL_12b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_12cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_12dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_12ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_12ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_1309: Expected O, but got Unknown
			//IL_134c: Unknown result type (might be due to invalid IL or missing references)
			//IL_135d: Unknown result type (might be due to invalid IL or missing references)
			//IL_136e: Unknown result type (might be due to invalid IL or missing references)
			//IL_137f: Unknown result type (might be due to invalid IL or missing references)
			//IL_140c: Unknown result type (might be due to invalid IL or missing references)
			//IL_142e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1438: Expected O, but got Unknown
			//IL_1450: Unknown result type (might be due to invalid IL or missing references)
			//IL_145a: Expected O, but got Unknown
			//IL_147a: Unknown result type (might be due to invalid IL or missing references)
			//IL_14a4: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					if (isUIBeingCreated)
					{
						return false;
					}
					if ((Object)(object)banUI != (Object)null)
					{
						return false;
					}
					<existingCanvas>5__1 = GameObject.Find("BanModCanvas");
					if ((Object)(object)<existingCanvas>5__1 != (Object)null)
					{
						ManualLogSource logger = BanUIManager.logger;
						if (logger != null)
						{
							logger.LogWarning((object)"Found existing BanModCanvas - destroying before creating new one");
						}
						Object.Destroy((Object)(object)<existingCanvas>5__1);
						<>2__current = (object)new WaitForSeconds(0.1f);
						<>1__state = 1;
						return true;
					}
					goto IL_00c9;
				case 1:
					<>1__state = -1;
					goto IL_00c9;
				case 2:
					{
						<>1__state = -3;
						<canvasObj>5__3 = new GameObject("BanModCanvas");
						<canvas>5__4 = <canvasObj>5__3.AddComponent<Canvas>();
						<canvas>5__4.renderMode = (RenderMode)0;
						<canvas>5__4.sortingOrder = 1000;
						<scaler>5__5 = <canvasObj>5__3.AddComponent<CanvasScaler>();
						<scaler>5__5.uiScaleMode = (ScaleMode)1;
						<scaler>5__5.referenceResolution = new Vector2(1920f, 1080f);
						<canvasObj>5__3.AddComponent<GraphicRaycaster>();
						mainCanvas = <canvas>5__4;
						RecentPlayersManager.CreateRecentPlayersButton(<canvas>5__4);
						banUI = new GameObject("BanModUI");
						banUI.transform.SetParent(<canvasObj>5__3.transform, false);
						banUI.SetActive(false);
						<mainRect>5__6 = banUI.AddComponent<RectTransform>();
						<mainRect>5__6.anchorMin = Vector2.zero;
						<mainRect>5__6.anchorMax = Vector2.one;
						<mainRect>5__6.offsetMin = Vector2.zero;
						<mainRect>5__6.offsetMax = Vector2.zero;
						banUIPanel = new GameObject("BanUIPanel");
						banUIPanel.transform.SetParent(banUI.transform, false);
						<panelImage>5__7 = banUIPanel.AddComponent<Image>();
						((Graphic)<panelImage>5__7).color = new Color(0.1f, 0.1f, 0.1f, 0.95f);
						<panelRect>5__8 = banUIPanel.GetComponent<RectTransform>();
						<panelRect>5__8.anchorMin = Vector2.zero;
						<panelRect>5__8.anchorMax = Vector2.one;
						<panelRect>5__8.offsetMin = Vector2.zero;
						<panelRect>5__8.offsetMax = Vector2.zero;
						<titleObj>5__9 = new GameObject("Title");
						<titleRect>5__10 = <titleObj>5__9.AddComponent<RectTransform>();
						<titleObj>5__9.transform.SetParent(banUIPanel.transform, false);
						<titleText>5__11 = <titleObj>5__9.AddComponent<Text>();
						<titleText>5__11.text = "Player Management";
						<titleText>5__11.font = Resources.GetBuiltinResource<Font>("Arial.ttf");
						<titleText>5__11.fontSize = 24;
						((Graphic)<titleText>5__11).color = Color.white;
						<titleText>5__11.alignment = (TextAnchor)4;
						<titleRect>5__10.anchorMin = new Vector2(0.1f, 0.85f);
						<titleRect>5__10.anchorMax = new Vector2(0.9f, 0.95f);
						<titleRect>5__10.offsetMin = Vector2.zero;
						<titleRect>5__10.offsetMax = Vector2.zero;
						<closeButtonObj>5__12 = new GameObject("CloseButton");
						<closeButtonObj>5__12.transform.SetParent(banUIPanel.transform, false);
						<closeButton>5__13 = <closeButtonObj>5__12.AddComponent<Button>();
						<closeButtonImage>5__14 = <closeButtonObj>5__12.AddComponent<Image>();
						((Graphic)<closeButtonImage>5__14).color = new Color(0.8f, 0.2f, 0.2f);
						<closeButtonRect>5__15 = <closeButtonObj>5__12.GetComponent<RectTransform>();
						<closeButtonRect>5__15.anchorMin = new Vector2(0.9f, 0.9f);
						<closeButtonRect>5__15.anchorMax = new Vector2(0.97f, 0.97f);
						<closeButtonRect>5__15.offsetMin = Vector2.zero;
						<closeButtonRect>5__15.offsetMax = Vector2.zero;
						<closeTextObj>5__16 = new GameObject("CloseText");
						<closeTextRect>5__17 = <closeTextObj>5__16.AddComponent<RectTransform>();
						<closeTextObj>5__16.transform.SetParent(<closeButtonObj>5__12.transform, false);
						<closeText>5__18 = <closeTextObj>5__16.AddComponent<Text>();
						<closeText>5__18.text = "X";
						<closeText>5__18.font = Resources.GetBuiltinResource<Font>("Arial.ttf");
						<closeText>5__18.fontSize = 14;
						((Graphic)<closeText>5__18).color = Color.white;
						<closeText>5__18.alignment = (TextAnchor)4;
						<closeTextRect>5__17.anchorMin = Vector2.zero;
						<closeTextRect>5__17.anchorMax = Vector2.one;
						<closeTextRect>5__17.offsetMin = Vector2.zero;
						<closeTextRect>5__17.offsetMax = Vector2.zero;
						ButtonClickedEvent onClick = <closeButton>5__13.onClick;
						object obj = <>c.<>9__41_0;
						if (obj == null)
						{
							UnityAction val = delegate
							{
								banUI.SetActive(false);
							};
							<>c.<>9__41_0 = val;
							obj = (object)val;
						}
						((UnityEvent)onClick).AddListener((UnityAction)obj);
						<activeTabButtonObj>5__19 = new GameObject("ActiveTabButton");
						<activeTabButtonObj>5__19.transform.SetParent(banUIPanel.transform, false);
						<activeTabButton>5__20 = <activeTabButtonObj>5__19.AddComponent<Button>();
						<>8__2.activeTabButtonImage = <activeTabButtonObj>5__19.AddComponent<Image>();
						((Graphic)<>8__2.activeTabButtonImage).color = new Color(0.3f, 0.3f, 0.3f, 0.9f);
						<activeTabButtonRect>5__21 = <activeTabButtonObj>5__19.GetComponent<RectTransform>();
						<activeTabButtonRect>5__21.anchorMin = new Vector2(0.05f, 0.75f);
						<activeTabButtonRect>5__21.anchorMax = new Vector2(0.45f, 0.85f);
						<activeTabButtonRect>5__21.offsetMin = Vector2.zero;
						<activeTabButtonRect>5__21.offsetMax = Vector2.zero;
						<activeTabTextObj>5__22 = new GameObject("ActiveTabText");
						<activeTabTextObj>5__22.transform.SetParent(<activeTabButtonObj>5__19.transform, false);
						<activeTabText>5__23 = <activeTabTextObj>5__22.AddComponent<Text>();
						<activeTabText>5__23.text = "Active Players";
						<activeTabText>5__23.font = Resources.GetBuiltinResource<Font>("Arial.ttf");
						<activeTabText>5__23.fontSize = 14;
						((Graphic)<activeTabText>5__23).color = Color.white;
						<activeTabText>5__23.alignment = (TextAnchor)4;
						<activeTabTextRect>5__24 = <activeTabTextObj>5__22.GetComponent<RectTransform>();
						<activeTabTextRect>5__24.anchorMin = Vector2.zero;
						<activeTabTextRect>5__24.anchorMax = Vector2.one;
						<activeTabTextRect>5__24.offsetMin = Vector2.zero;
						<activeTabTextRect>5__24.offsetMax = Vector2.zero;
						<bannedTabButtonObj>5__25 = new GameObject("BannedTabButton");
						<bannedTabButtonObj>5__25.transform.SetParent(banUIPanel.transform, false);
						<bannedTabButton>5__26 = <bannedTabButtonObj>5__25.AddComponent<Button>();
						<>8__2.bannedTabButtonImage = <bannedTabButtonObj>5__25.AddComponent<Image>();
						((Graphic)<>8__2.bannedTabButtonImage).color = new Color(0.3f, 0.3f, 0.3f, 0.9f);
						<bannedTabButtonRect>5__27 = <bannedTabButtonObj>5__25.GetComponent<RectTransform>();
						<bannedTabButtonRect>5__27.anchorMin = new Vector2(0.55f, 0.75f);
						<bannedTabButtonRect>5__27.anchorMax = new Vector2(0.95f, 0.85f);
						<bannedTabButtonRect>5__27.offsetMin = Vector2.zero;
						<bannedTabButtonRect>5__27.offsetMax = Vector2.zero;
						<bannedTabTextObj>5__28 = new GameObject("BannedTabText");
						<bannedTabTextObj>5__28.transform.SetParent(<bannedTabButtonObj>5__25.transform, false);
						<bannedTabText>5__29 = <bannedTabTextObj>5__28.AddComponent<Text>();
						<bannedTabText>5__29.text = "Banned Players";
						<bannedTabText>5__29.font = Resources.GetBuiltinResource<Font>("Arial.ttf");
						<bannedTabText>5__29.fontSize = 14;
						((Graphic)<bannedTabText>5__29).color = Color.white;
						<bannedTabText>5__29.alignment = (TextAnchor)4;
						<bannedTabTextRect>5__30 = <bannedTabTextObj>5__28.GetComponent<RectTransform>();
						<bannedTabTextRect>5__30.anchorMin = Vector2.zero;
						<bannedTabTextRect>5__30.anchorMax = Vector2.one;
						<bannedTabTextRect>5__30.offsetMin = Vector2.zero;
						<bannedTabTextRect>5__30.offsetMax = Vector2.zero;
						<>8__2.toggleOffColor = new Color(0.2f, 0.2f, 0.2f, 0.8f);
						<>8__2.toggleOnColor = new Color(0.2f, 0.6f, 0.2f, 0.9f);
						<autoModToggleObj>5__31 = new GameObject("AutobanModdedRanksToggle");
						<autoModToggleObj>5__31.transform.SetParent(banUIPanel.transform, false);
						autobanModdedRanksToggle = <autoModToggleObj>5__31.AddComponent<Toggle>();
						<>8__2.autoModToggleImage = <autoModToggleObj>5__31.AddComponent<Image>();
						((Graphic)<>8__2.autoModToggleImage).color = <>8__2.toggleOffColor;
						<autoModToggleRect>5__32 = <autoModToggleObj>5__31.GetComponent<RectTransform>();
						<autoModToggleRect>5__32.anchorMin = new Vector2(0.05f, 0.92f);
						<autoModToggleRect>5__32.anchorMax = new Vector2(0.08f, 0.97f);
						<autoModToggleRect>5__32.offsetMin = Vector2.zero;
						<autoModToggleRect>5__32.offsetMax = Vector2.zero;
						<autoModLabelObj>5__33 = new GameObject("AutobanModdedRanksLabel");
						<autoModLabelObj>5__33.transform.SetParent(banUIPanel.transform, false);
						<autoModLabel>5__34 = <autoModLabelObj>5__33.AddComponent<Text>();
						<autoModLabel>5__34.text = "Autoban Modded Ranks";
						<autoModLabel>5__34.font = Resources.GetBuiltinResource<Font>("Arial.ttf");
						<autoModLabel>5__34.fontSize = 24;
						((Graphic)<autoModLabel>5__34).color = Color.white;
						<autoModLabel>5__34.alignment = (TextAnchor)3;
						<autoModLabelRect>5__35 = <autoModLabelObj>5__33.GetComponent<RectTransform>();
						<autoModLabelRect>5__35.anchorMin = new Vector2(0.085f, 0.92f);
						<autoModLabelRect>5__35.anchorMax = new Vector2(0.3f, 0.97f);
						<autoModLabelRect>5__35.offsetMin = new Vector2(5f, 0f);
						<autoModLabelRect>5__35.offsetMax = new Vector2(-5f, 0f);
						<autoOffToggleObj>5__36 = new GameObject("AutobanOffensiveNamesToggle");
						<autoOffToggleObj>5__36.transform.SetParent(banUIPanel.transform, false);
						autobanOffensiveNamesToggle = <autoOffToggleObj>5__36.AddComponent<Toggle>();
						<>8__2.autoOffToggleImage = <autoOffToggleObj>5__36.AddComponent<Image>();
						((Graphic)<>8__2.autoOffToggleImage).color = <>8__2.toggleOffColor;
						<autoOffToggleRect>5__37 = <autoOffToggleObj>5__36.GetComponent<RectTransform>();
						<autoOffToggleRect>5__37.anchorMin = new Vector2(0.05f, 0.86f);
						<autoOffToggleRect>5__37.anchorMax = new Vector2(0.08f, 0.91f);
						<autoOffToggleRect>5__37.offsetMin = Vector2.zero;
						<autoOffToggleRect>5__37.offsetMax = Vector2.zero;
						<autoOffLabelObj>5__38 = new GameObject("AutobanOffensiveNamesLabel");
						<autoOffLabelObj>5__38.transform.SetParent(banUIPanel.transform, false);
						<autoOffLabel>5__39 = <autoOffLabelObj>5__38.AddComponent<Text>();
						<autoOffLabel>5__39.text = "Autoban Offensive Names";
						<autoOffLabel>5__39.font = Resources.GetBuiltinResource<Font>("Arial.ttf");
						<autoOffLabel>5__39.fontSize = 24;
						((Graphic)<autoOffLabel>5__39).color = Color.white;
						<autoOffLabel>5__39.alignment = (TextAnchor)3;
						<autoOffLabelRect>5__40 = <autoOffLabelObj>5__38.GetComponent<RectTransform>();
						<autoOffLabelRect>5__40.anchorMin = new Vector2(0.085f, 0.86f);
						<autoOffLabelRect>5__40.anchorMax = new Vector2(0.3f, 0.91f);
						<autoOffLabelRect>5__40.offsetMin = new Vector2(5f, 0f);
						<autoOffLabelRect>5__40.offsetMax = new Vector2(-5f, 0f);
						autobanModdedRanksToggle.isOn = autobanModdedRanksConfig.Value;
						autobanOffensiveNamesToggle.isOn = autobanOffensiveNamesConfig.Value;
						((Graphic)<>8__2.autoModToggleImage).color = (autobanModdedRanksToggle.isOn ? <>8__2.toggleOnColor : <>8__2.toggleOffColor);
						((Graphic)<>8__2.autoOffToggleImage).color = (autobanOffensiveNamesToggle.isOn ? <>8__2.toggleOnColor : <>8__2.toggleOffColor);
						((UnityEvent<bool>)(object)autobanModdedRanksToggle.onValueChanged).AddListener((UnityAction<bool>)delegate(bool value)
						{
							//IL_001f: Unknown result type (might be due to invalid IL or missing references)
							//IL_0017: Unknown result type (might be due to invalid IL or missing references)
							autobanModdedRanksConfig.Value = value;
							((Graphic)<>8__2.autoModToggleImage).color = (value ? <>8__2.toggleOnColor : <>8__2.toggleOffColor);
						});
						((UnityEvent<bool>)(object)autobanOffensiveNamesToggle.onValueChanged).AddListener((UnityAction<bool>)delegate(bool value)
						{
							//IL_001f: Unknown result type (might be due to invalid IL or missing references)
							//IL_0017: Unknown result type (might be due to invalid IL or missing references)
							autobanOffensiveNamesConfig.Value = value;
							((Graphic)<>8__2.autoOffToggleImage).color = (value ? <>8__2.toggleOnColor : <>8__2.toggleOffColor);
						});
						<autoFormattedToggleObj>5__41 = new GameObject("AutobanFormattedNamesToggle");
						<autoFormattedToggleObj>5__41.transform.SetParent(banUIPanel.transform, false);
						<autoFormattedToggle>5__42 = <autoFormattedToggleObj>5__41.AddComponent<Toggle>();
						<>8__2.autoFormattedToggleImage = <autoFormattedToggleObj>5__41.AddComponent<Image>();
						((Graphic)<>8__2.autoFormattedToggleImage).color = <>8__2.toggleOffColor;
						<autoFormattedToggleRect>5__43 = <autoFormattedToggleObj>5__41.GetComponent<RectTransform>();
						<autoFormattedToggleRect>5__43.anchorMin = new Vector2(0.245f, 0.92f);
						<autoFormattedToggleRect>5__43.anchorMax = new Vector2(0.275f, 0.97f);
						<autoFormattedToggleRect>5__43.offsetMin = Vector2.zero;
						<autoFormattedToggleRect>5__43.offsetMax = Vector2.zero;
						<autoFormattedLabelObj>5__44 = new GameObject("AutobanFormattedNamesLabel");
						<autoFormattedLabelObj>5__44.transform.SetParent(banUIPanel.transform, false);
						<autoFormattedLabel>5__45 = <autoFormattedLabelObj>5__44.AddComponent<Text>();
						<autoFormattedLabel>5__45.text = "Autoban Modded Names";
						<autoFormattedLabel>5__45.font = Resources.GetBuiltinResource<Font>("Arial.ttf");
						<autoFormattedLabel>5__45.fontSize = 24;
						((Graphic)<autoFormattedLabel>5__45).color = Color.white;
						<autoFormattedLabel>5__45.alignment = (TextAnchor)3;
						<autoFormattedLabelRect>5__46 = <autoFormattedLabelObj>5__44.GetComponent<RectTransform>();
						<autoFormattedLabelRect>5__46.anchorMin = new Vector2(0.28f, 0.92f);
						<autoFormattedLabelRect>5__46.anchorMax = new Vector2(0.52f, 0.97f);
						<autoFormattedLabelRect>5__46.offsetMin = new Vector2(5f, 0f);
						<autoFormattedLabelRect>5__46.offsetMax = new Vector2(-5f, 0f);
						<autoFormattedToggle>5__42.isOn = autobanFormattedNamesConfig.Value;
						((Graphic)<>8__2.autoFormattedToggleImage).color = (<autoFormattedToggle>5__42.isOn ? <>8__2.toggleOnColor : <>8__2.toggleOffColor);
						((UnityEvent<bool>)(object)<autoFormattedToggle>5__42.onValueChanged).AddListener((UnityAction<bool>)delegate(bool value)
						{
							//IL_001f: Unknown result type (might be due to invalid IL or missing references)
							//IL_0017: Unknown result type (might be due to invalid IL or missing references)
							autobanFormattedNamesConfig.Value = value;
							((Graphic)<>8__2.autoFormattedToggleImage).color = (value ? <>8__2.toggleOnColor : <>8__2.toggleOffColor);
							if (value)
							{
								BanPlayersWithFormattedNames();
							}
						});
						BanUIManager.activePlayersTab = new GameObject("ActivePlayersTab");
						<activeTabRect>5__47 = BanUIManager.activePlayersTab.AddComponent<RectTransform>();
						BanUIManager.activePlayersTab.transform.SetParent(banUIPanel.transform, false);
						<activeTabRect>5__47.anchorMin = new Vector2(0.05f, 0.1f);
						<activeTabRect>5__47.anchorMax = new Vector2(0.95f, 0.7f);
						<activeTabRect>5__47.offsetMin = Vector2.zero;
						<activeTabRect>5__47.offsetMax = Vector2.zero;
						BanUIManager.activePlayersTab.SetActive(true);
						<activeContentObj>5__48 = new GameObject("ActiveContent");
						<activeContentRect>5__49 = <activeContentObj>5__48.AddComponent<RectTransform>();
						<activeContentObj>5__48.transform.SetParent(BanUIManager.activePlayersTab.transform, false);
						playerListContent = <activeContentObj>5__48.transform;
						<activeContentRect>5__49.anchorMin = Vector2.zero;
						<activeContentRect>5__49.anchorMax = Vector2.one;
						<activeContentRect>5__49.offsetMin = Vector2.zero;
						<activeContentRect>5__49.offsetMax = Vector2.zero;
						<activeScrollRect>5__50 = BanUIManager.activePlayersTab.AddComponent<ScrollRect>();
						<activeScrollRect>5__50.content = <activeContentRect>5__49;
						<activeScrollRect>5__50.horizontal = false;
						<activeScrollRect>5__50.vertical = true;
						<activeScrollRect>5__50.scrollSensitivity = 10f;
						BanUIManager.activePlayersTab.AddComponent<Mask>();
						<activeMaskImage>5__51 = BanUIManager.activePlayersTab.AddComponent<Image>();
						((Graphic)<activeMaskImage>5__51).color = new Color(0.2f, 0.2f, 0.2f, 0.5f);
						bannedPlayersTab = new GameObject("BannedPlayersTab");
						<bannedTabRect>5__52 = bannedPlayersTab.AddComponent<RectTransform>();
						bannedPlayersTab.transform.SetParent(banUIPanel.transform, false);
						bannedPlayersTab.SetActive(false);
						<bannedTabRect>5__52.anchorMin = new Vector2(0.05f, 0.1f);
						<bannedTabRect>5__52.anchorMax = new Vector2(0.95f, 0.7f);
						<bannedTabRect>5__52.offsetMin = Vector2.zero;
						<bannedTabRect>5__52.offsetMax = Vector2.zero;
						<bannedContentObj>5__53 = new GameObject("BannedContent");
						<bannedContentRect>5__54 = <bannedContentObj>5__53.AddComponent<RectTransform>();
						<bannedContentObj>5__53.transform.SetParent(bannedPlayersTab.transform, false);
						bannedPlayersContent = <bannedContentObj>5__53.transform;
						<bannedContentRect>5__54.anchorMin = Vector2.zero;
						<bannedContentRect>5__54.anchorMax = Vector2.one;
						<bannedContentRect>5__54.offsetMin = Vector2.zero;
						<bannedContentRect>5__54.offsetMax = Vector2.zero;
						<bannedScrollRect>5__55 = bannedPlayersTab.AddComponent<ScrollRect>();
						<bannedScrollRect>5__55.content = <bannedContentRect>5__54;
						<bannedScrollRect>5__55.horizontal = false;
						<bannedScrollRect>5__55.vertical = true;
						<bannedScrollRect>5__55.scrollSensitivity = 10f;
						bannedPlayersTab.AddComponent<Mask>();
						<bannedMaskImage>5__56 = bannedPlayersTab.AddComponent<Image>();
						((Graphic)<bannedMaskImage>5__56).color = new Color(0.2f, 0.2f, 0.2f, 0.5f);
						((UnityEvent)<activeTabButton>5__20.onClick).AddListener((UnityAction)delegate
						{
							//IL_0033: 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)
							BanUIManager.activePlayersTab.SetActive(true);
							bannedPlayersTab.SetActive(false);
							((Graphic)<>8__2.activeTabButtonImage).color = new Color(0.4f, 0.4f, 0.4f, 0.9f);
							((Graphic)<>8__2.bannedTabButtonImage).color = new Color(0.3f, 0.3f, 0.3f, 0.9f);
							RefreshActivePlayers();
							ScrollRect val3 = (((Object)(object)BanUIManager.activePlayersTab != (Object)null) ? BanUIManager.activePlayersTab.GetComponent<ScrollRect>() : null);
							if ((Object)(object)val3 != (Object)null)
							{
								val3.verticalNormalizedPosition = 1f;
							}
							RecentPlayersManager.OnTabChanged();
							OnTabChanged();
						});
						((UnityEvent)<bannedTabButton>5__26.onClick).AddListener((UnityAction)delegate
						{
							//IL_0033: 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)
							BanUIManager.activePlayersTab.SetActive(false);
							bannedPlayersTab.SetActive(true);
							((Graphic)<>8__2.activeTabButtonImage).color = new Color(0.3f, 0.3f, 0.3f, 0.9f);
							((Graphic)<>8__2.bannedTabButtonImage).color = new Color(0.4f, 0.4f, 0.4f, 0.9f);
							isFirstTimeOpeningBannedTab = true;
							RefreshBannedPlayers();
							ScrollRect val2 = (((Object)(object)bannedPlayersTab != (Object)null) ? bannedPlayersTab.GetComponent<ScrollRect>() : null);
							if ((Object)(object)val2 != (Object)null)
							{
								val2.verticalNormalizedPosition = 1f;
							}
							RecentPlayersManager.OnTabChanged();
							OnTabChanged();
						});
						((Graphic)<>8__2.activeTabButtonImage).color = new Color(0.4f, 0.4f, 0.4f, 0.9f);
						((Graphic)<>8__2.bannedTabButtonImage).color = new Color(0.3f, 0.3f, 0.3f, 0.9f);
						GameObject activePlayersTab = BanUIManager.activePlayersTab;
						<initialScroll>5__57 = ((activePlayersTab != null) ? activePlayersTab.GetComponent<ScrollRect>() : null);
						if ((Object)(object)<initialScroll>5__57 != (Object)null)
						{
							<initialScroll>5__57.verticalNormalizedPosition = 1f;
						}
						CreateLoggingButton(<canvas>5__4);
						<>8__2 = null;
						<canvasObj>5__3 = null;
						<canvas>5__4 = null;
						<scaler>5__5 = null;
						<mainRect>5__6 = null;
						<panelImage>5__7 = null;
						<panelRect>5__8 = null;
						<titleObj>5__9 = null;
						<titleRect>5__10 = null;
						<titleText>5__11 = null;
						<closeButtonObj>5__12 = null;
						<closeButton>5__13 = null;
						<closeButtonImage>5__14 = null;
						<closeButtonRect>5__15 = null;
						<closeTextObj>5__16 = null;
						<closeTextRect>5__17 = null;
						<closeText>5__18 = null;
						<activeTabButtonObj>5__19 = null;
						<activeTabButton>5__20 = null;
						<activeTabButtonRect>5__21 = null;
						<activeTabTextObj>5__22 = null;
						<activeTabText>5__23 = null;
						<activeTabTextRect>5__24 = null;
						<bannedTabButtonObj>5__25 = null;
						<bannedTabButton>5__26 = null;
						<bannedTabButtonRect>5__27 = null;
						<bannedTabTextObj>5__28 = null;
						<bannedTabText>5__29 = null;
						<bannedTabTextRect>5__30 = null;
						<autoModToggleObj>5__31 = null;
						<autoModToggleRect>5__32 = null;
						<autoModLabelObj>5__33 = null;
						<autoModLabel>5__34 = null;
						<autoModLabelRect>5__35 = null;
						<autoOffToggleObj>5__36 = null;
						<autoOffToggleRect>5__37 = null;
						<autoOffLabelObj>5__38 = null;
						<autoOffLabel>5__39 = null;
						<autoOffLabelRect>5__40 = null;
						<autoFormattedToggleObj>5__41 = null;
						<autoFormattedToggle>5__42 = null;
						<autoFormattedToggleRect>5__43 = null;
						<autoFormattedLabelObj>5__44 = null;
						<autoFormattedLabel>5__45 = null;
						<autoFormattedLabelRect>5__46 = null;
						<activeTabRect>5__47 = null;
						<activeContentObj>5__48 = null;
						<activeContentRect>5__49 = null;
						<activeScrollRect>5__50 = null;
						<activeMaskImage>5__51 = null;
						<bannedTabRect>5__52 = null;
						<bannedContentObj>5__53 = null;
						<bannedContentRect>5__54 = null;
						<bannedScrollRect>5__55 = null;
						<bannedMaskImage>5__56 = null;
						<initialScroll>5__57 = null;
						<>m__Finally1();
						return false;
					}
					IL_00c9:
					isUIBeingCreated = true;
					<>1__state = -3;
					<>8__2 = new <>c__DisplayClass41_0();
					CleanupExistingUI();
					<>2__current = (object)new WaitForSeconds(1f);
					<>1__state = 2;
					return true;
				}
			}
			catch
			{
				//try-fault
				((IDisposable)this).Dispose();
				throw;
			}
		}

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

		private void <>m__Finally1()
		{
			<>1__state = -1;
			isUIBeingCreated = false;
		}

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

	[CompilerGenerated]
	private sealed class <DelayedUIUpdate>d__46 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

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

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

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

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = null;
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				UpdateLogDisplay();
				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();
		}
	}

	[CompilerGenerated]
	private sealed class <ForceRecreateUI>d__75 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

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

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

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

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
			{
				<>1__state = -1;
				ManualLogSource logger = BanUIManager.logger;
				if (logger != null)
				{
					logger.LogInfo((object)"Force recreating Ban UI...");
				}
				CleanupExistingUI();
				<>2__current = (object)new WaitForSeconds(0.1f);
				<>1__state = 1;
				return true;
			}
			case 1:
				<>1__state = -1;
				<>2__current = CreateUI();
				<>1__state = 2;
				return true;
			case 2:
				<>1__state = -1;
				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();
		}
	}

	private static ManualLogSource logger;

	private static ConfigEntry<bool> autobanModdedRanksConfig;

	private static ConfigEntry<bool> autobanOffensiveNamesConfig;

	private static ConfigEntry<bool> autobanFormattedNamesConfig;

	private static Func<Dictionary<string, string>> getConnectedPlayers;

	private static Func<Dictionary<string, string>> getBannedPlayers;

	private static Func<Dictionary<string, DateTime>> getBanTimestamps;

	private static Func<Dictionary<string, string>> getBanReasons;

	private static Action<string, string> kickPlayer;

	private static Action<string, string> toggleBanPlayer;

	private static Action<string, string, string> banPlayerWithReason;

	private static Action<string, string> unbanPlayer;

	private static GameObject banUI;

	private static GameObject banUIPanel;

	private static Transform playerListContent;

	private static Transform bannedPlayersContent;

	private static GameObject activePlayersTab;

	private static GameObject bannedPlayersTab;

	private static Toggle autobanModdedRanksToggle;

	private static Toggle autobanOffensiveNamesToggle;

	private static readonly Regex richTextTagPattern = new Regex("<\\s*/?\\s*(color|b|i|size|material)\\b[^>]*>", RegexOptions.IgnoreCase | RegexOptions.Compiled);

	private static GameObject loggingButton;

	private static GameObject loggingPanel;

	private static Transform logContent;

	private static bool isLoggingVisible = false;

	private static List<string> logMessages = new List<string>();

	private const int MAX_LOG_MESSAGES = 1000;

	private static bool isFirstTimeOpeningBannedTab = true;

	private static int bannedPlayersPageIndex = 0;

	private const int MAX_VISIBLE_BANNED_ITEMS = 50;

	private static string bannedSearchQuery = string.Empty;

	private static InputField bannedSearchInput;

	private static bool shouldRestoreFocus = false;

	private static bool isUIBeingCreated = false;

	private static Canvas mainCanvas = null;

	public static bool IsActive => (Object)(object)banUI != (Object)null && banUI.activeSelf;

	public static void Initialize(ManualLogSource log, ConfigEntry<bool> autoModded, ConfigEntry<bool> autoOffensive, ConfigEntry<bool> autoFormatted, Func<Dictionary<string, string>> getConn, Func<Dictionary<string, string>> getBanned, Func<Dictionary<string, DateTime>> getTimestamps, Func<Dictionary<string, string>> getReasons, Action<string, string> kick, Action<string, string> toggleBan, Action<string, string> unban, Action<string, string, string> banWithReason)
	{
		logger = log;
		autobanModdedRanksConfig = autoModded;
		autobanOffensiveNamesConfig = autoOffensive;
		autobanFormattedNamesConfig = autoFormatted;
		getConnectedPlayers = getConn;
		getBannedPlayers = getBanned;
		getBanTimestamps = getTimestamps;
		getBanReasons = getReasons;
		kickPlayer = kick;
		toggleBanPlayer = toggleBan;
		unbanPlayer = unban;
		banPlayerWithReason = banWithReason;
	}

	public static bool IsUICreated()
	{
		return (Object)(object)banUI != (Object)null;
	}

	public static bool IsUIHealthy()
	{
		return (Object)(object)banUI != (Object)null && (Object)(object)playerListContent != (Object)null && (Object)(object)bannedPlayersContent != (Object)null && (Object)(object)activePlayersTab != (Object)null && (Object)(object)bannedPlayersTab != (Object)null;
	}

	public static void DestroyUI()
	{
		try
		{
			if ((Object)(object)banUI != (Object)null)
			{
				GameObject gameObject = ((Component)banUI.transform.root).gameObject;
				if ((Object)(object)gameObject != (Object)null && ((Object)gameObject).name == "BanModCanvas")
				{
					Object.Destroy((Object)(object)gameObject);
				}
				else
				{
					Object.Destroy((Object)(object)banUI);
				}
				banUI = null;
				banUIPanel = null;
				playerListContent = null;
				bannedPlayersContent = null;
				activePlayersTab = null;
				bannedPlayersTab = null;
				autobanModdedRanksToggle = null;
				autobanOffensiveNamesToggle = null;
				bannedSearchInput = null;
				loggingButton = null;
				loggingPanel = null;
				isLoggingVisible = false;
				mainCanvas = null;
				isFirstTimeOpeningBannedTab = true;
				bannedPlayersPageIndex = 0;
				bannedSearchQuery = string.Empty;
			}
		}
		catch (Exception ex)
		{
			ManualLogSource obj = logger;
			if (obj != null)
			{
				obj.LogError((object)("Error destroying Ban UI: " + ex.Message));
			}
		}
	}

	[IteratorStateMachine(typeof(<CreateUI>d__41))]
	public static IEnumerator CreateUI()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <CreateUI>d__41(0);
	}

	public static void SetActive(bool visible)
	{
		if (!((Object)(object)banUI == (Object)null))
		{
			banUI.SetActive(visible);
			RecentPlayersManager.SetButtonVisible(visible);
			SetLoggingButtonVisible(visible);
		}
	}

	private static void CreateLoggingButton(Canvas canvas)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Expected O, but got Unknown
		//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_0112: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: Unknown result type (might be due to invalid IL or missing references)
		//IL_0157: Unknown result type (might be due to invalid IL or missing references)
		//IL_016e: Unknown result type (might be due to invalid IL or missing references)
		//IL_018e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0195: Expected O, but got Unknown
		//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0209: Unknown result type (might be due to invalid IL or missing references)
		//IL_0216: Unknown result type (might be due to invalid IL or missing references)
		//IL_0223: Unknown result type (might be due to invalid IL or missing references)
		//IL_0230: Unknown result type (might be due to invalid IL or missing references)
		//IL_0248: Unknown result type (might be due to invalid IL or missing references)
		//IL_0252: Expected O, but got Unknown
		if ((Object)(object)loggingButton != (Object)null)
		{
			return;
		}
		loggingButton = new GameObject("LoggingButton");
		GameObject val = null;
		GameObject val2 = GameObject.Find("BanModCanvas");
		if ((Object)(object)val2 != (Object)null)
		{
			Transform val3 = val2.transform.Find("BanModUI");
			if ((Object)(object)val3 != (Object)null)
			{
				val = ((Component)val3).gameObject;
			}
		}
		if ((Object)(object)val != (Object)null)
		{
			loggingButton.transform.SetParent(val.transform, false);
		}
		else
		{
			loggingButton.transform.SetParent(((Component)canvas).transform, false);
			ManualLogSource obj = logger;
			if (obj != null)
			{
				obj.LogWarning((object)"BanModUI not found, logging button created as child of canvas (fallback)");
			}
		}
		Button val4 = loggingButton.AddComponent<Button>();
		Image val5 = loggingButton.AddComponent<Image>();
		((Graphic)val5).color = new Color(0.8f, 0.4f, 0.2f, 0.9f);
		RectTransform component = loggingButton.GetComponent<RectTransform>();
		component.anchorMin = new Vector2(1f, 0f);
		component.anchorMax = new Vector2(1f, 0f);
		component.pivot = new Vector2(1f, 0f);
		component.anchoredPosition = new Vector2(-24f, 24f);
		component.sizeDelta = new Vector2(200f, 52f);
		loggingButton.transform.SetAsLastSibling();
		GameObject val6 = new GameObject("ButtonText");
		val6.transform.SetParent(loggingButton.transform, false);
		Text val7 = val6.AddComponent<Text>();
		val7.text = "Logging";
		val7.font = Resources.GetBuiltinResource<Font>("Arial.ttf");
		val7.fontSize = 14;
		((Graphic)val7).color = Color.white;
		val7.alignment = (TextAnchor)4;
		val7.fontStyle = (FontStyle)1;
		RectTransform component2 = val6.GetComponent<RectTransform>();
		component2.anchorMin = Vector2.zero;
		component2.anchorMax = Vector2.one;
		component2.offsetMin = Vector2.zero;
		component2.offsetMax = Vector2.zero;
		((UnityEvent)val4.onClick).AddListener(new UnityAction(ToggleLoggingPanel));
		loggingButton.SetActive(false);
	}

	public static void SetLoggingButtonVisible(bool visible)
	{
		if ((Object)(object)loggingButton == (Object)null)
		{
			if (visible)
			{
				GameObject obj = GameObject.Find("BanModCanvas");
				Canvas val = ((obj != null) ? obj.GetComponent<Canvas>() : null);
				if ((Object)(object)val != (Object)null)
				{
					CreateLoggingButton(val);
				}
			}
		}
		else
		{
			loggingButton.SetActive(visible);
			if (!visible && isLoggingVisible)
			{
				HideLoggingPanel();
			}
		}
	}

	private static void ToggleLoggingPanel()
	{
		if (isLoggingVisible)
		{
			HideLoggingPanel();
		}
		else
		{
			ShowLoggingPanel();
		}
	}

	[IteratorStateMachine(typeof(<DelayedUIUpdate>d__46))]
	private static IEnumerator DelayedUIUpdate()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <DelayedUIUpdate>d__46(0);
	}

	public static void TestLoggingSystem()
	{
		AddLogMessage($"[{DateTime.Now:HH:mm:ss}] === UI LOGGING TEST ===");
		AddLogMessage($"[{DateTime.Now:HH:mm:ss}] Test message 1: Basic message");
		AddLogMessage($"[{DateTime.Now:HH:mm:ss}] Test message 2: Player1 killed Player2 with Sword");
		AddLogMessage($"[{DateTime.Now:HH:mm:ss}] Test message 3: Wizard casted Fireball at level 5");
		AddLogMessage($"[{DateTime.Now:HH:mm:ss}] Test message 4: WARNING: Fast respawn detected!");
		AddLogMessage($"[{DateTime.Now:HH:mm:ss}] === END TEST ===");
		if (isLoggingVisible)
		{
			ForceRefreshLogDisplay();
		}
	}

	private static void ShowLoggingPanel()
	{
		if ((Object)(object)loggingPanel == (Object)null)
		{
			CreateLoggingPanel();
		}
		else if (!loggingPanel.activeSelf)
		{
			loggingPanel.SetActive(true);
		}
		if (!((Object)(object)loggingPanel != (Object)null))
		{
			return;
		}
		isLoggingVisible = true;
		if (logMessages.Count == 0)
		{
			try
			{
				MainMenuManager val = Object.FindFirstObjectByType<MainMenuManager>();
				if (!((Object)(object)val != (Object)null) || !val.GameHasStarted)
				{
					KillLogger.Instance.LoadPreviousLogs();
				}
				if (logMessages.Count == 0)
				{
					AddLogMessage($"[{DateTime.Now:HH:mm:ss}] === Logging panel created ===");
				}
			}
			catch (Exception ex)
			{
				ManualLogSource obj = logger;
				if (obj != null)
				{
					obj.LogError((object)("Error loading previous logs: " + ex.Message));
				}
				AddLogMessage($"[{DateTime.Now:HH:mm:ss}] === Logging panel created ===");
			}
		}
		UpdateLogDisplay();
		ScrollRect componentInParent = ((Component)logContent).GetComponentInParent<ScrollRect>();
		if ((Object)(object)componentInParent != (Object)null)
		{
			componentInParent.verticalNormalizedPosition = 0f;
		}
	}

	private static void AddDebugTestMessage()
	{
		string item = $"[{DateTime.Now:HH:m