Decompiled source of AdminMenu v2.0.5
plugins/AdminMenu.dll
Decompiled 9 hours ago
The result has been truncated due to the large size, download it to view full contents!
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.UI; 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 { private static AchievementManager Find() { GameObject val = GameObject.Find("SteamManager/AchievementManager"); if ((Object)(object)val == (Object)null) { return null; } return val.GetComponent<AchievementManager>(); } public static void UnlockAll() { //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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); } 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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); } 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; private static bool _registered; private static BoltConsole _cachedBc; private static float _nextRefindTime; public static void Init() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown try { if (!_registered) { ClassInjector.RegisterTypeInIl2Cpp<ConsolePopupDriver>(); _registered = true; } GameObject val = new GameObject("AdminMenu_ConsolePopupSuppressor") { hideFlags = (HideFlags)61 }; Object.DontDestroyOnLoad((Object)val); val.AddComponent<ConsolePopupDriver>(); Plugin.Log.LogDebug((object)"ConsolePopupSuppressor active (suppresses bottom-left BoltConsole popup)"); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(29, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("ConsolePopupSuppressor.Init: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message); } log.LogError(val2); } } internal static void TickHide() { if (!Active) { return; } try { if ((Object)(object)_cachedBc == (Object)null) { if (Time.unscaledTime < _nextRefindTime) { return; } _nextRefindTime = Time.unscaledTime + 5f; _cachedBc = Object.FindObjectOfType<BoltConsole>(); if ((Object)(object)_cachedBc == (Object)null) { return; } } if (_cachedBc.visible) { _cachedBc.visible = false; } } catch { } } } [HarmonyPatch(typeof(BoltConsole), "OnGUI")] internal static class BoltConsole_OnGUI_Suppress { private static bool Prefix() { return !ConsolePopupSuppressor.Active; } } public class ConsolePopupDriver : MonoBehaviour { public ConsolePopupDriver(IntPtr ptr) : base(ptr) { } private void LateUpdate() { ConsolePopupSuppressor.TickHide(); } } internal static class Esp { 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; 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>(); _playerNamesCacheTime = Time.unscaledTime; } return _cachedPlayerNames; } public static void RenderActorEsp() { //IL_014f: 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_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Invalid comparison between Unknown and I4 //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Expected O, but got Unknown //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0179: 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_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: 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_0100: Unknown result type (might be due to invalid IL or missing references) if ((!ActorEsp && !AnimalEsp) || (int)Event.current.type != 7) { return; } try { EnsureStyles(); 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; } Vector3 val3 = cam.WorldToScreenPoint(position2 + Vector3.up * 1.8f); if (!(val3.z <= 0f)) { float value = Mathf.Sqrt(num6); string value2; try { value2 = ((object)val.TypeId/*cast due to .constrained prefix*/).ToString(); } catch { value2 = "?"; } string text = (flag ? $"{value2} (dead) {value:0}m" : $"{value2} {value:0}m"); 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 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_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Expected O, but got Unknown //IL_0042: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0136: 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_0199: Unknown result type (might be due to invalid IL or missing references) if (!ItemEsp || (int)Event.current.type != 7) { return; } try { EnsureStyles(); 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)) { Vector3 val = cam.WorldToScreenPoint(pos + Vector3.up * 0.3f); if (!(val.z <= 0f)) { (string, Color) metaPublic = ItemEspScanner.GetMetaPublic(seenPickup.Value.ItemId); float value = Mathf.Sqrt(num6); DrawShadowedLabel(new Rect(val.x - 70f, (float)Screen.height - val.y - 8f, 140f, 16f), $"{metaPublic.Item1} {value:0}m", 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_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Expected O, but got Unknown //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_00af: 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_009e: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: 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) //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_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0189: 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_01aa: Unknown result type (might be due to invalid IL or missing references) if (!flag || (int)Event.current.type != 7) { return; } try { EnsureStyles(); 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)) { Vector3 val2 = cam.WorldToScreenPoint(val + Vector3.up * yOffset); if (!(val2.z <= 0f)) { float value = Mathf.Sqrt(num6); string text = $"{entry.Label} {value:0}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_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Expected O, but got Unknown //IL_0042: 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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) if (!PlayerEsp || (int)Event.current.type != 7) { return; } try { EnsureStyles(); 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; } 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; } string value = "Player"; try { IPlayerState playerState = val._playerState; if (playerState != null) { string name = playerState.name; if (!string.IsNullOrEmpty(name)) { value = name; } } } catch { } float value2 = Mathf.Sqrt(num6); string text = $"{value} {value2:0}m"; 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_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Expected O, but got Unknown //IL_0042: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013f: 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_016a: Unknown result type (might be due to invalid IL or missing references) if (!WaypointEsp || (int)Event.current.type != 7) { return; } try { EnsureStyles(); 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]; float value = Vector3.Distance(position, tuple.Item2); Vector3 val = cam.WorldToScreenPoint(tuple.Item2); if (!(val.z <= 0f)) { string text = $"[{tuple.Item1}] {value:0}m"; 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_0334: 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_0338: Unknown result type (might be due to invalid IL or missing references) //IL_033a: 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_04d5: Unknown result type (might be due to invalid IL or missing references) //IL_04f9: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Unknown result type (might be due to invalid IL or missing references) //IL_0565: Unknown result type (might be due to invalid IL or missing references) //IL_056c: Expected O, but got Unknown //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: 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_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0162: 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_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) if (!RadarEsp || (int)Event.current.type != 7) { return; } try { EnsureStyles(); if ((Object)(object)LocalPlayer._instance == (Object)null) { return; } Camera cam = GetCam(); Vector3 position = LocalPlayer.Transform.position; float num = (((Object)(object)cam != (Object)null) ? ((Component)cam).transform.eulerAngles.y : LocalPlayer.Transform.eulerAngles.y) * ((float)Math.PI / 180f); float num2 = Mathf.Cos(0f - num); float num3 = Mathf.Sin(0f - num); float num4 = (float)Screen.width - 150f - 12f; float num5 = 12f; Rect val = new Rect(num4, num5, 150f, 150f); Color color = GUI.color; GUI.color = Color.white; GUI.DrawTexture(val, (Texture)(object)_radarBgTex); GUI.color = new Color(1f, 1f, 1f, 0.4f); GUI.DrawTexture(new Rect(num4, num5, 150f, 1f), (Texture)(object)_whiteTex); GUI.DrawTexture(new Rect(num4, num5 + 150f - 1f, 150f, 1f), (Texture)(object)_whiteTex); GUI.DrawTexture(new Rect(num4, num5, 1f, 150f), (Texture)(object)_whiteTex); GUI.DrawTexture(new Rect(num4 + 150f - 1f, num5, 1f, 150f), (Texture)(object)_whiteTex); float num6 = num4 + 75f; float num7 = num5 + 75f; GUI.color = new Color(1f, 1f, 1f, 0.15f); GUI.DrawTexture(new Rect(num4, num7, 150f, 1f), (Texture)(object)_whiteTex); GUI.DrawTexture(new Rect(num6, num5, 1f, 150f), (Texture)(object)_whiteTex); GUI.color = Color.white; GUI.DrawTexture(new Rect(num6 - 2f, num7 - 2f, 4f, 4f), (Texture)(object)_whiteTex); GUI.DrawTexture(new Rect(num6 - 1f, num7 - 8f, 2f, 6f), (Texture)(object)_whiteTex); float maxDistance = MaxDistance; float num8 = 71f / maxDistance; Il2CppReferenceArray<VailActor> activeActors = VailActorManager.GetActiveActors(); if (activeActors != null) { int length = ((Il2CppArrayBase<VailActor>)(object)activeActors).Length; float num9 = maxDistance * maxDistance; for (int i = 0; i < length; i++) { VailActor val2 = ((Il2CppArrayBase<VailActor>)(object)activeActors)[i]; if ((Object)(object)val2 == (Object)null) { continue; } bool flag; try { flag = val2._isDead; } catch { flag = false; } if (flag && !ShowDead) { continue; } Transform transform; try { transform = ((Component)val2).transform; } catch { continue; } if ((Object)(object)transform == (Object)null) { continue; } Vector3 position2 = transform.position; float num10 = position2.x - position.x; float num11 = position2.z - position.z; if (!(num10 * num10 + num11 * num11 > num9)) { float num12 = num10 * num2 - num11 * num3; float num13 = num10 * num3 + num11 * num2; float num14 = num6 + num12 * num8; float num15 = num7 - num13 * num8; VailActorClassId id; try { id = val2.ClassId; } catch { id = (VailActorClassId)0; } Color val3 = ColorForClass(id); if (flag) { ((Color)(ref val3))..ctor(val3.r * 0.5f, val3.g * 0.5f, val3.b * 0.5f, 0.7f); } GUI.color = val3; GUI.DrawTexture(new Rect(num14 - 2f, num15 - 2f, 4f, 4f), (Texture)(object)_whiteTex); } } } try { Il2CppArrayBase<PlayerName> playerNames = GetPlayerNames(); if (playerNames != null) { Color color2 = default(Color); ((Color)(ref color2))..ctor(0.4f, 0.8f, 1f); for (int j = 0; j < playerNames.Length; j++) { PlayerName val4 = playerNames[j]; if ((Object)(object)val4 == (Object)null) { continue; } Transform transform2; try { transform2 = ((Component)val4).transform; } catch { continue; } if (!((Object)(object)transform2 == (Object)null)) { float num16 = transform2.position.x - position.x; float num17 = transform2.position.z - position.z; float num18 = Mathf.Sqrt(num16 * num16 + num17 * num17); if (!(num18 < 0.5f) && !(num18 > maxDistance)) { float num19 = num16 * num2 - num17 * num3; float num20 = num16 * num3 + num17 * num2; float num21 = num6 + num19 * num8; float num22 = num7 - num20 * num8; GUI.color = color2; GUI.DrawTexture(new Rect(num21 - 3f, num22 - 3f, 6f, 6f), (Texture)(object)_whiteTex); } } } } } catch { } GUI.color = Color.white; DrawShadowedLabel(new Rect(num4, num5 + 150f + 2f, 150f, 14f), $"Radar {maxDistance:0}m", Color.white, _radarLabelStyle); GUI.color = color; } catch (Exception ex) { if (!_loggedRadarErr) { _loggedRadarErr = true; ManualLogSource log = Plugin.Log; bool flag2 = default(bool); BepInExErrorLogInterpolatedStringHandler val5 = new BepInExErrorLogInterpolatedStringHandler(13, 1, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val5).AppendLiteral("RenderRadar: "); ((BepInExLogInterpolatedStringHandler)val5).AppendFormatted<string>(ex.Message); } log.LogError(val5); } } } } internal static class EspRegistry { public struct SeenPickup { public Vector3 Pos; public int ItemId; } public static readonly HashSet<PickUp> Pickups = new HashSet<PickUp>(); public static readonly HashSet<DroppedInventoryItemsPickup> DroppedBags = new HashSet<DroppedInventoryItemsPickup>(); public static readonly HashSet<StructureStorage> StructureStorages = new HashSet<StructureStorage>(); public static readonly HashSet<ContainerItemSpawner> LootCrates = new HashSet<ContainerItemSpawner>(); public static readonly HashSet<InWorldAutoStorage> AutoStorages = new HashSet<InWorldAutoStorage>(); public static readonly HashSet<ArtifactStructure> Artifacts = new HashSet<ArtifactStructure>(); public static readonly HashSet<GPSLocator> GpsLocators = new HashSet<GPSLocator>(); public static readonly Dictionary<long, SeenPickup> SeenPickups = new Dictionary<long, SeenPickup>(); public static void RememberPic