Decompiled source of AdminMenu v2.0.7

plugins/AdminMenu.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text;
using System.Text.Json;
using AdminMenu.Patches;
using AdminMenu.Tabs;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using Construction;
using HarmonyLib;
using Il2CppInterop.Runtime.Injection;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem.Collections.Generic;
using Microsoft.CodeAnalysis;
using Sons.Ai.Vail;
using Sons.Areas;
using Sons.Atmosphere;
using Sons.Characters;
using Sons.Crafting.Structures;
using Sons.Environment;
using Sons.Gameplay;
using Sons.Gameplay.Achievements;
using Sons.Gameplay.Artifact;
using Sons.Gameplay.CarryBody;
using Sons.Gameplay.GPS;
using Sons.Gameplay.GameSetup;
using Sons.Input;
using Sons.Inventory;
using Sons.Item;
using Sons.Items.Core;
using Sons.Multiplayer;
using Sons.Multiplayer.Gui;
using Sons.Save;
using Sons.Settings;
using Sons.StatSystem;
using Sons.Weapon;
using Sons.Wearable;
using Sons.Wearable.Armour;
using Steamworks;
using TheForest;
using TheForest.Commons.Enums;
using TheForest.Items.Inventory;
using TheForest.Utils;
using UnityEngine;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("AdminMenu")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("AdminMenu")]
[assembly: AssemblyTitle("AdminMenu")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace AdminMenu
{
	internal static class Achievements
	{
		internal class Row
		{
			public Achievement Obj;

			public string Key;

			public string Name;

			public string Desc;

			public bool Unlocked;
		}

		private static readonly List<Row> _rows = new List<Row>();

		public static bool Loaded;

		public static string Status = "";

		public static IReadOnlyList<Row> Rows => _rows;

		private static AchievementManager Find()
		{
			GameObject val = GameObject.Find("SteamManager/AchievementManager");
			if ((Object)(object)val == (Object)null)
			{
				return null;
			}
			return val.GetComponent<AchievementManager>();
		}

		private static string SteamAttr(string key, string attr)
		{
			try
			{
				return SteamUserStats.GetAchievementDisplayAttribute(key, attr);
			}
			catch
			{
				return null;
			}
		}

		private static string Pretty(string key)
		{
			if (string.IsNullOrEmpty(key))
			{
				return key;
			}
			StringBuilder stringBuilder = new StringBuilder(key.Length + 8);
			for (int i = 0; i < key.Length; i++)
			{
				char c = key[i];
				if (c == '_')
				{
					stringBuilder.Append(' ');
					continue;
				}
				if (i > 0 && char.IsUpper(c) && !char.IsUpper(key[i - 1]))
				{
					stringBuilder.Append(' ');
				}
				stringBuilder.Append(c);
			}
			return stringBuilder.ToString();
		}

		public static void Refresh()
		{
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Expected O, but got Unknown
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Expected O, but got Unknown
			_rows.Clear();
			Loaded = false;
			bool flag = default(bool);
			try
			{
				AchievementManager val = Find();
				if ((Object)(object)val == (Object)null)
				{
					Status = "Achievement manager not found, load a save first.";
					return;
				}
				List<Achievement> achievements = val._achievements;
				if (achievements == null)
				{
					Status = "Achievement manager not found, load a save first.";
					return;
				}
				for (int i = 0; i < achievements.Count; i++)
				{
					Achievement val2 = achievements[i];
					if ((Object)(object)val2 == (Object)null)
					{
						continue;
					}
					string text = null;
					try
					{
						text = val2.ApiName;
					}
					catch
					{
					}
					if (!string.IsNullOrEmpty(text))
					{
						Row row = new Row
						{
							Obj = val2,
							Key = text
						};
						row.Name = SteamAttr(text, "name");
						if (string.IsNullOrEmpty(row.Name))
						{
							row.Name = Pretty(text);
						}
						row.Desc = SteamAttr(text, "desc");
						try
						{
							row.Unlocked = val2.IsUnlocked();
						}
						catch
						{
						}
						_rows.Add(row);
					}
				}
				_rows.Sort((Row x, Row y) => string.Compare(x.Name, y.Name, StringComparison.OrdinalIgnoreCase));
				Loaded = true;
				Status = "";
				ManualLogSource log = Plugin.Log;
				BepInExDebugLogInterpolatedStringHandler val3 = new BepInExDebugLogInterpolatedStringHandler(29, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("Achievements.Refresh: ");
					((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<int>(_rows.Count);
					((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" loaded");
				}
				log.LogDebug(val3);
			}
			catch (Exception ex)
			{
				Status = "Achievement manager not found, load a save first.";
				ManualLogSource log2 = Plugin.Log;
				BepInExErrorLogInterpolatedStringHandler val4 = new BepInExErrorLogInterpolatedStringHandler(22, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("Achievements.Refresh: ");
					((BepInExLogInterpolatedStringHandler)val4).AppendFormatted<string>(ex.Message);
				}
				log2.LogError(val4);
			}
		}

		public static void RefreshStates()
		{
			for (int i = 0; i < _rows.Count; i++)
			{
				try
				{
					if ((Object)(object)_rows[i].Obj != (Object)null)
					{
						_rows[i].Unlocked = _rows[i].Obj.IsUnlocked();
					}
				}
				catch
				{
				}
			}
		}

		public static void UnlockOne(Row r)
		{
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Expected O, but got Unknown
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			if (r == null || (Object)(object)r.Obj == (Object)null)
			{
				return;
			}
			bool flag = default(bool);
			try
			{
				r.Obj.Unlock();
				r.Unlocked = r.Obj.IsUnlocked();
				ManualLogSource log = Plugin.Log;
				BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(23, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Achievement unlock ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(r.Key);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" -> ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<bool>(r.Unlocked);
				}
				log.LogDebug(val);
			}
			catch (Exception ex)
			{
				ManualLogSource log2 = Plugin.Log;
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(13, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("UnlockOne(");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(r.Key);
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("): ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				log2.LogError(val2);
			}
		}

		public static void ResetOne(Row r)
		{
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Expected O, but got Unknown
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			if (r == null || (Object)(object)r.Obj == (Object)null)
			{
				return;
			}
			bool flag = default(bool);
			try
			{
				r.Obj.Reset();
				r.Unlocked = r.Obj.IsUnlocked();
				ManualLogSource log = Plugin.Log;
				BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(22, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Achievement reset ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(r.Key);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" -> ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<bool>(r.Unlocked);
				}
				log.LogDebug(val);
			}
			catch (Exception ex)
			{
				ManualLogSource log2 = Plugin.Log;
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(12, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("ResetOne(");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(r.Key);
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("): ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				log2.LogError(val2);
			}
		}

		public static void UnlockAll()
		{
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Expected O, but got Unknown
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Expected O, but got Unknown
			bool flag = default(bool);
			try
			{
				AchievementManager val = Find();
				if ((Object)(object)val == (Object)null)
				{
					Plugin.Log.LogWarning((object)"UnlockAll: no AchievementManager");
					return;
				}
				List<Achievement> achievements = val._achievements;
				if (achievements == null)
				{
					Plugin.Log.LogWarning((object)"UnlockAll: _achievements is null");
					return;
				}
				int num = 0;
				for (int i = 0; i < achievements.Count; i++)
				{
					Achievement val2 = achievements[i];
					if (!((Object)(object)val2 == (Object)null))
					{
						val2.Unlock();
						num++;
					}
				}
				ManualLogSource log = Plugin.Log;
				BepInExDebugLogInterpolatedStringHandler val3 = new BepInExDebugLogInterpolatedStringHandler(33, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("UnlockAll: unlocked ");
					((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<int>(num);
					((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" achievements");
				}
				log.LogDebug(val3);
				RefreshStates();
			}
			catch (Exception ex)
			{
				ManualLogSource log2 = Plugin.Log;
				BepInExErrorLogInterpolatedStringHandler val4 = new BepInExErrorLogInterpolatedStringHandler(11, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("UnlockAll: ");
					((BepInExLogInterpolatedStringHandler)val4).AppendFormatted<string>(ex.Message);
				}
				log2.LogError(val4);
			}
		}

		public static void LockAll()
		{
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Expected O, but got Unknown
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Expected O, but got Unknown
			bool flag = default(bool);
			try
			{
				AchievementManager val = Find();
				if ((Object)(object)val == (Object)null)
				{
					Plugin.Log.LogWarning((object)"LockAll: no AchievementManager");
					return;
				}
				List<Achievement> achievements = val._achievements;
				if (achievements == null)
				{
					Plugin.Log.LogWarning((object)"LockAll: _achievements is null");
					return;
				}
				int num = 0;
				for (int i = 0; i < achievements.Count; i++)
				{
					Achievement val2 = achievements[i];
					if (!((Object)(object)val2 == (Object)null))
					{
						val2.Reset();
						num++;
					}
				}
				ManualLogSource log = Plugin.Log;
				BepInExDebugLogInterpolatedStringHandler val3 = new BepInExDebugLogInterpolatedStringHandler(28, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("LockAll: reset ");
					((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<int>(num);
					((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" achievements");
				}
				log.LogDebug(val3);
				RefreshStates();
			}
			catch (Exception ex)
			{
				ManualLogSource log2 = Plugin.Log;
				BepInExErrorLogInterpolatedStringHandler val4 = new BepInExErrorLogInterpolatedStringHandler(9, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("LockAll: ");
					((BepInExLogInterpolatedStringHandler)val4).AppendFormatted<string>(ex.Message);
				}
				log2.LogError(val4);
			}
		}
	}
	internal static class Cheats
	{
		public static bool CaveBrightnessOn;

		public static bool ContinuousHealOn;

		public static bool LungReplenishOn;

		public static bool ColdImmunityOn;

		public static bool RushModeOn;

		public static bool LogResourceLockOn;

		public static bool BuildResourceLockOn;

		public static bool DeathPinOn;

		public static float BodyScale = 1f;

		private static float? _origRunSpeedForRush;

		public static bool RadialCullEnabled;

		public static float RadialCullRadius = 10f;

		public static bool DetachedViewOn;

		public static bool CapsuleViewOn;

		public static bool CenterReticleOn;

		public static float WildlifeSpawnMul = 1f;

		public static float GravityScalar = -9.81f;

		public static float JumpForceScalar = 1f;

		public static void SetDeathPin(bool on)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			DeathPinOn = on;
			ManualLogSource log = Plugin.Log;
			bool flag = default(bool);
			BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(12, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("DeathPin -> ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<bool>(on);
			}
			log.LogDebug(val);
			CheatsDriverHost.Ensure();
		}

		public static void SetCaveBrightness(bool on)
		{
			CaveBrightnessOn = on;
			Send("cavelight " + (on ? "on" : "off"), "SetCaveBrightness");
		}

		public static void SetContinuousHeal(bool on)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Expected O, but got Unknown
			ContinuousHealOn = on;
			ManualLogSource log = Plugin.Log;
			bool flag = default(bool);
			BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(18, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("ContinuousHeal -> ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<bool>(on);
			}
			log.LogDebug(val);
			CheatsDriverHost.Ensure();
			if (!on)
			{
				return;
			}
			try
			{
				Vitals vitals = LocalPlayer.Vitals;
				if ((Object)(object)vitals != (Object)null)
				{
					vitals.SetFullHealth();
					vitals.SetFullVitality();
				}
			}
			catch (Exception ex)
			{
				ManualLogSource log2 = Plugin.Log;
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(19, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("SetContinuousHeal: ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				log2.LogError(val2);
			}
		}

		public static void SetLungReplenish(bool on)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			LungReplenishOn = on;
			ManualLogSource log = Plugin.Log;
			bool flag = default(bool);
			BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(17, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("LungReplenish -> ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<bool>(on);
			}
			log.LogDebug(val);
		}

		public static void SetColdImmunity(bool on)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected O, but got Unknown
			ColdImmunityOn = on;
			ManualLogSource log = Plugin.Log;
			bool flag = default(bool);
			BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(16, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("ColdImmunity -> ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<bool>(on);
			}
			log.LogDebug(val);
			try
			{
				Vitals vitals = LocalPlayer.Vitals;
				if ((Object)(object)vitals != (Object)null)
				{
					vitals.SetIsCold(false);
				}
			}
			catch (Exception ex)
			{
				ManualLogSource log2 = Plugin.Log;
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(17, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("SetColdImmunity: ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				log2.LogError(val2);
			}
		}

		public static void SetRushMode(bool on)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Expected O, but got Unknown
			RushModeOn = on;
			ManualLogSource log = Plugin.Log;
			bool flag = default(bool);
			BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(12, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("RushMode -> ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<bool>(on);
			}
			log.LogDebug(val);
			try
			{
				if ((Object)(object)LocalPlayer._instance == (Object)null)
				{
					Plugin.Log.LogWarning((object)"SetRushMode: no LocalPlayer");
					return;
				}
				FirstPersonCharacter fpCharacter = LocalPlayer.FpCharacter;
				if (!((Object)(object)fpCharacter == (Object)null))
				{
					if (on)
					{
						_origRunSpeedForRush = fpCharacter.RunSpeed;
						fpCharacter.SetRunSpeed(25f);
					}
					else if (_origRunSpeedForRush.HasValue)
					{
						fpCharacter.SetRunSpeed(_origRunSpeedForRush.Value);
						_origRunSpeedForRush = null;
					}
				}
			}
			catch (Exception ex)
			{
				ManualLogSource log2 = Plugin.Log;
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(13, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("SetRushMode: ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				log2.LogError(val2);
			}
		}

		public static void SetLogResourceLock(bool on)
		{
			LogResourceLockOn = on;
			Send("loghack " + (on ? "on" : "off"), "SetLogResourceLock");
		}

		public static void SetBuildResourceLock(bool on)
		{
			BuildResourceLockOn = on;
			Send("slapchop " + (on ? "on" : "off"), "SetBuildResourceLock");
		}

		public static void SetBodyScale(float scale)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Expected O, but got Unknown
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			scale = Mathf.Clamp(scale, 0.2f, 50f);
			BodyScale = scale;
			ManualLogSource log = Plugin.Log;
			bool flag = default(bool);
			BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(14, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("BodyScale -> ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(scale, "0.00");
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("x");
			}
			log.LogDebug(val);
			try
			{
				if ((Object)(object)LocalPlayer._instance == (Object)null)
				{
					Plugin.Log.LogWarning((object)"SetBodyScale: no LocalPlayer");
					return;
				}
				GameObject playerBase = LocalPlayer.PlayerBase;
				(((Object)(object)playerBase != (Object)null) ? playerBase.transform : LocalPlayer.Transform).localScale = new Vector3(scale, scale, scale);
			}
			catch (Exception ex)
			{
				ManualLogSource log2 = Plugin.Log;
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(14, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("SetBodyScale: ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				log2.LogError(val2);
			}
		}

		public static void ResetBodyScale()
		{
			SetBodyScale(1f);
		}

		public static void FixStuckMouse()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			try
			{
				Cursor.lockState = (CursorLockMode)0;
				Cursor.visible = true;
				Plugin.Log.LogDebug((object)"FixStuckMouse: cursor unlocked");
			}
			catch (Exception ex)
			{
				ManualLogSource log = Plugin.Log;
				bool flag = default(bool);
				BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(15, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("FixStuckMouse: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message);
				}
				log.LogError(val);
			}
		}

		public static void SetRadialCull(bool on)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			RadialCullEnabled = on;
			ManualLogSource log = Plugin.Log;
			bool flag = default(bool);
			BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(24, 2, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("RadialCull -> ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<bool>(on);
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" (radius=");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(RadialCullRadius);
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")");
			}
			log.LogDebug(val);
			CheatsDriverHost.Ensure();
		}

		public static void SetRadialCullRadius(float r)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			RadialCullRadius = Mathf.Max(0.5f, r);
			ManualLogSource log = Plugin.Log;
			bool flag = default(bool);
			BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(20, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("RadialCullRadius -> ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(RadialCullRadius, "0.0");
			}
			log.LogDebug(val);
		}

		public static void FakeDrown()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			Plugin.Log.LogDebug((object)"FakeDrown invoked");
			try
			{
				DebugConsole.Instance._fakeDrown("");
			}
			catch (Exception ex)
			{
				ManualLogSource log = Plugin.Log;
				bool flag = default(bool);
				BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(11, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("FakeDrown: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message);
				}
				log.LogError(val);
			}
		}

		public static void SetDetachedView(bool on)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Expected O, but got Unknown
			DetachedViewOn = on;
			ManualLogSource log = Plugin.Log;
			bool flag = default(bool);
			BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(16, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("DetachedView -> ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<bool>(on);
			}
			log.LogDebug(val);
			try
			{
				DebugConsole.Instance._freecamera(on ? "on" : "off");
			}
			catch (Exception ex)
			{
				ManualLogSource log2 = Plugin.Log;
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(17, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("SetDetachedView: ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				log2.LogError(val2);
			}
		}

		public static void SetCapsuleView(bool on)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Expected O, but got Unknown
			CapsuleViewOn = on;
			ManualLogSource log = Plugin.Log;
			bool flag = default(bool);
			BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(15, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("CapsuleView -> ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<bool>(on);
			}
			log.LogDebug(val);
			try
			{
				DebugConsole.Instance._capsulemode(on ? "on" : "off");
			}
			catch (Exception ex)
			{
				ManualLogSource log2 = Plugin.Log;
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(16, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("SetCapsuleView: ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				log2.LogError(val2);
			}
		}

		public static void SetCenterReticle(bool on)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			CenterReticleOn = on;
			ManualLogSource log = Plugin.Log;
			bool flag = default(bool);
			BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(17, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("CenterReticle -> ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<bool>(on);
			}
			log.LogDebug(val);
		}

		public static void DrawCenterCrosshair()
		{
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Expected O, but got Unknown
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			if (!CenterReticleOn)
			{
				return;
			}
			try
			{
				float num = (float)Screen.width * 0.5f;
				float num2 = (float)Screen.height * 0.5f;
				Color color = GUI.color;
				GUI.color = Color.white;
				GUI.DrawTexture(new Rect(num - 8f, num2 - 1f, 16f, 2f), (Texture)(object)Theme.AccentTex);
				GUI.DrawTexture(new Rect(num - 1f, num2 - 8f, 2f, 16f), (Texture)(object)Theme.AccentTex);
				GUI.color = color;
			}
			catch (Exception ex)
			{
				ManualLogSource log = Plugin.Log;
				bool flag = default(bool);
				BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(21, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("DrawCenterCrosshair: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message);
				}
				log.LogError(val);
			}
		}

		public static void HurricaneWind()
		{
			Plugin.Log.LogDebug((object)"HurricaneWind invoked");
			Send("setwindintensity 50", "HurricaneWind");
		}

		public static void ForceRainStorm()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			Plugin.Log.LogDebug((object)"ForceRainStorm invoked");
			try
			{
				DebugConsole.Instance._forcerain("heavy");
			}
			catch (Exception ex)
			{
				ManualLogSource log = Plugin.Log;
				bool flag = default(bool);
				BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(16, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("ForceRainStorm: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message);
				}
				log.LogError(val);
			}
		}

		public static void WeatherClear()
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected O, but got Unknown
			Plugin.Log.LogDebug((object)"WeatherClear invoked");
			try
			{
				DebugConsole.Instance._forcerain("none");
			}
			catch
			{
			}
			Send("setwindintensity 0", "WeatherClear");
			try
			{
				RainEffectController val = Object.FindObjectOfType<RainEffectController>();
				if ((Object)(object)val != (Object)null)
				{
					val.SetActive(false);
				}
			}
			catch (Exception ex)
			{
				ManualLogSource log = Plugin.Log;
				bool flag = default(bool);
				BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(23, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("WeatherClear rain off: ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				log.LogWarning(val2);
			}
		}

		public static void WeatherStorm()
		{
			Plugin.Log.LogDebug((object)"WeatherStorm invoked");
			try
			{
				DebugConsole.Instance._forcerain("heavy");
			}
			catch
			{
			}
			Send("setwindintensity 50", "WeatherStorm");
		}

		public static void WeatherSnow()
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			Plugin.Log.LogDebug((object)"WeatherSnow invoked");
			try
			{
				SnowHeightManager val = Object.FindObjectOfType<SnowHeightManager>();
				if ((Object)(object)val != (Object)null)
				{
					val.SetIsWinter(true);
					val.SetServerSnowHeight(2f);
				}
				else
				{
					Plugin.Log.LogWarning((object)"WeatherSnow: no SnowHeightManager");
				}
			}
			catch (Exception ex)
			{
				ManualLogSource log = Plugin.Log;
				bool flag = default(bool);
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(13, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("WeatherSnow: ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				log.LogError(val2);
			}
		}

		public static void ClearAllStructures()
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			Plugin.Log.LogDebug((object)"ClearAllStructures invoked");
			try
			{
				RuntimeStructureDatabase val = Object.FindObjectOfType<RuntimeStructureDatabase>();
				if ((Object)(object)val != (Object)null)
				{
					val.ClearAllStructures();
				}
				else
				{
					Plugin.Log.LogWarning((object)"ClearAllStructures: no RuntimeStructureDatabase in scene");
				}
			}
			catch (Exception ex)
			{
				ManualLogSource log = Plugin.Log;
				bool flag = default(bool);
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(20, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("ClearAllStructures: ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				log.LogError(val2);
			}
		}

		public static void CutAllTrees()
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			Plugin.Log.LogDebug((object)"CutAllTrees invoked");
			try
			{
				DebugConsole.Instance._treesCutAll("");
				Plugin.Log.LogDebug((object)"CutAllTrees: _treesCutAll('') called");
			}
			catch (Exception ex)
			{
				ManualLogSource log = Plugin.Log;
				bool flag = default(bool);
				BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(45, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("_treesCutAll('') failed: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(", trying SendCommand");
				}
				log.LogWarning(val);
				Send("treescutall", "CutAllTrees");
			}
		}

		public static void RegrowTrees()
		{
			Plugin.Log.LogDebug((object)"RegrowTrees invoked");
			Send("regrowalltrees", "RegrowTrees");
		}

		public static void RemoveDeadBodies()
		{
			Plugin.Log.LogDebug((object)"RemoveDeadBodies invoked");
			Send("removedead", "RemoveDeadBodies");
		}

		public static void SpawnFallingTree()
		{
			Plugin.Log.LogDebug((object)"SpawnFallingTree invoked");
			Send("spawnfallingtree", "SpawnFallingTree");
		}

		public static void TriggerGameOver()
		{
			Plugin.Log.LogDebug((object)"TriggerGameOver invoked");
			Send("playgameover", "TriggerGameOver");
		}

		public static void ClearBushesRadius(float r)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Expected O, but got Unknown
			ManualLogSource log = Plugin.Log;
			bool flag = default(bool);
			BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(26, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("ClearBushesRadius ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(r, "0.0");
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" invoked");
			}
			log.LogDebug(val);
			try
			{
				DebugConsole.Instance._clearBushRadius(r.ToString("0.0"));
			}
			catch (Exception ex)
			{
				ManualLogSource log2 = Plugin.Log;
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(19, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("ClearBushesRadius: ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				log2.LogError(val2);
			}
		}

		public static void SetWildlifeSpawnMul(float v)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			WildlifeSpawnMul = v;
			ManualLogSource log = Plugin.Log;
			bool flag = default(bool);
			BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(20, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("WildlifeSpawnMul -> ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(v, "0.00");
			}
			log.LogDebug(val);
			try
			{
				DebugConsole.Instance._animalLimitMult(v.ToString("0.00"));
			}
			catch (Exception ex)
			{
				ManualLogSource log2 = Plugin.Log;
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(21, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("SetWildlifeSpawnMul: ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				log2.LogError(val2);
			}
		}

		public static void InsaneAnimalSpawns()
		{
			SetWildlifeSpawnMul(50f);
		}

		public static void CreepyAttackParty()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			Plugin.Log.LogDebug((object)"CreepyAttackParty invoked");
			try
			{
				DebugConsole.Instance._creepyAttackParty("on");
			}
			catch (Exception ex)
			{
				ManualLogSource log = Plugin.Log;
				bool flag = default(bool);
				BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(19, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("CreepyAttackParty: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message);
				}
				log.LogError(val);
			}
		}

		public static void SetGravityScalar(float v)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			GravityScalar = v;
			ManualLogSource log = Plugin.Log;
			bool flag = default(bool);
			BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(17, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("GravityScalar -> ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(v, "0.00");
			}
			log.LogDebug(val);
			try
			{
				DebugConsole.Instance._gravity(v.ToString("0.00"));
			}
			catch (Exception ex)
			{
				ManualLogSource log2 = Plugin.Log;
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(18, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("SetGravityScalar: ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				log2.LogError(val2);
			}
		}

		public static void SetJumpForceScalar(float v)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			JumpForceScalar = v;
			ManualLogSource log = Plugin.Log;
			bool flag = default(bool);
			BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(19, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("JumpForceScalar -> ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(v, "0.00");
			}
			log.LogDebug(val);
			try
			{
				DebugConsole.Instance._superJump(v.ToString("0.00"));
			}
			catch (Exception ex)
			{
				ManualLogSource log2 = Plugin.Log;
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(20, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("SetJumpForceScalar: ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				log2.LogError(val2);
			}
		}

		public static void AddAllItems()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			Plugin.Log.LogDebug((object)"AddAllItems invoked");
			try
			{
				DebugConsole.Instance._addAllItems("on");
			}
			catch (Exception ex)
			{
				ManualLogSource log = Plugin.Log;
				bool flag = default(bool);
				BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(13, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("AddAllItems: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message);
				}
				log.LogError(val);
			}
		}

		public static void IndexSpawnableItems()
		{
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Expected O, but got Unknown
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Expected O, but got Unknown
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Expected O, but got Unknown
			bool flag = default(bool);
			try
			{
				List<ItemData> items = ItemDatabaseManager.Items;
				if (items == null)
				{
					Plugin.Log.LogWarning((object)"IndexSpawnableItems: no items");
					return;
				}
				int count = items.Count;
				ManualLogSource log = Plugin.Log;
				BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(27, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("IndexSpawnableItems: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(count);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" items");
				}
				log.LogDebug(val);
				for (int i = 0; i < count; i++)
				{
					ItemData val2 = items[i];
					if (!((Object)(object)val2 == (Object)null))
					{
						ManualLogSource log2 = Plugin.Log;
						val = new BepInExDebugLogInterpolatedStringHandler(5, 2, ref flag);
						if (flag)
						{
							((BepInExLogInterpolatedStringHandler)val).AppendLiteral("  #");
							((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(val2.Id);
							((BepInExLogInterpolatedStringHandler)val).AppendLiteral("  ");
							((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(val2.Name);
						}
						log2.LogDebug(val);
					}
				}
			}
			catch (Exception ex)
			{
				ManualLogSource log3 = Plugin.Log;
				BepInExErrorLogInterpolatedStringHandler val3 = new BepInExErrorLogInterpolatedStringHandler(21, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("IndexSpawnableItems: ");
					((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(ex.Message);
				}
				log3.LogError(val3);
			}
		}

		public static void GiveChainsaw()
		{
			GiveByName("Chainsaw");
		}

		public static void GiveKatana()
		{
			GiveByName("Katana");
		}

		public static void GiveShotgun()
		{
			GiveByName("Shotgun");
		}

		private static void GiveByName(string name)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Expected O, but got Unknown
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Expected O, but got Unknown
			ManualLogSource log = Plugin.Log;
			bool flag = default(bool);
			BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(22, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("GiveByName('");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(name);
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("') invoked");
			}
			log.LogDebug(val);
			try
			{
				int num = ItemDatabaseManager.ItemIdByName(name);
				if (num <= 0)
				{
					ManualLogSource log2 = Plugin.Log;
					BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(57, 1, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("GiveByName(");
						((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(name);
						((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("): not found, falling back to substring search");
					}
					log2.LogWarning(val2);
					List<(string, int)> list = Spawning.SearchItems(name, 1);
					if (list.Count == 0)
					{
						ManualLogSource log3 = Plugin.Log;
						val2 = new BepInExWarningLogInterpolatedStringHandler(22, 1, ref flag);
						if (flag)
						{
							((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("GiveByName(");
							((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(name);
							((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("): no match");
						}
						log3.LogWarning(val2);
					}
					else
					{
						Spawning.SpawnItem(list[0].Item2, 1);
					}
				}
				else
				{
					Spawning.SpawnItem(num, 1);
				}
			}
			catch (Exception ex)
			{
				ManualLogSource log4 = Plugin.Log;
				BepInExErrorLogInterpolatedStringHandler val3 = new BepInExErrorLogInterpolatedStringHandler(14, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("GiveByName(");
					((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(name);
					((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("): ");
					((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(ex.Message);
				}
				log4.LogError(val3);
			}
		}

		private static void Send(string cmd, string label)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			bool flag = default(bool);
			try
			{
				DebugConsole.Instance.SendCommand(cmd);
				ManualLogSource log = Plugin.Log;
				BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(20, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(label);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": SendCommand('");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(cmd);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("') OK");
				}
				log.LogDebug(val);
			}
			catch (Exception ex)
			{
				ManualLogSource log2 = Plugin.Log;
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(7, 3, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(label);
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" ('");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(cmd);
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("'): ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				log2.LogError(val2);
			}
		}
	}
	internal static class CheatsDriverHost
	{
		private static CheatsDriver _driver;

		private static bool _registered;

		public static void Ensure()
		{
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Expected O, but got Unknown
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			if ((Object)(object)_driver != (Object)null)
			{
				return;
			}
			try
			{
				if (!_registered)
				{
					ClassInjector.RegisterTypeInIl2Cpp<CheatsDriver>();
					_registered = true;
				}
				GameObject val = new GameObject("AdminMenu_CheatsDriver");
				Object.DontDestroyOnLoad((Object)val);
				_driver = val.AddComponent<CheatsDriver>();
				Plugin.Log.LogDebug((object)"CheatsDriver created");
			}
			catch (Exception ex)
			{
				ManualLogSource log = Plugin.Log;
				bool flag = default(bool);
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(25, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("CheatsDriverHost.Ensure: ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				log.LogError(val2);
			}
		}
	}
	public class CheatsDriver : MonoBehaviour
	{
		private float _infHealTimer;

		private float _killAuraTimer;

		private float _lungTimer;

		private float _coldTimer;

		private float _deathPollTimer;

		private bool _wasAliveLastPoll = true;

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

		private void Update()
		{
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Expected O, but got Unknown
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Expected O, but got Unknown
			//IL_0253: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Expected O, but got Unknown
			//IL_0364: Unknown result type (might be due to invalid IL or missing references)
			//IL_036b: Expected O, but got Unknown
			//IL_03a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03af: Expected O, but got Unknown
			//IL_0422: Unknown result type (might be due to invalid IL or missing references)
			//IL_0429: Expected O, but got Unknown
			//IL_045e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0465: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0323: Unknown result type (might be due to invalid IL or missing references)
			//IL_032a: Expected O, but got Unknown
			bool flag = default(bool);
			try
			{
				if ((Object)(object)LocalPlayer._instance == (Object)null)
				{
					return;
				}
				float deltaTime = Time.deltaTime;
				if (Cheats.RadialCullEnabled)
				{
					_killAuraTimer += deltaTime;
					if (_killAuraTimer >= 0.1f)
					{
						_killAuraTimer = 0f;
						try
						{
							Vector3 position = LocalPlayer.Transform.position;
							float num = Cheats.RadialCullRadius * Cheats.RadialCullRadius;
							Il2CppReferenceArray<VailActor> activeActors = VailActorManager.GetActiveActors();
							if (activeActors != null)
							{
								int length = ((Il2CppArrayBase<VailActor>)(object)activeActors).Length;
								for (int i = 0; i < length; i++)
								{
									VailActor val = ((Il2CppArrayBase<VailActor>)(object)activeActors)[i];
									if ((Object)(object)val == (Object)null)
									{
										continue;
									}
									try
									{
										if (val._isDead)
										{
											continue;
										}
									}
									catch
									{
										continue;
									}
									Transform transform;
									try
									{
										transform = ((Component)val).transform;
									}
									catch
									{
										continue;
									}
									if ((Object)(object)transform == (Object)null)
									{
										continue;
									}
									Vector3 position2 = transform.position;
									float num2 = position2.x - position.x;
									float num3 = position2.y - position.y;
									float num4 = position2.z - position.z;
									if (!(num2 * num2 + num3 * num3 + num4 * num4 > num))
									{
										try
										{
											val.ForceDeath();
										}
										catch
										{
										}
									}
								}
							}
						}
						catch (Exception ex)
						{
							ManualLogSource log = Plugin.Log;
							BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(15, 1, ref flag);
							if (flag)
							{
								((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("KillAura tick: ");
								((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
							}
							log.LogError(val2);
						}
					}
				}
				if (Cheats.ContinuousHealOn)
				{
					_infHealTimer += deltaTime;
					if (_infHealTimer >= 0.5f)
					{
						_infHealTimer = 0f;
						try
						{
							Vitals vitals = LocalPlayer.Vitals;
							if ((Object)(object)vitals != (Object)null)
							{
								vitals.SetFullHealth();
								vitals.SetFullVitality();
							}
						}
						catch (Exception ex2)
						{
							ManualLogSource log2 = Plugin.Log;
							BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(14, 1, ref flag);
							if (flag)
							{
								((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("InfHeal tick: ");
								((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex2.Message);
							}
							log2.LogError(val2);
						}
					}
				}
				if (Cheats.LungReplenishOn)
				{
					_lungTimer += deltaTime;
					if (_lungTimer >= 0.25f)
					{
						_lungTimer = 0f;
						try
						{
							Vitals vitals2 = LocalPlayer.Vitals;
							BreathingData val3 = (((Object)(object)vitals2 != (Object)null) ? vitals2.LungBreathing : null);
							if (val3 != null)
							{
								val3.CurrentLungAir = val3.MaxLungAirCapacity;
							}
						}
						catch (Exception ex3)
						{
							ManualLogSource log3 = Plugin.Log;
							BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(14, 1, ref flag);
							if (flag)
							{
								((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("InfLung tick: ");
								((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex3.Message);
							}
							log3.LogError(val2);
						}
					}
				}
				if (Cheats.DeathPinOn)
				{
					_deathPollTimer += deltaTime;
					if (_deathPollTimer >= 0.25f)
					{
						_deathPollTimer = 0f;
						try
						{
							Vitals vitals3 = LocalPlayer.Vitals;
							bool flag2 = (Object)(object)vitals3 != (Object)null && vitals3.IsAlive();
							if (_wasAliveLastPoll && !flag2)
							{
								string text = $"Death @ {DateTime.Now:HH:mm}";
								try
								{
									Teleport.SaveCurrent(text);
									ManualLogSource log4 = Plugin.Log;
									BepInExDebugLogInterpolatedStringHandler val4 = new BepInExDebugLogInterpolatedStringHandler(20, 1, ref flag);
									if (flag)
									{
										((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("DeathPin: dropped '");
										((BepInExLogInterpolatedStringHandler)val4).AppendFormatted<string>(text);
										((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("'");
									}
									log4.LogDebug(val4);
								}
								catch (Exception ex4)
								{
									ManualLogSource log5 = Plugin.Log;
									BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(15, 1, ref flag);
									if (flag)
									{
										((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("DeathPin save: ");
										((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex4.Message);
									}
									log5.LogError(val2);
								}
							}
							_wasAliveLastPoll = flag2;
						}
						catch (Exception ex5)
						{
							ManualLogSource log6 = Plugin.Log;
							BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(15, 1, ref flag);
							if (flag)
							{
								((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("DeathPin tick: ");
								((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex5.Message);
							}
							log6.LogError(val2);
						}
					}
				}
				if (!Cheats.ColdImmunityOn)
				{
					return;
				}
				_coldTimer += deltaTime;
				if (!(_coldTimer >= 1f))
				{
					return;
				}
				_coldTimer = 0f;
				try
				{
					Vitals vitals4 = LocalPlayer.Vitals;
					if (vitals4 != null)
					{
						vitals4.SetIsCold(false);
					}
				}
				catch (Exception ex6)
				{
					ManualLogSource log7 = Plugin.Log;
					BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(13, 1, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("NoCold tick: ");
						((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex6.Message);
					}
					log7.LogError(val2);
				}
			}
			catch (Exception ex7)
			{
				ManualLogSource log8 = Plugin.Log;
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(21, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("CheatsDriver.Update: ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex7.Message);
				}
				log8.LogError(val2);
			}
		}
	}
	internal static class Combat
	{
		public static bool DamageOverride { get; set; }

		public static bool AmmoLockEnabled { get; set; }

		public static bool ImpulseBoostEnabled { get; set; }

		public static bool TreeOneShotEnabled { get; set; }

		public static bool SilentToEnemies { get; set; }

		public static float ImpulseMultiplier { get; set; } = 10f;

		public static float DamageOverrideValue { get; set; } = 99999f;

		public static float DamageMultiplier { get; set; } = 1f;

		public static bool AiPauseEnabled { get; private set; }

		public static void SetDamageOverride(bool on)
		{
			DamageOverride = on;
		}

		public static void SetAmmoLock(bool on)
		{
			AmmoLockEnabled = on;
		}

		public static void SetImpulseBoost(bool on)
		{
			ImpulseBoostEnabled = on;
		}

		public static void SetTreeOneShot(bool on)
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Expected O, but got Unknown
			TreeOneShotEnabled = on;
			try
			{
				if (Cheats.Setup != null)
				{
					Cheats.Setup.OneHitTreeCutting = on;
				}
				else
				{
					Plugin.Log.LogWarning((object)"SetTreeOneShot: Cheats.Setup is null (game not ready yet)");
				}
			}
			catch (Exception ex)
			{
				ManualLogSource log = Plugin.Log;
				bool flag = default(bool);
				BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(16, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SetTreeOneShot: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message);
				}
				log.LogError(val);
			}
		}

		public static void SetSilentToEnemies(bool on)
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			SilentToEnemies = on;
			try
			{
				VailActorManager.SetGhostPlayer(on);
				if (!on)
				{
					HideOtherPlayerLabelsWhenInvisible.RestoreAll();
				}
			}
			catch (Exception ex)
			{
				ManualLogSource log = Plugin.Log;
				bool flag = default(bool);
				BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(20, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SetSilentToEnemies: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message);
				}
				log.LogError(val);
			}
		}

		private static void ForEachActor(Action<VailActor> fn)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			Il2CppReferenceArray<VailActor> activeActors = VailActorManager.GetActiveActors();
			if (activeActors == null)
			{
				return;
			}
			bool flag = default(bool);
			for (int i = 0; i < ((Il2CppArrayBase<VailActor>)(object)activeActors).Length; i++)
			{
				VailActor val = ((Il2CppArrayBase<VailActor>)(object)activeActors)[i];
				if ((Object)(object)val == (Object)null)
				{
					continue;
				}
				try
				{
					fn(val);
				}
				catch (Exception ex)
				{
					ManualLogSource log = Plugin.Log;
					BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(10, 1, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("actor op: ");
						((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
					}
					log.LogError(val2);
				}
			}
		}

		public static void ExecCannibalSweep()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Expected O, but got Unknown
			bool flag = default(bool);
			try
			{
				int n = 0;
				ForEachActor(delegate(VailActor a)
				{
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					//IL_0007: Invalid comparison between Unknown and I4
					//IL_000a: Unknown result type (might be due to invalid IL or missing references)
					//IL_0010: Invalid comparison between Unknown and I4
					if ((int)a.ClassId == 1 || (int)a.ClassId == 2)
					{
						a.ForceDeath();
						n++;
					}
				});
				ManualLogSource log = Plugin.Log;
				BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(19, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("ExecCannibalSweep: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(n);
				}
				log.LogDebug(val);
			}
			catch (Exception ex)
			{
				ManualLogSource log2 = Plugin.Log;
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(19, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("ExecCannibalSweep: ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				log2.LogError(val2);
			}
		}

		public static void ExecCannibalIgnite()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Expected O, but got Unknown
			bool flag = default(bool);
			try
			{
				int n = 0;
				ForEachActor(delegate(VailActor a)
				{
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					//IL_0007: Invalid comparison between Unknown and I4
					//IL_000a: Unknown result type (might be due to invalid IL or missing references)
					//IL_0010: Invalid comparison between Unknown and I4
					if ((int)a.ClassId == 1 || (int)a.ClassId == 2)
					{
						a.IgniteSelf(80f);
						n++;
					}
				});
				ManualLogSource log = Plugin.Log;
				BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(20, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("ExecCannibalIgnite: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(n);
				}
				log.LogDebug(val);
			}
			catch (Exception ex)
			{
				ManualLogSource log2 = Plugin.Log;
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(20, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("ExecCannibalIgnite: ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				log2.LogError(val2);
			}
		}

		public static void ExecAnimalSweep()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Expected O, but got Unknown
			bool flag = default(bool);
			try
			{
				int n = 0;
				ForEachActor(delegate(VailActor a)
				{
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					//IL_0007: Invalid comparison between Unknown and I4
					if ((int)a.ClassId == 3)
					{
						a.ForceDeath();
						n++;
					}
				});
				ManualLogSource log = Plugin.Log;
				BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(17, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("ExecAnimalSweep: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(n);
				}
				log.LogDebug(val);
			}
			catch (Exception ex)
			{
				ManualLogSource log2 = Plugin.Log;
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(17, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("ExecAnimalSweep: ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				log2.LogError(val2);
			}
		}

		public static void SetAiPause(bool on)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			AiPauseEnabled = on;
			try
			{
				VailWorldSimulation.SetPaused(on);
			}
			catch (Exception ex)
			{
				ManualLogSource log = Plugin.Log;
				bool flag = default(bool);
				BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(12, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SetAiPause: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message);
				}
				log.LogError(val);
			}
		}
	}
	internal static class ConsolePopupSuppressor
	{
		public static bool Active = true;

		public static void Init()
		{
		}

		internal static void OnConsoleAwake(BoltConsole bc)
		{
			if (!Active || (Object)(object)bc == (Object)null)
			{
				return;
			}
			try
			{
				if (bc.visible)
				{
					bc.visible = false;
				}
			}
			catch
			{
			}
		}
	}
	[HarmonyPatch(typeof(BoltConsole), "Awake")]
	internal static class BoltConsole_Awake_Hide
	{
		private static void Postfix(BoltConsole __instance)
		{
			ConsolePopupSuppressor.OnConsoleAwake(__instance);
		}
	}
	[HarmonyPatch(typeof(BoltConsole), "OnGUI")]
	internal static class BoltConsole_OnGUI_Suppress
	{
		private static bool Prefix()
		{
			return !ConsolePopupSuppressor.Active;
		}
	}
	internal static class Esp
	{
		private struct CachedLabel
		{
			public int Dist;

			public bool Flag;

			public string Text;
		}

		private static GUIStyle _txtStyle;

		private static GUIStyle _radarLabelStyle;

		private static Texture2D _whiteTex;

		private static Texture2D _radarBgTex;

		private static bool _loggedActorErr;

		private static bool _loggedPlayerErr;

		private static bool _loggedRadarErr;

		private static bool _loggedWaypointErr;

		private static bool _loggedItemErr;

		private static Camera _camRef;

		private static float _camCacheTime;

		private static Il2CppArrayBase<PlayerName> _cachedPlayerNames;

		private static float _playerNamesCacheTime;

		private const int LabelBudgetPerFrame = 90;

		private static int _labelsThisFrame;

		private static int _labelBudgetFrameNum;

		private static readonly Dictionary<int, CachedLabel> _labelById = new Dictionary<int, CachedLabel>();

		private static readonly Dictionary<long, CachedLabel> _labelByKey = new Dictionary<long, CachedLabel>();

		private static readonly Dictionary<object, CachedLabel> _labelByObj = new Dictionary<object, CachedLabel>();

		private static float _labelPurgeAt;

		private static string _radarLabel;

		private static int _radarLabelRange;

		public static bool ActorEsp { get; set; }

		public static bool AnimalEsp { get; set; }

		public static bool PlayerEsp { get; set; }

		public static bool RadarEsp { get; set; }

		public static bool WaypointEsp { get; set; }

		public static bool ItemEsp { get; set; }

		public static bool ContainerEsp { get; set; }

		public static bool CollectibleEsp { get; set; }

		public static bool ShowDead { get; set; }

		public static float MaxDistance { get; set; } = 200f;

		public static void Init()
		{
		}

		private static void EnsureStyles()
		{
			//IL_0012: 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)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Expected O, but got Unknown
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Expected O, but got Unknown
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			if (_txtStyle == null)
			{
				GUIStyle val = new GUIStyle(GUI.skin.label)
				{
					fontSize = 11,
					alignment = (TextAnchor)4
				};
				val.normal.textColor = Color.white;
				_txtStyle = val;
				GUIStyle val2 = new GUIStyle(GUI.skin.label)
				{
					fontSize = 10,
					alignment = (TextAnchor)4
				};
				val2.normal.textColor = Color.white;
				_radarLabelStyle = val2;
				_whiteTex = new Texture2D(2, 2, (TextureFormat)4, false)
				{
					hideFlags = (HideFlags)61
				};
				Color[] array = (Color[])(object)new Color[4];
				for (int i = 0; i < 4; i++)
				{
					array[i] = Color.white;
				}
				_whiteTex.SetPixels(Il2CppStructArray<Color>.op_Implicit(array));
				_whiteTex.Apply();
				_radarBgTex = new Texture2D(2, 2, (TextureFormat)4, false)
				{
					hideFlags = (HideFlags)61
				};
				Color[] array2 = (Color[])(object)new Color[4];
				for (int j = 0; j < 4; j++)
				{
					array2[j] = new Color(0f, 0f, 0f, 0.55f);
				}
				_radarBgTex.SetPixels(Il2CppStructArray<Color>.op_Implicit(array2));
				_radarBgTex.Apply();
			}
		}

		private static Color ColorForClass(VailActorClassId id)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Invalid comparison between Unknown and I4
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Invalid comparison between Unknown and I4
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Invalid comparison between Unknown and I4
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			if ((int)id == 1)
			{
				return Color.red;
			}
			if ((int)id == 3)
			{
				return Color.green;
			}
			if ((int)id == 2)
			{
				return new Color(1f, 0f, 1f);
			}
			return Color.white;
		}

		private static void DrawShadowedLabel(Rect r, string text, Color color, GUIStyle style)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			Color color2 = GUI.color;
			GUI.color = new Color(0f, 0f, 0f, 0.85f);
			GUI.Label(new Rect(((Rect)(ref r)).x + 1f, ((Rect)(ref r)).y + 1f, ((Rect)(ref r)).width, ((Rect)(ref r)).height), text, style);
			GUI.color = color;
			GUI.Label(r, text, style);
			GUI.color = color2;
		}

		private static Camera GetCam()
		{
			if ((Object)(object)_camRef == (Object)null || Time.unscaledTime - _camCacheTime > 2f)
			{
				_camRef = Camera.main;
				_camCacheTime = Time.unscaledTime;
			}
			return _camRef;
		}

		private static Il2CppArrayBase<PlayerName> GetPlayerNames()
		{
			if (_cachedPlayerNames == null || Time.unscaledTime - _playerNamesCacheTime > 2f)
			{
				_cachedPlayerNames = Object.FindObjectsOfType<PlayerName>(true);
				_playerNamesCacheTime = Time.unscaledTime;
			}
			return _cachedPlayerNames;
		}

		public static void RenderActorEsp()
		{
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Invalid comparison between Unknown and I4
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Invalid comparison between Unknown and I4
			//IL_0394: Unknown result type (might be due to invalid IL or missing references)
			//IL_039b: Expected O, but got Unknown
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0307: Unknown result type (might be due to invalid IL or missing references)
			//IL_030c: Unknown result type (might be due to invalid IL or missing references)
			//IL_030e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0313: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_034e: Unknown result type (might be due to invalid IL or missing references)
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0328: Unknown result type (might be due to invalid IL or missing references)
			//IL_0335: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			if ((!ActorEsp && !AnimalEsp) || (int)Event.current.type != 7)
			{
				return;
			}
			try
			{
				EnsureStyles();
				PurgeLabelCaches();
				Camera cam = GetCam();
				if ((Object)(object)cam == (Object)null || (Object)(object)LocalPlayer._instance == (Object)null)
				{
					return;
				}
				Vector3 position = LocalPlayer.Transform.position;
				float num = MaxDistance * MaxDistance;
				int num2 = RemainingLabelBudget();
				if (num2 <= 0)
				{
					return;
				}
				Il2CppReferenceArray<VailActor> activeActors = VailActorManager.GetActiveActors();
				if (activeActors == null)
				{
					return;
				}
				int length = ((Il2CppArrayBase<VailActor>)(object)activeActors).Length;
				for (int i = 0; i < length && num2 > 0; i++)
				{
					VailActor val = ((Il2CppArrayBase<VailActor>)(object)activeActors)[i];
					if ((Object)(object)val == (Object)null)
					{
						continue;
					}
					Transform transform;
					try
					{
						transform = ((Component)val).transform;
					}
					catch
					{
						continue;
					}
					if ((Object)(object)transform == (Object)null)
					{
						continue;
					}
					Vector3 position2;
					try
					{
						position2 = transform.position;
					}
					catch
					{
						continue;
					}
					float num3 = position2.x - position.x;
					float num4 = position2.y - position.y;
					float num5 = position2.z - position.z;
					float num6 = num3 * num3 + num4 * num4 + num5 * num5;
					if (num6 > num)
					{
						continue;
					}
					bool flag;
					try
					{
						flag = val._isDead;
					}
					catch
					{
						flag = false;
					}
					if (flag && !ShowDead)
					{
						continue;
					}
					VailActorClassId val2;
					try
					{
						val2 = val.ClassId;
					}
					catch
					{
						val2 = (VailActorClassId)0;
					}
					bool flag2 = (int)val2 == 3;
					if ((flag2 && !AnimalEsp) || (!flag2 && !ActorEsp))
					{
						continue;
					}
					float num7 = (flag ? 0.35f : (flag2 ? 0.5f : 1.8f));
					Vector3 val3 = cam.WorldToScreenPoint(position2 + Vector3.up * num7);
					if (val3.z <= 0f)
					{
						continue;
					}
					int num8 = Mathf.RoundToInt(Mathf.Sqrt(num6));
					int key;
					try
					{
						key = ((Object)val).GetInstanceID();
					}
					catch
					{
						key = 0;
					}
					if (!_labelById.TryGetValue(key, out var value) || value.Dist != num8 || value.Flag != flag)
					{
						string value2;
						try
						{
							value2 = ((object)val.TypeId/*cast due to .constrained prefix*/).ToString();
						}
						catch
						{
							value2 = "?";
						}
						value.Text = (flag ? $"{value2} (dead) {num8}m" : $"{value2} {num8}m");
						value.Dist = num8;
						value.Flag = flag;
						_labelById[key] = value;
					}
					string text = value.Text;
					Rect r = new Rect(val3.x - 60f, (float)Screen.height - val3.y - 9f, 120f, 18f);
					Color val4 = ColorForClass(val2);
					if (flag)
					{
						((Color)(ref val4))..ctor(val4.r * 0.5f, val4.g * 0.5f, val4.b * 0.5f, 0.7f);
					}
					DrawShadowedLabel(r, text, val4, _txtStyle);
					_labelsThisFrame++;
					num2--;
				}
			}
			catch (Exception ex)
			{
				if (!_loggedActorErr)
				{
					_loggedActorErr = true;
					ManualLogSource log = Plugin.Log;
					bool flag3 = default(bool);
					BepInExErrorLogInterpolatedStringHandler val5 = new BepInExErrorLogInterpolatedStringHandler(28, 1, ref flag3);
					if (flag3)
					{
						((BepInExLogInterpolatedStringHandler)val5).AppendLiteral("RenderActorEsp first error: ");
						((BepInExLogInterpolatedStringHandler)val5).AppendFormatted<Exception>(ex);
					}
					log.LogError(val5);
				}
			}
		}

		private static void PurgeLabelCaches()
		{
			if (!(Time.unscaledTime < _labelPurgeAt))
			{
				_labelPurgeAt = Time.unscaledTime + 60f;
				_labelById.Clear();
				_labelByKey.Clear();
				_labelByObj.Clear();
			}
		}

		private static int RemainingLabelBudget()
		{
			if (_labelBudgetFrameNum != Time.frameCount)
			{
				_labelBudgetFrameNum = Time.frameCount;
				_labelsThisFrame = 0;
			}
			return 90 - _labelsThisFrame;
		}

		public static void RenderItemEsp()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Invalid comparison between Unknown and I4
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: 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_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: 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_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			if (!ItemEsp || (int)Event.current.type != 7)
			{
				return;
			}
			try
			{
				EnsureStyles();
				PurgeLabelCaches();
				Camera cam = GetCam();
				if ((Object)(object)cam == (Object)null || (Object)(object)LocalPlayer._instance == (Object)null)
				{
					return;
				}
				Vector3 position = LocalPlayer.Transform.position;
				float num = MaxDistance * MaxDistance;
				int num2 = RemainingLabelBudget();
				if (num2 <= 0)
				{
					return;
				}
				foreach (KeyValuePair<long, EspRegistry.SeenPickup> seenPickup in EspRegistry.SeenPickups)
				{
					if (num2 <= 0)
					{
						break;
					}
					Vector3 pos = seenPickup.Value.Pos;
					float num3 = pos.x - position.x;
					float num4 = pos.y - position.y;
					float num5 = pos.z - position.z;
					float num6 = num3 * num3 + num4 * num4 + num5 * num5;
					if (num6 > num)
					{
						continue;
					}
					Vector3 val = cam.WorldToScreenPoint(pos + Vector3.up * 0.3f);
					if (!(val.z <= 0f))
					{
						(string, Color) metaPublic = ItemEspScanner.GetMetaPublic(seenPickup.Value.ItemId);
						int num7 = Mathf.RoundToInt(Mathf.Sqrt(num6));
						if (!_labelByKey.TryGetValue(seenPickup.Key, out var value) || value.Dist != num7)
						{
							value.Text = $"{metaPublic.Item1} {num7}m";
							value.Dist = num7;
							_labelByKey[seenPickup.Key] = value;
						}
						DrawShadowedLabel(new Rect(val.x - 70f, (float)Screen.height - val.y - 8f, 140f, 16f), value.Text, metaPublic.Item2, _txtStyle);
						_labelsThisFrame++;
						num2--;
					}
				}
			}
			catch (Exception ex)
			{
				if (!_loggedItemErr)
				{
					_loggedItemErr = true;
					ManualLogSource log = Plugin.Log;
					bool flag = default(bool);
					BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(15, 1, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("RenderItemEsp: ");
						((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<Exception>(ex);
					}
					log.LogError(val2);
				}
			}
		}

		public static void RenderContainerEsp()
		{
			RenderSnapshot(ContainerEsp, ItemEspScanner.ContainerSnapshot, 0.8f);
		}

		public static void RenderCollectibleEsp()
		{
			RenderSnapshot(CollectibleEsp, ItemEspScanner.CollectSnapshot, 0.8f);
		}

		private static void RenderSnapshot(bool flag, List<ItemEspScanner.Entry> snap, float yOffset)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Invalid comparison between Unknown and I4
			//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b1: Expected O, but got Unknown
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			if (!flag || (int)Event.current.type != 7)
			{
				return;
			}
			try
			{
				EnsureStyles();
				PurgeLabelCaches();
				Camera cam = GetCam();
				if ((Object)(object)cam == (Object)null || (Object)(object)LocalPlayer._instance == (Object)null)
				{
					return;
				}
				Vector3 position = LocalPlayer.Transform.position;
				float num = MaxDistance * MaxDistance;
				int num2 = RemainingLabelBudget();
				if (num2 <= 0 || snap == null)
				{
					return;
				}
				int count = snap.Count;
				for (int i = 0; i < count && num2 > 0; i++)
				{
					ItemEspScanner.Entry entry = snap[i];
					Vector3 val;
					if ((Object)(object)entry.Tr != (Object)null)
					{
						try
						{
							val = entry.Tr.position;
						}
						catch
						{
							continue;
						}
					}
					else
					{
						val = entry.SnapshotPos;
					}
					float num3 = val.x - position.x;
					float num4 = val.y - position.y;
					float num5 = val.z - position.z;
					float num6 = num3 * num3 + num4 * num4 + num5 * num5;
					if (num6 > num)
					{
						continue;
					}
					Vector3 val2 = cam.WorldToScreenPoint(val + Vector3.up * yOffset);
					if (val2.z <= 0f)
					{
						continue;
					}
					int num7 = Mathf.RoundToInt(Mathf.Sqrt(num6));
					int num8 = 0;
					if ((Object)(object)entry.Tr != (Object)null)
					{
						try
						{
							num8 = ((Object)entry.Tr).GetInstanceID();
						}
						catch
						{
							num8 = 0;
						}
					}
					string text;
					if (num8 != 0)
					{
						if (!_labelById.TryGetValue(num8, out var value) || value.Dist != num7)
						{
							value.Text = $"{entry.Label} {num7}m";
							value.Dist = num7;
							_labelById[num8] = value;
						}
						text = value.Text;
					}
					else
					{
						text = $"{entry.Label} {num7}m";
					}
					DrawShadowedLabel(new Rect(val2.x - 70f, (float)Screen.height - val2.y - 8f, 140f, 16f), text, entry.Color, _txtStyle);
					_labelsThisFrame++;
					num2--;
				}
			}
			catch (Exception ex)
			{
				if (!_loggedItemErr)
				{
					_loggedItemErr = true;
					ManualLogSource log = Plugin.Log;
					bool flag2 = default(bool);
					BepInExErrorLogInterpolatedStringHandler val3 = new BepInExErrorLogInterpolatedStringHandler(28, 1, ref flag2);
					if (flag2)
					{
						((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("RenderSnapshot first error: ");
						((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<Exception>(ex);
					}
					log.LogError(val3);
				}
			}
		}

		public static void RenderPlayerEsp()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Invalid comparison between Unknown and I4
			//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cf: Expected O, but got Unknown
			//IL_024b: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: 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_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			if (!PlayerEsp || (int)Event.current.type != 7)
			{
				return;
			}
			try
			{
				EnsureStyles();
				PurgeLabelCaches();
				Camera cam = GetCam();
				if ((Object)(object)cam == (Object)null || (Object)(object)LocalPlayer._instance == (Object)null)
				{
					return;
				}
				Vector3 position = LocalPlayer.Transform.position;
				float num = MaxDistance * MaxDistance;
				int num2 = RemainingLabelBudget();
				if (num2 <= 0)
				{
					return;
				}
				Il2CppArrayBase<PlayerName> playerNames = GetPlayerNames();
				if (playerNames == null)
				{
					return;
				}
				Color color = default(Color);
				((Color)(ref color))..ctor(0.4f, 0.8f, 1f);
				for (int i = 0; i < playerNames.Length && num2 > 0; i++)
				{
					PlayerName val = playerNames[i];
					if ((Object)(object)val == (Object)null)
					{
						continue;
					}
					try
					{
						if (val._playerState == null)
						{
							continue;
						}
					}
					catch
					{
						continue;
					}
					Transform transform;
					try
					{
						transform = ((Component)val).transform;
					}
					catch
					{
						continue;
					}
					if ((Object)(object)transform == (Object)null)
					{
						continue;
					}
					Vector3 position2;
					try
					{
						position2 = transform.position;
					}
					catch
					{
						continue;
					}
					float num3 = position2.x - position.x;
					float num4 = position2.y - position.y;
					float num5 = position2.z - position.z;
					float num6 = num3 * num3 + num4 * num4 + num5 * num5;
					if (num6 < 0.25f || num6 > num)
					{
						continue;
					}
					Vector3 val2 = cam.WorldToScreenPoint(position2 + Vector3.up * 1.9f);
					if (val2.z <= 0f)
					{
						continue;
					}
					int num7 = Mathf.RoundToInt(Mathf.Sqrt(num6));
					int key;
					try
					{
						key = ((Object)val).GetInstanceID();
					}
					catch
					{
						key = 0;
					}
					if (!_labelById.TryGetValue(key, out var value) || value.Dist != num7)
					{
						string value2 = "Player";
						try
						{
							IPlayerState playerState = val._playerState;
							if (playerState != null)
							{
								string name = playerState.name;
								if (!string.IsNullOrEmpty(name))
								{
									value2 = name;
								}
							}
						}
						catch
						{
						}
						value.Text = $"{value2} {num7}m";
						value.Dist = num7;
						_labelById[key] = value;
					}
					string text = value.Text;
					DrawShadowedLabel(new Rect(val2.x - 80f, (float)Screen.height - val2.y - 9f, 160f, 18f), text, color, _txtStyle);
					_labelsThisFrame++;
					num2--;
				}
			}
			catch (Exception ex)
			{
				if (!_loggedPlayerErr)
				{
					_loggedPlayerErr = true;
					ManualLogSource log = Plugin.Log;
					bool flag = default(bool);
					BepInExErrorLogInterpolatedStringHandler val3 = new BepInExErrorLogInterpolatedStringHandler(17, 1, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("RenderPlayerEsp: ");
						((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(ex.Message);
					}
					log.LogError(val3);
				}
			}
		}

		public static void RenderWaypointEsp()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Invalid comparison between Unknown and I4
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			if (!WaypointEsp || (int)Event.current.type != 7)
			{
				return;
			}
			try
			{
				EnsureStyles();
				PurgeLabelCaches();
				Camera cam = GetCam();
				if ((Object)(object)cam == (Object)null || (Object)(object)LocalPlayer._instance == (Object)null)
				{
					return;
				}
				Vector3 position = LocalPlayer.Transform.position;
				Color color = default(Color);
				((Color)(ref color))..ctor(1f, 0.85f, 0.2f);
				IReadOnlyList<(string, Vector3)> savedSpots = Teleport.SavedSpots;
				for (int i = 0; i < savedSpots.Count; i++)
				{
					(string, Vector3) tuple = savedSpots[i];
					int num = Mathf.RoundToInt(Vector3.Distance(position, tuple.Item2));
					Vector3 val = cam.WorldToScreenPoint(tuple.Item2);
					if (!(val.z <= 0f))
					{
						if (!_labelByObj.TryGetValue(tuple, out var value) || value.Dist != num)
						{
							value.Text = $"[{tuple.Item1}] {num}m";
							value.Dist = num;
							_labelByObj[tuple] = value;
						}
						string text = value.Text;
						DrawShadowedLabel(new Rect(val.x - 80f, (float)Screen.height - val.y - 9f, 160f, 18f), text, color, _txtStyle);
						Color color2 = GUI.color;
						GUI.color = color;
						GUI.DrawTexture(new Rect(val.x - 2f, (float)Screen.height - val.y - 2f, 4f, 4f), (Texture)(object)_whiteTex);
						GUI.color = color2;
					}
				}
			}
			catch (Exception ex)
			{
				if (!_loggedWaypointErr)
				{
					_loggedWaypointErr = true;
					ManualLogSource log = Plugin.Log;
					bool flag = default(bool);
					BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(19, 1, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("RenderWaypointEsp: ");
						((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
					}
					log.LogError(val2);
				}
			}
		}

		public static void RenderRadar()
		{
			//IL_0339: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Invalid comparison between Unknown and I4
			//IL_033d: Unknown result type (might be due to invalid IL or missing references)
			//IL_033f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0344: Unknown result type (might be due to invalid IL or missing references)
			//IL_04da: Unknown result type (might be due to invalid IL or missing references)
			//IL_058f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0596: Expected O, but got Unknown
			//IL_037d: Unknown result type (might be due to invalid IL or missing references)
			//IL_039e: Unknown result type (might be due to invalid IL or missing references)
			//IL_034c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0359: Unknown result type (might be due to invalid IL or missing references)
			//IL_0366: Unknown result type (might be due to invalid IL or missing references)
			//IL_0554: Unknown result type (might be due to invalid IL or missing references)
			//IL_055e: Unknown result type (might be due to invalid IL or missing references)
			//IL_056d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (m