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(); } 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 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(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(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 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(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(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(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(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(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(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(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(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(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(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(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(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(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(on); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" (radius="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(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(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(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(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(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(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(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(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(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(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(); 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(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(); 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(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(); 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(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(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(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(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(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(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(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(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(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(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(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(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 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(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(val2.Id); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(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(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(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(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(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(name); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("): "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(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(label); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": SendCommand('"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(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(label); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" ('"); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(cmd); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("'): "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(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(); _registered = true; } GameObject val = new GameObject("AdminMenu_CheatsDriver"); Object.DontDestroyOnLoad((Object)val); _driver = val.AddComponent(); 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(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 activeActors = VailActorManager.GetActiveActors(); if (activeActors != null) { int length = ((Il2CppArrayBase)(object)activeActors).Length; for (int i = 0; i < length; i++) { VailActor val = ((Il2CppArrayBase)(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(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(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(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(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(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(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(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(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(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(ex.Message); } log.LogError(val); } } private static void ForEachActor(Action fn) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown Il2CppReferenceArray activeActors = VailActorManager.GetActiveActors(); if (activeActors == null) { return; } bool flag = default(bool); for (int i = 0; i < ((Il2CppArrayBase)(object)activeActors).Length; i++) { VailActor val = ((Il2CppArrayBase)(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(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(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(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(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(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(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(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(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(); _registered = true; } GameObject val = new GameObject("AdminMenu_ConsolePopupSuppressor") { hideFlags = (HideFlags)61 }; Object.DontDestroyOnLoad((Object)val); val.AddComponent(); 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(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(); 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 _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.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.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 GetPlayerNames() { if (_cachedPlayerNames == null || Time.unscaledTime - _playerNamesCacheTime > 2f) { _cachedPlayerNames = Object.FindObjectsOfType(); _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 activeActors = VailActorManager.GetActiveActors(); if (activeActors == null) { return; } int length = ((Il2CppArrayBase)(object)activeActors).Length; for (int i = 0; i < length && num2 > 0; i++) { VailActor val = ((Il2CppArrayBase)(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(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 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(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 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(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 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(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(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 activeActors = VailActorManager.GetActiveActors(); if (activeActors != null) { int length = ((Il2CppArrayBase)(object)activeActors).Length; float num9 = maxDistance * maxDistance; for (int i = 0; i < length; i++) { VailActor val2 = ((Il2CppArrayBase)(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 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(ex.Message); } log.LogError(val5); } } } } internal static class EspRegistry { public struct SeenPickup { public Vector3 Pos; public int ItemId; } public static readonly HashSet Pickups = new HashSet(); public static readonly HashSet DroppedBags = new HashSet(); public static readonly HashSet StructureStorages = new HashSet(); public static readonly HashSet LootCrates = new HashSet(); public static readonly HashSet AutoStorages = new HashSet(); public static readonly HashSet Artifacts = new HashSet(); public static readonly HashSet GpsLocators = new HashSet(); public static readonly Dictionary SeenPickups = new Dictionary(); public static void RememberPickup(Vector3 pos, int itemId) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (itemId > 0) { SeenPickups[KeyFor(pos)] = new SeenPickup { Pos = pos, ItemId = itemId }; } } public static void ForgetPickup(Vector3 pos) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) SeenPickups.Remove(KeyFor(pos)); } private static long KeyFor(Vector3 pos) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0013: 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) return ((long)Mathf.RoundToInt(pos.x) * 73856093L) ^ ((long)Mathf.RoundToInt(pos.y) * 19349663L) ^ ((long)Mathf.RoundToInt(pos.z) * 83492791L); } } [HarmonyPatch(typeof(PickUp), "OnEnable")] internal static class RegisterPickup { private static void Postfix(PickUp __instance) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)__instance == (Object)null) { return; } EspRegistry.Pickups.Add(__instance); DroppedInventoryItemsPickup val = (DroppedInventoryItemsPickup)(object)((__instance is DroppedInventoryItemsPickup) ? __instance : null); if (val != null) { EspRegistry.DroppedBags.Add(val); } try { if ((Object)(object)((Component)__instance).transform != (Object)null) { EspRegistry.RememberPickup(((Component)__instance).transform.position, __instance._itemId); } } catch { } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(16, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("RegisterPickup: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } } } [HarmonyPatch(typeof(PickUp), "OnDisable")] internal static class RememberPickupOnDisable { private static void Postfix(PickUp __instance) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) try { if (!((Object)(object)__instance == (Object)null) && !((Object)(object)((Component)__instance).transform == (Object)null)) { EspRegistry.RememberPickup(((Component)__instance).transform.position, __instance._itemId); } } catch { } } } [HarmonyPatch(typeof(PickUp), "Take")] internal static class ForgetPickupOnTake { private static void Prefix(PickUp __instance) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) try { if (!((Object)(object)__instance == (Object)null) && !((Object)(object)((Component)__instance).transform == (Object)null)) { EspRegistry.ForgetPickup(((Component)__instance).transform.position); } } catch { } } } [HarmonyPatch(typeof(PickUp), "OnDestroy")] internal static class UnregisterPickup { private static void Postfix(PickUp __instance) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown try { if (!((Object)(object)__instance == (Object)null)) { EspRegistry.Pickups.Remove(__instance); DroppedInventoryItemsPickup val = (DroppedInventoryItemsPickup)(object)((__instance is DroppedInventoryItemsPickup) ? __instance : null); if (val != null) { EspRegistry.DroppedBags.Remove(val); } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(18, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("UnregisterPickup: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } } } [HarmonyPatch(typeof(StructureStorage), "Awake")] internal static class RegisterStructureStorage { private static void Postfix(StructureStorage __instance) { try { if ((Object)(object)__instance != (Object)null) { EspRegistry.StructureStorages.Add(__instance); } } catch { } } } [HarmonyPatch(typeof(ContainerItemSpawner), "OnEnable")] internal static class RegisterLootCrate { private static void Postfix(ContainerItemSpawner __instance) { try { if ((Object)(object)__instance != (Object)null) { EspRegistry.LootCrates.Add(__instance); } } catch { } } } [HarmonyPatch(typeof(InWorldAutoStorage), "Start")] internal static class RegisterAutoStorage { private static void Postfix(InWorldAutoStorage __instance) { try { if ((Object)(object)__instance != (Object)null) { EspRegistry.AutoStorages.Add(__instance); } } catch { } } } [HarmonyPatch(typeof(ArtifactStructure), "OnEnable")] internal static class RegisterArtifact { private static void Postfix(ArtifactStructure __instance) { try { if ((Object)(object)__instance != (Object)null) { EspRegistry.Artifacts.Add(__instance); } } catch { } } } [HarmonyPatch(typeof(GPSLocator), "OnEnable")] internal static class RegisterGps { private static void Postfix(GPSLocator __instance) { try { if (!((Object)(object)__instance == (Object)null) && !((Object)(object)((Component)__instance).GetComponent() != (Object)null) && !((Object)(object)((Component)__instance).GetComponentInParent() != (Object)null)) { EspRegistry.GpsLocators.Add(__instance); } } catch { } } } internal static class EspRegistryBootstrap { private static bool _firstSweepDone; public static void FullSweep() { //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Expected O, but got Unknown bool flag = default(bool); try { Il2CppArrayBase val = Object.FindObjectsOfType(true); if (val != null) { for (int i = 0; i < val.Length; i++) { PickUp val2 = val[i]; if ((Object)(object)val2 == (Object)null) { continue; } EspRegistry.Pickups.Add(val2); DroppedInventoryItemsPickup val3 = (DroppedInventoryItemsPickup)(object)((val2 is DroppedInventoryItemsPickup) ? val2 : null); if (val3 != null) { EspRegistry.DroppedBags.Add(val3); } try { if ((Object)(object)((Component)val2).transform != (Object)null) { EspRegistry.RememberPickup(((Component)val2).transform.position, val2._itemId); } } catch { } } } foreach (StructureStorage item in Object.FindObjectsOfType(true)) { if ((Object)(object)item != (Object)null) { EspRegistry.StructureStorages.Add(item); } } foreach (ContainerItemSpawner item2 in Object.FindObjectsOfType(true)) { if ((Object)(object)item2 != (Object)null) { EspRegistry.LootCrates.Add(item2); } } foreach (InWorldAutoStorage item3 in Object.FindObjectsOfType(true)) { if ((Object)(object)item3 != (Object)null) { EspRegistry.AutoStorages.Add(item3); } } foreach (ArtifactStructure item4 in Object.FindObjectsOfType(true)) { if ((Object)(object)item4 != (Object)null) { EspRegistry.Artifacts.Add(item4); } } foreach (GPSLocator item5 in Object.FindObjectsOfType(true)) { if (!((Object)(object)item5 == (Object)null) && !((Object)(object)((Component)item5).GetComponent() != (Object)null) && !((Object)(object)((Component)item5).GetComponentInParent() != (Object)null)) { EspRegistry.GpsLocators.Add(item5); } } ManualLogSource log = Plugin.Log; BepInExInfoLogInterpolatedStringHandler val4 = new BepInExInfoLogInterpolatedStringHandler(117, 8, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("EspRegistry sweep (incl. inactive): "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted(EspRegistry.SeenPickups.Count); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral(" seen pickups, "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted(EspRegistry.Pickups.Count); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral(" live pickups ("); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted(EspRegistry.DroppedBags.Count); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral(" bags), "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted(EspRegistry.StructureStorages.Count); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral(" storages, "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted(EspRegistry.LootCrates.Count); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral(" crates, "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted(EspRegistry.AutoStorages.Count); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral(" auto, "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted(EspRegistry.Artifacts.Count); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral(" artifacts, "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted(EspRegistry.GpsLocators.Count); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral(" GPS"); } log.LogInfo(val4); } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val5 = new BepInExErrorLogInterpolatedStringHandler(32, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val5).AppendLiteral("EspRegistryBootstrap.FullSweep: "); ((BepInExLogInterpolatedStringHandler)val5).AppendFormatted(ex.Message); } log2.LogError(val5); } } public static void EnsureBootstrap() { if (!_firstSweepDone) { _firstSweepDone = true; FullSweep(); } } public static void Cleanup() { //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Expected O, but got Unknown try { EspRegistry.Pickups.RemoveWhere((PickUp s) => (Object)(object)s == (Object)null); EspRegistry.DroppedBags.RemoveWhere((DroppedInventoryItemsPickup s) => (Object)(object)s == (Object)null); EspRegistry.StructureStorages.RemoveWhere((StructureStorage s) => (Object)(object)s == (Object)null); EspRegistry.LootCrates.RemoveWhere((ContainerItemSpawner s) => (Object)(object)s == (Object)null); EspRegistry.AutoStorages.RemoveWhere((InWorldAutoStorage s) => (Object)(object)s == (Object)null); EspRegistry.Artifacts.RemoveWhere((ArtifactStructure s) => (Object)(object)s == (Object)null); EspRegistry.GpsLocators.RemoveWhere((GPSLocator s) => (Object)(object)s == (Object)null); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(30, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("EspRegistryBootstrap.Cleanup: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogWarning(val); } } } internal enum FeatureKey { AmmoBlock, DamageBoost, ThrowBoost, SightSuppress, LabelHide, AdminMask, KickBlock, BanBlock, NameMask, MirrorActive } internal static class FeatureGate { public static bool IsActive(FeatureKey k) { return k switch { FeatureKey.AmmoBlock => Combat.AmmoLockEnabled, FeatureKey.DamageBoost => Combat.DamageOverride, FeatureKey.ThrowBoost => Combat.ImpulseBoostEnabled, FeatureKey.SightSuppress => Combat.SilentToEnemies, FeatureKey.LabelHide => Combat.SilentToEnemies, FeatureKey.AdminMask => Multiplayer.AdminPretend, FeatureKey.KickBlock => Multiplayer.BlockKickResp, FeatureKey.BanBlock => Multiplayer.BlockBanResp, FeatureKey.NameMask => Multiplayer.IsNameMaskActive, FeatureKey.MirrorActive => Multiplayer.SaveMirrorRunning, _ => false, }; } public static string NameMaskValue() { return Multiplayer.FakeSteamName; } public static float DamageValue() { return Combat.DamageOverrideValue; } public static float ThrowScalar() { return Combat.ImpulseMultiplier; } } internal static class GraphicsTweaks { public const float DefaultTaaSharpness = 0.5f; public const float DefaultTaaAntiFlicker = 0.5f; private static float? _origSharp; private static float? _origAnti; public static float TaaSharpness { get; private set; } = 0.5f; public static float TaaAntiFlicker { get; private set; } = 0.5f; public static float OriginalTaaSharpness => _origSharp ?? 0.5f; public static float OriginalTaaAntiFlicker => _origAnti ?? 0.5f; private static HDAdditionalCameraData GetHDCam() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown try { Camera mainCam = LocalPlayer.MainCam; if ((Object)(object)mainCam == (Object)null) { return null; } return ((Component)mainCam).GetComponent(); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(10, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("GetHDCam: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); return null; } } public static void SetTaaSharpness(float v) { //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown TaaSharpness = v; bool flag = default(bool); try { HDAdditionalCameraData hDCam = GetHDCam(); if ((Object)(object)hDCam == (Object)null) { Plugin.Log.LogWarning((object)"SetTaaSharpness: no HDAdditionalCameraData on LocalPlayer.MainCam"); return; } float taaSharpenStrength = hDCam.taaSharpenStrength; hDCam.taaSharpenStrength = v; ManualLogSource log = Plugin.Log; BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(23, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("TaaSharpness -> "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(v, "0.00"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" (was "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(taaSharpenStrength, "0.00"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")"); } log.LogDebug(val); } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(17, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("SetTaaSharpness: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log2.LogError(val2); } } public static void SetTaaAntiFlicker(float v) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown TaaAntiFlicker = v; bool flag = default(bool); try { HDAdditionalCameraData hDCam = GetHDCam(); if ((Object)(object)hDCam == (Object)null) { Plugin.Log.LogWarning((object)"SetTaaAntiFlicker: no HDAdditionalCameraData on LocalPlayer.MainCam"); return; } hDCam.taaAntiFlicker = v; ManualLogSource log = Plugin.Log; BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(18, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("TaaAntiFlicker -> "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(v, "0.00"); } log.LogDebug(val); } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(19, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("SetTaaAntiFlicker: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log2.LogError(val2); } } public static void RefreshFromCamera() { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown try { HDAdditionalCameraData hDCam = GetHDCam(); if (!((Object)(object)hDCam == (Object)null)) { TaaSharpness = hDCam.taaSharpenStrength; TaaAntiFlicker = hDCam.taaAntiFlicker; if (!_origSharp.HasValue) { _origSharp = hDCam.taaSharpenStrength; } if (!_origAnti.HasValue) { _origAnti = hDCam.taaAntiFlicker; } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(19, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("RefreshFromCamera: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } } internal static class ItemDump { public static string LastPath { get; private set; } = ""; public static void DumpItemsToFile() { //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Expected O, but got Unknown //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Expected O, but got Unknown bool flag = default(bool); try { List items = ItemDatabaseManager.Items; if (items == null) { Plugin.Log.LogWarning((object)"DumpItems: ItemDatabaseManager.Items is null"); return; } string text = Path.Combine(Paths.PluginPath ?? "", ""); if (string.IsNullOrEmpty(text)) { text = AppDomain.CurrentDomain.BaseDirectory; } string text2 = Path.Combine(text, "AdminMenu_items.txt"); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine("# AdminMenu item dump"); stringBuilder.AppendLine("# Format: id\tname"); int num = 0; for (int i = 0; i < items.Count; i++) { ItemData val = items[i]; if (!((Object)(object)val == (Object)null)) { stringBuilder.Append(val.Id).Append('\t').AppendLine(val.Name ?? ""); num++; } } File.WriteAllText(text2, stringBuilder.ToString()); LastPath = text2; ManualLogSource log = Plugin.Log; BepInExDebugLogInterpolatedStringHandler val2 = new BepInExDebugLogInterpolatedStringHandler(27, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("DumpItems: wrote "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(num); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" items to "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(text2); } log.LogDebug(val2); } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val3 = new BepInExErrorLogInterpolatedStringHandler(11, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("DumpItems: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex.Message); } log2.LogError(val3); } } } internal static class ItemEspScanner { public struct Entry { public Transform Tr; public Vector3 SnapshotPos; public string Label; public Color Color; } private static readonly Dictionary _metaCache = new Dictionary(); private static ItemEspDriver _driver; private static bool _registered; private static readonly List _containerScratch = new List(); private static readonly List _collectScratch = new List(); public static List ContainerSnapshot { get; } = new List(); public static List CollectSnapshot { get; } = new List(); private static float CullDistSq { get { float num = Esp.MaxDistance + 30f; return num * num; } } public static void Init() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown if ((Object)(object)_driver != (Object)null) { return; } try { if (!_registered) { ClassInjector.RegisterTypeInIl2Cpp(); _registered = true; } GameObject val = new GameObject("AdminMenu_ItemEspDriver") { hideFlags = (HideFlags)61 }; Object.DontDestroyOnLoad((Object)val); _driver = val.AddComponent(); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(21, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("ItemEspScanner.Init: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } } public static void Refresh() { if ((Object)(object)_driver != (Object)null) { _driver.ForceSweep(); } } private static Color ColorFor(Types t) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) if ((t & 0x9200) != 0) { return new Color(1f, 0.35f, 0.35f); } if ((t & 0x60) != 0) { return new Color(1f, 0.55f, 0.15f); } if ((t & 8) != 0) { return new Color(0.45f, 1f, 0.45f); } if ((t & 0x4002) != 0) { return new Color(0.5f, 0.85f, 1f); } if ((t & 0x804) != 0) { return new Color(0.95f, 0.85f, 0.35f); } if ((t & 0x100) != 0) { return new Color(0.85f, 0.55f, 1f); } if ((t & 0x480) != 0) { return new Color(1f, 0.4f, 0.95f); } return new Color(0.85f, 0.85f, 0.85f); } public static (string name, Color color) GetMetaPublic(int itemId) { //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Expected O, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) if (_metaCache.TryGetValue(itemId, out (string, Color) value)) { return value; } string item = $"Item#{itemId}"; Color item2 = Color.white; try { ItemData val = ItemDatabaseManager.ItemById(itemId); if ((Object)(object)val != (Object)null) { ItemUiData uiData = val._uiData; string text = ((uiData != null) ? uiData.GetTitleLocalized() : null); string name = val.Name; if (!string.IsNullOrEmpty(text) && text.Length >= 2) { item = text; } else if (!string.IsNullOrEmpty(name) && name.Length >= 2) { item = name; } item2 = ColorFor(val.Type); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(11, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("GetMeta("); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(itemId); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("): "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogWarning(val2); } (string, Color) tuple = (item, item2); _metaCache[itemId] = tuple; return tuple; } internal static void ResetContainerScratch() { _containerScratch.Clear(); } internal static void CommitContainerScratch() { ContainerSnapshot.Clear(); ContainerSnapshot.AddRange(_containerScratch); } private static void AppendFromSet(IEnumerable set, string label, Color color, List sink, Vector3 lp, float maxSq) where T : Component { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_0085: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_00d5: Unknown result type (might be due to invalid IL or missing references) foreach (T item in set) { if ((Object)(object)item == (Object)null) { continue; } GameObject gameObject; try { gameObject = ((Component)item).gameObject; } catch { continue; } if (!((Object)(object)gameObject == (Object)null) && gameObject.activeInHierarchy) { Vector3 position; try { position = ((Component)item).transform.position; } catch { continue; } float num = position.x - lp.x; float num2 = position.y - lp.y; float num3 = position.z - lp.z; if (!(num * num + num2 * num2 + num3 * num3 > maxSq)) { sink.Add(new Entry { Tr = ((Component)item).transform, SnapshotPos = position, Label = label, Color = color }); } } } } internal static void ScanStructureStorage() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)LocalPlayer._instance == (Object)null) { return; } try { AppendFromSet((IEnumerable)EspRegistry.StructureStorages, "Storage", new Color(0.5f, 0.85f, 1f), _containerScratch, LocalPlayer.Transform.position, CullDistSq); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(22, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("ScanStructureStorage: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } internal static void ScanLootCrates() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)LocalPlayer._instance == (Object)null) { return; } try { AppendFromSet((IEnumerable)EspRegistry.LootCrates, "Loot Crate", new Color(1f, 0.7f, 0.2f), _containerScratch, LocalPlayer.Transform.position, CullDistSq); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(16, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("ScanLootCrates: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } internal static void ScanAutoStorage() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)LocalPlayer._instance == (Object)null) { return; } try { AppendFromSet((IEnumerable)EspRegistry.AutoStorages, "Container", new Color(0.5f, 0.85f, 1f), _containerScratch, LocalPlayer.Transform.position, CullDistSq); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(17, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("ScanAutoStorage: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } internal static void ScanDroppedBags() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)LocalPlayer._instance == (Object)null) { return; } try { AppendFromSet((IEnumerable)EspRegistry.DroppedBags, "Dropped Bag", new Color(1f, 0.85f, 0.4f), _containerScratch, LocalPlayer.Transform.position, CullDistSq); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(17, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("ScanDroppedBags: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } internal static void ResetCollectScratch() { _collectScratch.Clear(); } internal static void CommitCollectScratch() { CollectSnapshot.Clear(); CollectSnapshot.AddRange(_collectScratch); } internal static void ScanArtifacts() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)LocalPlayer._instance == (Object)null) { return; } try { AppendFromSet((IEnumerable)EspRegistry.Artifacts, "Artifact", new Color(1f, 0.4f, 0.95f), _collectScratch, LocalPlayer.Transform.position, CullDistSq); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(15, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("ScanArtifacts: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } internal static void ScanGps() { //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Expected O, but got Unknown //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018a: 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_019e: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)LocalPlayer._instance == (Object)null) { return; } try { Vector3 position = LocalPlayer.Transform.position; float cullDistSq = CullDistSq; Color val = default(Color); ((Color)(ref val))..ctor(0.4f, 1f, 0.8f); Color val2 = default(Color); ((Color)(ref val2))..ctor(1f, 0.85f, 0.3f); foreach (GPSLocator gpsLocator in EspRegistry.GpsLocators) { if ((Object)(object)gpsLocator == (Object)null) { continue; } GameObject gameObject; try { gameObject = ((Component)gpsLocator).gameObject; } catch { continue; } if ((Object)(object)gameObject == (Object)null || !gameObject.activeInHierarchy) { continue; } Vector3 position2; try { position2 = ((Component)gpsLocator).transform.position; } catch { continue; } float num = position2.x - position.x; float num2 = position2.y - position.y; float num3 = position2.z - position.z; if (num * num + num2 * num2 + num3 * num3 > cullDistSq) { continue; } string text = null; bool flag = false; try { string pointOfInterestName = gpsLocator._pointOfInterestName; string text2 = gpsLocator.Text; if (!string.IsNullOrEmpty(pointOfInterestName) && pointOfInterestName.Length >= 2) { text = pointOfInterestName; } else if (!string.IsNullOrEmpty(text2) && text2.Length >= 2) { text = text2; } flag = gpsLocator._gpsLocatorItemInstanceModule != null; } catch { } if (string.IsNullOrEmpty(text)) { text = (flag ? "GPS" : "POI"); } _collectScratch.Add(new Entry { Tr = ((Component)gpsLocator).transform, SnapshotPos = position2, Label = text, Color = (flag ? val2 : val) }); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag2 = default(bool); BepInExErrorLogInterpolatedStringHandler val3 = new BepInExErrorLogInterpolatedStringHandler(9, 1, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("ScanGps: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex.Message); } log.LogError(val3); } } } public class ItemEspDriver : MonoBehaviour { private enum Phase { Idle, ContainersReset, ContainersStorage, ContainersLootCrate, ContainersAuto, ContainersBags, ContainersCommit, CollectReset, CollectArtifacts, CollectGps, CollectCommit } private const float RefreshInterval = 4f; private const float FullSweepInterval = 60f; private float _lastFullSweep = -999f; private Phase _phase; private float _nextSweepAt; private bool _bootstrapped; public ItemEspDriver(IntPtr p) : base(p) { } public void ForceSweep() { _phase = Phase.ContainersReset; _nextSweepAt = 0f; } private void Update() { if (!Esp.ItemEsp && !Esp.ContainerEsp && !Esp.CollectibleEsp) { _phase = Phase.Idle; return; } if (!_bootstrapped) { EspRegistryBootstrap.EnsureBootstrap(); _bootstrapped = true; } if (_phase == Phase.Idle) { if (Time.unscaledTime < _nextSweepAt) { return; } _phase = Phase.ContainersReset; } switch (_phase) { case Phase.ContainersReset: if (Esp.ContainerEsp) { ItemEspScanner.ResetContainerScratch(); } _phase = Phase.ContainersStorage; break; case Phase.ContainersStorage: if (Esp.ContainerEsp) { ItemEspScanner.ScanStructureStorage(); } _phase = Phase.ContainersLootCrate; break; case Phase.ContainersLootCrate: if (Esp.ContainerEsp) { ItemEspScanner.ScanLootCrates(); } _phase = Phase.ContainersAuto; break; case Phase.ContainersAuto: if (Esp.ContainerEsp) { ItemEspScanner.ScanAutoStorage(); } _phase = Phase.ContainersBags; break; case Phase.ContainersBags: if (Esp.ContainerEsp) { ItemEspScanner.ScanDroppedBags(); } _phase = Phase.ContainersCommit; break; case Phase.ContainersCommit: if (Esp.ContainerEsp) { ItemEspScanner.CommitContainerScratch(); } _phase = Phase.CollectReset; break; case Phase.CollectReset: if (Esp.CollectibleEsp) { ItemEspScanner.ResetCollectScratch(); } _phase = Phase.CollectArtifacts; break; case Phase.CollectArtifacts: if (Esp.CollectibleEsp) { ItemEspScanner.ScanArtifacts(); } _phase = Phase.CollectGps; break; case Phase.CollectGps: if (Esp.CollectibleEsp) { ItemEspScanner.ScanGps(); } _phase = Phase.CollectCommit; break; case Phase.CollectCommit: if (Esp.CollectibleEsp) { ItemEspScanner.CommitCollectScratch(); } EspRegistryBootstrap.Cleanup(); if (Time.unscaledTime - _lastFullSweep > 60f) { _lastFullSweep = Time.unscaledTime; EspRegistryBootstrap.FullSweep(); } _phase = Phase.Idle; _nextSweepAt = Time.unscaledTime + 4f; break; } } } internal class KeyBindEntry { public string Name; public Func Get; public Action Set; public ConfigEntry Binding; } internal static class Keybinds { private static readonly List _all = new List(); private static ConfigFile _cfg; private static KeybindsDriver _driver; private static bool _registered; public static int CapturingIndex = -1; public static IReadOnlyList All => _all; public static void Init(ConfigFile cfg) { _cfg = cfg; BuildRegistry(); EnsureDriver(); } private static ConfigEntry Bind(string key) { return _cfg.Bind("Keybinds", key, (KeyCode)0, "Hotkey to toggle this feature. None = unbound."); } private static void Add(string name, Func get, Action set, string key) { _all.Add(new KeyBindEntry { Name = name, Get = get, Set = set, Binding = Bind(key) }); } private static void BuildRegistry() { //IL_1048: Unknown result type (might be due to invalid IL or missing references) //IL_104e: Expected O, but got Unknown Add("God Mode", () => SurvivalState.InvulnerableMode, delegate(bool v) { SurvivalState.InvulnerableMode = v; PlayerTweaks.SetInvincible(v); Settings.Invincible.Value = v; }, "GodMode"); Add("Infinite Stamina", () => SurvivalState.InfiniteEnergy, delegate(bool v) { SurvivalState.InfiniteEnergy = v; PlayerTweaks.InfiniteStamina(v); Settings.InfStam.Value = v; }, "InfStamina"); Add("No Hunger", () => SurvivalState.HungerOff, delegate(bool v) { SurvivalState.HungerOff = v; PlayerTweaks.NoHunger(v); Settings.NoHunger.Value = v; }, "NoHunger"); Add("No Thirst", () => SurvivalState.ThirstOff, delegate(bool v) { SurvivalState.ThirstOff = v; PlayerTweaks.NoThirst(v); Settings.NoThirst.Value = v; }, "NoThirst"); Add("No Sleep Loss", () => SurvivalState.SleepOff, delegate(bool v) { SurvivalState.SleepOff = v; PlayerTweaks.NoSleepLoss(v); Settings.NoSleep.Value = v; }, "NoSleep"); Add("No Fall Damage", () => SurvivalState.FallShield, delegate(bool v) { SurvivalState.FallShield = v; PlayerTweaks.NoFallDamage(v); Settings.NoFall.Value = v; }, "NoFall"); Add("Infinite Heal", () => Cheats.ContinuousHealOn, delegate(bool v) { Cheats.SetContinuousHeal(v); Settings.InfHeal.Value = v; }, "InfHeal"); Add("Inf Lung", () => Cheats.LungReplenishOn, delegate(bool v) { Cheats.SetLungReplenish(v); Settings.InfLungCapacity.Value = v; }, "InfLung"); Add("No Cold", () => Cheats.ColdImmunityOn, delegate(bool v) { Cheats.SetColdImmunity(v); Settings.NoCold.Value = v; }, "NoCold"); Add("Death Pin", () => Cheats.DeathPinOn, delegate(bool v) { Cheats.SetDeathPin(v); Settings.DeathPin.Value = v; }, "DeathPin"); Add("Speedy Run", () => Cheats.RushModeOn, delegate(bool v) { Cheats.SetRushMode(v); }, "SpeedyRun"); Add("NoClip", () => PhantomFly.Enabled, delegate(bool v) { PhantomFly.SetEnabled(v); }, "NoClip"); Add("No Gravity", () => Worldcraft.IsNoGravity, delegate(bool v) { Worldcraft.NoGravity(v); }, "NoGravity"); Add("Insta Kill", () => Combat.DamageOverride, delegate(bool v) { Combat.SetDamageOverride(v); Settings.InstaDmg.Value = v; }, "InstaKill"); Add("Infinite Ammo", () => Combat.AmmoLockEnabled, delegate(bool v) { Combat.SetAmmoLock(v); Settings.AmmoLock.Value = v; }, "InfAmmo"); Add("Super Strength", () => Combat.ImpulseBoostEnabled, delegate(bool v) { Combat.SetImpulseBoost(v); Settings.ThrowBoost.Value = v; }, "SuperStrength"); Add("One-Hit Trees", () => Combat.TreeOneShotEnabled, delegate(bool v) { Combat.SetTreeOneShot(v); Settings.OneHitTrees.Value = v; }, "OneHitTrees"); Add("Invisibility", () => Combat.SilentToEnemies, delegate(bool v) { Combat.SetSilentToEnemies(v); Settings.Stealth.Value = v; }, "Invisibility"); Add("Kill Aura", () => Cheats.RadialCullEnabled, delegate(bool v) { Cheats.SetRadialCull(v); Settings.RadialCull.Value = v; }, "KillAura"); Add("Freeze Actors", () => Combat.AiPauseEnabled, delegate(bool v) { Combat.SetAiPause(v); }, "FreezeActors"); Add("Actor ESP", () => Esp.ActorEsp, delegate(bool v) { Esp.ActorEsp = v; Settings.ActorEsp.Value = v; }, "ActorEsp"); Add("Player ESP", () => Esp.PlayerEsp, delegate(bool v) { Esp.PlayerEsp = v; Settings.PlayerEsp.Value = v; }, "PlayerEsp"); Add("Radar", () => Esp.RadarEsp, delegate(bool v) { Esp.RadarEsp = v; Settings.RadarEsp.Value = v; }, "Radar"); Add("Waypoint ESP", () => Esp.WaypointEsp, delegate(bool v) { Esp.WaypointEsp = v; Settings.WaypointEsp.Value = v; }, "WaypointEsp"); Add("Item ESP", () => Esp.ItemEsp, delegate(bool v) { Esp.ItemEsp = v; Settings.ItemEsp.Value = v; if (v) { ItemEspScanner.Refresh(); } }, "ItemEsp"); Add("Animal ESP", () => Esp.AnimalEsp, delegate(bool v) { Esp.AnimalEsp = v; Settings.AnimalEsp.Value = v; }, "AnimalEsp"); Add("Container ESP", () => Esp.ContainerEsp, delegate(bool v) { Esp.ContainerEsp = v; Settings.ContainerEsp.Value = v; if (v) { ItemEspScanner.Refresh(); } }, "ContainerEsp"); Add("Collectible ESP", () => Esp.CollectibleEsp, delegate(bool v) { Esp.CollectibleEsp = v; Settings.CollectibleEsp.Value = v; if (v) { ItemEspScanner.Refresh(); } }, "CollectibleEsp"); Add("Show Dead", () => Esp.ShowDead, delegate(bool v) { Esp.ShowDead = v; Settings.ShowDead.Value = v; }, "ShowDead"); Add("Center Crosshair", () => Cheats.CenterReticleOn, delegate(bool v) { Cheats.SetCenterReticle(v); Settings.CenterCrosshair.Value = v; }, "CenterCrosshair"); Add("Cave Light", () => Cheats.CaveBrightnessOn, delegate(bool v) { Cheats.SetCaveBrightness(v); Settings.CaveLight.Value = v; }, "CaveLight"); Add("Free Camera", () => Cheats.DetachedViewOn, delegate(bool v) { Cheats.SetDetachedView(v); }, "FreeCamera"); Add("Capsule Mode", () => Cheats.CapsuleViewOn, delegate(bool v) { Cheats.SetCapsuleView(v); }, "CapsuleMode"); Add("World Edit", () => WorldEdit.Enabled, delegate(bool v) { WorldEdit.SetEnabled(v); }, "WorldEdit"); Add("Creative Mode", () => Worldcraft.FreeCraftFlag, delegate(bool v) { Worldcraft.SetFreeCraftFlag(v); }, "CreativeMode"); Add("Instant Build", () => Worldcraft.InstantPlace, delegate(bool v) { Worldcraft.SetInstantPlace(v); }, "InstantBuild"); Add("Infinite Build", () => Cheats.BuildResourceLockOn, delegate(bool v) { Cheats.SetBuildResourceLock(v); }, "InfBuild"); Add("Infinite Logs", () => Cheats.LogResourceLockOn, delegate(bool v) { Cheats.SetLogResourceLock(v); }, "InfLogs"); Add("Freeze Lakes", () => Worldcraft.IsFreezeLakes, delegate(bool v) { Worldcraft.FreezeLakes(v); }, "FreezeLakes"); Add("No Lakes", () => Worldcraft.IsNoLakes, delegate(bool v) { Worldcraft.NoLakes(v); }, "NoLakes"); Add("No Ocean", () => Worldcraft.IsNoOcean, delegate(bool v) { Worldcraft.NoOcean(v); }, "NoOcean"); Add("No Waterfalls", () => Worldcraft.IsNoWaterfalls, delegate(bool v) { Worldcraft.NoWaterfalls(v); }, "NoWaterfalls"); Add("Lighter Range", () => ModdedItems.LighterRangeOn, delegate(bool v) { ModdedItems.LighterIncreaseRange(v); Settings.LighterRange.Value = v; }, "LighterRange"); Add("Flashlight No Drain", () => ModdedItems.FlashlightNoDrainOn, delegate(bool v) { ModdedItems.FlashlightNoDrain(v); Settings.FlashlightNoDrain.Value = v; }, "FlashNoDrain"); Add("Rebreather No Oxygen", () => ModdedItems.RebreatherNoOxygenOn, delegate(bool v) { ModdedItems.RebreatherNoOxygen(v); Settings.RebreatherNoOxygen.Value = v; }, "RebNoOxygen"); Add("Rope Gun Infinite", () => ModdedItems.RopegunInfiniteOn, delegate(bool v) { ModdedItems.RopegunInfinite(v); Settings.RopegunInfinite.Value = v; }, "RopegunInf"); Add("Glider No Downforce", () => ModdedItems.GliderNoDownforceOn, delegate(bool v) { ModdedItems.GliderNoDownforce(v); Settings.GliderNoDownforce.Value = v; }, "GliderNoDown"); Add("Shotgun Rapid Fire", () => ModdedItems.ShotgunRapidFireOn, delegate(bool v) { ModdedItems.ShotgunRapidFire(v); Settings.ShotgunRapidFire.Value = v; }, "ShotgunRapid"); Add("Pistol Rapid Fire", () => ModdedItems.PistolRapidFireOn, delegate(bool v) { ModdedItems.PistolRapidFire(v); Settings.PistolRapidFire.Value = v; }, "PistolRapid"); Add("Revolver Rapid Fire", () => ModdedItems.RevolverRapidFireOn, delegate(bool v) { ModdedItems.RevolverRapidFire(v); Settings.RevolverRapidFire.Value = v; }, "RevolverRapid"); Add("Rifle Rapid Fire", () => ModdedItems.RifleRapidFireOn, delegate(bool v) { ModdedItems.RifleRapidFire(v); Settings.RifleRapidFire.Value = v; }, "RifleRapid"); Add("Admin Pretend", () => Multiplayer.AdminPretend, delegate(bool v) { Multiplayer.SetAdminPretend(v); Settings.AdminPretend.Value = v; }, "AdminPretend"); Add("Block Kick", () => Multiplayer.BlockKickResp, delegate(bool v) { Multiplayer.SetBlockKickResp(v); Settings.BlockKickResp.Value = v; }, "BlockKick"); Add("Block Ban", () => Multiplayer.BlockBanResp, delegate(bool v) { Multiplayer.SetBlockBanResp(v); Settings.BlockBanResp.Value = v; }, "BlockBan"); ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(38, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Keybinds: registered "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(_all.Count); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" bindable toggles"); } log.LogDebug(val); } private static void EnsureDriver() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown if ((Object)(object)_driver != (Object)null) { return; } try { if (!_registered) { ClassInjector.RegisterTypeInIl2Cpp(); _registered = true; } GameObject val = new GameObject("AdminMenu_KeybindsDriver") { hideFlags = (HideFlags)61 }; Object.DontDestroyOnLoad((Object)val); _driver = val.AddComponent(); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(23, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Keybinds.EnsureDriver: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } } public static void TickFromDriver() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_0021: 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (MenuComponent.IsOpen) { return; } bool flag = default(bool); for (int i = 0; i < _all.Count; i++) { KeyBindEntry keyBindEntry = _all[i]; KeyCode value = keyBindEntry.Binding.Value; if ((int)value == 0 || !Input.GetKeyDown(value)) { continue; } try { keyBindEntry.Set(!keyBindEntry.Get()); } catch (Exception ex) { ManualLogSource log = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(12, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Keybind '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(keyBindEntry.Name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("': "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } } } public class KeybindsDriver : MonoBehaviour { public KeybindsDriver(IntPtr p) : base(p) { } private void Update() { Keybinds.TickFromDriver(); } } internal static class Map { public static bool Show; private static Texture2D _mapTex; private static Texture2D _dotTex; private static bool _loaded; private static Rect _mapRect = new Rect(80f, 80f, 720f, 720f); private const float Scale = 5.5f; private const float Center = 360f; private const int MapSize = 720; private const float DotSize = 16f; public static void Init() { //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown bool flag = default(bool); try { _mapTex = LoadEmbedded("map.png"); _dotTex = LoadEmbedded("playerdot.png"); _loaded = (Object)(object)_mapTex != (Object)null && (Object)(object)_dotTex != (Object)null; ManualLogSource log = Plugin.Log; BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(29, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Map.Init: loaded="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(_loaded); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" (map="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(((Object)(object)_mapTex != (Object)null) ? $"{((Texture)_mapTex).width}x{((Texture)_mapTex).height}" : "null"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" dot="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(((Object)(object)_dotTex != (Object)null) ? $"{((Texture)_dotTex).width}x{((Texture)_dotTex).height}" : "null"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")"); } log.LogDebug(val); MapDriverHost.Ensure(); } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(10, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Map.Init: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex); } log2.LogError(val2); } } public static void Toggle() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown Show = !Show; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(12, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Map.Show -> "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(Show); } log.LogDebug(val); if (Show && !_loaded) { Plugin.Log.LogWarning((object)"Map.Toggle: textures not loaded; map will be blank"); } } public static void DrawMapWindow() { //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) if (!Show) { return; } try { float renderScale = MenuComponent.RenderScale; float num = Mathf.Max(0f, (float)Screen.width / renderScale - 40f); float num2 = Mathf.Max(0f, (float)Screen.height / renderScale - 40f); ((Rect)(ref _mapRect)).x = Mathf.Clamp(((Rect)(ref _mapRect)).x, 0f, num); ((Rect)(ref _mapRect)).y = Mathf.Clamp(((Rect)(ref _mapRect)).y, 0f, num2); Matrix4x4 matrix = GUI.matrix; GUI.matrix = Matrix4x4.Scale(new Vector3(renderScale, renderScale, 1f)); try { _mapRect = GUI.Window(44354, _mapRect, WindowFunction.op_Implicit((Action)Body), "Map (RMB to teleport)"); } finally { GUI.matrix = matrix; } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(19, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Map.DrawMapWindow: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } private static void Body(int id) { //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Expected O, but got Unknown //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Expected O, but got Unknown //IL_0036: 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_0380: 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_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0195: 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_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0324: 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_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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) Rect val = default(Rect); ((Rect)(ref val))..ctor(0f, 22f, 720f, 720f); if ((Object)(object)_mapTex != (Object)null) { GUI.DrawTexture(val, (Texture)(object)_mapTex, (ScaleMode)0); } else { GUI.Label(val, "(map texture failed to load)"); } bool flag = default(bool); try { foreach (Teleport.Folder folder in Teleport.Folders) { foreach (Teleport.SavedSpot savedSpot in folder.SavedSpots) { float num = savedSpot.Pos.x / 5.5f + 360f; float num2 = savedSpot.Pos.z / 5.5f + 360f; Color color = GUI.color; GUI.color = savedSpot.Color; GUI.DrawTexture(new Rect(num - 4f, 22f + (720f - num2) - 4f, 8f, 8f), (Texture)(object)Theme.AccentTex); GUI.color = color; } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(15, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Map waypoints: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } try { if ((Object)(object)LocalPlayer._instance != (Object)null) { Vector3 position = LocalPlayer.Transform.position; float num3 = position.x / 5.5f + 360f; float num4 = position.z / 5.5f + 360f; if ((Object)(object)_dotTex != (Object)null) { GUI.DrawTexture(new Rect(num3 - 8f, 22f + (720f - num4) - 8f, 16f, 16f), (Texture)(object)_dotTex); } else { Color color2 = GUI.color; GUI.color = Color.red; GUI.DrawTexture(new Rect(num3 - 4f, 22f + (720f - num4) - 4f, 8f, 8f), (Texture)(object)Theme.AccentTex); GUI.color = color2; } GUI.Label(new Rect(6f, 720f, 240f, 20f), $"X {position.x:0} Y {position.y:0} Z {position.z:0}", Theme.Small); } } catch (Exception ex2) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(9, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Map dot: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex2.Message); } log2.LogError(val2); } Event current2 = Event.current; if (current2 != null && (int)current2.type == 0 && current2.button == 1) { Vector2 mousePosition = current2.mousePosition; if (((Rect)(ref val)).Contains(mousePosition)) { float x = (mousePosition.x - 360f) * 5.5f; float z = (360f - (mousePosition.y - 22f)) * 5.5f; TeleportTo(x, z); current2.Use(); } } GUI.DragWindow(new Rect(0f, 0f, 10000f, 22f)); } private static void TeleportTo(float x, float z) { //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0091: Expected O, but got Unknown //IL_00ba: Unknown result type (might be due to invalid IL or missing references) bool flag = default(bool); try { if ((Object)(object)LocalPlayer._instance == (Object)null) { Plugin.Log.LogWarning((object)"Map.TeleportTo: no LocalPlayer"); return; } Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(x, 1000f, z); int mask = LayerMask.GetMask(new string[1] { "Terrain" }); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, Vector3.down, ref val2, float.PositiveInfinity, mask, (QueryTriggerInteraction)1)) { LocalPlayer.Transform.position = ((RaycastHit)(ref val2)).point + Vector3.up * 2f; ManualLogSource log = Plugin.Log; BepInExDebugLogInterpolatedStringHandler val3 = new BepInExDebugLogInterpolatedStringHandler(22, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("Map.TeleportTo: ("); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(x, "0"); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(", "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(((RaycastHit)(ref val2)).point.y, "0"); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(", "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(z, "0"); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(")"); } log.LogDebug(val3); } else { LocalPlayer.Transform.position = new Vector3(x, 50f, z); ManualLogSource log2 = Plugin.Log; BepInExDebugLogInterpolatedStringHandler val3 = new BepInExDebugLogInterpolatedStringHandler(40, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("Map.TeleportTo (fallback y=50): ("); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(x, "0"); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(", 50, "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(z, "0"); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(")"); } log2.LogDebug(val3); } } catch (Exception ex) { ManualLogSource log3 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val4 = new BepInExErrorLogInterpolatedStringHandler(16, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("Map.TeleportTo: "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted(ex.Message); } log3.LogError(val4); } } private static Texture2D LoadEmbedded(string suffix) { //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown //IL_00ca: Expected O, but got Unknown bool flag = default(bool); try { Assembly executingAssembly = Assembly.GetExecutingAssembly(); string text = null; string[] manifestResourceNames = executingAssembly.GetManifestResourceNames(); foreach (string text2 in manifestResourceNames) { if (text2.EndsWith(suffix, StringComparison.OrdinalIgnoreCase)) { text = text2; break; } } if (text == null) { ManualLogSource log = Plugin.Log; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(41, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Map.LoadEmbedded: no resource matching '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(suffix); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("'"); } log.LogWarning(val); return null; } using Stream stream = executingAssembly.GetManifestResourceStream(text); if (stream == null) { return null; } using MemoryStream memoryStream = new MemoryStream(); stream.CopyTo(memoryStream); byte[] array = memoryStream.ToArray(); Texture2D val2 = new Texture2D(2, 2, (TextureFormat)4, false) { hideFlags = (HideFlags)61 }; ImageConversion.LoadImage(val2, Il2CppStructArray.op_Implicit(array)); return val2; } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val3 = new BepInExErrorLogInterpolatedStringHandler(20, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("Map.LoadEmbedded("); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(suffix); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("): "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex); } log2.LogError(val3); return null; } } } internal static class MapDriverHost { private static MapDriver _driver; public static void Ensure() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown try { if (!((Object)(object)_driver != (Object)null)) { ClassInjector.RegisterTypeInIl2Cpp(); GameObject val = new GameObject("AdminMenu_MapDriver") { hideFlags = (HideFlags)61 }; Object.DontDestroyOnLoad((Object)val); _driver = val.AddComponent(); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(22, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("MapDriverHost.Ensure: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex); } log.LogError(val2); } } } public class MapDriver : MonoBehaviour { public MapDriver(IntPtr ptr) : base(ptr) { } private void OnGUI() { Map.DrawMapWindow(); } } public class MenuComponent : MonoBehaviour { private enum Tab { PlayerStats, PlayerMove, Combat, Spawn, TeleportMap, ItemsMods, WorldClimate, WorldTerrain, WorldBuild, Visual, MpPlayers, Keybinds, UtilHelp } private Tab _tab; private bool _show; private Vector2 _scroll; private Rect _rect = new Rect(40f, 40f, 620f, 740f); private int _enforceCounter; private static KeyCode ToggleKey { get { //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (Settings.ToggleKey == null) { return (KeyCode)9; } return Settings.ToggleKey.Value; } } public static bool IsOpen { get; private set; } public static float RenderScale { get; private set; } = 1f; public MenuComponent(IntPtr ptr) : base(ptr) { }//IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) private void Update() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) Multiplayer.TickSaveMirror(Time.deltaTime); if (Input.GetKeyDown(ToggleKey)) { bool show = _show; _show = !_show; IsOpen = _show; PlayerTweaks.LockView(_show); if (_show && !show) { SpawnTab.InvalidateItemCache(); } if (!_show && show) { Cursor.lockState = (CursorLockMode)1; Cursor.visible = false; } } } private void LateUpdate() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (_show) { if ((int)Cursor.lockState != 0) { Cursor.lockState = (CursorLockMode)0; } if (!Cursor.visible) { Cursor.visible = true; } if (++_enforceCounter % 30 == 0) { PlayerTweaks.LockView(on: true); } } } private void OnDisable() { if (_show) { PlayerTweaks.LockView(on: false); } IsOpen = false; } private void OnGUI() { //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) Theme.Build(); Cheats.DrawCenterCrosshair(); if (Esp.ActorEsp || Esp.AnimalEsp || Esp.PlayerEsp || Esp.RadarEsp || Esp.WaypointEsp || Esp.ItemEsp || Esp.ContainerEsp || Esp.CollectibleEsp) { Esp.RenderActorEsp(); Esp.RenderPlayerEsp(); Esp.RenderWaypointEsp(); Esp.RenderItemEsp(); Esp.RenderContainerEsp(); Esp.RenderCollectibleEsp(); Esp.RenderRadar(); } if (!_show) { return; } float num = Mathf.Clamp((Settings.UiScale != null) ? Settings.UiScale.Value : 1f, 0.5f, 3f); RenderScale = Mathf.Lerp(RenderScale, num, 0.18f); if (Mathf.Abs(RenderScale - num) < 0.002f) { RenderScale = num; } float renderScale = RenderScale; float num2 = Mathf.Max(0f, (float)Screen.width / renderScale - 40f); float num3 = Mathf.Max(0f, (float)Screen.height / renderScale - 40f); ((Rect)(ref _rect)).x = Mathf.Clamp(((Rect)(ref _rect)).x, 0f, num2); ((Rect)(ref _rect)).y = Mathf.Clamp(((Rect)(ref _rect)).y, 0f, num3); Theme.PushSkin(); try { Matrix4x4 matrix = GUI.matrix; GUI.matrix = Matrix4x4.Scale(new Vector3(renderScale, renderScale, 1f)); try { _rect = GUI.Window(44353, _rect, WindowFunction.op_Implicit((Action)Body), GUIContent.none, Theme.Window); } finally { GUI.matrix = matrix; } } finally { Theme.PopSkin(); } } private void Body(int id) { //IL_0175: 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_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label("ADMIN MENU", Theme.Title, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }); GUILayout.FlexibleSpace(); GUILayout.Label("v2.0.5 Tab", Theme.Small, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }); GUILayout.EndHorizontal(); AccentLine(); GUILayout.Space(6f); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); DrawTab("Player", Tab.PlayerStats, 80f); DrawTab("Movement", Tab.PlayerMove, 80f); DrawTab("Combat", Tab.Combat, 80f); DrawTab("Spawn", Tab.Spawn, 80f); DrawTab("Teleport", Tab.TeleportMap, 80f); DrawTab("Items", Tab.ItemsMods, 80f); DrawTab("Weather", Tab.WorldClimate, 80f); GUILayout.EndHorizontal(); GUILayout.Space(2f); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); DrawTab("Terrain", Tab.WorldTerrain, 80f); DrawTab("Build", Tab.WorldBuild, 80f); DrawTab("Visual", Tab.Visual, 80f); DrawTab("Multiplayer", Tab.MpPlayers, 80f); DrawTab("Keybinds", Tab.Keybinds, 80f); DrawTab("Util", Tab.UtilHelp, 80f); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.Space(8f); _scroll = GUILayout.BeginScrollView(_scroll, GUIStyle.none, GUI.skin.verticalScrollbar, Array.Empty()); switch (_tab) { case Tab.PlayerStats: PlayerStatsTab.Draw(); break; case Tab.PlayerMove: PlayerMoveTab.Draw(); break; case Tab.Combat: CombatTab.Draw(); break; case Tab.Spawn: SpawnTab.Draw(); break; case Tab.TeleportMap: TeleportTab.Draw(); break; case Tab.ItemsMods: ItemsTab.Draw(); break; case Tab.WorldClimate: WorldClimateTab.Draw(); break; case Tab.WorldTerrain: WorldTerrainTab.Draw(); break; case Tab.WorldBuild: WorldBuildTab.Draw(); break; case Tab.Visual: VisualTab.Draw(); break; case Tab.MpPlayers: MpPlayersTab.Draw(); break; case Tab.Keybinds: KeybindsTab.Draw(); break; case Tab.UtilHelp: UtilHelpTab.Draw(); break; } GUILayout.EndScrollView(); Footer(); GUI.DragWindow(new Rect(0f, 0f, 10000f, 32f)); } private void DrawTab(string label, Tab t, float width = 0f) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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) GUIStyle val = ((_tab == t) ? Theme.TabActive : Theme.Tab); GUILayoutOption[] array = (GUILayoutOption[])(object)((!(width > 0f)) ? new GUILayoutOption[2] { GUILayout.Height(26f), GUILayout.ExpandWidth(true) } : new GUILayoutOption[2] { GUILayout.Height(26f), GUILayout.Width(width) }); if (GUILayout.Button(label, val, array)) { _tab = t; } if (_tab == t) { Rect lastRect = GUILayoutUtility.GetLastRect(); GUI.DrawTexture(new Rect(((Rect)(ref lastRect)).x, ((Rect)(ref lastRect)).yMax - 2f, ((Rect)(ref lastRect)).width, 2f), (Texture)(object)Theme.AccentTex); } } private static void AccentLine() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) Rect rect = GUILayoutUtility.GetRect(1f, 2f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); GUI.DrawTexture(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width * 0.35f, 2f), (Texture)(object)Theme.AccentTex); } private void Footer() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) GUILayout.Space(6f); GUI.DrawTexture(GUILayoutUtility.GetRect(1f, 1f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }), (Texture)(object)Theme.SeparatorTex); GUILayout.Space(4f); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label($"Tab: {_tab}", Theme.Small, (Il2CppReferenceArray)null); GUILayout.FlexibleSpace(); GUILayout.Label($"{ToggleKey} to close", Theme.Small, (Il2CppReferenceArray)null); GUILayout.EndHorizontal(); } } internal static class MenuUI { private static readonly Dictionary _editBuf = new Dictionary(); private static string _focusedField; public static void ClearAllEditBuffers() { _editBuf.Clear(); } public static string TextField(string id, string current, params GUILayoutOption[] options) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Invalid comparison between Unknown and I4 //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Invalid comparison between Unknown and I4 //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Invalid comparison between Unknown and I4 //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Invalid comparison between Unknown and I4 //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Invalid comparison between Unknown and I4 //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Invalid comparison between Unknown and I4 if (current == null) { current = ""; } Rect rect = GUILayoutUtility.GetRect(new GUIContent(current), Theme.Field, options); bool flag = _focusedField == id; Event current2 = Event.current; if ((int)current2.type == 0) { if (((Rect)(ref rect)).Contains(current2.mousePosition)) { _focusedField = id; flag = true; current2.Use(); } else if (flag) { _focusedField = null; flag = false; } } GUI.DrawTexture(rect, (Texture)(object)(flag ? Theme.AccentTex : Theme.PanelTex)); Rect val = new Rect(((Rect)(ref rect)).x + 6f, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width - 12f, ((Rect)(ref rect)).height); string text = ((flag && Time.unscaledTime % 1f < 0.5f) ? (current + "|") : current); GUI.Label(val, text, Theme.Label); if (flag && (int)current2.type == 4) { if ((int)current2.keyCode == 8) { if (current.Length > 0) { current = current.Substring(0, current.Length - 1); } current2.Use(); } else if ((int)current2.keyCode == 13 || (int)current2.keyCode == 271 || (int)current2.keyCode == 27 || (int)current2.keyCode == 9) { _focusedField = null; current2.Use(); } else if (current2.character >= ' ' && current2.character != '\u007f') { current += current2.character; current2.Use(); } } return current; } public static void Header(string text) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) GUILayout.Space(8f); GUILayout.Label(text.ToUpperInvariant(), Theme.Header, (Il2CppReferenceArray)null); GUI.DrawTexture(GUILayoutUtility.GetRect(1f, 1f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }), (Texture)(object)Theme.SeparatorTex); GUILayout.Space(4f); } public static void Help(string text) { GUILayout.Label(text, Theme.Small, (Il2CppReferenceArray)null); GUILayout.Space(2f); } public static bool Button(string label, float? width = null) { if (width.HasValue) { return GUILayout.Button(label, Theme.Button, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Height(26f), GUILayout.Width(width.Value) }); } return GUILayout.Button(label, Theme.Button, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }); } public static void KeyRow(string action, string key) { GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label(action, Theme.Label, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(170f) }); GUILayout.Label(key, Theme.Small, (Il2CppReferenceArray)null); GUILayout.EndHorizontal(); } public static void Toggle(string label, bool state, Action apply) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Expected O, but got Unknown //IL_00bb: Unknown result type (might be due to invalid IL or missing references) GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) }); GUILayout.Label(label, Theme.Label, (Il2CppReferenceArray)null); GUILayout.FlexibleSpace(); Rect rect = GUILayoutUtility.GetRect(42f, 22f, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(42f), GUILayout.Height(22f) }); bool num = GUI.Button(rect, GUIContent.none, GUIStyle.none); GUI.DrawTexture(rect, (Texture)(object)(state ? Theme.SwitchOnTex : Theme.SwitchOffTex), (ScaleMode)0); GUI.DrawTexture(new Rect(state ? (((Rect)(ref rect)).xMax - 18f - 2f) : (((Rect)(ref rect)).x + 2f), ((Rect)(ref rect)).y + 2f, 18f, 18f), (Texture)(object)Theme.KnobTex, (ScaleMode)0); GUILayout.EndHorizontal(); if (!num) { return; } try { apply(!state); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(11, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Toggle '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(label); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("': "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static float Slider(string key, string label, float value, float min, float max, string unit, Action apply, float? defaultValue = null) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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_028b: Expected O, but got Unknown //IL_00d6: 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) GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label(label, Theme.Label, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(110f) }); Rect rect = GUILayoutUtility.GetRect(GUIContent.none, Theme.Slider, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.ExpandWidth(true), GUILayout.Height(18f) }); float num = ((Rect)(ref rect)).y + ((Rect)(ref rect)).height * 0.5f - 2f; Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref rect)).x + 2f, num, ((Rect)(ref rect)).width - 4f, 4f); GUI.DrawTexture(val, (Texture)(object)Theme.SliderTrackTex); float num2 = ((max > min) ? Mathf.Clamp01((value - min) / (max - min)) : 0f); GUI.DrawTexture(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y, ((Rect)(ref val)).width * num2, ((Rect)(ref val)).height), (Texture)(object)Theme.AccentTex); float num3 = GUI.HorizontalSlider(rect, value, min, max, Theme.Slider, Theme.SliderThumb); string value2 = num3.ToString((Mathf.Abs(num3) < 10f) ? "0.00" : "0.0"); if (!Mathf.Approximately(num3, value) || !_editBuf.ContainsKey(key)) { _editBuf[key] = value2; } string text = _editBuf[key]; string text2 = TextField("slider_" + key, text, GUILayout.Width(60f), GUILayout.Height(20f)); float num4 = num3; if (text2 != text) { _editBuf[key] = text2; if (float.TryParse(text2, out var result)) { num4 = Mathf.Clamp(result, min, max); } } if (!string.IsNullOrEmpty(unit)) { GUILayout.Label(unit, Theme.Small, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(22f) }); } if (defaultValue.HasValue && GUILayout.Button((Texture)(object)Theme.ResetIconTex, Theme.IconButton, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(22f), GUILayout.Height(20f) })) { num4 = Mathf.Clamp(defaultValue.Value, min, max); _editBuf[key] = num4.ToString((Mathf.Abs(num4) < 10f) ? "0.00" : "0.0"); } GUILayout.EndHorizontal(); if (Mathf.Abs(num4 - value) > 0.001f) { try { apply(num4); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(11, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Slider '"); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(label); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("': "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } } return num4; } public static int IntSlider(string key, string label, int value, int min, int max, string unit, Action apply, int? defaultValue = null) { float? defaultValue2 = (defaultValue.HasValue ? new float?(defaultValue.Value) : ((float?)null)); return Mathf.RoundToInt(Slider(key, label, value, min, max, unit, delegate(float v) { apply(Mathf.RoundToInt(v)); }, defaultValue2)); } public static void ButtonGrid(IList items, int cols, Func label, Action onClick) { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown bool flag = default(bool); for (int i = 0; i < items.Count; i += cols) { GUILayout.BeginHorizontal((Il2CppReferenceArray)null); for (int j = 0; j < cols && i + j < items.Count; j++) { T val = items[i + j]; if (!GUILayout.Button(label(val), Theme.Button, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { continue; } try { onClick(val); } catch (Exception ex) { ManualLogSource log = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(12, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("ButtonGrid: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } } GUILayout.EndHorizontal(); } } } internal static class ModdedItems { private static ModdedItemsDriver _driver; private static bool _registered; private static int _idLighter = -1; private static int _idFlashlight = -1; private static int _idRebreather = -1; private static int _idRopeGun = -1; private static int _idShotgun = -1; private static int _idPistol = -1; private static int _idRevolver = -1; private static int _idRifle = -1; public static float LighterIntensityValue = -1f; public static bool LighterRangeOn; public static float FlashlightIntensityValue = -1f; public static bool FlashlightNoDrainOn; public static float RebreatherIntensityValue = -1f; public static bool RebreatherNoOxygenOn; public static bool RopegunInfiniteOn; public static float KnightSpeedValue = 25f; public static float KnightJumpForceValue = 6f; public static float GliderSpeedValue = 30f; public static bool GliderNoDownforceOn; public static bool ShotgunRapidFireOn; public static bool PistolRapidFireOn; public static bool RevolverRapidFireOn; public static bool RifleRapidFireOn; private static PlasmaLighterController _lighterController; private static float? _lighterDefIntensity; private static float? _lighterDefRange; private static FlashlightController _flashlightController; private static float? _flashlightDefIntensity; private static float? _flashlightDefDrain; private static RebreatherController _rebreatherController; private static float? _rebreatherDefIntensity; private static float? _rebreatherDefDrain; private static RopeGunController _ropegunController; private static float? _ropegunDefLength; private static float? _ropegunDefRange; private static float? _gliderDefBaseDown; private static float? _gliderDefUpPitch; private static ShotgunWeaponController _shotgun; private static CompactPistolWeaponController _pistol; private static RevolverWeaponController _revolver; private static RifleAnimatorController _rifle; private static bool _errLighter; private static bool _errFlash; private static bool _errReb; private static bool _errRope; private static bool _errShot; private static bool _errPis; private static bool _errRev; private static bool _errRif; private static bool _errKnight; private static bool _errGlider; private static int LighterId => Resolve(ref _idLighter, "PlasmaLighter", "Lighter"); private static int FlashId => Resolve(ref _idFlashlight, "Flashlight"); private static int RebreatherId => Resolve(ref _idRebreather, "Rebreather"); private static int RopeGunId => Resolve(ref _idRopeGun, "RopeGun"); private static int ShotgunId => Resolve(ref _idShotgun, "ShotgunPumpAction", "Shotgun"); private static int PistolId => Resolve(ref _idPistol, "CompactPistol", "Pistol"); private static int RevolverId => Resolve(ref _idRevolver, "Revolver"); private static int RifleId => Resolve(ref _idRifle, "Rifle"); public static float DefaultLighterIntensity => _lighterDefIntensity ?? 5f; public static float DefaultFlashlightIntensity => _flashlightDefIntensity ?? 14f; public static float DefaultRebreatherIntensity => _rebreatherDefIntensity ?? 5f; private static int Resolve(ref int cache, string primary, string fallback = null) { if (cache > 0) { return cache; } if (cache == -2) { return -1; } try { int num = ItemDatabaseManager.ItemIdByName(primary); if (num <= 0 && !string.IsNullOrEmpty(fallback)) { num = ItemDatabaseManager.ItemIdByName(fallback); } if (num > 0) { cache = num; return num; } cache = -2; } catch { cache = -2; } return -1; } public static void Init() { //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(); _registered = true; } GameObject val = new GameObject("AdminMenu_ModdedItemsDriver"); Object.DontDestroyOnLoad((Object)val); _driver = val.AddComponent(); Plugin.Log.LogDebug((object)"ModdedItems driver created"); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(18, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("ModdedItems.Init: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } } public static void LighterIntensity(float v) { Init(); LighterIntensityValue = v; } public static void LighterIncreaseRange(bool on) { Init(); LighterRangeOn = on; } public static void FlashlightIntensity(float v) { Init(); FlashlightIntensityValue = v; } public static void FlashlightNoDrain(bool on) { Init(); FlashlightNoDrainOn = on; } public static void RebreatherIntensity(float v) { Init(); RebreatherIntensityValue = v; } public static void RebreatherNoOxygen(bool on) { Init(); RebreatherNoOxygenOn = on; } public static void RopegunInfinite(bool on) { Init(); RopegunInfiniteOn = on; } public static void KnightSpeed(float v) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown KnightSpeedValue = v; try { if (!((Object)(object)LocalPlayer._instance == (Object)null)) { GameObject specialActions = LocalPlayer.SpecialActions; PlayerKnightVAction val = ((specialActions != null) ? ((Component)specialActions.transform).GetComponentInChildren() : null); if ((Object)(object)val != (Object)null && (Object)(object)val._controlDefinition != (Object)null) { val._controlDefinition.MaxVelocity = v; } } } catch (Exception ex) { if (!_errKnight) { _errKnight = true; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(13, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("KnightSpeed: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } } } public static void KnightJumpForce(float v) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown KnightJumpForceValue = v; try { if (!((Object)(object)LocalPlayer._instance == (Object)null)) { GameObject specialActions = LocalPlayer.SpecialActions; PlayerKnightVAction val = ((specialActions != null) ? ((Component)specialActions.transform).GetComponentInChildren() : null); if ((Object)(object)val != (Object)null && (Object)(object)val._controlDefinition != (Object)null) { val._controlDefinition.JumpForce = v; } } } catch (Exception ex) { if (!_errKnight) { _errKnight = true; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(17, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("KnightJumpForce: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } } } public static void GliderSpeed(float v) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown GliderSpeedValue = v; try { if (!((Object)(object)LocalPlayer._instance == (Object)null)) { GameObject specialActions = LocalPlayer.SpecialActions; PlayerHangGliderAction val = ((specialActions != null) ? ((Component)specialActions.transform).GetComponentInChildren() : null); if ((Object)(object)val != (Object)null && (Object)(object)val._hangGliderSettings != (Object)null) { val._hangGliderSettings.ConstantForwardForce = v; } } } catch (Exception ex) { if (!_errGlider) { _errGlider = true; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(13, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("GliderSpeed: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } } } public static void GliderNoDownforce(bool on) { //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Expected O, but got Unknown GliderNoDownforceOn = on; try { if ((Object)(object)LocalPlayer._instance == (Object)null) { return; } GameObject specialActions = LocalPlayer.SpecialActions; PlayerHangGliderAction val = ((specialActions != null) ? ((Component)specialActions.transform).GetComponentInChildren() : null); if (!((Object)(object)val == (Object)null) && !((Object)(object)val._hangGliderSettings == (Object)null)) { float valueOrDefault = _gliderDefBaseDown.GetValueOrDefault(); if (!_gliderDefBaseDown.HasValue) { valueOrDefault = val._hangGliderSettings.BaseDownPitchForce; _gliderDefBaseDown = valueOrDefault; } valueOrDefault = _gliderDefUpPitch.GetValueOrDefault(); if (!_gliderDefUpPitch.HasValue) { valueOrDefault = val._hangGliderSettings.UpPitchDownForce; _gliderDefUpPitch = valueOrDefault; } if (on) { val._hangGliderSettings.BaseDownPitchForce = 0f; val._hangGliderSettings.UpPitchDownForce = 0f; } else { val._hangGliderSettings.BaseDownPitchForce = _gliderDefBaseDown.Value; val._hangGliderSettings.UpPitchDownForce = _gliderDefUpPitch.Value; } } } catch (Exception ex) { if (!_errGlider) { _errGlider = true; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(19, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("GliderNoDownforce: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } } } public static void ShotgunRapidFire(bool on) { Init(); ShotgunRapidFireOn = on; } public static void PistolRapidFire(bool on) { Init(); PistolRapidFireOn = on; } public static void RevolverRapidFire(bool on) { Init(); RevolverRapidFireOn = on; } public static void RifleRapidFire(bool on) { Init(); RifleRapidFireOn = on; } public static void RunCleanup() { _lighterDefIntensity = null; _lighterDefRange = null; LighterIntensityValue = -1f; _flashlightDefIntensity = null; _flashlightDefDrain = null; FlashlightIntensityValue = -1f; _rebreatherDefIntensity = null; _rebreatherDefDrain = null; RebreatherIntensityValue = -1f; _ropegunDefLength = null; _ropegunDefRange = null; _gliderDefBaseDown = null; _gliderDefUpPitch = null; _lighterController = null; _flashlightController = null; _rebreatherController = null; _ropegunController = null; _shotgun = null; _pistol = null; _revolver = null; _rifle = null; } public static void Tick() { if (!((Object)(object)LocalPlayer._instance == (Object)null)) { _lighterMods(); _flashlightMods(); _rebreatherMods(); _ropegunMods(); if (ShotgunRapidFireOn) { _shotgunRapidFire(); } if (PistolRapidFireOn) { _pistolRapidFire(); } if (RevolverRapidFireOn) { _revolverRapidFire(); } if (RifleRapidFireOn) { _rifleRapidFire(); } } } private static bool LeftHandHolding(int id) { if (id <= 0) { return false; } PlayerInventory inventory = LocalPlayer.Inventory; if ((Object)(object)inventory == (Object)null) { return false; } ItemInstance leftHandItem = inventory.LeftHandItem; if (leftHandItem != null) { return leftHandItem._itemID == id; } return false; } private static bool RightHandHolding(int id) { if (id <= 0) { return false; } PlayerInventory inventory = LocalPlayer.Inventory; if ((Object)(object)inventory == (Object)null) { return false; } ItemInstance rightHandItem = inventory.RightHandItem; if (rightHandItem != null) { return rightHandItem._itemID == id; } return false; } private static bool ChestEquipped(int id) { if (id <= 0) { return false; } PlayerInventory inventory = LocalPlayer.Inventory; if ((Object)(object)inventory == (Object)null) { return false; } ItemInstance equippedChestItem = inventory.EquippedChestItem; if (equippedChestItem != null) { return equippedChestItem._itemID == id; } return false; } private static void _lighterMods() { //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown try { if (LeftHandHolding(LighterId)) { if (_lighterController == null) { _lighterController = ((Component)LocalPlayer.Transform).GetComponentInChildren(); } if (!((Object)(object)_lighterController == (Object)null) && !((Object)(object)_lighterController._localPlayerLight == (Object)null)) { float valueOrDefault = _lighterDefRange.GetValueOrDefault(); if (!_lighterDefRange.HasValue) { valueOrDefault = _lighterController._localPlayerLight.range; _lighterDefRange = valueOrDefault; } valueOrDefault = _lighterDefIntensity.GetValueOrDefault(); if (!_lighterDefIntensity.HasValue) { valueOrDefault = _lighterController._localPlayerLight.intensity; _lighterDefIntensity = valueOrDefault; } if (LighterIntensityValue >= 0f) { _lighterController._localPlayerLight.intensity = LighterIntensityValue; } else if (_lighterDefIntensity.HasValue) { _lighterController._localPlayerLight.intensity = _lighterDefIntensity.Value; } if (LighterRangeOn) { _lighterController._localPlayerLight.range = 100f; } else if (_lighterDefRange.HasValue) { _lighterController._localPlayerLight.range = _lighterDefRange.Value; } } } else { _lighterController = null; } } catch (Exception ex) { if (!_errLighter) { _errLighter = true; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(14, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("_lighterMods: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } } private static void _flashlightMods() { //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown try { if (LeftHandHolding(FlashId)) { if (_flashlightController == null) { _flashlightController = ((Component)LocalPlayer.Transform).GetComponentInChildren(); } if ((Object)(object)_flashlightController == (Object)null) { return; } if (_flashlightController._powerDrainRate != 0f) { float valueOrDefault = _flashlightDefDrain.GetValueOrDefault(); if (!_flashlightDefDrain.HasValue) { valueOrDefault = _flashlightController._powerDrainRate; _flashlightDefDrain = valueOrDefault; } } if (_flashlightController._maxLightIntensity != 0f) { float valueOrDefault = _flashlightDefIntensity.GetValueOrDefault(); if (!_flashlightDefIntensity.HasValue) { valueOrDefault = _flashlightController._maxLightIntensity; _flashlightDefIntensity = valueOrDefault; } } if (FlashlightIntensityValue >= 0f) { _flashlightController._maxLightIntensity = FlashlightIntensityValue; } else if (_flashlightDefIntensity.HasValue) { _flashlightController._maxLightIntensity = _flashlightDefIntensity.Value; } if (FlashlightNoDrainOn) { _flashlightController._powerDrainRate = 0f; } else if (_flashlightDefDrain.HasValue) { _flashlightController._powerDrainRate = _flashlightDefDrain.Value; } } else { _flashlightController = null; } } catch (Exception ex) { if (!_errFlash) { _errFlash = true; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(17, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("_flashlightMods: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } } private static void _rebreatherMods() { //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown try { if (ChestEquipped(RebreatherId)) { if (_rebreatherController == null) { _rebreatherController = ((Component)LocalPlayer.Transform).GetComponentInChildren(); } if ((Object)(object)_rebreatherController == (Object)null) { return; } if (_rebreatherController._airConsumptionRate != 0f) { float valueOrDefault = _rebreatherDefDrain.GetValueOrDefault(); if (!_rebreatherDefDrain.HasValue) { valueOrDefault = _rebreatherController._airConsumptionRate; _rebreatherDefDrain = valueOrDefault; } } if (_rebreatherController._maxLightIntensity != 0f) { float valueOrDefault = _rebreatherDefIntensity.GetValueOrDefault(); if (!_rebreatherDefIntensity.HasValue) { valueOrDefault = _rebreatherController._maxLightIntensity; _rebreatherDefIntensity = valueOrDefault; } } if (RebreatherIntensityValue >= 0f) { _rebreatherController._maxLightIntensity = RebreatherIntensityValue; } else if (_rebreatherDefIntensity.HasValue) { _rebreatherController._maxLightIntensity = _rebreatherDefIntensity.Value; } if (RebreatherNoOxygenOn) { _rebreatherController._airConsumptionRate = 0f; } else if (_rebreatherDefDrain.HasValue) { _rebreatherController._airConsumptionRate = _rebreatherDefDrain.Value; } } else { _rebreatherController = null; } } catch (Exception ex) { if (!_errReb) { _errReb = true; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(17, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("_rebreatherMods: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } } private static void _ropegunMods() { //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Expected O, but got Unknown try { if (RightHandHolding(RopeGunId)) { if (_ropegunController == null) { _ropegunController = ((Component)LocalPlayer.Transform).GetComponentInChildren(); } if ((Object)(object)_ropegunController == (Object)null) { return; } if (_ropegunController._maxRopeLength != 0f) { float valueOrDefault = _ropegunDefLength.GetValueOrDefault(); if (!_ropegunDefLength.HasValue) { valueOrDefault = _ropegunController._maxRopeLength; _ropegunDefLength = valueOrDefault; } } if (_ropegunController._maxFiringRange != 0f) { float valueOrDefault = _ropegunDefRange.GetValueOrDefault(); if (!_ropegunDefRange.HasValue) { valueOrDefault = _ropegunController._maxFiringRange; _ropegunDefRange = valueOrDefault; } } if (RopegunInfiniteOn) { _ropegunController._maxRopeLength = 10000000f; _ropegunController._maxFiringRange = 10000000f; } else if (_ropegunDefLength.HasValue && _ropegunDefRange.HasValue) { _ropegunController._maxRopeLength = _ropegunDefLength.Value; _ropegunController._maxFiringRange = _ropegunDefRange.Value; } } else { _ropegunController = null; } } catch (Exception ex) { if (!_errRope) { _errRope = true; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(14, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("_ropegunMods: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } } private static void _shotgunRapidFire() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown try { if (RightHandHolding(ShotgunId)) { if (_shotgun == null) { _shotgun = ((Component)LocalPlayer.Transform).GetComponentInChildren(); } if ((Object)(object)_shotgun != (Object)null && Input.GetMouseButton(0)) { ((RangedWeaponController)_shotgun).FireWeapon(); } } else { _shotgun = null; } } catch (Exception ex) { if (!_errShot) { _errShot = true; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(19, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("_shotgunRapidFire: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } } private static void _pistolRapidFire() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown try { if (RightHandHolding(PistolId)) { if (_pistol == null) { _pistol = ((Component)LocalPlayer.Transform).GetComponentInChildren(); } if ((Object)(object)_pistol != (Object)null && Input.GetMouseButton(0)) { ((RangedWeaponController)_pistol).FireWeapon(); } } else { _pistol = null; } } catch (Exception ex) { if (!_errPis) { _errPis = true; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(18, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("_pistolRapidFire: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } } private static void _revolverRapidFire() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown try { if (RightHandHolding(RevolverId)) { if (_revolver == null) { _revolver = ((Component)LocalPlayer.Transform).GetComponentInChildren(); } if ((Object)(object)_revolver != (Object)null && Input.GetMouseButton(0)) { ((RangedWeaponController)_revolver).FireWeapon(); } } else { _revolver = null; } } catch (Exception ex) { if (!_errRev) { _errRev = true; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(20, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("_revolverRapidFire: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } } private static void _rifleRapidFire() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown try { if (RightHandHolding(RifleId)) { if (_rifle == null) { _rifle = ((Component)LocalPlayer.Transform).GetComponentInChildren(); } if ((Object)(object)_rifle != (Object)null && Input.GetMouseButton(0)) { ((RangedWeaponController)_rifle).FireWeapon(); } } else { _rifle = null; } } catch (Exception ex) { if (!_errRif) { _errRif = true; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(17, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("_rifleRapidFire: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } } } public class ModdedItemsDriver : MonoBehaviour { public ModdedItemsDriver(IntPtr ptr) : base(ptr) { } private void Update() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown try { ModdedItems.Tick(); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(26, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("ModdedItemsDriver.Update: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } } internal static class Multiplayer { private static SaveGameType _prevSaveType; private static PlayerModes _prevMode; private static MpTypes _prevMpType; private static bool _mirrorActive; private static float _mirrorRestoreCountdown; public const int MirrorSlotIndex = 5; private static float _confirmDeadline; public static bool AdminPretend { get; private set; } public static bool BlockKickResp { get; private set; } public static bool BlockBanResp { get; private set; } public static string FakeSteamName { get; private set; } = ""; public static bool IsNameMaskActive => !string.IsNullOrEmpty(FakeSteamName); public static bool SaveMirrorRunning => _mirrorActive; public static string SaveMirrorStatus { get; private set; } = "Idle"; public static void SetAdminPretend(bool on) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown AdminPretend = on; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(16, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("AdminPretend -> "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(on); } log.LogDebug(val); } public static void SetBlockKickResp(bool on) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown BlockKickResp = on; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(17, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("BlockKickResp -> "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(on); } log.LogDebug(val); } public static void SetBlockBanResp(bool on) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown BlockBanResp = on; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(16, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("BlockBanResp -> "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(on); } log.LogDebug(val); } public static void SetFakeSteamName(string v) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown FakeSteamName = v ?? ""; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(29, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("FakeSteamName -> '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(FakeSteamName); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("' (active="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(IsNameMaskActive); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")"); } log.LogDebug(val); } public static void StartSaveMirror() { //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Expected O, but got Unknown //IL_016c: 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_0180: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) try { bool flag = false; try { flag = BoltNetwork.isRunning; } catch { } if (!flag) { SaveMirrorStatus = "Need to be in a multiplayer session (host or client)."; Plugin.Log.LogWarning((object)"SaveMirror: not in MP"); return; } if (_mirrorActive) { SaveMirrorStatus = "Already running."; return; } if (Time.unscaledTime > _confirmDeadline) { _confirmDeadline = Time.unscaledTime + 5f; SaveMirrorStatus = $"Click again within 5s to confirm. SP slot {5} WILL be overwritten if it exists."; return; } _confirmDeadline = 0f; _prevSaveType = SaveGameManager._activeSaveGameType; _prevMode = GameSetup.Mode; _prevMpType = GameSetup.MpType; SaveGameManager.SetActiveGameType((SaveGameType)0); GameSetup.Mode = (PlayerModes)0; GameSetup.MpType = (MpTypes)0; SaveGameManager.SaveToSlot(5, ""); _mirrorActive = true; _mirrorRestoreCountdown = 4f; SaveMirrorStatus = $"Mirroring world to slot {5}... leave menu open."; } catch (Exception ex) { SaveMirrorStatus = "Failed: " + ex.Message; ManualLogSource log = Plugin.Log; bool flag2 = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(12, 1, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SaveMirror: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex); } log.LogError(val); try { SaveGameManager.SetActiveGameType(_prevSaveType); GameSetup.Mode = _prevMode; GameSetup.MpType = _prevMpType; } catch { } _mirrorActive = false; } } public static void TickSaveMirror(float dt) { //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown //IL_0022: 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_0036: Unknown result type (might be due to invalid IL or missing references) if (!_mirrorActive) { return; } _mirrorRestoreCountdown -= dt; if (_mirrorRestoreCountdown > 0f) { return; } try { SaveGameManager.SetActiveGameType(_prevSaveType); GameSetup.Mode = _prevMode; GameSetup.MpType = _prevMpType; SaveMirrorStatus = $"Done. Check SP slot {5}."; } catch (Exception ex) { SaveMirrorStatus = "Restore failed: " + ex.Message; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(20, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SaveMirror restore: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex); } log.LogError(val); } _mirrorActive = false; } } internal static class _PatchesPlaceholder { } internal static class Persist { private static PersistDriver _driver; private static bool _registered; public static void Ensure() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown if ((Object)(object)_driver != (Object)null) { return; } try { if (!_registered) { ClassInjector.RegisterTypeInIl2Cpp(); _registered = true; } GameObject val = new GameObject("AdminMenu_Persist") { hideFlags = (HideFlags)61 }; Object.DontDestroyOnLoad((Object)val); _driver = val.AddComponent(); Plugin.Log.LogDebug((object)"Persist driver created"); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(16, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Persist.Ensure: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex); } log.LogError(val2); } } public static void ResetAll() { //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Expected O, but got Unknown //IL_0424: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Expected O, but got Unknown //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_046c: Expected O, but got Unknown //IL_04a6: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Expected O, but got Unknown //IL_04e7: Unknown result type (might be due to invalid IL or missing references) //IL_04ee: Expected O, but got Unknown //IL_0528: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Expected O, but got Unknown //IL_0569: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Expected O, but got Unknown //IL_05b8: Unknown result type (might be due to invalid IL or missing references) //IL_05bf: Expected O, but got Unknown bool flag76 = default(bool); try { SurvivalState.InvulnerableMode = false; PlayerTweaks.SetInvincible(on: false); SurvivalState.InfiniteEnergy = false; PlayerTweaks.InfiniteStamina(on: false); SurvivalState.HungerOff = false; PlayerTweaks.NoHunger(on: false); SurvivalState.ThirstOff = false; PlayerTweaks.NoThirst(on: false); SurvivalState.SleepOff = false; PlayerTweaks.NoSleepLoss(on: false); SurvivalState.FallShield = false; PlayerTweaks.NoFallDamage(on: false); Cheats.SetContinuousHeal(on: false); Cheats.SetLungReplenish(on: false); Cheats.SetColdImmunity(on: false); Cheats.SetDeathPin(on: false); Combat.SetDamageOverride(on: false); Combat.SetAmmoLock(on: false); Combat.SetImpulseBoost(on: false); Combat.SetTreeOneShot(on: false); Combat.SetSilentToEnemies(on: false); Combat.SetAiPause(on: false); Cheats.SetRadialCull(on: false); Cheats.SetRushMode(on: false); try { PhantomFly.SetEnabled(on: false); } catch { } try { Players.RaycastTeleport(on: false); } catch { } Multiplayer.SetAdminPretend(on: false); Multiplayer.SetBlockKickResp(on: false); Multiplayer.SetBlockBanResp(on: false); Multiplayer.SetFakeSteamName(""); Worldcraft.NoGravity(on: false); Worldcraft.FreezeLakes(on: false); Worldcraft.NoLakes(on: false); Worldcraft.NoOcean(on: false); Worldcraft.NoWaterfalls(on: false); Worldcraft.ApplyLockTime(on: false, 12f); Worldcraft.SetFreeCraftFlag(on: false); Worldcraft.SetInstantPlace(on: false); Cheats.SetBuildResourceLock(on: false); Cheats.SetLogResourceLock(on: false); bool num = (Esp.ShowDead = false); Esp.CollectibleEsp = num; Esp.ContainerEsp = num; Esp.ItemEsp = num; Esp.WaypointEsp = num; Esp.RadarEsp = num; Esp.PlayerEsp = num; Esp.AnimalEsp = num; Esp.ActorEsp = num; Cheats.SetCenterReticle(on: false); Cheats.SetCaveBrightness(on: false); Cheats.SetDetachedView(on: false); Cheats.SetCapsuleView(on: false); try { WorldEdit.SetEnabled(on: false); } catch { } ModdedItems.LighterIncreaseRange(on: false); ModdedItems.FlashlightNoDrain(on: false); ModdedItems.RebreatherNoOxygen(on: false); ModdedItems.RopegunInfinite(on: false); ModdedItems.GliderNoDownforce(on: false); ModdedItems.ShotgunRapidFire(on: false); ModdedItems.PistolRapidFire(on: false); ModdedItems.RevolverRapidFire(on: false); ModdedItems.RifleRapidFire(on: false); ConfigEntry invincible = Settings.Invincible; ConfigEntry infStam = Settings.InfStam; ConfigEntry noHunger = Settings.NoHunger; ConfigEntry noThirst = Settings.NoThirst; ConfigEntry noSleep = Settings.NoSleep; ConfigEntry noFall = Settings.NoFall; ConfigEntry infHeal = Settings.InfHeal; ConfigEntry infLungCapacity = Settings.InfLungCapacity; ConfigEntry noCold = Settings.NoCold; ConfigEntry deathPin = Settings.DeathPin; ConfigEntry instaDmg = Settings.InstaDmg; ConfigEntry ammoLock = Settings.AmmoLock; ConfigEntry throwBoost = Settings.ThrowBoost; ConfigEntry oneHitTrees = Settings.OneHitTrees; ConfigEntry stealth = Settings.Stealth; ConfigEntry radialCull = Settings.RadialCull; ConfigEntry actorEsp = Settings.ActorEsp; ConfigEntry animalEsp = Settings.AnimalEsp; ConfigEntry playerEsp = Settings.PlayerEsp; ConfigEntry radarEsp = Settings.RadarEsp; ConfigEntry waypointEsp = Settings.WaypointEsp; ConfigEntry itemEsp = Settings.ItemEsp; ConfigEntry containerEsp = Settings.ContainerEsp; ConfigEntry collectibleEsp = Settings.CollectibleEsp; ConfigEntry showDead = Settings.ShowDead; ConfigEntry centerCrosshair = Settings.CenterCrosshair; ConfigEntry caveLight = Settings.CaveLight; ConfigEntry lighterRange = Settings.LighterRange; ConfigEntry flashlightNoDrain = Settings.FlashlightNoDrain; ConfigEntry rebreatherNoOxygen = Settings.RebreatherNoOxygen; ConfigEntry ropegunInfinite = Settings.RopegunInfinite; ConfigEntry gliderNoDownforce = Settings.GliderNoDownforce; ConfigEntry shotgunRapidFire = Settings.ShotgunRapidFire; ConfigEntry pistolRapidFire = Settings.PistolRapidFire; ConfigEntry revolverRapidFire = Settings.RevolverRapidFire; ConfigEntry rifleRapidFire = Settings.RifleRapidFire; ConfigEntry adminPretend = Settings.AdminPretend; ConfigEntry blockKickResp = Settings.BlockKickResp; bool flag2 = (Settings.BlockBanResp.Value = false); bool flag4 = (blockKickResp.Value = flag2); bool flag6 = (adminPretend.Value = flag4); bool flag8 = (rifleRapidFire.Value = flag6); bool flag10 = (revolverRapidFire.Value = flag8); bool flag12 = (pistolRapidFire.Value = flag10); bool flag14 = (shotgunRapidFire.Value = flag12); bool flag16 = (gliderNoDownforce.Value = flag14); bool flag18 = (ropegunInfinite.Value = flag16); bool flag20 = (rebreatherNoOxygen.Value = flag18); bool flag22 = (flashlightNoDrain.Value = flag20); bool flag24 = (lighterRange.Value = flag22); bool flag26 = (caveLight.Value = flag24); bool flag28 = (centerCrosshair.Value = flag26); bool flag30 = (showDead.Value = flag28); bool flag32 = (collectibleEsp.Value = flag30); bool flag34 = (containerEsp.Value = flag32); bool flag36 = (itemEsp.Value = flag34); bool flag38 = (waypointEsp.Value = flag36); bool flag40 = (radarEsp.Value = flag38); bool flag42 = (playerEsp.Value = flag40); bool flag44 = (animalEsp.Value = flag42); bool flag46 = (actorEsp.Value = flag44); bool flag48 = (radialCull.Value = flag46); bool flag50 = (stealth.Value = flag48); bool flag52 = (oneHitTrees.Value = flag50); bool flag54 = (throwBoost.Value = flag52); bool flag56 = (ammoLock.Value = flag54); bool flag58 = (instaDmg.Value = flag56); bool flag60 = (deathPin.Value = flag58); bool flag62 = (noCold.Value = flag60); bool flag64 = (infLungCapacity.Value = flag62); bool flag66 = (infHeal.Value = flag64); bool flag68 = (noFall.Value = flag66); bool flag70 = (noSleep.Value = flag68); bool flag72 = (noThirst.Value = flag70); bool flag74 = (noHunger.Value = flag72); flag76 = (infStam.Value = flag74); invincible.Value = flag76; try { PlayerMoveTab.ResetSliders(); } catch (Exception ex) { ManualLogSource log = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(20, 1, ref flag76); if (flag76) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("PlayerMove sliders: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } try { CombatTab.ResetSliders(); } catch (Exception ex2) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(16, 1, ref flag76); if (flag76) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Combat sliders: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex2.Message); } log2.LogError(val); } try { WorldClimateTab.ResetSliders(); } catch (Exception ex3) { ManualLogSource log3 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(17, 1, ref flag76); if (flag76) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Climate sliders: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex3.Message); } log3.LogError(val); } try { ItemsTab.ResetSliders(); } catch (Exception ex4) { ManualLogSource log4 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(15, 1, ref flag76); if (flag76) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Items sliders: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex4.Message); } log4.LogError(val); } try { VisualTab.ResetSliders(); } catch (Exception ex5) { ManualLogSource log5 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(16, 1, ref flag76); if (flag76) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Visual sliders: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex5.Message); } log5.LogError(val); } try { WorldTerrainTab.ResetSliders(); } catch (Exception ex6) { ManualLogSource log6 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(17, 1, ref flag76); if (flag76) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Terrain sliders: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex6.Message); } log6.LogError(val); } try { SpawnTab.ResetSliders(); } catch (Exception ex7) { ManualLogSource log7 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(15, 1, ref flag76); if (flag76) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Spawn sliders: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex7.Message); } log7.LogError(val); } MenuUI.ClearAllEditBuffers(); Plugin.Log.LogInfo((object)"Persist.ResetAll: every toggle and slider cleared, config saved"); } catch (Exception ex8) { ManualLogSource log8 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(18, 1, ref flag76); if (flag76) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Persist.ResetAll: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex8); } log8.LogError(val); } } public static void ReapplyAll() { //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Expected O, but got Unknown if (!Settings.AutoApplyOnLoad.Value) { Plugin.Log.LogDebug((object)"Persist.ReapplyAll: skipped (AutoApplyOnLoad is off)"); return; } try { if (Settings.Invincible.Value) { SurvivalState.InvulnerableMode = true; PlayerTweaks.SetInvincible(on: true); } if (Settings.InfStam.Value) { SurvivalState.InfiniteEnergy = true; PlayerTweaks.InfiniteStamina(on: true); } if (Settings.NoHunger.Value) { SurvivalState.HungerOff = true; PlayerTweaks.NoHunger(on: true); } if (Settings.NoThirst.Value) { SurvivalState.ThirstOff = true; PlayerTweaks.NoThirst(on: true); } if (Settings.NoSleep.Value) { SurvivalState.SleepOff = true; PlayerTweaks.NoSleepLoss(on: true); } if (Settings.NoFall.Value) { SurvivalState.FallShield = true; PlayerTweaks.NoFallDamage(on: true); } if (Settings.InfHeal.Value) { Cheats.SetContinuousHeal(on: true); } if (Settings.InfLungCapacity.Value) { Cheats.SetLungReplenish(on: true); } if (Settings.NoCold.Value) { Cheats.SetColdImmunity(on: true); } if (Settings.DeathPin.Value) { Cheats.SetDeathPin(on: true); } if (Settings.InstaDmg.Value) { Combat.SetDamageOverride(on: true); } if (Settings.AmmoLock.Value) { Combat.SetAmmoLock(on: true); } if (Settings.ThrowBoost.Value) { Combat.SetImpulseBoost(on: true); } if (Settings.OneHitTrees.Value) { Combat.SetTreeOneShot(on: true); } if (Settings.Stealth.Value) { Combat.SetSilentToEnemies(on: true); } if (Settings.RadialCull.Value) { Cheats.SetRadialCull(on: true); } Esp.ActorEsp = Settings.ActorEsp.Value; Esp.AnimalEsp = Settings.AnimalEsp.Value; Esp.PlayerEsp = Settings.PlayerEsp.Value; Esp.RadarEsp = Settings.RadarEsp.Value; Esp.WaypointEsp = Settings.WaypointEsp.Value; Esp.ItemEsp = Settings.ItemEsp.Value; Esp.ContainerEsp = Settings.ContainerEsp.Value; Esp.CollectibleEsp = Settings.CollectibleEsp.Value; Esp.ShowDead = Settings.ShowDead.Value; if (Settings.CenterCrosshair.Value) { Cheats.SetCenterReticle(on: true); } if (Settings.CaveLight.Value) { Cheats.SetCaveBrightness(on: true); } if (Settings.LighterRange.Value) { ModdedItems.LighterIncreaseRange(on: true); } if (Settings.FlashlightNoDrain.Value) { ModdedItems.FlashlightNoDrain(on: true); } if (Settings.RebreatherNoOxygen.Value) { ModdedItems.RebreatherNoOxygen(on: true); } if (Settings.RopegunInfinite.Value) { ModdedItems.RopegunInfinite(on: true); } if (Settings.GliderNoDownforce.Value) { ModdedItems.GliderNoDownforce(on: true); } if (Settings.ShotgunRapidFire.Value) { ModdedItems.ShotgunRapidFire(on: true); } if (Settings.PistolRapidFire.Value) { ModdedItems.PistolRapidFire(on: true); } if (Settings.RevolverRapidFire.Value) { ModdedItems.RevolverRapidFire(on: true); } if (Settings.RifleRapidFire.Value) { ModdedItems.RifleRapidFire(on: true); } if (Settings.AdminPretend.Value) { Multiplayer.SetAdminPretend(on: true); } if (Settings.BlockKickResp.Value) { Multiplayer.SetBlockKickResp(on: true); } if (Settings.BlockBanResp.Value) { Multiplayer.SetBlockBanResp(on: true); } Plugin.Log.LogDebug((object)"Persist.ReapplyAll: settings re-applied to game state"); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(20, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Persist.ReapplyAll: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex); } log.LogError(val); } } } public class PersistDriver : MonoBehaviour { private bool _wasAlive; private float _checkTimer; public PersistDriver(IntPtr p) : base(p) { } private void Update() { _checkTimer += Time.unscaledDeltaTime; if (!(_checkTimer < 0.5f)) { _checkTimer = 0f; bool flag = (Object)(object)LocalPlayer._instance != (Object)null; if (flag && !_wasAlive) { _wasAlive = true; Persist.ReapplyAll(); } else if (!flag && _wasAlive) { _wasAlive = false; } } } } internal static class PhantomFly { private static PhantomFlyDriver _driver; private static bool _registered; public static float Speed { get; set; } = 10f; public static bool Enabled { get; private set; } public static void Init() { EnsureDriver(); } public static void SetEnabled(bool on) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown EnsureDriver(); Enabled = on; if ((Object)(object)_driver != (Object)null) { _driver.Active = on; } try { if (!((Object)(object)LocalPlayer._instance == (Object)null)) { FirstPersonCharacter fpCharacter = LocalPlayer.FpCharacter; if ((Object)(object)fpCharacter != (Object)null && (Object)(object)fpCharacter._rigidbody != (Object)null) { fpCharacter._rigidbody.isKinematic = on; } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(23, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("PhantomFly.SetEnabled: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } private static void EnsureDriver() { //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(); _registered = true; } GameObject val = new GameObject("AdminMenu_PhantomFlyDriver"); Object.DontDestroyOnLoad((Object)val); _driver = val.AddComponent(); Plugin.Log.LogDebug((object)"PhantomFly driver 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("PhantomFly.EnsureDriver: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } } } public class PhantomFlyDriver : MonoBehaviour { public bool Active; public PhantomFlyDriver(IntPtr ptr) : base(ptr) { } private void Update() { //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Expected O, but got Unknown //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_00bd: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_011e: 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_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: 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_0147: 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_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) if (!Active || (Object)(object)LocalPlayer._instance == (Object)null) { return; } try { FirstPersonCharacter fpCharacter = LocalPlayer.FpCharacter; if ((Object)(object)fpCharacter == (Object)null || (Object)(object)fpCharacter._rigidbody == (Object)null) { return; } if (!fpCharacter._rigidbody.isKinematic) { fpCharacter._rigidbody.isKinematic = true; } float axisRaw = Input.GetAxisRaw("Vertical"); float axisRaw2 = Input.GetAxisRaw("Horizontal"); float num = 0f; if (Input.GetKey((KeyCode)32)) { num = 1f; } else if (Input.GetKey((KeyCode)306)) { num = -1f; } Camera main = Camera.main; if (!((Object)(object)main == (Object)null)) { Vector3 forward = ((Component)main).transform.forward; Vector3 right = ((Component)main).transform.right; Vector3 val = forward * axisRaw + right * axisRaw2; if (((Vector3)(ref val)).sqrMagnitude > 1f) { ((Vector3)(ref val)).Normalize(); } float speed = PhantomFly.Speed; float num2 = (Input.GetKey((KeyCode)304) ? 2f : 1f); float deltaTime = Time.deltaTime; Transform transform = LocalPlayer.Transform; transform.position += val * speed * deltaTime * num2 + Vector3.up * num * speed * deltaTime * num2; } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(25, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("PhantomFlyDriver.Update: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } } } internal struct RemotePlayerInfo { public string Name; public ulong SteamId; public Vector3 Position; public bool IsAlive; public bool IsLocal; public bool IsAdmin; public BoltEntity Entity; public GameObject Body; } internal static class Players { private static readonly List _roster = new List(); private static RaycastTpDriver _driver; private static bool _registered; public static float GetPlayerX => TryPos().x; public static float GetPlayerY => TryPos().y; public static float GetPlayerZ => TryPos().z; public static IReadOnlyList Roster => _roster; public static bool RaycastEnabled { get; private set; } private static Vector3 TryPos() { //IL_0021: 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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) try { return Object.op_Implicit((Object)(object)LocalPlayer._instance) ? LocalPlayer.Transform.position : Vector3.zero; } catch { return Vector3.zero; } } public static void MovePlayerX(float v) { Move(0, v); } public static void MovePlayerY(float v) { Move(1, v); } public static void MovePlayerZ(float v) { Move(2, v); } private static void Move(int axis, float v) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)LocalPlayer._instance == (Object)null) { Plugin.Log.LogWarning((object)"MovePlayer: no LocalPlayer"); return; } try { Transform transform = LocalPlayer.Transform; Vector3 position = transform.position; switch (axis) { case 0: position.x = v; break; case 1: position.y = v; break; default: position.z = v; break; } transform.position = position; } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(12, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("MovePlayer: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static void GotoItemByName(string name) { //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: 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_0216: Expected O, but got Unknown //IL_0242: Unknown result type (might be due to invalid IL or missing references) if (string.IsNullOrWhiteSpace(name)) { return; } bool flag = default(bool); try { ItemData val = ItemDatabaseManager.ItemByName(name); if ((Object)(object)val == (Object)null && int.TryParse(name, out var result)) { val = ItemDatabaseManager.ItemById(result); } if ((Object)(object)val == (Object)null) { ManualLogSource log = Plugin.Log; BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(22, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("GotoItem: '"); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(name); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("' not found"); } log.LogWarning(val2); return; } string text = val.Name + "Pickup"; Transform val3 = null; GameObject val4 = GameObject.Find(text); if ((Object)(object)val4 != (Object)null) { val3 = val4.transform; } else { int sceneCount = SceneManager.sceneCount; for (int i = 0; i < sceneCount; i++) { if (!((Object)(object)val3 == (Object)null)) { break; } Scene sceneAt = SceneManager.GetSceneAt(i); if (!((Scene)(ref sceneAt)).isLoaded) { continue; } foreach (GameObject item in (Il2CppArrayBase)(object)((Scene)(ref sceneAt)).GetRootGameObjects()) { if ((Object)(object)item == (Object)null) { continue; } int childCount = item.transform.childCount; for (int j = 0; j < childCount; j++) { Transform child = item.transform.GetChild(j); if ((Object)(object)child != (Object)null && (Object)(object)((Component)child).gameObject != (Object)null && ((Object)((Component)child).gameObject).name == text) { val3 = child; break; } } if ((Object)(object)val3 != (Object)null) { break; } } } } if ((Object)(object)val3 == (Object)null) { ManualLogSource log2 = Plugin.Log; BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(24, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("GotoItem: no '"); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(text); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("' in world"); } log2.LogWarning(val2); return; } if ((Object)(object)LocalPlayer._instance == (Object)null) { Plugin.Log.LogWarning((object)"GotoItem: no LocalPlayer"); return; } LocalPlayer._instance.Goto(val3.position); ManualLogSource log3 = Plugin.Log; BepInExDebugLogInterpolatedStringHandler val5 = new BepInExDebugLogInterpolatedStringHandler(27, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val5).AppendLiteral("GotoItem: teleported to "); ((BepInExLogInterpolatedStringHandler)val5).AppendFormatted(val.Name); ((BepInExLogInterpolatedStringHandler)val5).AppendLiteral(" @ "); ((BepInExLogInterpolatedStringHandler)val5).AppendFormatted(val3.position); } log3.LogDebug(val5); } catch (Exception ex) { ManualLogSource log4 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val6 = new BepInExErrorLogInterpolatedStringHandler(16, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val6).AppendLiteral("GotoItemByName: "); ((BepInExLogInterpolatedStringHandler)val6).AppendFormatted(ex.Message); } log4.LogError(val6); } } public static void RefreshRoster() { //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Expected O, but got Unknown //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Expected O, but got Unknown //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_02d5: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Invalid comparison between Unknown and I4 _roster.Clear(); bool flag = default(bool); try { BoltEntity val = null; try { val = (((Object)(object)LocalPlayer._instance != (Object)null) ? LocalPlayer.GameObject.GetComponentInParent() : null); } catch { } ulong steamId = 0uL; try { steamId = SteamUser.GetSteamID().m_SteamID; } catch { } if ((Object)(object)LocalPlayer._instance != (Object)null) { Vector3 position = Vector3.zero; try { position = LocalPlayer.Transform.position; } catch { } bool isAlive = true; try { isAlive = (Object)(object)LocalPlayer.Vitals != (Object)null && LocalPlayer.Vitals.HasHealth(); } catch { } string name = "you"; try { name = SteamFriends.GetPersonaName(); } catch { } _roster.Add(new RemotePlayerInfo { Name = name, SteamId = steamId, Position = position, IsAlive = isAlive, IsLocal = true, Entity = val, Body = LocalPlayer.GameObject }); } MultiplayerPlayerRoles val2 = Object.FindObjectOfType(); Dictionary knownPlayers = PlayerListBase._knownPlayers; Il2CppArrayBase val3 = Object.FindObjectsOfType(); int num = 0; if (val3 != null) { for (int i = 0; i < val3.Length; i++) { try { PlayerName val4 = val3[i]; if ((Object)(object)val4 == (Object)null || (Object)(object)((Component)val4).gameObject == (Object)null) { continue; } BoltEntity componentInParent = ((Component)val4).GetComponentInParent(); if ((Object)(object)componentInParent == (Object)null || ((Object)(object)val != (Object)null && (Object)(object)componentInParent == (Object)(object)val)) { continue; } num++; ulong num2 = 0uL; string name2 = "Player"; bool isAdmin = false; if (knownPlayers != null) { Enumerator enumerator = knownPlayers.GetEnumerator(); while (enumerator.MoveNext()) { KnownPlayerData value = enumerator.Current.Value; if (value != null && (Object)(object)value.BoltEntity == (Object)(object)componentInParent) { num2 = value.SteamId; if (!string.IsNullOrEmpty(value.Name)) { name2 = value.Name; } break; } } } if (num2 != 0L && (Object)(object)val2 != (Object)null) { try { isAdmin = (val2.GetRoleValue(num2) & 0x30) > 0; } catch { } } _roster.Add(new RemotePlayerInfo { Name = name2, SteamId = num2, Position = ((Component)val4).transform.position, IsAlive = ((Component)val4).gameObject.activeInHierarchy, IsLocal = false, IsAdmin = isAdmin, Entity = componentInParent, Body = ((Component)val4).gameObject }); } catch (Exception ex) { ManualLogSource log = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val5 = new BepInExErrorLogInterpolatedStringHandler(24, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val5).AppendLiteral("RefreshRoster pn entry: "); ((BepInExLogInterpolatedStringHandler)val5).AppendFormatted(ex.Message); } log.LogError(val5); } } } ManualLogSource log2 = Plugin.Log; BepInExDebugLogInterpolatedStringHandler val6 = new BepInExDebugLogInterpolatedStringHandler(62, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val6).AppendLiteral("RefreshRoster: "); ((BepInExLogInterpolatedStringHandler)val6).AppendFormatted(_roster.Count); ((BepInExLogInterpolatedStringHandler)val6).AppendLiteral(" player(s) total ("); ((BepInExLogInterpolatedStringHandler)val6).AppendFormatted(num); ((BepInExLogInterpolatedStringHandler)val6).AppendLiteral(" remote found via PlayerName)"); } log2.LogDebug(val6); } catch (Exception ex2) { ManualLogSource log3 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val5 = new BepInExErrorLogInterpolatedStringHandler(15, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val5).AppendLiteral("RefreshRoster: "); ((BepInExLogInterpolatedStringHandler)val5).AppendFormatted(ex2.Message); } log3.LogError(val5); } } public static IReadOnlyList GetPlayers() { if (_roster.Count == 0) { RefreshRoster(); } return _roster; } private static bool TryGetEntity(int index, out BoltEntity entity) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown entity = null; try { if (index < 0 || index >= _roster.Count) { return false; } RemotePlayerInfo remotePlayerInfo = _roster[index]; if (remotePlayerInfo.IsLocal) { return false; } entity = remotePlayerInfo.Entity; return (Object)(object)entity != (Object)null; } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(14, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("TryGetEntity: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } return false; } public static void TeleportToPlayer(int index) { //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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_00f4: 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: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_0135: Unknown result type (might be due to invalid IL or missing references) bool flag = default(bool); try { if (index < 0 || index >= _roster.Count) { return; } RemotePlayerInfo remotePlayerInfo = _roster[index]; if (remotePlayerInfo.IsLocal) { Plugin.Log.LogWarning((object)"TeleportToPlayer: that's you"); } else { if ((Object)(object)LocalPlayer._instance == (Object)null) { return; } Vector3 position = remotePlayerInfo.Position; if ((Object)(object)remotePlayerInfo.Body != (Object)null) { position = remotePlayerInfo.Body.transform.position; } else if ((Object)(object)remotePlayerInfo.Entity != (Object)null) { position = ((Component)remotePlayerInfo.Entity).transform.position; } if (position == Vector3.zero) { ManualLogSource log = Plugin.Log; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(39, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("TeleportToPlayer: no live position for "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(remotePlayerInfo.Name); } log.LogWarning(val); return; } position += Vector3.up * 0.5f; LocalPlayer._instance.Goto(position); ManualLogSource log2 = Plugin.Log; BepInExDebugLogInterpolatedStringHandler val2 = new BepInExDebugLogInterpolatedStringHandler(24, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("TeleportToPlayer: -> "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(remotePlayerInfo.Name); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" @ "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(position); } log2.LogDebug(val2); } } catch (Exception ex) { ManualLogSource log3 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val3 = new BepInExErrorLogInterpolatedStringHandler(18, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("TeleportToPlayer: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex.Message); } log3.LogError(val3); } } public static void BringPlayer(int index) { //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown //IL_009b: Unknown result type (might be due to invalid IL or missing references) bool flag = default(bool); try { if (!TryGetEntity(index, out var entity)) { Plugin.Log.LogWarning((object)"BringPlayer: no entity"); } else if (!((Object)(object)LocalPlayer._instance == (Object)null)) { Vector3 val = LocalPlayer.Transform.position + Vector3.up * 0.5f; ((Component)entity).transform.position = val; ManualLogSource log = Plugin.Log; BepInExDebugLogInterpolatedStringHandler val2 = new BepInExDebugLogInterpolatedStringHandler(53, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("BringPlayer: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(_roster[index].Name); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" -> "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(val); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" (client-side, server may snap back)"); } log.LogDebug(val2); } } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val3 = new BepInExErrorLogInterpolatedStringHandler(13, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("BringPlayer: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex.Message); } log2.LogError(val3); } } public static void RevivePlayer(int index) { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown bool flag = default(bool); try { if (!TryGetEntity(index, out var entity)) { Plugin.Log.LogWarning((object)"RevivePlayer: no entity"); return; } Vitals componentInChildren = ((Component)entity).GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { Plugin.Log.LogWarning((object)"RevivePlayer: no Vitals on remote (server-authoritative; not exposed client-side)"); return; } componentInChildren.SetFullHealth(); ManualLogSource log = Plugin.Log; BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(35, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("RevivePlayer: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(_roster[index].Name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" healed (client-side)"); } log.LogDebug(val); } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(14, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("RevivePlayer: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log2.LogError(val2); } } public static void KillPlayer(int index) { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown bool flag = default(bool); try { if (!TryGetEntity(index, out var entity)) { Plugin.Log.LogWarning((object)"KillPlayer: no entity"); return; } Vitals componentInChildren = ((Component)entity).GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { Plugin.Log.LogWarning((object)"KillPlayer: no Vitals on remote (server-authoritative; not exposed client-side)"); return; } componentInChildren.TriggerDeath(); ManualLogSource log = Plugin.Log; BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(41, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("KillPlayer: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(_roster[index].Name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" killed (client-side request)"); } log.LogDebug(val); } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(12, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("KillPlayer: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log2.LogError(val2); } } public static void RaycastTeleport(bool on) { EnsureDriver(); RaycastEnabled = on; if ((Object)(object)_driver != (Object)null) { _driver.Active = on; } } private static void EnsureDriver() { //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(); _registered = true; } GameObject val = new GameObject("AdminMenu_RaycastTpDriver"); Object.DontDestroyOnLoad((Object)val); _driver = val.AddComponent(); Plugin.Log.LogDebug((object)"RaycastTp driver created"); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(22, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Players.EnsureDriver: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } } } public class RaycastTpDriver : MonoBehaviour { public bool Active; public RaycastTpDriver(IntPtr ptr) : base(ptr) { } private void Update() { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) if (!Active || MenuComponent.IsOpen || (Object)(object)LocalPlayer._instance == (Object)null) { return; } try { if (!Input.GetKeyDown((KeyCode)324)) { return; } Transform mainCamTr = LocalPlayer.MainCamTr; if (!((Object)(object)mainCamTr == (Object)null)) { int mask = LayerMask.GetMask(new string[1] { "Terrain" }); RaycastHit val = default(RaycastHit); if (Physics.Raycast(mainCamTr.position + mainCamTr.forward * 1.2f, mainCamTr.forward, ref val, float.PositiveInfinity, mask)) { LocalPlayer.Transform.position = ((RaycastHit)(ref val)).point + Vector3.up * 1f; } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(24, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("RaycastTpDriver.Update: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } } } internal static class PlayerTweaks { private static float? _originalFallDamage; private static float? _defWalk; private static float? _defRun; private static float? _defSwim; private static float? _defJump; public static readonly string[] ArmourTypes = new string[5] { "BoneArmour", "CreepyArmour", "DeerHideArmour", "LeafArmour", "TechArmour" }; public static float CurrentWalkSpeed => TryGetCaptured(() => LocalPlayer.FpCharacter.WalkSpeed, 5f, ref _defWalk); public static float CurrentRunSpeed => TryGetCaptured(() => LocalPlayer.FpCharacter.RunSpeed, 8f, ref _defRun); public static float CurrentSwimSpeed => TryGetCaptured(() => LocalPlayer.FpCharacter.SwimSpeed, 4f, ref _defSwim); public static float CurrentJumpMultiplier => TryGetCaptured(() => LocalPlayer.FpCharacter.JumpMultiplier, 1f, ref _defJump); public static float DefaultWalkSpeed => _defWalk ?? 5f; public static float DefaultRunSpeed => _defRun ?? 8f; public static float DefaultSwimSpeed => _defSwim ?? 4f; public static float DefaultJumpMultiplier => _defJump ?? 1f; public static void SetInvincible(bool on) { SafeCheat(delegate { DebugConsole.Instance._godmode(on ? "on" : "off"); }, "SetInvincible"); } public static void InfiniteStamina(bool on) { SafeCheat(delegate { DebugConsole.Instance._energyhack(on ? "on" : "off"); }, "InfiniteStamina"); } public static void LockView(bool on) { SafeCheat(delegate { InputSystem.SetState((InputState)1, on); InputSystem.ForceRefreshState(); }, "LockView"); } public static void NoHunger(bool on) { Safe(delegate { ((Stat)LocalPlayer.Vitals.Fullness).SetMin(on ? 100f : 0f); }, "NoHunger"); } public static void NoThirst(bool on) { Safe(delegate { ((Stat)LocalPlayer.Vitals.Hydration).SetMin(on ? 100f : 0f); }, "NoThirst"); } public static void NoSleepLoss(bool on) { Safe(delegate { ((Stat)LocalPlayer.Vitals.Rested).SetMin(on ? 100f : 0f); }, "NoSleepLoss"); } public static void RefillHunger() { RefillStat(() => (Stat)(object)LocalPlayer.Vitals.Fullness, "RefillHunger"); } public static void RefillThirst() { RefillStat(() => (Stat)(object)LocalPlayer.Vitals.Hydration, "RefillThirst"); } public static void RefillSleep() { RefillStat(() => (Stat)(object)LocalPlayer.Vitals.Rested, "RefillSleep"); } public static void RefillStamina() { RefillStat(() => (Stat)(object)LocalPlayer.Vitals.Stamina, "RefillStamina"); } private static void RefillStat(Func getStat, string name) { Safe(delegate { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown Stat val = getStat(); if (val == null) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(14, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(name); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(": stat is null"); } log.LogWarning(val2); } else { val.SetCurrentValue(val.GetMax()); } }, name); } public static void NoFallDamage(bool on) { Safe(delegate { float valueOrDefault = _originalFallDamage.GetValueOrDefault(); if (!_originalFallDamage.HasValue) { valueOrDefault = LocalPlayer.FpCharacter._baseFallDamage; _originalFallDamage = valueOrDefault; } LocalPlayer.FpCharacter._baseFallDamage = (on ? 0f : _originalFallDamage.Value); }, "NoFallDamage"); } public static void SetWalkSpeed(float v) { Safe(delegate { LocalPlayer.FpCharacter.SetWalkSpeed(v); }, "SetWalkSpeed"); } public static void SetRunSpeed(float v) { Safe(delegate { LocalPlayer.FpCharacter.SetRunSpeed(v); }, "SetRunSpeed"); } public static void SetSwimSpeed(float v) { Safe(delegate { LocalPlayer.FpCharacter.SetSwimSpeed(v); }, "SetSwimSpeed"); } public static void SetJumpMultiplier(float v) { Safe(delegate { LocalPlayer.FpCharacter.SetSuperJump(v); }, "SetJumpMultiplier"); } public static string ArmourLabel(string assetName) { try { ItemData obj = ItemDatabaseManager.ItemByName(assetName); object obj2; if (obj == null) { obj2 = null; } else { ItemUiData uiData = obj._uiData; obj2 = ((uiData != null) ? uiData.GetTitleLocalized() : null); } string text = (string)obj2; if (!string.IsNullOrEmpty(text)) { return text; } } catch { } return assetName; } public static void EquipArmour(string name) { Safe(delegate { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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 //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(23, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("EquipArmour('"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("') invoked"); } log.LogDebug(val); int num = ItemDatabaseManager.ItemIdByName(name); if (num <= 0) { ManualLogSource log2 = Plugin.Log; BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(36, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("EquipArmour: '"); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(name); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("' not in item database"); } log2.LogWarning(val2); } else { PlayerStats stats = LocalPlayer.Stats; PlayerArmourSystem val3 = ((stats != null) ? stats.ArmourSystem : null); if ((Object)(object)val3 == (Object)null) { Plugin.Log.LogWarning((object)"EquipArmour: no PlayerArmourSystem"); } else { ArmourPiece armourPieceById = val3.GetArmourPieceById(num); if ((Object)(object)armourPieceById == (Object)null) { ManualLogSource log3 = Plugin.Log; BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(47, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("EquipArmour: GetArmourPieceById("); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(num); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(") returned null"); } log3.LogWarning(val2); } else { for (int i = 0; i <= 11; i++) { try { val3.TryUnequipSlot((WearableSlots)i, true); } catch { } } int num2 = 0; for (int j = 0; j < 12; j++) { if (!val3.EquipToNextAvailableSlot(armourPieceById)) { break; } num2++; } ManualLogSource log4 = Plugin.Log; val = new BepInExDebugLogInterpolatedStringHandler(32, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("EquipArmour: equipped "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(num2); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("' pieces"); } log4.LogDebug(val); } } } }, "EquipArmour"); } private static void Safe(Action a, string name) { //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_001d: Expected O, but got Unknown bool flag = default(bool); if ((Object)(object)LocalPlayer._instance == (Object)null) { ManualLogSource log = Plugin.Log; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(20, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": no LocalPlayer yet"); } log.LogWarning(val); return; } try { a(); } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(2, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(name); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(": "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log2.LogError(val2); } } private static void SafeCheat(Action a, string name) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown try { a(); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(2, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } private static float TryGet(Func g, float fallback) { try { return Object.op_Implicit((Object)(object)LocalPlayer._instance) ? g() : fallback; } catch { return fallback; } } private static float TryGetCaptured(Func g, float fallback, ref float? captured) { try { if (!Object.op_Implicit((Object)(object)LocalPlayer._instance)) { return captured ?? fallback; } float num = g(); if (!captured.HasValue) { captured = num; } return num; } catch { return captured ?? fallback; } } } [BepInPlugin("pineapple54.adminmenu", "AdminMenu", "2.0.5")] public class Plugin : BasePlugin { public const string Guid = "pineapple54.adminmenu"; public const string Name = "AdminMenu"; public const string Version = "2.0.5"; internal static ManualLogSource Log; public override void Load() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Expected O, but got Unknown //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Expected O, but got Unknown //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Expected O, but got Unknown //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Expected O, but got Unknown //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Expected O, but got Unknown //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Expected O, but got Unknown //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Expected O, but got Unknown //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Expected O, but got Unknown //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Expected O, but got Unknown //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Expected O, but got Unknown //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Expected O, but got Unknown //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Expected O, but got Unknown //IL_0316: Unknown result type (might be due to invalid IL or missing references) Log = ((BasePlugin)this).Log; ManualLogSource log = Log; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(10, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("AdminMenu"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" v"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("2.0.5"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" loading"); } log.LogInfo(val); try { Settings.Init(((BasePlugin)this).Config); } catch (Exception ex) { ManualLogSource log2 = Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(15, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Settings.Init: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex); } log2.LogError(val2); } try { Teleport.Load(); } catch (Exception ex2) { ManualLogSource log3 = Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(15, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Teleport.Load: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex2); } log3.LogError(val2); } ClassInjector.RegisterTypeInIl2Cpp(); ((BasePlugin)this).AddComponent(); try { ModdedItems.Init(); } catch (Exception ex3) { ManualLogSource log4 = Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(18, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("ModdedItems.Init: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex3); } log4.LogError(val2); } try { CheatsDriverHost.Ensure(); } catch (Exception ex4) { ManualLogSource log5 = Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(21, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("CheatsDriver.Ensure: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex4); } log5.LogError(val2); } try { ItemEspScanner.Init(); } catch (Exception ex5) { ManualLogSource log6 = Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(21, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("ItemEspScanner.Init: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex5); } log6.LogError(val2); } try { Map.Init(); } catch (Exception ex6) { ManualLogSource log7 = Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(10, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Map.Init: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex6); } log7.LogError(val2); } try { WorldEdit.Init(); } catch (Exception ex7) { ManualLogSource log8 = Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(16, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("WorldEdit.Init: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex7); } log8.LogError(val2); } try { ConsolePopupSuppressor.Init(); } catch (Exception ex8) { ManualLogSource log9 = Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(29, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("ConsolePopupSuppressor.Init: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex8); } log9.LogError(val2); } try { Persist.Ensure(); } catch (Exception ex9) { ManualLogSource log10 = Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(16, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Persist.Ensure: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex9); } log10.LogError(val2); } try { Keybinds.Init(((BasePlugin)this).Config); } catch (Exception ex10) { ManualLogSource log11 = Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(15, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Keybinds.Init: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex10); } log11.LogError(val2); } Harmony val3 = new Harmony("pineapple54.adminmenu"); int num = 0; int num2 = 0; Type[] types = typeof(Plugin).Assembly.GetTypes(); foreach (Type type in types) { if (type.GetCustomAttributes(typeof(HarmonyPatch), inherit: true).Length == 0) { continue; } try { new PatchClassProcessor(val3, type).Patch(); num++; } catch (Exception ex11) { num2++; ManualLogSource log12 = Log; BepInExWarningLogInterpolatedStringHandler val4 = new BepInExWarningLogInterpolatedStringHandler(29, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("Harmony patch class "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted(type.Name); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral(" failed: "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted(ex11.Message); } log12.LogWarning(val4); } } ManualLogSource log13 = Log; val = new BepInExInfoLogInterpolatedStringHandler(41, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Harmony: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(num); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" patch classes applied, "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(num2); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" skipped"); } log13.LogInfo(val); ManualLogSource log14 = Log; val = new BepInExInfoLogInterpolatedStringHandler(42, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("AdminMenu"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" loaded. Press Tab in-game to toggle menu."); } log14.LogInfo(val); } } internal static class Settings { private static ConfigFile _cfg; public static ConfigEntry AutoApplyOnLoad; public static ConfigEntry ToggleKey; public static ConfigEntry UiScale; public static ConfigEntry Invincible; public static ConfigEntry InfStam; public static ConfigEntry NoHunger; public static ConfigEntry NoThirst; public static ConfigEntry NoSleep; public static ConfigEntry NoFall; public static ConfigEntry InfHeal; public static ConfigEntry InfLungCapacity; public static ConfigEntry NoCold; public static ConfigEntry DeathPin; public static ConfigEntry InstaDmg; public static ConfigEntry AmmoLock; public static ConfigEntry ThrowBoost; public static ConfigEntry OneHitTrees; public static ConfigEntry Stealth; public static ConfigEntry RadialCull; public static ConfigEntry ActorEsp; public static ConfigEntry AnimalEsp; public static ConfigEntry PlayerEsp; public static ConfigEntry RadarEsp; public static ConfigEntry WaypointEsp; public static ConfigEntry ItemEsp; public static ConfigEntry ContainerEsp; public static ConfigEntry CollectibleEsp; public static ConfigEntry ShowDead; public static ConfigEntry CenterCrosshair; public static ConfigEntry CaveLight; public static ConfigEntry LighterRange; public static ConfigEntry FlashlightNoDrain; public static ConfigEntry RebreatherNoOxygen; public static ConfigEntry RopegunInfinite; public static ConfigEntry GliderNoDownforce; public static ConfigEntry ShotgunRapidFire; public static ConfigEntry PistolRapidFire; public static ConfigEntry RevolverRapidFire; public static ConfigEntry RifleRapidFire; public static ConfigEntry AdminPretend; public static ConfigEntry BlockKickResp; public static ConfigEntry BlockBanResp; public static ConfigEntry SlDamageMult; public static ConfigEntry SlImpulseMult; public static ConfigEntry SlKillAuraRadius; public static ConfigEntry SlWalkSpeed; public static ConfigEntry SlRunSpeed; public static ConfigEntry SlSwimSpeed; public static ConfigEntry SlJumpMult; public static ConfigEntry SlNoClipSpeed; public static ConfigEntry SlPlayerSize; public static ConfigEntry SlGravity; public static ConfigEntry SlJumpPower; public static ConfigEntry SlLighterIntensity; public static ConfigEntry SlFlashlightIntensity; public static ConfigEntry SlRebreatherIntensity; public static ConfigEntry SlKnightSpeed; public static ConfigEntry SlKnightJump; public static ConfigEntry SlGliderSpeed; public static ConfigEntry SlTreeRegrow; public static ConfigEntry SlBushRadius; public static ConfigEntry SlTimeMul; public static ConfigEntry SlWind; public static ConfigEntry SlSun; public static ConfigEntry SlSunR; public static ConfigEntry SlSunG; public static ConfigEntry SlSunB; public static ConfigEntry SlAnimalMult; public static ConfigEntry SlEspMaxDistance; public static ConfigEntry SlTaaSharp; public static ConfigEntry SlTaaAnti; public static void Init(ConfigFile cfg) { _cfg = cfg; AutoApplyOnLoad = Bind("General", "AutoApplyOnLoad", def: true, "Re-apply saved toggles when a save loads. Off = start each session clean."); ToggleKey = Bind("General", "ToggleKey", (KeyCode)9, "Key that opens and closes the menu. Use any Unity KeyCode name, e.g. Tab, F3, Backslash, Insert, etc."); UiScale = Bind("General", "UiScale", 1f, "Menu UI scale multiplier. 1.0 = native pixel size. Try 1.5 or 2.0 on 4K screens."); Invincible = Bind("Player", "GodMode", def: false, "God Mode"); InfStam = Bind("Player", "InfStam", def: false, "Infinite Stamina"); NoHunger = Bind("Player", "NoHunger", def: false, "No Hunger"); NoThirst = Bind("Player", "NoThirst", def: false, "No Thirst"); NoSleep = Bind("Player", "NoSleep", def: false, "No Sleep loss"); NoFall = Bind("Player", "NoFall", def: false, "No Fall damage"); InfHeal = Bind("Player", "InfHeal", def: false, "Infinite continuous heal"); InfLungCapacity = Bind("Player", "InfLungCapacity", def: false, "Infinite lung capacity"); NoCold = Bind("Player", "NoCold", def: false, "No cold"); DeathPin = Bind("Player", "DeathPin", def: false, "Drop a waypoint when the player dies"); InstaDmg = Bind("Combat", "InstaKill", def: false, "Insta-kill all enemies"); AmmoLock = Bind("Combat", "InfiniteAmmo", def: false, "Infinite ammo"); ThrowBoost = Bind("Combat", "SuperStrength", def: false, "Super throw strength"); OneHitTrees = Bind("Combat", "OneHitTrees", def: false, "One-hit chop trees"); Stealth = Bind("Combat", "Invisibility", def: false, "Invisibility to enemies"); RadialCull = Bind("Combat", "KillAura", def: false, "Kill aura around player"); ActorEsp = Bind("Visual", "ActorEsp", def: false, "Show hostile actor labels (cannibals, creepies)"); AnimalEsp = Bind("Visual", "AnimalEsp", def: false, "Show wildlife labels (deer, rabbits, etc.)"); PlayerEsp = Bind("Visual", "PlayerEsp", def: false, "Show player labels"); RadarEsp = Bind("Visual", "RadarEsp", def: false, "Show corner radar"); WaypointEsp = Bind("Visual", "WaypointEsp", def: false, "Show waypoint labels"); ItemEsp = Bind("Visual", "ItemEsp", def: false, "Show world pickup labels (logs, food, weapons, etc.)"); ContainerEsp = Bind("Visual", "ContainerEsp", def: false, "Show storage/loot container labels"); CollectibleEsp = Bind("Visual", "CollectibleEsp", def: false, "Show artifact / GPS / cassette labels"); ShowDead = Bind("Visual", "ShowDead", def: false, "Include dead actors in ESP"); CenterCrosshair = Bind("Visual", "CenterCrosshair", def: false, "Center crosshair"); CaveLight = Bind("Visual", "CaveLight", def: false, "Cave light"); LighterRange = Bind("Items", "LighterRange", def: false, "Lighter increased range"); FlashlightNoDrain = Bind("Items", "FlashlightNoDrain", def: false, "Flashlight no battery drain"); RebreatherNoOxygen = Bind("Items", "RebreatherNoOxygen", def: false, "Rebreather no oxygen drain"); RopegunInfinite = Bind("Items", "RopegunInfinite", def: false, "Rope gun infinite range"); GliderNoDownforce = Bind("Items", "GliderNoDownforce", def: false, "Glider no downforce"); ShotgunRapidFire = Bind("Items", "ShotgunRapidFire", def: false, "Shotgun rapid fire"); PistolRapidFire = Bind("Items", "PistolRapidFire", def: false, "Pistol rapid fire"); RevolverRapidFire = Bind("Items", "RevolverRapidFire", def: false, "Revolver rapid fire"); RifleRapidFire = Bind("Items", "RifleRapidFire", def: false, "Rifle rapid fire"); AdminPretend = Bind("Multiplayer", "AdminPretend", def: false, "Pretend to be admin (client side)"); BlockKickResp = Bind("Multiplayer", "BlockKickResp", def: false, "Block kick-disconnect handler"); BlockBanResp = Bind("Multiplayer", "BlockBanResp", def: false, "Block ban click"); SlDamageMult = Bind("Sliders", "SlDamageMult", float.NaN, "Damage multiplier (1.0 = vanilla)"); SlImpulseMult = Bind("Sliders", "SlImpulseMult", float.NaN, "Throw impulse multiplier"); SlKillAuraRadius = Bind("Sliders", "SlKillAuraRadius", float.NaN, "Kill aura radius (meters)"); SlWalkSpeed = Bind("Sliders", "SlWalkSpeed", float.NaN, "Player walk speed"); SlRunSpeed = Bind("Sliders", "SlRunSpeed", float.NaN, "Player run speed"); SlSwimSpeed = Bind("Sliders", "SlSwimSpeed", float.NaN, "Player swim speed"); SlJumpMult = Bind("Sliders", "SlJumpMult", float.NaN, "Player jump multiplier"); SlNoClipSpeed = Bind("Sliders", "SlNoClipSpeed", float.NaN, "NoClip / fly speed"); SlPlayerSize = Bind("Sliders", "SlPlayerSize", float.NaN, "Player body scale"); SlGravity = Bind("Sliders", "SlGravity", float.NaN, "Gravity (negative = down)"); SlJumpPower = Bind("Sliders", "SlJumpPower", float.NaN, "Jump force multiplier"); SlLighterIntensity = Bind("Sliders", "SlLighterIntensity", float.NaN, "Lighter intensity"); SlFlashlightIntensity = Bind("Sliders", "SlFlashlightIntensity", float.NaN, "Flashlight intensity"); SlRebreatherIntensity = Bind("Sliders", "SlRebreatherIntensity", float.NaN, "Rebreather light intensity"); SlKnightSpeed = Bind("Sliders", "SlKnightSpeed", float.NaN, "Knight V (EUC) max speed"); SlKnightJump = Bind("Sliders", "SlKnightJump", float.NaN, "Knight V (EUC) jump force"); SlGliderSpeed = Bind("Sliders", "SlGliderSpeed", float.NaN, "Hang glider speed"); SlTreeRegrow = Bind("Sliders", "SlTreeRegrow", float.NaN, "Tree regrow factor"); SlBushRadius = Bind("Sliders", "SlBushRadius", float.NaN, "Bush clear radius (meters)"); SlTimeMul = Bind("Sliders", "SlTimeMul", float.NaN, "Time-of-day speed multiplier"); SlWind = Bind("Sliders", "SlWind", float.NaN, "Wind intensity"); SlSun = Bind("Sliders", "SlSun", float.NaN, "Sun intensity"); SlSunR = Bind("Sliders", "SlSunR", float.NaN, "Sun color R"); SlSunG = Bind("Sliders", "SlSunG", float.NaN, "Sun color G"); SlSunB = Bind("Sliders", "SlSunB", float.NaN, "Sun color B"); SlAnimalMult = Bind("Sliders", "SlAnimalMult", float.NaN, "Animal spawn multiplier"); SlEspMaxDistance = Bind("Sliders", "SlEspMaxDistance", float.NaN, "ESP max draw distance (meters)"); SlTaaSharp = Bind("Sliders", "SlTaaSharp", float.NaN, "TAA sharpness"); SlTaaAnti = Bind("Sliders", "SlTaaAnti", float.NaN, "TAA anti-flicker"); } private static ConfigEntry Bind(string section, string key, T def, string desc) { return _cfg.Bind(section, key, def, desc); } } internal static class Spawning { public enum ItemCategory { All, Weapon, Ammo, Edible, Clothing, CraftingMaterial, StructureBlueprint, Special, Other } public const int KnightVItemId = 630; public const int HangGliderItemId = 626; public static readonly string[] CommonActors = new string[57] { "Robby", "Virginia", "Timmy", "PaintedMale", "PaintedFemale", "MuddyMale", "MuddyFemale", "HeavyMale", "FatMale", "FatFemale", "FacelessMale", "Fingers", "Baby", "Twins", "John2", "BossMutant", "Armsy", "Demon", "DemonBoss", "CreepyVirginia", "Angel", "Holey", "Skunk", "Legsy", "Andy", "Billy", "Brandy", "Carl", "Crystal", "Danny", "Destiny", "Eddy", "Elise", "Frank", "GoldMask", "Greg", "Henry", "Igor", "Bluebird", "Hummingbird", "Eagle", "Duck", "Seagull", "Bat", "Deer", "Moose", "Rabbit", "Squirrel", "Raccoon", "Turtle", "LandTurtle", "Shark", "KillerWhale", "MrPuffy", "MissPuffy", "PuffyBossMale", "PuffyBossFemale" }; private static bool MatchesCategory(Types t, ItemCategory cat) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Invalid comparison between Unknown and I4 //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Invalid comparison between Unknown and I4 //IL_0041: 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_0045: Invalid comparison between Unknown and I4 //IL_0048: 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_0050: Invalid comparison between Unknown and I4 //IL_0053: 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_005b: Invalid comparison between Unknown and I4 //IL_005e: 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_0066: Invalid comparison between Unknown and I4 //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Invalid comparison between Unknown and I4 //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Invalid comparison between Unknown and I4 switch (cat) { case ItemCategory.All: return true; case ItemCategory.Weapon: return (t & 0x9200) > 0; case ItemCategory.Ammo: return (t & 0x60) > 0; case ItemCategory.Edible: return (t & 8) > 0; case ItemCategory.Clothing: return (t & 0x4002) > 0; case ItemCategory.CraftingMaterial: return (t & 0x804) > 0; case ItemCategory.StructureBlueprint: return (t & 0x100) > 0; case ItemCategory.Special: return (t & 0x480) > 0; case ItemCategory.Other: { Types val = (Types)57326; return (t & val) == 0; } default: return true; } } public static List<(string name, int id)> SearchItems(string query, int max = 30) { return SearchItems(query, ItemCategory.All, max); } private static string DisplayName(ItemData data) { string name = data.Name; try { ItemUiData uiData = data._uiData; if (uiData != null) { string titleLocalized = uiData.GetTitleLocalized(); if (!string.IsNullOrEmpty(titleLocalized) && !string.Equals(titleLocalized, name, StringComparison.OrdinalIgnoreCase)) { return name + " (" + titleLocalized + ")"; } } } catch { } return name; } public static List<(string name, int id)> AllItems(int max = 200) { //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown List<(string, int)> list = new List<(string, int)>(); try { List items = ItemDatabaseManager.Items; if (items == null) { return list; } for (int i = 0; i < items.Count; i++) { if (list.Count >= max) { break; } ItemData val = items[i]; if (!((Object)(object)val == (Object)null)) { string text = DisplayName(val); if (!string.IsNullOrEmpty(text)) { list.Add((text, val.Id)); } } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(10, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("AllItems: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } return list; } public static List<(string name, int id)> SearchItems(string query, ItemCategory cat, int max = 30) { //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) List<(string, int)> list = new List<(string, int)>(); try { List items = ItemDatabaseManager.Items; if (items == null) { return list; } string text = (string.IsNullOrWhiteSpace(query) ? null : query.ToLowerInvariant()); bool flag = cat != ItemCategory.All; if (text == null && !flag) { return list; } for (int i = 0; i < items.Count && list.Count < max; i++) { ItemData val = items[i]; if ((Object)(object)val == (Object)null) { continue; } string text2 = DisplayName(val); if (string.IsNullOrEmpty(text2)) { continue; } if (text != null && !text2.ToLowerInvariant().Contains(text)) { string name = val.Name; if (name == null || !name.ToLowerInvariant().Contains(text)) { continue; } } if (!flag || MatchesCategory(val.Type, cat)) { list.Add((text2, val.Id)); } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag2 = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(13, 1, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("SearchItems: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } return list; } public static void SpawnItem(int itemId, int amount) { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Expected O, but got Unknown //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Expected O, but got Unknown //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Expected O, but got Unknown if ((Object)(object)LocalPlayer._instance == (Object)null) { Plugin.Log.LogWarning((object)"SpawnItem: no LocalPlayer"); return; } if (amount < 1) { amount = 1; } if (amount > 9999) { amount = 9999; } bool flag = default(bool); try { PlayerInventory inventory = LocalPlayer.Inventory; if ((Object)(object)inventory == (Object)null) { Plugin.Log.LogWarning((object)"SpawnItem: no Inventory"); return; } int num = 0; for (int i = 0; i < amount; i++) { try { inventory.AddItem(itemId, 1, false, false, (ItemInstance)null); num++; } catch (Exception ex) { ManualLogSource log = Plugin.Log; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(26, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SpawnItem: stopped at "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(num); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("/"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(amount); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" ("); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")"); } log.LogWarning(val); break; } } ManualLogSource log2 = Plugin.Log; BepInExDebugLogInterpolatedStringHandler val2 = new BepInExDebugLogInterpolatedStringHandler(22, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("SpawnItem: id="); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(itemId); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" added "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(num); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("/"); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(amount); } log2.LogDebug(val2); } catch (Exception ex2) { ManualLogSource log3 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val3 = new BepInExErrorLogInterpolatedStringHandler(11, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("SpawnItem: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex2.Message); } log3.LogError(val3); } } public static void SpawnItemInWorld(int itemId, int amount) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Expected O, but got Unknown //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown if ((Object)(object)LocalPlayer._instance == (Object)null) { Plugin.Log.LogWarning((object)"SpawnItemInWorld: no LocalPlayer"); return; } if (amount < 1) { amount = 1; } if (amount > 9999) { amount = 9999; } bool flag = default(bool); try { int num = 0; for (int i = 0; i < amount; i++) { try { DebugConsole.Instance._spawnitem(itemId.ToString()); num++; } catch (Exception ex) { ManualLogSource log = Plugin.Log; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(33, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SpawnItemInWorld: stopped at "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(num); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("/"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(amount); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" ("); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")"); } log.LogWarning(val); break; } } ManualLogSource log2 = Plugin.Log; BepInExDebugLogInterpolatedStringHandler val2 = new BepInExDebugLogInterpolatedStringHandler(31, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("SpawnItemInWorld: id="); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(itemId); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" spawned "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(num); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("/"); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(amount); } log2.LogDebug(val2); } catch (Exception ex2) { ManualLogSource log3 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val3 = new BepInExErrorLogInterpolatedStringHandler(18, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("SpawnItemInWorld: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex2.Message); } log3.LogError(val3); } } public static void SpawnItemAtCursor(int itemId, int amount) { //IL_00be: 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_00f1: Expected O, but got Unknown //IL_006a: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)LocalPlayer._instance == (Object)null) { Plugin.Log.LogWarning((object)"SpawnItemAtCursor: no LocalPlayer"); return; } Transform mainCamTr = LocalPlayer.MainCamTr; if ((Object)(object)mainCamTr == (Object)null) { SpawnItemInWorld(itemId, amount); return; } try { int mask = LayerMask.GetMask(new string[5] { "Terrain", "Default", "Prop", "Structure", "TerrainObject" }); RaycastHit val = default(RaycastHit); if (Physics.Raycast(mainCamTr.position, mainCamTr.forward, ref val, 200f, mask, (QueryTriggerInteraction)1)) { Transform transform = LocalPlayer.Transform; Vector3 position = transform.position; transform.position = ((RaycastHit)(ref val)).point + Vector3.up * 0.5f; try { SpawnItemInWorld(itemId, amount); return; } finally { transform.position = position; } } Plugin.Log.LogDebug((object)"SpawnItemAtCursor: no surface hit, dropping at feet"); SpawnItemInWorld(itemId, amount); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(19, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("SpawnItemAtCursor: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } } public static void SpawnItemByName(string name, int amount) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown bool flag = default(bool); try { int num = ItemDatabaseManager.ItemIdByName(name); if (num <= 0) { ManualLogSource log = Plugin.Log; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(27, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SpawnItemByName: no item '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("'"); } log.LogWarning(val); } else { SpawnItem(num, amount); } } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(17, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("SpawnItemByName: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log2.LogError(val2); } } public static void GiveKnightV() { GiveByNameOrId("KnightV", 630); } public static void GiveHangGlider() { GiveByNameOrId("HangGlider", 626); } private static void GiveByNameOrId(string name, int fallbackId) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown bool flag = default(bool); try { int num = ItemDatabaseManager.ItemIdByName(name); if (num <= 0) { ManualLogSource log = Plugin.Log; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(50, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("GiveByNameOrId: '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("' not in DB, trying hardcoded id="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(fallbackId); } log.LogWarning(val); num = fallbackId; } SpawnItem(num, 1); } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(18, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("GiveByNameOrId("); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(name); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("): "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log2.LogError(val2); } } public static void SpawnGolfCart() { //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)LocalPlayer._instance == (Object)null) { Plugin.Log.LogWarning((object)"SpawnGolfCart: no LocalPlayer"); return; } bool flag = default(bool); try { if (!BoltNetwork.isRunning) { Plugin.Log.LogWarning((object)"SpawnGolfCart: Bolt session not running. Golf Cart spawn requires multiplayer (host or client)."); return; } Transform transform = LocalPlayer.Transform; Vector3 val = transform.position + transform.forward * 3f + Vector3.up; BoltNetwork.Instantiate(BoltPrefabs.GolfCart, val, transform.rotation); ManualLogSource log = Plugin.Log; BepInExDebugLogInterpolatedStringHandler val2 = new BepInExDebugLogInterpolatedStringHandler(17, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("SpawnGolfCart at "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(val); } log.LogDebug(val2); } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val3 = new BepInExErrorLogInterpolatedStringHandler(15, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("SpawnGolfCart: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex.Message); } log2.LogError(val3); } } public static void SpawnActor(string name) { //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Expected O, but got Unknown //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0172: 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_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown //IL_0196: 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_019d: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: 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_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Expected O, but got Unknown if (string.IsNullOrWhiteSpace(name)) { return; } if ((Object)(object)LocalPlayer._instance == (Object)null) { Plugin.Log.LogWarning((object)"SpawnActor: no LocalPlayer"); return; } bool flag3 = default(bool); try { CharacterManager instance = CharacterManager.Instance; if ((Object)(object)instance == (Object)null) { Plugin.Log.LogWarning((object)"SpawnActor: no CharacterManager"); return; } VailActorTypeId result; bool flag = Enum.TryParse(name, ignoreCase: false, out result); int num = (flag ? CountOfType(result) : (-1)); bool flag2 = instance.DebugAddCharacter(name, true); int num2 = (flag ? CountOfType(result) : (-1)); if (flag && num2 > num) { ManualLogSource log = Plugin.Log; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(41, 3, ref flag3); if (flag3) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SpawnActor: '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("' via DebugAddCharacter ("); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(num); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("->"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(num2); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")"); } log.LogInfo(val); return; } if (!flag) { ManualLogSource log2 = Plugin.Log; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(73, 2, ref flag3); if (flag3) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SpawnActor: '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("' DebugAddCharacter -> "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(flag2); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" (not a VailActorTypeId, no fallback)"); } log2.LogInfo(val); return; } Transform transform = LocalPlayer.Transform; Vector3 val2 = transform.position + transform.forward * 4f + Vector3.up * 0.5f; Quaternion val3 = Quaternion.LookRotation(-transform.forward, Vector3.up); try { AreaMask currentAreaMask = CaveEntranceManager.CurrentAreaMask; VailWorldSimulation.InstantSpawnActor(result, val2, val3, State.Default, currentAreaMask, 0); int num3 = CountOfType(result); if (num3 > num) { ManualLogSource log3 = Plugin.Log; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(41, 3, ref flag3); if (flag3) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SpawnActor: '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("' via InstantSpawnActor ("); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(num); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("->"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(num3); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")"); } log3.LogInfo(val); } else { ManualLogSource log4 = Plugin.Log; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(115, 2, ref flag3); if (flag3) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SpawnActor: '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("' fired both paths, land-actor count still "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(num3); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" (may be a water/air actor not tracked in VailActorManager)"); } log4.LogInfo(val); } } catch (Exception ex) { ManualLogSource log5 = Plugin.Log; BepInExWarningLogInterpolatedStringHandler val4 = new BepInExWarningLogInterpolatedStringHandler(40, 2, ref flag3); if (flag3) { ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("SpawnActor: '"); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted(name); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("' InstantSpawnActor threw: "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted(ex.Message); } log5.LogWarning(val4); } } catch (Exception ex2) { ManualLogSource log6 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val5 = new BepInExErrorLogInterpolatedStringHandler(12, 1, ref flag3); if (flag3) { ((BepInExLogInterpolatedStringHandler)val5).AppendLiteral("SpawnActor: "); ((BepInExLogInterpolatedStringHandler)val5).AppendFormatted(ex2); } log6.LogError(val5); } } private static int CountOfType(VailActorTypeId typeId) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) try { Il2CppReferenceArray activeActors = VailActorManager.GetActiveActors(); if (activeActors == null) { return 0; } int num = 0; for (int i = 0; i < ((Il2CppArrayBase)(object)activeActors).Length; i++) { VailActor val = ((Il2CppArrayBase)(object)activeActors)[i]; if ((Object)(object)val == (Object)null) { continue; } try { if (val.TypeId == typeId) { num++; } } catch { } } return num; } catch { return -1; } } private static (VailActor actor, float distance) ClosestOfType(VailActorTypeId typeId, Vector3 origin) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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) try { Il2CppReferenceArray activeActors = VailActorManager.GetActiveActors(); if (activeActors == null) { return (actor: null, distance: 0f); } VailActor item = null; float num = float.MaxValue; for (int i = 0; i < ((Il2CppArrayBase)(object)activeActors).Length; i++) { VailActor val = ((Il2CppArrayBase)(object)activeActors)[i]; if ((Object)(object)val == (Object)null) { continue; } try { if (val.TypeId == typeId) { float num2 = Vector3.Distance(origin, ((Component)val).transform.position); if (num2 < num) { num = num2; item = val; } } } catch { } } return (actor: item, distance: num); } catch { return (actor: null, distance: 0f); } } private static int CountInPool(VailActorTypeId typeId) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) try { VailWorldSimulation val = default(VailWorldSimulation); if (!VailWorldSimulation.TryGetInstance(ref val) || (Object)(object)val == (Object)null) { return -1; } VailActorPools actorPools = val._actorPools; if ((Object)(object)actorPools == (Object)null) { return -1; } return (!((Object)(object)actorPools.GetPrefab(typeId) == (Object)null)) ? 1 : 0; } catch { return -1; } } public static bool RemoveActorByTypeId(VailActorTypeId typeId) { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown //IL_00ca: 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_006b: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) bool flag = default(bool); try { Il2CppReferenceArray activeActors = VailActorManager.GetActiveActors(); if (activeActors == null) { Plugin.Log.LogWarning((object)"RemoveActorByTypeId: no actors"); return false; } int num = 0; for (int i = 0; i < ((Il2CppArrayBase)(object)activeActors).Length; i++) { VailActor val = ((Il2CppArrayBase)(object)activeActors)[i]; if (!((Object)(object)val == (Object)null) && val.TypeId == typeId) { val.ForceDeath(); num++; } } ManualLogSource log = Plugin.Log; BepInExDebugLogInterpolatedStringHandler val2 = new BepInExDebugLogInterpolatedStringHandler(30, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("RemoveActorByTypeId("); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(typeId); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("): killed "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(num); } log.LogDebug(val2); return num > 0; } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val3 = new BepInExErrorLogInterpolatedStringHandler(23, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("RemoveActorByTypeId("); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(typeId); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("): "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex.Message); } log2.LogError(val3); return false; } } public static bool RemoveActorByName(string substring) { //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Expected O, but got Unknown //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown if (string.IsNullOrWhiteSpace(substring)) { return false; } bool flag = default(bool); try { Il2CppReferenceArray activeActors = VailActorManager.GetActiveActors(); if (activeActors == null) { Plugin.Log.LogWarning((object)"RemoveActorByName: no actors"); return false; } string value = substring.ToLowerInvariant(); for (int i = 0; i < ((Il2CppArrayBase)(object)activeActors).Length; i++) { VailActor val = ((Il2CppArrayBase)(object)activeActors)[i]; if ((Object)(object)val == (Object)null) { continue; } GameObject gameObject = ((Component)val).gameObject; if ((Object)(object)gameObject == (Object)null) { continue; } string name = ((Object)gameObject).name; if (!string.IsNullOrEmpty(name) && name.ToLowerInvariant().Contains(value)) { val.ForceDeath(); ManualLogSource log = Plugin.Log; BepInExDebugLogInterpolatedStringHandler val2 = new BepInExDebugLogInterpolatedStringHandler(28, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("RemoveActorByName: killed '"); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(name); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("'"); } log.LogDebug(val2); return true; } } ManualLogSource log2 = Plugin.Log; BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(39, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("RemoveActorByName: no actor matching '"); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(substring); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("'"); } log2.LogWarning(val3); return false; } catch (Exception ex) { ManualLogSource log3 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val4 = new BepInExErrorLogInterpolatedStringHandler(19, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("RemoveActorByName: "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted(ex.Message); } log3.LogError(val4); return false; } } public static void RemoveKelvin() { RemoveActorByTypeId((VailActorTypeId)9); } public static void RemoveVirginia() { RemoveActorByTypeId((VailActorTypeId)10); } } internal static class StatusEffects { private static PlayerStats Stats { get { if (!((Object)(object)LocalPlayer._instance != (Object)null)) { return null; } return LocalPlayer.Stats; } } public static void Burn(float seconds = 10f) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown try { PlayerStats stats = Stats; if ((Object)(object)stats == (Object)null) { Plugin.Log.LogWarning((object)"StatusEffects.Burn: no PlayerStats"); } else { stats.Burn(seconds); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(20, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("StatusEffects.Burn: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static void StopBurn() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown try { PlayerStats stats = Stats; if (!((Object)(object)stats == (Object)null)) { stats.StopBurning(); stats.SetOnFireState(false); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(24, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("StatusEffects.StopBurn: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static void Poison() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown try { PlayerStats stats = Stats; if (stats != null) { stats.HitPoison(); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(22, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("StatusEffects.Poison: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static void SkunkSpray() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown try { PlayerStats stats = Stats; if (stats != null) { stats.HitSkunkSpray(); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(26, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("StatusEffects.SkunkSpray: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static void ClearSkunk() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown try { PlayerStats stats = Stats; if (stats != null) { stats.ClearSkunkSmell(); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(26, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("StatusEffects.ClearSkunk: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static void Adrenaline() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown try { PlayerStats stats = Stats; if (!((Object)(object)stats == (Object)null)) { ((MonoBehaviour)stats).StartCoroutine(stats.AdrenalineRush()); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(26, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("StatusEffects.Adrenaline: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static void GetMuddy() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown try { PlayerStats stats = Stats; if (stats != null) { stats.GotMud(); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(24, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("StatusEffects.GetMuddy: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static void GetBloody() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown try { PlayerStats stats = Stats; if (stats != null) { stats.GotBloody(); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(25, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("StatusEffects.GetBloody: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static void CleanUp() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown try { PlayerStats stats = Stats; if (!((Object)(object)stats == (Object)null)) { stats.GotClean(); stats.GotCleanReal(); stats.ClearSkunkSmell(); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(23, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("StatusEffects.CleanUp: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } } internal static class L { public const string MenuTitle = "ADMIN MENU"; public const string TabFmt = "Tab: {0}"; public const string CloseFmt = "{0} to close"; public const string TabPlayer = "Player"; public const string TabMovement = "Movement"; public const string TabCombat = "Combat"; public const string TabSpawn = "Spawn"; public const string TabTeleport = "Teleport"; public const string TabItems = "Items"; public const string TabWeather = "Weather"; public const string TabTerrain = "Terrain"; public const string TabBuild = "Build"; public const string TabVisual = "Visual"; public const string TabMultiplayer = "Multiplayer"; public const string TabKeybinds = "Keybinds"; public const string TabUtil = "Util"; public const string SecSurvival = "Survival"; public const string GodMode = "God Mode"; public const string InfStamina = "Infinite Stamina"; public const string NoHunger = "No Hunger"; public const string NoThirst = "No Thirst"; public const string NoSleepLoss = "No Sleep Loss"; public const string NoFallDmg = "No Fall Damage"; public const string SecContinuousHeal = "Continuous Heal"; public const string InfHeal = "Infinite Heal"; public const string InfLungCap = "Inf Lung Capacity"; public const string NoCold = "No Cold"; public const string SecStatRefill = "Stat Refill"; public const string Hunger = "Hunger"; public const string Thirst = "Thirst"; public const string Sleep = "Sleep"; public const string Stamina = "Stamina"; public const string HelpContHeal = "Continuous Heal regenerates HP every tick. Inf Lung lets you hold breath forever. No Cold ignores temperature."; public const string HelpStatRefill = "Fills the matching stat bar instantly."; public const string HelpDeathPin = "Drops a waypoint at the spot you die so you can teleport back to it later."; public const string SecStatusEffects = "Status Effects"; public const string FxBurn = "Burn"; public const string FxStopBurn = "Stop Burn"; public const string FxPoison = "Poison"; public const string FxSkunkSpray = "Skunk Spray"; public const string FxClearSkunk = "Clear Skunk"; public const string FxAdrenaline = "Adrenaline Rush"; public const string FxGotMud = "Get Muddy"; public const string FxGotBloody = "Get Bloody"; public const string FxGetClean = "Clean Up"; public const string HelpStatusFx = "Apply the game's built-in status effects to yourself. Useful for testing or video recording."; public const string HelpInvisibility = "Cannibals, animals, and creepies won't see, hear, or attack you. Effectively pacifist mode."; public const string HelpKillAura = "Continuously kills every actor inside the radius. Large radii may impact performance."; public const string HelpInstaKill = "Player damage is fixed at 99999. Overrides the multiplier."; public const string HelpDamageMult = "Multiplies your dealt damage. Has no effect while Insta Kill is on."; public const string HelpFreezeActors = "Pauses the entire AI simulation - all actors freeze in place."; public const string HelpSpawnAtCursor = "Raycasts from the crosshair and drops the item at the hit point. Takes priority over Drop in world."; public const string HelpDropInWorld = "Drops the item at your feet, bypassing inventory stack limits. Best for large log counts."; public const string HelpLookTeleport = "While on, right-click teleports you to where you're looking."; public const string HelpWeatherPresets = "Weather may revert as the game's atmospheric system updates."; public const string HelpClearStructures = "Permanently removes every player-built structure. Cannot be undone - save first."; public const string HelpTriggerGameOver = "Ends the current game session. Host-only. Cannot be undone."; public const string HelpAdminPretend = "Lies to your own client only - other players still see you as a regular player."; public const string HelpBlockKick = "Intercepts SOTF's default kick/ban UI. A dedicated anti-cheat can still kick you."; public const string HelpMirrorMpToSp = "Copies the current multiplayer save to single-player slot 5 so you can continue offline."; public const string HelpFlyControls = "W/A/S/D move · Space up · LCtrl down · LShift boost 2x"; public const string HelpUiScale = "Scales the entire menu. Try 1.5x-2.0x on 4K screens. Updates live."; public const string HelpResetAll = "Turns every toggle off, restores every slider default, clears the saved config."; public const string HelpAutoApply = "On: toggles restore when a save loads. Off: each session starts clean."; public const string HelpWaypointsFile = "Waypoints save to BepInEx/config/AdminMenu_waypoints.json. Restored on launch."; public const string SecMoveSpeed = "Movement Speed"; public const string Walk = "Walk"; public const string Run = "Run"; public const string Swim = "Swim"; public const string Jump = "Jump"; public const string SpeedyRun = "Speedy Run (toggle)"; public const string SecNoClipFly = "NoClip / Fly"; public const string NoClip = "NoClip"; public const string Speed = "Speed"; public const string SecPlayerSize = "Player Size"; public const string Size = "Size"; public const string SecGravJump = "Gravity & Jump Power"; public const string NoGravity = "No Gravity"; public const string Gravity = "Gravity"; public const string JumpPower = "Jump Power"; public const string SecEquipArmour = "Equip Armour"; public const string HelpEquipArmour = "Click a button to equip a full set of that armor type instantly."; public const string SecDamage = "Damage"; public const string InstaKill = "Insta Kill"; public const string InfAmmo = "Infinite Ammo"; public const string SuperStrength = "Super Strength"; public const string OneHitTrees = "One-Hit Trees"; public const string ThrowMult = "Throw Multiplier"; public const string DamageMult = "Damage Multiplier"; public const string SecStealth = "Stealth"; public const string Invisibility = "Invisibility"; public const string SecKillAura = "Kill Aura"; public const string KillAura = "Kill Aura"; public const string AuraRadius = "Aura Radius"; public const string SecMassActions = "Mass Actions"; public const string KillCannibals = "Kill Cannibals"; public const string BurnCannibals = "Burn Cannibals"; public const string KillAnimals = "Kill Animals"; public const string FreezeActors = "Freeze Actors"; public const string SecSelfTroll = "Self-troll"; public const string FakeDrown = "Fake Drown (self)"; public const string SecItemSpawner = "Item Spawner"; public const string Search = "Search"; public const string Amount = "Amount"; public const string DropInWorld = "Drop in world"; public const string SpawnAtCursor = "Spawn at cursor"; public const string SpawnXFmt = "Spawn x{0}"; public const string NoItemsMatch = "No items match."; public const string SecBulkItems = "Bulk Items"; public const string AddAllItems = "Add All Items"; public const string IndexSpawnable = "Index Spawnable Items"; public const string GiveChainsaw = "Give Chainsaw"; public const string GiveKatana = "Give Katana"; public const string GiveShotgun = "Give Shotgun"; public const string SecVehicles = "Vehicles"; public const string KnightV = "Knight V (EUC)"; public const string HangGlider = "Hang Glider"; public const string SpawnGolfCart = "Spawn Golf Cart (MP-only)"; public const string SecActorsNpcs = "Actors / NPCs"; public const string Name = "Name"; public const string Spawn = "Spawn"; public const string RemoveKelvin = "Remove Kelvin"; public const string RemoveVirginia = "Remove Virginia"; public const string QuickSpawns = "Quick spawns:"; public const string SecAnimalSpawning = "Animal Spawning"; public const string AnimalMult = "Animal Mult"; public const string InsaneAnimals = "Insane Animal Spawns"; public const string CreepyParty = "Creepy Attack Party"; public const string CatAll = "All"; public const string CatWeapon = "Weapon"; public const string CatAmmo = "Ammo"; public const string CatEdible = "Edible"; public const string CatClothing = "Clothing"; public const string CatCrafting = "Crafting"; public const string CatBuild = "Build"; public const string CatSpecial = "Special"; public const string CatOther = "Other"; public const string HelpItemSpawner = "Search then click Spawn. Drop in world bypasses inventory stack limits. Spawn at cursor places the item where you're aiming."; public const string HelpBulkItems = "Add All Items stuffs every spawnable item into your inventory. Index Spawnable Items rebuilds the database list first."; public const string HelpActorsNpcs = "Spawn NPCs by name. Use the exact class spelling (see the quick-spawn buttons). Remove Kelvin / Virginia wipes them from the world."; public const string HelpAnimalSpawning = "Animal Mult scales wildlife spawn rate. Insane Animal Spawns maxes it out. Creepy Attack Party triggers a Creepy wave."; public const string SecLighter = "Lighter"; public const string Intensity = "Intensity"; public const string IncreaseRange = "Increase Range"; public const string SecFlashlight = "Flashlight"; public const string NoDrain = "No Drain"; public const string SecRebreather = "Rebreather"; public const string LightAmt = "Light"; public const string NoOxygenDrain = "No Oxygen Drain"; public const string SecRopeGun = "Rope Gun"; public const string InfLength = "Infinite Length"; public const string MaxSpeed = "Max Speed"; public const string JumpForce = "Jump Force"; public const string SecHangGlider = "Hang Glider"; public const string NoDownforce = "No Downforce"; public const string SecRapidFire = "Rapid Fire"; public const string Shotgun = "Shotgun"; public const string Pistol = "Pistol"; public const string Revolver = "Revolver"; public const string Rifle = "Rifle"; public const string HelpRapidFire = "Caps your weapon's fire rate at max. May trigger anti-cheat in MP."; public const string HelpRopeGun = "Rope gun never runs out of rope."; public const string SecPosition = "Position"; public const string PosFmt = "Pos: {0:0.0}, {1:0.0}, {2:0.0}"; public const string SecQuickTeleport = "Quick Teleport"; public const string Item = "Item"; public const string GoTo = "Go To"; public const string LookTeleport = "Look Teleport (RMB)"; public const string CloseMap = "Close Map Window"; public const string OpenMap = "Open Interactive Map"; public const string SecWaypoints = "Waypoints"; public const string Folder = "Folder"; public const string NewFolder = "New Folder"; public const string OpenWaypointsFolder = "Open Folder"; public const string CurrentFolderFmt = "in: {0}"; public const string Save = "Save"; public const string Color = "Color"; public const string TP = "TP"; public const string SecTimeOfDay = "Time of Day"; public const string LockTimeOfDay = "Lock Time of Day"; public const string Hour = "Hour"; public const string TimeSpeed = "Time Speed"; public const string Day = "Day"; public const string SetDay = "Set Day"; public const string SecSeasons = "Seasons"; public const string Spring = "Spring"; public const string Summer = "Summer"; public const string Autumn = "Autumn"; public const string Winter = "Winter"; public const string SecWindSun = "Wind & Sun"; public const string Wind = "Wind"; public const string Sun = "Sun"; public const string SecSunColor = "Sun Color"; public const string Red = "Red"; public const string Green = "Green"; public const string Blue = "Blue"; public const string SecWeatherEvents = "Weather Events"; public const string HurricaneWind = "Hurricane Wind"; public const string ForceRainstorm = "Force Rainstorm"; public const string SecTimePresets = "Time Presets"; public const string TimeMorning = "Morning (6)"; public const string TimeNoon = "Noon (12)"; public const string TimeSunset = "Sunset (18)"; public const string TimeMidnight = "Midnight (0)"; public const string SecWeatherPresets = "Weather Presets"; public const string WeatherClear = "Clear"; public const string WeatherStorm = "Storm"; public const string WeatherSnow = "Snow"; public const string SecLakesOcean = "Lakes & Ocean"; public const string FreezeLakes = "Freeze Lakes"; public const string NoLakes = "No Lakes"; public const string NoOcean = "No Ocean"; public const string NoWaterfalls = "No Waterfalls"; public const string SecTrees = "Trees"; public const string TreeRegrow = "Tree Regrow"; public const string CutAllTrees = "Cut All Trees"; public const string RegrowTrees = "Re-grow Trees"; public const string FallingTree = "Falling Tree"; public const string SecBushes = "Bushes"; public const string ClearRadius = "Clear Radius"; public const string ClearBushesFmt = "Clear Bushes ({0:0}m radius)"; public const string SecCleanup = "Cleanup"; public const string RemoveDeadBody = "Remove Dead Bodies"; public const string HelpTrees = "Tree Regrow controls how fast cut trees come back. 0 = never."; public const string HelpBushClear = "Centered on your current position. Clears every bush inside the radius."; public const string HelpRemoveBody = "Wipes dead bodies from the world. Helps with save bloat and frame rate."; public const string SecBuildCheats = "Build Cheats"; public const string CreativeMode = "Creative Mode"; public const string InstantBuild = "Instant Build"; public const string InfBuild = "Infinite Build"; public const string InfLogs = "Infinite Logs"; public const string HelpBuildCheats = "Creative: build for free. Instant: skip the hammer animation. Inf Build/Logs: no resource cost."; public const string HelpForceSave = "Forces a save to your current slot. Use it before risky stuff in case of a crash."; public const string SecWorldActions = "World Actions"; public const string ForceSave = "Force Save"; public const string KillAllEnemies = "Kill All Enemies"; public const string ClearStructures = "Clear All Structures"; public const string SecDangerZone = "Danger Zone"; public const string TriggerGameOver = "Trigger Game Over (HOST)"; public const string SecEsp = "ESP"; public const string ActorEsp = "Hostile ESP"; public const string AnimalEsp = "Animal ESP"; public const string PlayerEsp = "Player ESP"; public const string RadarCorner = "Radar (corner)"; public const string WaypointEsp = "Waypoint ESP"; public const string ItemEsp = "Item ESP"; public const string ContainerEsp = "Container ESP"; public const string CollectibleEsp = "Collectible ESP"; public const string HelpActorEsp = "Labels cannibals and creepies. Color by class. Range from the slider below."; public const string HelpAnimalEsp = "Wildlife only (deer, rabbits, etc). Useful for hunting."; public const string HelpPlayerEsp = "Labels other players in MP. Yourself is skipped."; public const string HelpRadar = "Small corner radar with dots for nearby actors and players."; public const string HelpWaypointEsp = "Labels your saved waypoints so you can find them again."; public const string HelpItemEsp = "Labels world pickups (logs, food, weapons, etc.). Color by category."; public const string HelpContainerEsp = "Labels storage racks, dropped backpacks, loot crates."; public const string HelpCollectibleEsp = "Labels artifacts, GPS units, cassettes."; public const string HelpShowDead = "Include dead actors in ESP (off by default)."; public const string ShowDead = "Show Dead"; public const string DeathPin = "Death Pin (auto waypoint)"; public const string MaxDistance = "Max Distance"; public const string HelpMaxDistance = "Max draw distance for all ESP. Shared across every ESP type."; public const string SecHud = "HUD"; public const string CenterCrosshair = "Center Crosshair"; public const string CaveLight = "Cave Light"; public const string SecCamera = "Camera"; public const string FreeCamera = "Free Camera"; public const string CapsuleMode = "Capsule Mode"; public const string SecTaa = "TAA"; public const string Sharpness = "Sharpness"; public const string AntiFlicker = "Anti-flicker"; public const string SecWorldEdit = "World Edit"; public const string WorldEditMode = "World Edit Mode"; public const string WorldEditHelpFmt = "Aim at object, press E to grab. Active: {0}\n↑/↓: move Y · Q/R: rotate · ←/->: cycle axis (current={1})\nScroll: scale · Ctrl/Caps: snap to player · Del: destroy · RMB: release"; public const string WorldEditNone = "(none)"; public const string SecAdminPretend = "Admin Pretend"; public const string AdminPretendToggle = "Pretend to be admin (client-side only)"; public const string SecKickBanProtect = "Kick / Ban Protection"; public const string BlockKickDisconnect = "Block kick disconnect"; public const string BlockBanButton = "Block ban button"; public const string SecSteamNameMask = "Steam Name Mask (local view only)"; public const string Apply = "Apply"; public const string Clear = "Clear"; public const string SteamNameMaskDesc = "Changes how your name appears on YOUR client. Other players still see your real Steam name. Steam's network signs that, we can't fake it."; public const string SecSaveMirror = "Save Mirror"; public const string MirrorMpToSp = "Mirror MP world -> SP slot 5"; public const string PlayersCountFmt = "Players ({0})"; public const string NotInMpSession = "Not in a multiplayer session."; public const string TagYou = " (you)"; public const string TagAdmin = " [ADMIN]"; public const string TagDead = " [dead]"; public const string Goto = "Goto"; public const string Bring = "Bring"; public const string Heal = "Heal"; public const string Kill = "Kill"; public const string CopyId = "Copy ID"; public const string Profile = "Profile"; public const string SecKeybindsHeader = "Keybinds"; public const string KeybindsDesc = "Bind any toggle to a key. Bound keys fire while the menu is closed only. Press Esc while capturing to cancel. Conflicts are not blocked, that's on you."; public const string PressAnyKey = "press any key..."; public const string Unbound = "(unbound)"; public const string Set = "Set"; public const string NoMatches = "No matches."; public const string KbGodMode = "God Mode"; public const string KbInfStamina = "Infinite Stamina"; public const string KbNoHunger = "No Hunger"; public const string KbNoThirst = "No Thirst"; public const string KbNoSleepLoss = "No Sleep Loss"; public const string KbNoFallDmg = "No Fall Damage"; public const string KbInfHeal = "Infinite Heal"; public const string KbInfLung = "Inf Lung"; public const string KbNoCold = "No Cold"; public const string KbDeathPin = "Death Pin"; public const string KbSpeedyRun = "Speedy Run"; public const string KbNoClip = "NoClip"; public const string KbNoGravity = "No Gravity"; public const string KbInstaKill = "Insta Kill"; public const string KbInfAmmo = "Infinite Ammo"; public const string KbSuperStrength = "Super Strength"; public const string KbOneHitTrees = "One-Hit Trees"; public const string KbInvisibility = "Invisibility"; public const string KbKillAura = "Kill Aura"; public const string KbFreezeActors = "Freeze Actors"; public const string KbActorEsp = "Actor ESP"; public const string KbPlayerEsp = "Player ESP"; public const string KbRadar = "Radar"; public const string KbWaypointEsp = "Waypoint ESP"; public const string KbItemEsp = "Item ESP"; public const string KbAnimalEsp = "Animal ESP"; public const string KbContainerEsp = "Container ESP"; public const string KbCollectibleEsp = "Collectible ESP"; public const string KbShowDead = "Show Dead"; public const string KbCenterCrosshair = "Center Crosshair"; public const string KbCaveLight = "Cave Light"; public const string KbFreeCamera = "Free Camera"; public const string KbCapsuleMode = "Capsule Mode"; public const string KbWorldEdit = "World Edit"; public const string KbCreativeMode = "Creative Mode"; public const string KbInstantBuild = "Instant Build"; public const string KbInfBuild = "Infinite Build"; public const string KbInfLogs = "Infinite Logs"; public const string KbFreezeLakes = "Freeze Lakes"; public const string KbNoLakes = "No Lakes"; public const string KbNoOcean = "No Ocean"; public const string KbNoWaterfalls = "No Waterfalls"; public const string KbLighterRange = "Lighter Range"; public const string KbFlashNoDrain = "Flashlight No Drain"; public const string KbRebreatherNoOx = "Rebreather No Oxygen"; public const string KbRopegunInf = "Rope Gun Infinite"; public const string KbGliderNoDown = "Glider No Downforce"; public const string KbShotgunRapid = "Shotgun Rapid Fire"; public const string KbPistolRapid = "Pistol Rapid Fire"; public const string KbRevolverRapid = "Revolver Rapid Fire"; public const string KbRifleRapid = "Rifle Rapid Fire"; public const string KbAdminPretend = "Admin Pretend"; public const string KbBlockKick = "Block Kick"; public const string KbBlockBan = "Block Ban"; public const string SecAchievements = "Achievements"; public const string UnlockAll = "Unlock All"; public const string LockAll = "Lock All"; public const string SecDisplay = "Display"; public const string UiScale = "UI Scale"; public const string SecItemDump = "Item Dump"; public const string DumpItemsToFile = "Dump Items to File"; public const string LastFmt = "Last: {0}"; public const string SecUtility = "Utility"; public const string FixStuckMouse = "Fix Stuck Mouse"; public const string SecAutoSave = "Auto-save"; public const string ReapplyOnLoad = "Re-apply toggles on save load"; public const string AutoSaveDesc = "On: God Mode, ESP, etc. turn back on automatically when you load a save. Off: start each session clean."; public const string SecReset = "Reset"; public const string ResetDesc = "Turns every toggle off, restores every slider to its default, and clears the saved config."; public const string ResetAll = "Reset All"; public const string SecHotkeys = "Hotkeys"; public const string ToggleMenu = "Toggle menu"; public const string WorldEditGrab = "WorldEdit grab"; public const string WorldEditGrabKey = "E (when WorldEdit active)"; public const string RaycastTp = "Raycast TP"; public const string RaycastTpKey = "RMB (when toggle on)"; public const string MapTeleport = "Map teleport"; public const string MapTeleportKey = "RMB on map window"; public const string SecAbout = "About"; public const string AboutLine = "BepInEx 6 IL2CPP plugin. Drag the title bar to move the window."; } internal static class Teleport { public class SavedSpot { public string Name; public Vector3 Pos; public Color Color = Color.white; } public class Folder { public string Name; public List SavedSpots = new List(); } private class SaveDto { public List folders { get; set; } } private class FolderDto { public string name { get; set; } public List spots { get; set; } } private class SpotDto { public string name { get; set; } public float x { get; set; } public float y { get; set; } public float z { get; set; } public float r { get; set; } public float g { get; set; } public float b { get; set; } } public static readonly List Folders = new List { new Folder { Name = "Default" } }; public static string SavePath => Path.Combine(Paths.ConfigPath, "AdminMenu_waypoints.json"); public static IReadOnlyList<(string name, Vector3 pos)> SavedSpots { get { //IL_0037: Unknown result type (might be due to invalid IL or missing references) List<(string, Vector3)> list = new List<(string, Vector3)>(); foreach (Folder folder in Folders) { foreach (SavedSpot savedSpot in folder.SavedSpots) { list.Add((savedSpot.Name, savedSpot.Pos)); } } return list; } } public static Vector3 PlayerPosition { get { //IL_0021: 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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) try { return Object.op_Implicit((Object)(object)LocalPlayer._instance) ? LocalPlayer.Transform.position : Vector3.zero; } catch { return Vector3.zero; } } } public static void Save() { //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Expected O, but got Unknown try { SaveDto saveDto = new SaveDto { folders = new List(Folders.Count) }; foreach (Folder folder in Folders) { FolderDto folderDto = new FolderDto { name = folder.Name, spots = new List(folder.SavedSpots.Count) }; foreach (SavedSpot savedSpot in folder.SavedSpots) { folderDto.spots.Add(new SpotDto { name = savedSpot.Name, x = savedSpot.Pos.x, y = savedSpot.Pos.y, z = savedSpot.Pos.z, r = savedSpot.Color.r, g = savedSpot.Color.g, b = savedSpot.Color.b }); } saveDto.folders.Add(folderDto); } string contents = JsonSerializer.Serialize(saveDto, new JsonSerializerOptions { WriteIndented = true }); File.WriteAllText(SavePath, contents); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(15, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Teleport.Save: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogWarning(val); } } public static void Load() { //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Expected O, but got Unknown //IL_00cd: 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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) try { if (!File.Exists(SavePath)) { return; } SaveDto saveDto = JsonSerializer.Deserialize(File.ReadAllText(SavePath)); Folders.Clear(); if (saveDto?.folders != null) { foreach (FolderDto folder2 in saveDto.folders) { Folder folder = new Folder { Name = (string.IsNullOrEmpty(folder2.name) ? "Default" : folder2.name) }; if (folder2.spots != null) { foreach (SpotDto spot in folder2.spots) { folder.SavedSpots.Add(new SavedSpot { Name = spot.name, Pos = new Vector3(spot.x, spot.y, spot.z), Color = new Color(spot.r, spot.g, spot.b) }); } } Folders.Add(folder); } } if (Folders.Count == 0) { Folders.Add(new Folder { Name = "Default" }); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(15, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Teleport.Load: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); Folders.Clear(); Folders.Add(new Folder { Name = "Default" }); } } public static int CreateFolder(string name) { if (string.IsNullOrWhiteSpace(name)) { name = $"Folder {Folders.Count}"; } Folders.Add(new Folder { Name = name }); Save(); return Folders.Count - 1; } public static void RemoveFolder(int folderIdx) { if (folderIdx <= 0 || folderIdx >= Folders.Count) { return; } Folder folder = Folders[0]; foreach (SavedSpot savedSpot in Folders[folderIdx].SavedSpots) { folder.SavedSpots.Add(savedSpot); } Folders.RemoveAt(folderIdx); Save(); } public static void SaveCurrent(string name) { SaveCurrent(name, 0); } public static void SaveCurrent(string name, int folderIdx) { //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)LocalPlayer._instance == (Object)null) { Plugin.Log.LogWarning((object)"SaveCurrent: no LocalPlayer"); return; } if (folderIdx < 0 || folderIdx >= Folders.Count) { folderIdx = 0; } Folder folder = Folders[folderIdx]; if (string.IsNullOrWhiteSpace(name)) { name = $"WP{folder.SavedSpots.Count + 1}"; } bool flag = default(bool); try { Vector3 position = LocalPlayer.Transform.position; folder.SavedSpots.Add(new SavedSpot { Name = name, Pos = position }); ManualLogSource log = Plugin.Log; BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(26, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Saved waypoint '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("' @ "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(position); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" in '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(folder.Name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("'"); } log.LogDebug(val); Save(); } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(13, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("SaveCurrent: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log2.LogError(val2); } } public static void RemoveAt(int folderIdx, int wpIdx) { if (folderIdx >= 0 && folderIdx < Folders.Count) { Folder folder = Folders[folderIdx]; if (wpIdx >= 0 && wpIdx < folder.SavedSpots.Count) { folder.SavedSpots.RemoveAt(wpIdx); Save(); } } } public static void RemoveAt(int flatIndex) { int num = flatIndex; for (int i = 0; i < Folders.Count; i++) { Folder folder = Folders[i]; if (num < folder.SavedSpots.Count) { folder.SavedSpots.RemoveAt(num); Save(); break; } num -= folder.SavedSpots.Count; } } public static void MoveSavedSpot(int srcFolder, int wpIdx, int dstFolder) { if (srcFolder >= 0 && srcFolder < Folders.Count && dstFolder >= 0 && dstFolder < Folders.Count && srcFolder != dstFolder) { Folder folder = Folders[srcFolder]; if (wpIdx >= 0 && wpIdx < folder.SavedSpots.Count) { SavedSpot item = folder.SavedSpots[wpIdx]; folder.SavedSpots.RemoveAt(wpIdx); Folders[dstFolder].SavedSpots.Add(item); Save(); } } } public static void SetSavedSpotColor(int folderIdx, int wpIdx, Color c) { //IL_003d: 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) if (folderIdx >= 0 && folderIdx < Folders.Count) { Folder folder = Folders[folderIdx]; if (wpIdx >= 0 && wpIdx < folder.SavedSpots.Count) { folder.SavedSpots[wpIdx].Color = c; Save(); } } } public static void TeleportTo(Vector3 pos) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)LocalPlayer._instance == (Object)null) { Plugin.Log.LogWarning((object)"TeleportTo: no LocalPlayer"); return; } bool flag = default(bool); try { LocalPlayer.Transform.position = pos; ManualLogSource log = Plugin.Log; BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(14, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Teleported to "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(pos); } log.LogDebug(val); } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(12, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("TeleportTo: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log2.LogError(val2); } } public static void TeleportTo(int folderIdx, int wpIdx) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) if (folderIdx >= 0 && folderIdx < Folders.Count) { Folder folder = Folders[folderIdx]; if (wpIdx >= 0 && wpIdx < folder.SavedSpots.Count) { TeleportTo(folder.SavedSpots[wpIdx].Pos); } } } public static void TeleportTo(int flatIndex) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) int num = flatIndex; for (int i = 0; i < Folders.Count; i++) { Folder folder = Folders[i]; if (num < folder.SavedSpots.Count) { TeleportTo(folder.SavedSpots[num].Pos); break; } num -= folder.SavedSpots.Count; } } } internal static class Theme { public static readonly Color Bg = new Color(0.045f, 0.055f, 0.075f, 0.94f); public static readonly Color Panel = new Color(0.1f, 0.12f, 0.16f, 1f); public static readonly Color Accent = new Color(0.95f, 0.55f, 0.18f, 1f); public static readonly Color Text = new Color(0.93f, 0.94f, 0.97f, 1f); public static readonly Color TextDim = new Color(0.7f, 0.73f, 0.78f, 1f); public static readonly Color TextMuted = new Color(0.55f, 0.58f, 0.64f, 1f); public static readonly Color Separator = new Color(1f, 1f, 1f, 0.08f); public static readonly Color SliderTrack = new Color(0.16f, 0.18f, 0.22f, 1f); public static readonly Color ButtonBg = new Color(0.2f, 0.23f, 0.29f, 1f); public static readonly Color SwitchOff = new Color(0.2f, 0.22f, 0.27f, 1f); public static readonly Color Knob = new Color(0.97f, 0.97f, 0.99f, 1f); public static Texture2D BgTex; public static Texture2D PanelTex; public static Texture2D AccentTex; public static Texture2D SeparatorTex; public static Texture2D SliderTrackTex; public static Texture2D ButtonTex; public static Texture2D ButtonHoverTex; public static Texture2D SwitchOffTex; public static Texture2D SwitchOnTex; public static Texture2D KnobTex; public static Texture2D ThumbTex; public static Texture2D TransparentTex; public static Texture2D ResetIconTex; public static Texture2D TabHoverTex; public static Texture2D TabActiveTex; public static GUIStyle Window; public static GUIStyle Title; public static GUIStyle Header; public static GUIStyle Label; public static GUIStyle Small; public static GUIStyle Tab; public static GUIStyle TabActive; public static GUIStyle Button; public static GUIStyle Field; public static GUIStyle Slider; public static GUIStyle SliderThumb; public static GUIStyle IconButton; public static GUISkin OurSkin; private static GUISkin _savedSkin; private static bool _ready; private static Font _cjkRegular; private static Font _cjkBold; private static Font LoadCjk(string[] candidates, int atlasSize, string label) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown bool flag = default(bool); foreach (string text in candidates) { try { Font val = Font.CreateDynamicFontFromOSFont(text, atlasSize); if ((Object)(object)val != (Object)null) { ManualLogSource log = Plugin.Log; BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(18, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Loaded "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(label); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" CJK font: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(text); } log.LogInfo(val2); return val; } } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExDebugLogInterpolatedStringHandler val3 = new BepInExDebugLogInterpolatedStringHandler(21, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(label); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" CJK font '"); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(text); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("' failed: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex.Message); } log2.LogDebug(val3); } } ManualLogSource log3 = Plugin.Log; BepInExWarningLogInterpolatedStringHandler val4 = new BepInExWarningLogInterpolatedStringHandler(19, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("No "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted(label); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral(" CJK font found."); } log3.LogWarning(val4); return null; } private static Font GetCjkRegular() { if ((Object)(object)_cjkRegular != (Object)null) { return _cjkRegular; } _cjkRegular = LoadCjk(new string[3] { "Microsoft YaHei UI", "Microsoft YaHei", "SimSun" }, 32, "regular"); return _cjkRegular; } private static Font GetCjkBold() { if ((Object)(object)_cjkBold != (Object)null) { return _cjkBold; } _cjkBold = LoadCjk(new string[4] { "SimHei", "Microsoft YaHei UI Bold", "Microsoft YaHei Bold", "Microsoft YaHei UI" }, 32, "bold"); return _cjkBold; } public static void PushSkin() { _savedSkin = GUI.skin; if ((Object)(object)OurSkin != (Object)null) { GUI.skin = OurSkin; } } public static void PopSkin() { GUI.skin = _savedSkin; } public static void Build() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_0068: 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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: 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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Expected O, but got Unknown //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Expected O, but got Unknown //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Expected O, but got Unknown //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Expected O, but got Unknown //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Expected O, but got Unknown //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Expected O, but got Unknown //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Expected O, but got Unknown //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Expected O, but got Unknown //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Expected O, but got Unknown //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Expected O, but got Unknown //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_031d: 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_0332: Expected O, but got Unknown //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_033c: 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_0352: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Expected O, but got Unknown //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Expected O, but got Unknown //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_03df: Expected O, but got Unknown //IL_03df: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Expected O, but got Unknown //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_03fe: Unknown result type (might be due to invalid IL or missing references) //IL_0404: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_0424: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Unknown result type (might be due to invalid IL or missing references) //IL_043e: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Expected O, but got Unknown //IL_045d: Unknown result type (might be due to invalid IL or missing references) //IL_0462: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_0471: Unknown result type (might be due to invalid IL or missing references) //IL_0476: Unknown result type (might be due to invalid IL or missing references) //IL_0480: Expected O, but got Unknown //IL_0480: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04c5: Expected O, but got Unknown //IL_04cf: Unknown result type (might be due to invalid IL or missing references) //IL_04d4: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e4: Unknown result type (might be due to invalid IL or missing references) //IL_04ee: Expected O, but got Unknown //IL_04ee: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Expected O, but got Unknown //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_0502: Unknown result type (might be due to invalid IL or missing references) //IL_050c: Expected O, but got Unknown //IL_050c: Unknown result type (might be due to invalid IL or missing references) //IL_0521: Expected O, but got Unknown //IL_052b: Unknown result type (might be due to invalid IL or missing references) //IL_0530: Unknown result type (might be due to invalid IL or missing references) //IL_053b: Unknown result type (might be due to invalid IL or missing references) //IL_054c: Expected O, but got Unknown //IL_0556: Unknown result type (might be due to invalid IL or missing references) //IL_055b: Unknown result type (might be due to invalid IL or missing references) //IL_0566: Unknown result type (might be due to invalid IL or missing references) //IL_056b: Unknown result type (might be due to invalid IL or missing references) //IL_0575: Expected O, but got Unknown //IL_0575: Unknown result type (might be due to invalid IL or missing references) //IL_0585: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_05a6: Expected O, but got Unknown //IL_05b0: Unknown result type (might be due to invalid IL or missing references) //IL_05b5: Unknown result type (might be due to invalid IL or missing references) //IL_05c0: Unknown result type (might be due to invalid IL or missing references) //IL_05cb: Unknown result type (might be due to invalid IL or missing references) //IL_05dc: Expected O, but got Unknown //IL_05e6: Unknown result type (might be due to invalid IL or missing references) //IL_05eb: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Unknown result type (might be due to invalid IL or missing references) //IL_0601: Unknown result type (might be due to invalid IL or missing references) //IL_0612: Expected O, but got Unknown //IL_063b: Unknown result type (might be due to invalid IL or missing references) //IL_0645: Expected O, but got Unknown //IL_0651: Unknown result type (might be due to invalid IL or missing references) //IL_065b: Expected O, but got Unknown //IL_0667: Unknown result type (might be due to invalid IL or missing references) //IL_0671: Expected O, but got Unknown //IL_067d: Unknown result type (might be due to invalid IL or missing references) //IL_0687: Expected O, but got Unknown //IL_0693: Unknown result type (might be due to invalid IL or missing references) //IL_069d: Expected O, but got Unknown //IL_06a9: Unknown result type (might be due to invalid IL or missing references) //IL_06b3: Expected O, but got Unknown //IL_06bf: Unknown result type (might be due to invalid IL or missing references) //IL_06c9: Expected O, but got Unknown //IL_06d5: Unknown result type (might be due to invalid IL or missing references) //IL_06df: Expected O, but got Unknown //IL_06eb: Unknown result type (might be due to invalid IL or missing references) //IL_06f5: Expected O, but got Unknown //IL_0701: Unknown result type (might be due to invalid IL or missing references) //IL_070b: Expected O, but got Unknown //IL_0717: Unknown result type (might be due to invalid IL or missing references) //IL_0721: Expected O, but got Unknown //IL_072d: Unknown result type (might be due to invalid IL or missing references) //IL_0737: Expected O, but got Unknown //IL_0743: Unknown result type (might be due to invalid IL or missing references) //IL_074d: Expected O, but got Unknown //IL_0759: Unknown result type (might be due to invalid IL or missing references) //IL_0763: Expected O, but got Unknown //IL_0799: Unknown result type (might be due to invalid IL or missing references) //IL_079e: Unknown result type (might be due to invalid IL or missing references) //IL_07a3: Unknown result type (might be due to invalid IL or missing references) //IL_07ad: Expected O, but got Unknown //IL_07ad: Unknown result type (might be due to invalid IL or missing references) //IL_07b2: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Expected O, but got Unknown //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07c1: Unknown result type (might be due to invalid IL or missing references) //IL_07cb: Expected O, but got Unknown //IL_07cb: Unknown result type (might be due to invalid IL or missing references) //IL_07d0: Unknown result type (might be due to invalid IL or missing references) //IL_07da: Expected O, but got Unknown //IL_07da: Unknown result type (might be due to invalid IL or missing references) //IL_07e1: Unknown result type (might be due to invalid IL or missing references) //IL_07f1: Unknown result type (might be due to invalid IL or missing references) //IL_0801: Unknown result type (might be due to invalid IL or missing references) //IL_0816: Expected O, but got Unknown //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_0825: Unknown result type (might be due to invalid IL or missing references) //IL_0830: Unknown result type (might be due to invalid IL or missing references) //IL_083b: Unknown result type (might be due to invalid IL or missing references) //IL_0840: Unknown result type (might be due to invalid IL or missing references) //IL_084a: Expected O, but got Unknown //IL_084a: Unknown result type (might be due to invalid IL or missing references) //IL_084f: Unknown result type (might be due to invalid IL or missing references) //IL_0859: Expected O, but got Unknown //IL_0859: Unknown result type (might be due to invalid IL or missing references) //IL_085e: Unknown result type (might be due to invalid IL or missing references) //IL_0868: Expected O, but got Unknown //IL_0868: Unknown result type (might be due to invalid IL or missing references) //IL_086d: Unknown result type (might be due to invalid IL or missing references) //IL_0877: Expected O, but got Unknown //IL_0877: Unknown result type (might be due to invalid IL or missing references) //IL_0887: Unknown result type (might be due to invalid IL or missing references) //IL_0897: Unknown result type (might be due to invalid IL or missing references) //IL_08ac: Expected O, but got Unknown if (!_ready) { _ready = true; BgTex = Solid(Bg); PanelTex = Solid(Panel); AccentTex = Solid(Accent); SeparatorTex = Solid(Separator); SliderTrackTex = Solid(SliderTrack); ButtonTex = Solid(ButtonBg); ButtonHoverTex = Solid(Accent); SwitchOffTex = Pill(42, 22, SwitchOff); SwitchOnTex = Pill(42, 22, Accent); KnobTex = Circle(18, Knob); ThumbTex = Circle(16, Knob); TransparentTex = Solid(new Color(0f, 0f, 0f, 0f)); ResetIconTex = ResetIcon(20, Text); TabHoverTex = Solid(new Color(1f, 1f, 1f, 0.04f)); TabActiveTex = Solid(new Color(0.14f, 0.16f, 0.2f, 1f)); GUIStyle val = new GUIStyle(GUI.skin.box) { padding = new RectOffset(18, 18, 14, 14), border = new RectOffset(2, 2, 2, 2) }; val.normal.background = BgTex; val.normal.textColor = Text; Window = val; GUIStyle val2 = new GUIStyle(GUI.skin.label) { fontStyle = (FontStyle)1, fontSize = 20, alignment = (TextAnchor)3 }; val2.normal.textColor = Color.white; Title = val2; GUIStyle val3 = new GUIStyle(GUI.skin.label) { fontStyle = (FontStyle)1, fontSize = 12 }; val3.normal.textColor = Accent; Header = val3; GUIStyle val4 = new GUIStyle(GUI.skin.label) { fontSize = 13 }; val4.normal.textColor = Text; Label = val4; GUIStyle val5 = new GUIStyle(GUI.skin.label) { fontSize = 11 }; val5.normal.textColor = TextDim; val5.alignment = (TextAnchor)3; Small = val5; GUIStyle val6 = new GUIStyle(GUI.skin.button) { fontSize = 12, fontStyle = (FontStyle)1, alignment = (TextAnchor)4, padding = new RectOffset(0, 0, 7, 7), margin = new RectOffset(1, 1, 0, 0), border = new RectOffset(0, 0, 0, 0) }; val6.normal.background = TransparentTex; val6.normal.textColor = TextMuted; val6.hover.background = TabHoverTex; val6.hover.textColor = Text; val6.active.background = TabHoverTex; val6.active.textColor = Color.white; val6.onNormal.background = TabActiveTex; val6.onNormal.textColor = Color.white; Tab = val6; GUIStyle val7 = new GUIStyle(Tab); val7.normal.background = TabActiveTex; val7.normal.textColor = Color.white; val7.hover.background = TabActiveTex; val7.hover.textColor = Color.white; val7.active.background = TabActiveTex; val7.active.textColor = Color.white; TabActive = val7; GUIStyle val8 = new GUIStyle(GUI.skin.button) { fontSize = 12, fontStyle = (FontStyle)1, padding = new RectOffset(10, 10, 6, 6), margin = new RectOffset(4, 4, 4, 4), border = new RectOffset(0, 0, 0, 0) }; val8.normal.background = ButtonTex; val8.normal.textColor = Text; val8.hover.background = ButtonHoverTex; val8.hover.textColor = Color.white; val8.active.background = ButtonHoverTex; val8.active.textColor = Color.white; Button = val8; GUIStyle val9 = new GUIStyle(GUI.skin.textField) { fontSize = 12, alignment = (TextAnchor)5, padding = new RectOffset(4, 4, 4, 4) }; val9.normal.background = PanelTex; val9.normal.textColor = Color.white; val9.focused.background = AccentTex; val9.focused.textColor = Color.white; Field = val9; GUIStyle val10 = new GUIStyle(GUI.skin.horizontalSlider) { fixedHeight = 16f, margin = new RectOffset(8, 8, 8, 8), border = new RectOffset(0, 0, 0, 0), overflow = new RectOffset(0, 0, 0, 0) }; val10.normal.background = TransparentTex; Slider = val10; GUIStyle val11 = new GUIStyle(GUI.skin.verticalScrollbar) { fixedWidth = 8f }; val11.normal.background = SliderTrackTex; GUIStyle verticalScrollbar = val11; GUIStyle val12 = new GUIStyle(GUI.skin.verticalScrollbarThumb) { fixedWidth = 8f, border = new RectOffset(0, 0, 0, 0) }; val12.normal.background = AccentTex; val12.hover.background = AccentTex; val12.active.background = AccentTex; GUIStyle verticalScrollbarThumb = val12; GUIStyle val13 = new GUIStyle(GUI.skin.verticalScrollbarUpButton) { fixedHeight = 0f, fixedWidth = 0f }; val13.normal.background = TransparentTex; GUIStyle verticalScrollbarUpButton = val13; GUIStyle val14 = new GUIStyle(GUI.skin.verticalScrollbarDownButton) { fixedHeight = 0f, fixedWidth = 0f }; val14.normal.background = TransparentTex; GUIStyle verticalScrollbarDownButton = val14; OurSkin = ScriptableObject.CreateInstance(); ((Object)OurSkin).hideFlags = (HideFlags)61; GUISkin skin = GUI.skin; OurSkin.box = new GUIStyle(skin.box); OurSkin.button = new GUIStyle(skin.button); OurSkin.label = new GUIStyle(skin.label); OurSkin.textField = new GUIStyle(skin.textField); OurSkin.textArea = new GUIStyle(skin.textArea); OurSkin.window = new GUIStyle(skin.window); OurSkin.toggle = new GUIStyle(skin.toggle); OurSkin.horizontalSlider = new GUIStyle(skin.horizontalSlider); OurSkin.horizontalSliderThumb = new GUIStyle(skin.horizontalSliderThumb); OurSkin.horizontalScrollbar = new GUIStyle(skin.horizontalScrollbar); OurSkin.horizontalScrollbarThumb = new GUIStyle(skin.horizontalScrollbarThumb); OurSkin.horizontalScrollbarLeftButton = new GUIStyle(skin.horizontalScrollbarLeftButton); OurSkin.horizontalScrollbarRightButton = new GUIStyle(skin.horizontalScrollbarRightButton); OurSkin.scrollView = new GUIStyle(skin.scrollView); OurSkin.verticalScrollbar = verticalScrollbar; OurSkin.verticalScrollbarThumb = verticalScrollbarThumb; OurSkin.verticalScrollbarUpButton = verticalScrollbarUpButton; OurSkin.verticalScrollbarDownButton = verticalScrollbarDownButton; GUIStyle val15 = new GUIStyle(GUI.skin.button) { padding = new RectOffset(0, 0, 0, 0), margin = new RectOffset(2, 2, 0, 0), border = new RectOffset(0, 0, 0, 0), overflow = new RectOffset(0, 0, 0, 0), imagePosition = (ImagePosition)2 }; val15.normal.background = ButtonTex; val15.hover.background = ButtonHoverTex; val15.active.background = ButtonHoverTex; IconButton = val15; GUIStyle val16 = new GUIStyle(GUI.skin.horizontalSliderThumb) { fixedWidth = 16f, fixedHeight = 16f, border = new RectOffset(0, 0, 0, 0), margin = new RectOffset(0, 0, 0, 0), overflow = new RectOffset(0, 0, 0, 0), padding = new RectOffset(0, 0, 0, 0) }; val16.normal.background = ThumbTex; val16.hover.background = ThumbTex; val16.active.background = ThumbTex; SliderThumb = val16; } } private static Texture2D Solid(Color c) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) Texture2D val = 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] = c; } val.SetPixels(Il2CppStructArray.op_Implicit(array)); val.Apply(); return val; } private static Texture2D Circle(int size, Color c) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(size, size, (TextureFormat)4, false) { hideFlags = (HideFlags)61 }; Color[] array = (Color[])(object)new Color[size * size]; float num = (float)size * 0.5f; for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { float num2 = (float)j + 0.5f - num; float num3 = (float)i + 0.5f - num; float num4 = Mathf.Sqrt(num2 * num2 + num3 * num3); float num5 = Mathf.Clamp01(num - num4); array[i * size + j] = new Color(c.r, c.g, c.b, c.a * num5); } } val.SetPixels(Il2CppStructArray.op_Implicit(array)); ((Texture)val).filterMode = (FilterMode)1; val.Apply(); return val; } private static Texture2D ResetIcon(int size, Color c) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013b: 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_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(size, size, (TextureFormat)4, false) { hideFlags = (HideFlags)61 }; Color val2 = default(Color); ((Color)(ref val2))..ctor(0f, 0f, 0f, 0f); Color[] array = (Color[])(object)new Color[size * size]; for (int i = 0; i < array.Length; i++) { array[i] = val2; } float num = (float)size * 0.5f - 0.5f; float num2 = (float)size * 0.5f - 0.5f; float num3 = (float)size * 0.4f; float num4 = (float)size * 0.26f; float num5 = -2.7f; float num6 = -1.6f; for (int j = 0; j < size; j++) { for (int k = 0; k < size; k++) { float num7 = (float)k - num; float num8 = (float)j - num2; float num9 = Mathf.Sqrt(num7 * num7 + num8 * num8); if (num9 > num4 - 0.5f && num9 < num3 + 0.5f) { float num10 = Mathf.Atan2(num8, num7); if (num10 < num5 || num10 > num6) { float num11 = Mathf.Clamp01(num3 - num9) * Mathf.Clamp01(num9 - num4 + 1f); num11 = Mathf.Clamp01(num11); array[j * size + k] = new Color(c.r, c.g, c.b, c.a * num11); } } } } float num12 = num6; float num13 = num + Mathf.Cos(num12) * (num3 + num4) * 0.5f; float num14 = num2 + Mathf.Sin(num12) * (num3 + num4) * 0.5f; float num15 = (num3 - num4) * 1.6f; Vector2 a = default(Vector2); ((Vector2)(ref a))..ctor(num13 - num15, num14); Vector2 b = default(Vector2); ((Vector2)(ref b))..ctor(num13 + num15 * 0.6f, num14 - num15); Vector2 c2 = default(Vector2); ((Vector2)(ref c2))..ctor(num13 + num15 * 0.6f, num14 + num15); for (int l = 0; l < size; l++) { for (int m = 0; m < size; m++) { if (PointInTri(new Vector2((float)m, (float)l), a, b, c2)) { array[l * size + m] = c; } } } val.SetPixels(Il2CppStructArray.op_Implicit(array)); ((Texture)val).filterMode = (FilterMode)1; val.Apply(); return val; } private static bool PointInTri(Vector2 p, Vector2 a, Vector2 b, Vector2 c) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) float num = Sign(p, a, b); float num2 = Sign(p, b, c); float num3 = Sign(p, c, a); bool flag = num < 0f || num2 < 0f || num3 < 0f; bool flag2 = num > 0f || num2 > 0f || num3 > 0f; return !(flag && flag2); } private static float Sign(Vector2 p, Vector2 a, Vector2 b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) return (p.x - b.x) * (a.y - b.y) - (a.x - b.x) * (p.y - b.y); } private static Texture2D Pill(int w, int h, Color c) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: 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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(w, h, (TextureFormat)4, false) { hideFlags = (HideFlags)61 }; Color[] array = (Color[])(object)new Color[w * h]; float num = (float)h * 0.5f; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { float num2 = (float)j + 0.5f; float num3 = (float)i + 0.5f; float num6; if (num2 < num) { float num4 = num2 - num; float num5 = num3 - num; num6 = Mathf.Clamp01(num - Mathf.Sqrt(num4 * num4 + num5 * num5)); } else if (num2 > (float)w - num) { float num7 = num2 - ((float)w - num); float num8 = num3 - num; num6 = Mathf.Clamp01(num - Mathf.Sqrt(num7 * num7 + num8 * num8)); } else { num6 = 1f; } array[i * w + j] = new Color(c.r, c.g, c.b, c.a * num6); } } val.SetPixels(Il2CppStructArray.op_Implicit(array)); ((Texture)val).filterMode = (FilterMode)1; val.Apply(); return val; } } internal static class Worldcraft { public static bool LockTime; public static float LockedHour = 12f; public static float TimeMultiplier = 1f; public static float WindIntensity; public static float SunIntensity = 1f; public static bool FreeCraftFlag; public static bool InstantPlace; public static bool IsFreezeLakes; public static bool IsNoLakes; public static bool IsNoOcean; public static bool IsNoWaterfalls; public static bool IsNoGravity; public static float SunR = 1f; public static float SunG = 1f; public static float SunB = 1f; public static float TreeRegrowRate = 1f; public static bool SunIntensityLocked; public static float CurrentHour { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) try { TimeOfDay timeOfDay = TimeOfDayHolder.GetTimeOfDay(); return (float)((TimeOfDay)(ref timeOfDay)).Hours + (float)((TimeOfDay)(ref timeOfDay)).Minutes / 60f; } catch { return 12f; } } } public static void ApplyLockTime(bool on, float hour) { //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown LockTime = on; LockedHour = hour; try { if (on) { int num = Mathf.Clamp((int)hour, 0, 23); int value = Mathf.Clamp((int)((hour - (float)num) * 60f), 0, 59); DebugConsole.Instance._lockTimeOfDay($"{num:00}:{value:00}"); } else { DebugConsole.Instance._lockTimeOfDay("off"); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(15, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("ApplyLockTime: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static void SetTimeOfDay(float hour) { //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown LockedHour = hour; try { int num = Mathf.Clamp((int)hour, 0, 23); int value = Mathf.Clamp((int)((hour - (float)num) * 60f), 0, 59); if (LockTime) { DebugConsole.Instance._lockTimeOfDay($"{num:00}:{value:00}"); } else { DebugConsole.Instance._setTimeOfDay($"{num:00}:{value:00}"); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(14, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SetTimeOfDay: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static void SetTimeMultiplier(float v) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown TimeMultiplier = v; try { TimeOfDayHolder.SetBaseTimeSpeed(v); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(19, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SetTimeMultiplier: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static void SetWindIntensity(float v) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown WindIntensity = v; try { if (v <= 0.001f) { WindManager.Unlock(); } else { WindManager.SetAndLockIntensity(v); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(18, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SetWindIntensity: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static void SetSunIntensity(float v) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown SunIntensity = v; SunIntensityLocked = Mathf.Abs(v - 1f) > 0.01f; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(25, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SunIntensity -> "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(v, "0.00"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" locked="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(SunIntensityLocked); } log.LogDebug(val); ApplySunIntensity(); } public static void ApplySunIntensity() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown try { Light light = SunLightManager.GetLight(); if (!((Object)(object)light == (Object)null)) { HDAdditionalLightData component = ((Component)light).GetComponent(); if ((Object)(object)component != (Object)null) { component.intensity = SunIntensity * 100000f; } else { light.intensity = SunIntensity; } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(19, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("ApplySunIntensity: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static void SetFreeCraftFlag(bool on) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown FreeCraftFlag = on; try { GameSetupManager.SetCreativeModeSetting(on); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(18, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SetFreeCraftFlag: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static void SetInstantPlace(bool on) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown InstantPlace = on; try { StructureCraftingSystem val = Object.FindObjectOfType(); if ((Object)(object)val != (Object)null) { val.InstantBuild = on; } else { Plugin.Log.LogWarning((object)"SetInstantPlace: no StructureCraftingSystem in scene"); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(17, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("SetInstantPlace: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } } public static void KillAllEnemies() { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_0046: 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_004d: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)LocalPlayer._instance == (Object)null) { Plugin.Log.LogWarning((object)"KillAllEnemies: no LocalPlayer"); return; } VailActorManager instance = VailActorManager._instance; if ((Object)(object)instance == (Object)null) { Plugin.Log.LogWarning((object)"KillAllEnemies: no VailActorManager"); return; } Vector3 position = LocalPlayer.Transform.position; instance.DamageActorsInRadius(position, 99999f, 99999f); Plugin.Log.LogDebug((object)"KillAllEnemies: damaged all actors in radius"); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(16, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("KillAllEnemies: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static void ForceSave() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown try { DebugConsole.Instance._save("0"); Plugin.Log.LogDebug((object)"ForceSave: triggered"); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(11, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("ForceSave: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } private static GameObject FindRoot(string sceneName, string rootName) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) Scene sceneByName = SceneManager.GetSceneByName(sceneName); if (!((Scene)(ref sceneByName)).isLoaded) { return null; } foreach (GameObject item in (Il2CppArrayBase)(object)((Scene)(ref sceneByName)).GetRootGameObjects()) { if ((Object)(object)item != (Object)null && ((Object)item).name == rootName) { return item; } } return null; } public static void FreezeLakes(bool on) { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown IsFreezeLakes = on; try { GameObject val = FindRoot("Site02StreamsAndLakes", "Lakes"); if ((Object)(object)val == (Object)null) { Plugin.Log.LogWarning((object)"FreezeLakes: 'Lakes' not found"); return; } int childCount = val.transform.childCount; for (int i = 0; i < childCount; i++) { Transform child = val.transform.GetChild(i); if (!((Object)(object)child == (Object)null)) { FreezeWater componentInChildren = ((Component)child).GetComponentInChildren(); if (!((Object)(object)componentInChildren == (Object)null) && !componentInChildren._forceFrozen && !componentInChildren._neverFreeze) { componentInChildren.Freeze(on); } } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(13, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("FreezeLakes: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } } public static void NoLakes(bool on) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown IsNoLakes = on; try { GameObject val = FindRoot("Site02StreamsAndLakes", "Lakes"); if ((Object)(object)val != (Object)null) { val.SetActive(!on); } else { Plugin.Log.LogWarning((object)"NoLakes: 'Lakes' not found"); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(9, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("NoLakes: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } } public static void NoOcean(bool on) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown IsNoOcean = on; try { GameObject val = FindRoot("SonsMain", "OceanZone"); if ((Object)(object)val != (Object)null) { val.SetActive(!on); } GameObject val2 = FindRoot("SonsMain", "Atmosphere"); if ((Object)(object)val2 != (Object)null) { Transform val3 = val2.transform.Find("CrestOcean"); if ((Object)(object)val3 != (Object)null) { ((Component)val3).gameObject.SetActive(!on); } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val4 = new BepInExErrorLogInterpolatedStringHandler(9, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("NoOcean: "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted(ex.Message); } log.LogError(val4); } } public static void NoWaterfalls(bool on) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown IsNoWaterfalls = on; try { GameObject val = FindRoot("Site02StreamsAndLakes", "Waterfalls"); if ((Object)(object)val != (Object)null) { val.SetActive(!on); } else { Plugin.Log.LogWarning((object)"NoWaterfalls: 'Waterfalls' not found"); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(14, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("NoWaterfalls: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } } public static void NoGrass() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown try { DebugConsole.Instance.SendCommand("togglegrass"); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(9, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("NoGrass: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static void NoForest() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown try { DebugConsole.Instance.SendCommand("noforest"); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(10, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("NoForest: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static void NoGravity(bool on) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown IsNoGravity = on; try { if ((Object)(object)LocalPlayer._instance == (Object)null) { Plugin.Log.LogWarning((object)"NoGravity: no LocalPlayer"); } else { LocalPlayer.FpCharacter.SetDisabledGravity(on); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(11, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("NoGravity: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static void SetSpring() { RunSeason("spring"); } public static void SetSummer() { RunSeason("summer"); } public static void SetAutumn() { RunSeason("autumn"); } public static void SetWinter() { RunSeason("winter"); } private static void RunSeason(string s) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown try { DebugConsole.Instance._season(s); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(11, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("_season("); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(s); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("): "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static void SetSunColorR(float v) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) SunR = v; try { SunLightManager instance = SunLightManager._instance; if (!((Object)(object)instance == (Object)null) && !((Object)(object)instance._sunLight == (Object)null)) { Color color = instance._sunLight.color; instance._sunLight.color = new Color(v, color.g, color.b, color.a); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(14, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SetSunColorR: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static void SetSunColorG(float v) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) SunG = v; try { SunLightManager instance = SunLightManager._instance; if (!((Object)(object)instance == (Object)null) && !((Object)(object)instance._sunLight == (Object)null)) { Color color = instance._sunLight.color; instance._sunLight.color = new Color(color.r, v, color.b, color.a); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(14, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SetSunColorG: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static void SetSunColorB(float v) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) SunB = v; try { SunLightManager instance = SunLightManager._instance; if (!((Object)(object)instance == (Object)null) && !((Object)(object)instance._sunLight == (Object)null)) { Color color = instance._sunLight.color; instance._sunLight.color = new Color(color.r, color.g, v, color.a); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(14, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SetSunColorB: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static void TreeRegrowFactor(float v) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown TreeRegrowRate = v; try { TreeRegrowChecker val = Object.FindObjectOfType(); if ((Object)(object)val != (Object)null) { val._regrowthFactor = v; } else { Plugin.Log.LogWarning((object)"TreeRegrowFactor: no TreeRegrowChecker"); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(18, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("TreeRegrowFactor: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } } public static void SetDay(int day) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown try { TimeOfDayHolder.SetDay(day); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(8, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SetDay: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } } internal static class WorldEdit { public enum Axis { X, Y, Z } public static bool Enabled; public static int UpDownSpeed = 2; public static int RotationSpeed = 10; public static Axis RotationAxis = Axis.Y; private static GameObject _root; private static LineRenderer _line; public static GameObject PointedObject { get; private set; } public static GameObject ActiveObject { get; private set; } public static void Init() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Expected O, but got Unknown //IL_0046: 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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown try { _root = new GameObject("AdminMenu_WorldEdit"); Object.DontDestroyOnLoad((Object)(object)_root); _line = _root.AddComponent(); _line.widthMultiplier = 0.05f; ((Renderer)_line).material = new Material(Shader.Find("Sprites/Default")) { color = Color.cyan }; ((Renderer)_line).enabled = false; WorldEditDriverHost.Ensure(); Plugin.Log.LogDebug((object)"WorldEdit.Init: ready"); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(16, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("WorldEdit.Init: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex); } log.LogError(val); } } public static void SetEnabled(bool on) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown Enabled = on; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(13, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("WorldEdit -> "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(on); } log.LogDebug(val); if (!on) { ReleaseActive(); PointedObject = null; if ((Object)(object)_line != (Object)null) { ((Renderer)_line).enabled = false; } } } public static void SetUpDownSpeed(float v) { UpDownSpeed = Mathf.Max(1, (int)v); } public static void SetRotationSpeed(float v) { RotationSpeed = Mathf.Max(1, (int)v); } public static void Tick() { //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Expected O, but got Unknown //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_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_012b: Unknown result type (might be due to invalid IL or missing references) if (!Enabled) { if ((Object)(object)_line != (Object)null && ((Renderer)_line).enabled) { ((Renderer)_line).enabled = false; } return; } bool flag = default(bool); try { if ((Object)(object)LocalPlayer._instance == (Object)null || (Object)(object)LocalPlayer.MainCam == (Object)null) { return; } Transform transform = ((Component)LocalPlayer.MainCam).transform; if ((Object)(object)ActiveObject == (Object)null) { RaycastHit val = default(RaycastHit); if (Physics.Raycast(transform.position, transform.forward, ref val, 25f, ~LayerMask.GetMask(new string[1] { "Terrain" }), (QueryTriggerInteraction)1)) { GameObject val2 = (((Object)(object)((RaycastHit)(ref val)).transform != (Object)null) ? ((Component)((RaycastHit)(ref val)).transform).gameObject : null); if ((Object)(object)val2 != (Object)null && (Object)(object)val2 != (Object)(object)LocalPlayer.GameObject && (Object)(object)val2.GetComponentInChildren() != (Object)null) { PointedObject = val2; if ((Object)(object)_line != (Object)null) { ((Renderer)_line).enabled = true; _line.SetPosition(0, transform.position + transform.forward * 0.5f); _line.SetPosition(1, ((RaycastHit)(ref val)).point); } } else { PointedObject = null; if ((Object)(object)_line != (Object)null) { ((Renderer)_line).enabled = false; } } } else { PointedObject = null; if ((Object)(object)_line != (Object)null) { ((Renderer)_line).enabled = false; } } if (Input.GetKeyDown((KeyCode)101) && (Object)(object)PointedObject != (Object)null) { ActiveObject = PointedObject; if ((Object)(object)_line != (Object)null) { ((Renderer)_line).enabled = false; } ManualLogSource log = Plugin.Log; BepInExDebugLogInterpolatedStringHandler val3 = new BepInExDebugLogInterpolatedStringHandler(21, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("WorldEdit: grabbed '"); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(((Object)ActiveObject).name); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("'"); } log.LogDebug(val3); } } if ((Object)(object)ActiveObject != (Object)null) { ObjectControl(ActiveObject); } } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val4 = new BepInExErrorLogInterpolatedStringHandler(16, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("WorldEdit.Tick: "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted(ex.Message); } log2.LogError(val4); } } private static void ObjectControl(GameObject obj) { //IL_0008: 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_000f: 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: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: 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_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_0147: 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_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016f: 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_0186: 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_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0274: 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_0286: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Expected O, but got Unknown Transform transform = obj.transform; Vector3 position = transform.position; Quaternion localRotation = transform.localRotation; Vector3 localScale = transform.localScale; bool flag = Input.GetKey((KeyCode)306) || Input.GetKey((KeyCode)305) || Input.GetKey((KeyCode)301); if (Input.GetKeyDown((KeyCode)276)) { RotationAxis = (Axis)Mathf.Max(0, (int)(RotationAxis - 1)); } if (Input.GetKeyDown((KeyCode)275)) { RotationAxis = (Axis)Mathf.Min(2, (int)(RotationAxis + 1)); } if (!flag) { float deltaTime = Time.deltaTime; if (Input.GetKey((KeyCode)273)) { transform.position = new Vector3(position.x, position.y + (float)UpDownSpeed * deltaTime, position.z); } if (Input.GetKey((KeyCode)274)) { transform.position = new Vector3(position.x, position.y - (float)UpDownSpeed * deltaTime, position.z); } } float num = (float)(RotationSpeed * 10) * Time.deltaTime; Vector3 eulerAngles = ((Quaternion)(ref localRotation)).eulerAngles; if (Input.GetKey((KeyCode)113)) { switch (RotationAxis) { case Axis.X: transform.localRotation = Quaternion.Euler(eulerAngles.x - num, eulerAngles.y, eulerAngles.z); break; case Axis.Y: transform.localRotation = Quaternion.Euler(eulerAngles.x, eulerAngles.y - num, eulerAngles.z); break; case Axis.Z: transform.localRotation = Quaternion.Euler(eulerAngles.x, eulerAngles.y, eulerAngles.z - num); break; } } else if (Input.GetKey((KeyCode)114)) { switch (RotationAxis) { case Axis.X: transform.localRotation = Quaternion.Euler(eulerAngles.x + num, eulerAngles.y, eulerAngles.z); break; case Axis.Y: transform.localRotation = Quaternion.Euler(eulerAngles.x, eulerAngles.y + num, eulerAngles.z); break; case Axis.Z: transform.localRotation = Quaternion.Euler(eulerAngles.x, eulerAngles.y, eulerAngles.z + num); break; } } float axis = Input.GetAxis("Mouse ScrollWheel"); if (Mathf.Abs(axis) > 0.001f) { float num2 = ((axis > 0f) ? 0.1f : (-0.1f)); transform.localScale = new Vector3(localScale.x + num2, localScale.y + num2, localScale.z + num2); } if (flag) { if ((Object)(object)transform.parent != (Object)(object)LocalPlayer.Transform) { transform.SetParent(LocalPlayer.Transform, true); } } else if ((Object)(object)transform.parent == (Object)(object)LocalPlayer.Transform) { transform.SetParent((Transform)null, true); } if (Input.GetKeyDown((KeyCode)127)) { ManualLogSource log = Plugin.Log; bool flag2 = default(bool); BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(23, 1, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("WorldEdit: destroyed '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(((Object)obj).name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("'"); } log.LogDebug(val); Object.Destroy((Object)(object)obj); ActiveObject = null; } else if (Input.GetKeyDown((KeyCode)324)) { ReleaseActive(); } } private static void ReleaseActive() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown if (!((Object)(object)ActiveObject == (Object)null)) { if ((Object)(object)ActiveObject.transform.parent == (Object)(object)LocalPlayer.Transform) { ActiveObject.transform.SetParent((Transform)null, true); } ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(22, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("WorldEdit: released '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(((Object)ActiveObject).name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("'"); } log.LogDebug(val); ActiveObject = null; } } } internal static class WorldEditDriverHost { private static WorldEditDriver _driver; public static void Ensure() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown try { if (!((Object)(object)_driver != (Object)null)) { ClassInjector.RegisterTypeInIl2Cpp(); GameObject val = new GameObject("AdminMenu_WorldEditDriver") { hideFlags = (HideFlags)61 }; Object.DontDestroyOnLoad((Object)val); _driver = val.AddComponent(); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(28, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("WorldEditDriverHost.Ensure: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex); } log.LogError(val2); } } } public class WorldEditDriver : MonoBehaviour { public WorldEditDriver(IntPtr ptr) : base(ptr) { } private void Update() { WorldEdit.Tick(); } } } namespace AdminMenu.Tabs { internal static class CombatTab { private static float _strength = 10f; private static float _killAuraR = 10f; private static float _dmgMult = 1f; private static bool _init; public static void Draw() { if (!_init) { _strength = (float.IsNaN(Settings.SlImpulseMult.Value) ? Combat.ImpulseMultiplier : Settings.SlImpulseMult.Value); _killAuraR = (float.IsNaN(Settings.SlKillAuraRadius.Value) ? Cheats.RadialCullRadius : Settings.SlKillAuraRadius.Value); _dmgMult = (float.IsNaN(Settings.SlDamageMult.Value) ? 1f : Settings.SlDamageMult.Value); Combat.ImpulseMultiplier = _strength; Cheats.SetRadialCullRadius(_killAuraR); Combat.DamageMultiplier = _dmgMult; _init = true; } MenuUI.Header("Damage"); MenuUI.Toggle("Insta Kill", Combat.DamageOverride, delegate(bool v) { Combat.SetDamageOverride(v); Settings.InstaDmg.Value = v; }); MenuUI.Toggle("Infinite Ammo", Combat.AmmoLockEnabled, delegate(bool v) { Combat.SetAmmoLock(v); Settings.AmmoLock.Value = v; }); MenuUI.Toggle("Super Strength", Combat.ImpulseBoostEnabled, delegate(bool v) { Combat.SetImpulseBoost(v); Settings.ThrowBoost.Value = v; }); MenuUI.Toggle("One-Hit Trees", Combat.TreeOneShotEnabled, delegate(bool v) { Combat.SetTreeOneShot(v); Settings.OneHitTrees.Value = v; }); _dmgMult = MenuUI.Slider("combat_dmgmult", "Damage Multiplier", _dmgMult, 0.1f, 100f, "x", delegate(float v) { _dmgMult = v; Combat.DamageMultiplier = v; Settings.SlDamageMult.Value = v; }, 1f); MenuUI.Help("Player damage is fixed at 99999. Overrides the multiplier."); MenuUI.Help("Multiplies your dealt damage. Has no effect while Insta Kill is on."); _strength = MenuUI.Slider("combat_throw", "Throw Multiplier", _strength, 1f, 100f, "x", delegate(float v) { _strength = v; Combat.ImpulseMultiplier = v; Settings.SlImpulseMult.Value = v; }, 10f); MenuUI.Header("Stealth"); MenuUI.Toggle("Invisibility", Combat.SilentToEnemies, delegate(bool v) { Combat.SetSilentToEnemies(v); Settings.Stealth.Value = v; }); MenuUI.Help("Cannibals, animals, and creepies won't see, hear, or attack you. Effectively pacifist mode."); MenuUI.Header("Kill Aura"); MenuUI.Toggle("Kill Aura", Cheats.RadialCullEnabled, delegate(bool v) { Cheats.SetRadialCull(v); Settings.RadialCull.Value = v; }); _killAuraR = MenuUI.Slider("combat_aura_r", "Aura Radius", _killAuraR, 1f, 100f, "m", delegate(float v) { _killAuraR = v; Cheats.SetRadialCullRadius(v); Settings.SlKillAuraRadius.Value = v; }, 10f); MenuUI.Help("Continuously kills every actor inside the radius. Large radii may impact performance."); MenuUI.Header("Mass Actions"); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); if (MenuUI.Button("Kill Cannibals")) { Combat.ExecCannibalSweep(); } if (MenuUI.Button("Burn Cannibals")) { Combat.ExecCannibalIgnite(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); if (MenuUI.Button("Kill Animals")) { Combat.ExecAnimalSweep(); } MenuUI.Toggle("Freeze Actors", Combat.AiPauseEnabled, Combat.SetAiPause); GUILayout.EndHorizontal(); MenuUI.Help("Pauses the entire AI simulation - all actors freeze in place."); MenuUI.Header("Self-troll"); if (MenuUI.Button("Fake Drown (self)")) { Cheats.FakeDrown(); } } public static void ResetSliders() { _strength = 10f; Combat.ImpulseMultiplier = 10f; Settings.SlImpulseMult.Value = float.NaN; _killAuraR = 10f; Cheats.SetRadialCullRadius(10f); Settings.SlKillAuraRadius.Value = float.NaN; _dmgMult = 1f; Combat.DamageMultiplier = 1f; Settings.SlDamageMult.Value = float.NaN; } } internal static class ItemsTab { private static float _lighterIntensity = 5f; private static float _flashlightIntensity = 14f; private static float _rebreatherIntensity = 5f; private static float _knightSpeed = 25f; private static float _knightJump = 6f; private static float _gliderSpeed = 30f; private static bool _initialized; public static void Draw() { if (!_initialized) { _knightSpeed = ModdedItems.KnightSpeedValue; _knightJump = ModdedItems.KnightJumpForceValue; _gliderSpeed = ModdedItems.GliderSpeedValue; if (ModdedItems.LighterIntensityValue >= 0f) { _lighterIntensity = ModdedItems.LighterIntensityValue; } if (ModdedItems.FlashlightIntensityValue >= 0f) { _flashlightIntensity = ModdedItems.FlashlightIntensityValue; } if (ModdedItems.RebreatherIntensityValue >= 0f) { _rebreatherIntensity = ModdedItems.RebreatherIntensityValue; } if (!float.IsNaN(Settings.SlLighterIntensity.Value)) { _lighterIntensity = Settings.SlLighterIntensity.Value; ModdedItems.LighterIntensity(_lighterIntensity); } if (!float.IsNaN(Settings.SlFlashlightIntensity.Value)) { _flashlightIntensity = Settings.SlFlashlightIntensity.Value; ModdedItems.FlashlightIntensity(_flashlightIntensity); } if (!float.IsNaN(Settings.SlRebreatherIntensity.Value)) { _rebreatherIntensity = Settings.SlRebreatherIntensity.Value; ModdedItems.RebreatherIntensity(_rebreatherIntensity); } if (!float.IsNaN(Settings.SlKnightSpeed.Value)) { _knightSpeed = Settings.SlKnightSpeed.Value; ModdedItems.KnightSpeed(_knightSpeed); } if (!float.IsNaN(Settings.SlKnightJump.Value)) { _knightJump = Settings.SlKnightJump.Value; ModdedItems.KnightJumpForce(_knightJump); } if (!float.IsNaN(Settings.SlGliderSpeed.Value)) { _gliderSpeed = Settings.SlGliderSpeed.Value; ModdedItems.GliderSpeed(_gliderSpeed); } ModdedItems.Init(); _initialized = true; } MenuUI.Header("Lighter"); _lighterIntensity = MenuUI.Slider("items_lighter", "Intensity", _lighterIntensity, 0f, 20f, "x", delegate(float v) { _lighterIntensity = v; ModdedItems.LighterIntensity(v); Settings.SlLighterIntensity.Value = v; }, ModdedItems.DefaultLighterIntensity); MenuUI.Toggle("Increase Range", ModdedItems.LighterRangeOn, delegate(bool v) { ModdedItems.LighterIncreaseRange(v); Settings.LighterRange.Value = v; }); MenuUI.Header("Flashlight"); _flashlightIntensity = MenuUI.Slider("items_flashlight", "Intensity", _flashlightIntensity, 0f, 100f, "x", delegate(float v) { _flashlightIntensity = v; ModdedItems.FlashlightIntensity(v); Settings.SlFlashlightIntensity.Value = v; }, ModdedItems.DefaultFlashlightIntensity); MenuUI.Toggle("No Drain", ModdedItems.FlashlightNoDrainOn, delegate(bool v) { ModdedItems.FlashlightNoDrain(v); Settings.FlashlightNoDrain.Value = v; }); MenuUI.Header("Rebreather"); _rebreatherIntensity = MenuUI.Slider("items_rebreather", "Light", _rebreatherIntensity, 0f, 20f, "x", delegate(float v) { _rebreatherIntensity = v; ModdedItems.RebreatherIntensity(v); Settings.SlRebreatherIntensity.Value = v; }, ModdedItems.DefaultRebreatherIntensity); MenuUI.Toggle("No Oxygen Drain", ModdedItems.RebreatherNoOxygenOn, delegate(bool v) { ModdedItems.RebreatherNoOxygen(v); Settings.RebreatherNoOxygen.Value = v; }); MenuUI.Header("Rope Gun"); MenuUI.Toggle("Infinite Length", ModdedItems.RopegunInfiniteOn, delegate(bool v) { ModdedItems.RopegunInfinite(v); Settings.RopegunInfinite.Value = v; }); MenuUI.Help("Rope gun never runs out of rope."); MenuUI.Header("Knight V (EUC)"); _knightSpeed = MenuUI.Slider("items_knightSpeed", "Max Speed", _knightSpeed, 1f, 200f, "", delegate(float v) { _knightSpeed = v; ModdedItems.KnightSpeed(v); Settings.SlKnightSpeed.Value = v; }, 25f); _knightJump = MenuUI.Slider("items_knightJump", "Jump Force", _knightJump, 1f, 100f, "", delegate(float v) { _knightJump = v; ModdedItems.KnightJumpForce(v); Settings.SlKnightJump.Value = v; }, 6f); MenuUI.Header("Hang Glider"); _gliderSpeed = MenuUI.Slider("items_gliderSpeed", "Speed", _gliderSpeed, 1f, 200f, "", delegate(float v) { _gliderSpeed = v; ModdedItems.GliderSpeed(v); Settings.SlGliderSpeed.Value = v; }, 30f); MenuUI.Toggle("No Downforce", ModdedItems.GliderNoDownforceOn, delegate(bool v) { ModdedItems.GliderNoDownforce(v); Settings.GliderNoDownforce.Value = v; }); MenuUI.Header("Rapid Fire"); MenuUI.Toggle("Shotgun", ModdedItems.ShotgunRapidFireOn, delegate(bool v) { ModdedItems.ShotgunRapidFire(v); Settings.ShotgunRapidFire.Value = v; }); MenuUI.Toggle("Pistol", ModdedItems.PistolRapidFireOn, delegate(bool v) { ModdedItems.PistolRapidFire(v); Settings.PistolRapidFire.Value = v; }); MenuUI.Toggle("Revolver", ModdedItems.RevolverRapidFireOn, delegate(bool v) { ModdedItems.RevolverRapidFire(v); Settings.RevolverRapidFire.Value = v; }); MenuUI.Toggle("Rifle", ModdedItems.RifleRapidFireOn, delegate(bool v) { ModdedItems.RifleRapidFire(v); Settings.RifleRapidFire.Value = v; }); MenuUI.Help("Caps your weapon's fire rate at max. May trigger anti-cheat in MP."); } public static void ResetSliders() { _lighterIntensity = ModdedItems.DefaultLighterIntensity; ModdedItems.LighterIntensity(_lighterIntensity); _flashlightIntensity = ModdedItems.DefaultFlashlightIntensity; ModdedItems.FlashlightIntensity(_flashlightIntensity); _rebreatherIntensity = ModdedItems.DefaultRebreatherIntensity; ModdedItems.RebreatherIntensity(_rebreatherIntensity); _knightSpeed = 25f; ModdedItems.KnightSpeed(25f); _knightJump = 6f; ModdedItems.KnightJumpForce(6f); _gliderSpeed = 30f; ModdedItems.GliderSpeed(30f); } } internal static class KeybindsTab { private static Vector2 _scroll; private static string _searchBuf = ""; public static void Draw() { //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Invalid comparison between Unknown and I4 //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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: Expected O, but got Unknown //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) MenuUI.Header("Keybinds"); GUILayout.Label("Bind any toggle to a key. Bound keys fire while the menu is closed only. Press Esc while capturing to cancel. Conflicts are not blocked, that's on you.", Theme.Small, (Il2CppReferenceArray)null); GUILayout.Space(4f); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label("Search", Theme.Label, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) }); _searchBuf = MenuUI.TextField("kb_search", _searchBuf, GUILayout.ExpandWidth(true), GUILayout.Height(22f)); if (MenuUI.Button("Clear", 70f)) { _searchBuf = ""; } GUILayout.EndHorizontal(); GUILayout.Space(4f); if (Keybinds.CapturingIndex >= 0 && (int)Event.current.type == 4) { KeyCode keyCode = Event.current.keyCode; if ((int)keyCode == 27) { Keybinds.CapturingIndex = -1; } else if ((int)keyCode != 0) { KeyBindEntry keyBindEntry = Keybinds.All[Keybinds.CapturingIndex]; keyBindEntry.Binding.Value = keyCode; Keybinds.CapturingIndex = -1; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(18, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Keybind '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(keyBindEntry.Name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("' set to "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(keyCode); } log.LogDebug(val); } Event.current.Use(); } string text = (string.IsNullOrWhiteSpace(_searchBuf) ? null : _searchBuf.ToLowerInvariant()); _scroll = GUILayout.BeginScrollView(_scroll, GUIStyle.none, GUI.skin.verticalScrollbar, Array.Empty()); int num = 0; for (int i = 0; i < Keybinds.All.Count; i++) { KeyBindEntry keyBindEntry2 = Keybinds.All[i]; if (text == null || keyBindEntry2.Name.ToLowerInvariant().Contains(text)) { num++; GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }); GUILayout.Label(keyBindEntry2.Name, Theme.Label, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(220f) }); string text2 = ((Keybinds.CapturingIndex == i) ? "press any key..." : (((int)keyBindEntry2.Binding.Value != 0) ? ((object)keyBindEntry2.Binding.Value/*cast due to .constrained prefix*/).ToString() : "(unbound)")); GUILayout.Label(text2, Theme.Small, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) }); GUILayout.FlexibleSpace(); if (MenuUI.Button("Set", 60f)) { Keybinds.CapturingIndex = i; } if (MenuUI.Button("Clear", 60f)) { keyBindEntry2.Binding.Value = (KeyCode)0; } GUILayout.EndHorizontal(); } } if (num == 0 && text != null) { GUILayout.Label("No matches.", Theme.Small, (Il2CppReferenceArray)null); } GUILayout.EndScrollView(); } } internal static class MpPlayersTab { private static string _nameBuf = ""; private static bool _nameInit; private static float _rosterRefreshTimer; private static readonly List _frameSnapshot = new List(); public static void Draw() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Invalid comparison between Unknown and I4 if (!_nameInit) { _nameBuf = Multiplayer.FakeSteamName; _nameInit = true; } if ((int)Event.current.type == 8) { _rosterRefreshTimer += Time.unscaledDeltaTime; if (_rosterRefreshTimer >= 1.5f) { _rosterRefreshTimer = 0f; try { Players.RefreshRoster(); } catch { } } _frameSnapshot.Clear(); foreach (RemotePlayerInfo item in Players.Roster) { _frameSnapshot.Add(item); } } MenuUI.Header("Admin Pretend"); MenuUI.Toggle("Pretend to be admin (client-side only)", Multiplayer.AdminPretend, delegate(bool v) { Multiplayer.SetAdminPretend(v); Settings.AdminPretend.Value = v; }); MenuUI.Help("Lies to your own client only - other players still see you as a regular player."); MenuUI.Header("Kick / Ban Protection"); MenuUI.Toggle("Block kick disconnect", Multiplayer.BlockKickResp, delegate(bool v) { Multiplayer.SetBlockKickResp(v); Settings.BlockKickResp.Value = v; }); MenuUI.Toggle("Block ban button", Multiplayer.BlockBanResp, delegate(bool v) { Multiplayer.SetBlockBanResp(v); Settings.BlockBanResp.Value = v; }); MenuUI.Help("Intercepts SOTF's default kick/ban UI. A dedicated anti-cheat can still kick you."); MenuUI.Header("Steam Name Mask (local view only)"); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); _nameBuf = MenuUI.TextField("mp_mask", _nameBuf, GUILayout.ExpandWidth(true), GUILayout.Height(22f)); if (MenuUI.Button("Apply", 70f)) { Multiplayer.SetFakeSteamName(_nameBuf ?? ""); } if (MenuUI.Button("Clear", 60f)) { _nameBuf = ""; Multiplayer.SetFakeSteamName(""); } GUILayout.EndHorizontal(); GUILayout.Label("Changes how your name appears on YOUR client. Other players still see your real Steam name. Steam's network signs that, we can't fake it.", Theme.Small, (Il2CppReferenceArray)null); MenuUI.Header("Save Mirror"); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); if (MenuUI.Button("Mirror MP world -> SP slot 5", 220f)) { Multiplayer.StartSaveMirror(); } GUILayout.Label(Multiplayer.SaveMirrorStatus, Theme.Small, (Il2CppReferenceArray)null); GUILayout.EndHorizontal(); MenuUI.Help("Copies the current multiplayer save to single-player slot 5 so you can continue offline."); MenuUI.Header($"Players ({_frameSnapshot.Count})"); if (_frameSnapshot.Count == 0) { GUILayout.Label("Not in a multiplayer session.", Theme.Small, (Il2CppReferenceArray)null); return; } for (int num = 0; num < _frameSnapshot.Count; num++) { DrawRosterRow(num, _frameSnapshot[num]); } } private static void DrawRosterRow(int i, RemotePlayerInfo p) { //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Expected O, but got Unknown //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Expected O, but got Unknown //IL_007d: 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_00c3: Unknown result type (might be due to invalid IL or missing references) GUILayout.BeginHorizontal((Il2CppReferenceArray)null); string text = ""; if (p.IsLocal) { text += " (you)"; } if (p.IsAdmin) { text += " [ADMIN]"; } if (!p.IsAlive) { text += " [dead]"; } GUILayout.Label(p.Name + text, Theme.Label, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(220f) }); GUILayout.Label($"{p.Position.x:0}, {p.Position.y:0}, {p.Position.z:0}", Theme.Small, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(140f) }); GUILayout.FlexibleSpace(); if (!p.IsLocal) { if (MenuUI.Button("Goto", 56f)) { Players.TeleportToPlayer(i); } if (MenuUI.Button("Bring", 56f)) { Players.BringPlayer(i); } if (MenuUI.Button("Heal", 56f)) { Players.RevivePlayer(i); } if (MenuUI.Button("Kill", 56f)) { Players.KillPlayer(i); } } if (p.SteamId != 0L) { bool flag = default(bool); if (MenuUI.Button("Copy ID", 70f)) { try { GUIUtility.systemCopyBuffer = p.SteamId.ToString(); } catch (Exception ex) { ManualLogSource log = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(9, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Copy ID: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } if (MenuUI.Button("Profile", 70f)) { try { Application.OpenURL($"https://steamcommunity.com/profiles/{p.SteamId}"); } catch (Exception ex2) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(14, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Open profile: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex2.Message); } log2.LogError(val); } } } GUILayout.EndHorizontal(); } } internal static class PlayerMoveTab { private static float _walk = 5f; private static float _run = 8f; private static float _swim = 4f; private static float _jump = 1f; private static float _charScale = 1f; private static float _gravity = -9.81f; private static float _jumpPower = 1f; private static bool _init; public static void Draw() { if (!_init && (Object)(object)LocalPlayer._instance != (Object)null) { _walk = PlayerTweaks.CurrentWalkSpeed; _run = PlayerTweaks.CurrentRunSpeed; _swim = PlayerTweaks.CurrentSwimSpeed; _jump = PlayerTweaks.CurrentJumpMultiplier; _charScale = Cheats.BodyScale; _gravity = Cheats.GravityScalar; _jumpPower = Cheats.JumpForceScalar; if (!float.IsNaN(Settings.SlWalkSpeed.Value)) { _walk = Settings.SlWalkSpeed.Value; PlayerTweaks.SetWalkSpeed(_walk); } if (!float.IsNaN(Settings.SlRunSpeed.Value)) { _run = Settings.SlRunSpeed.Value; PlayerTweaks.SetRunSpeed(_run); } if (!float.IsNaN(Settings.SlSwimSpeed.Value)) { _swim = Settings.SlSwimSpeed.Value; PlayerTweaks.SetSwimSpeed(_swim); } if (!float.IsNaN(Settings.SlJumpMult.Value)) { _jump = Settings.SlJumpMult.Value; PlayerTweaks.SetJumpMultiplier(_jump); } if (!float.IsNaN(Settings.SlPlayerSize.Value)) { _charScale = Settings.SlPlayerSize.Value; Cheats.SetBodyScale(_charScale); } if (!float.IsNaN(Settings.SlGravity.Value)) { _gravity = Settings.SlGravity.Value; Cheats.SetGravityScalar(_gravity); } if (!float.IsNaN(Settings.SlJumpPower.Value)) { _jumpPower = Settings.SlJumpPower.Value; Cheats.SetJumpForceScalar(_jumpPower); } if (!float.IsNaN(Settings.SlNoClipSpeed.Value)) { PhantomFly.Speed = Settings.SlNoClipSpeed.Value; } _init = true; } MenuUI.Header("Movement Speed"); _walk = MenuUI.Slider("move_walk", "Walk", _walk, 1f, 50f, "", delegate(float v) { PlayerTweaks.SetWalkSpeed(v); Settings.SlWalkSpeed.Value = v; }, PlayerTweaks.DefaultWalkSpeed); _run = MenuUI.Slider("move_run", "Run", _run, 1f, 50f, "", delegate(float v) { PlayerTweaks.SetRunSpeed(v); Settings.SlRunSpeed.Value = v; }, PlayerTweaks.DefaultRunSpeed); _swim = MenuUI.Slider("move_swim", "Swim", _swim, 1f, 50f, "", delegate(float v) { PlayerTweaks.SetSwimSpeed(v); Settings.SlSwimSpeed.Value = v; }, PlayerTweaks.DefaultSwimSpeed); _jump = MenuUI.Slider("move_jump", "Jump", _jump, 0f, 50f, "x", delegate(float v) { PlayerTweaks.SetJumpMultiplier(v); Settings.SlJumpMult.Value = v; }, PlayerTweaks.DefaultJumpMultiplier); MenuUI.Toggle("Speedy Run (toggle)", Cheats.RushModeOn, Cheats.SetRushMode); MenuUI.Header("NoClip / Fly"); MenuUI.Toggle("NoClip", PhantomFly.Enabled, PhantomFly.SetEnabled); float speed = PhantomFly.Speed; speed = MenuUI.Slider("move_noclip_speed", "Speed", speed, 1f, 50f, "", delegate(float v) { PhantomFly.Speed = v; Settings.SlNoClipSpeed.Value = v; }, 10f); MenuUI.Help("W/A/S/D move · Space up · LCtrl down · LShift boost 2x"); MenuUI.Header("Player Size"); _charScale = MenuUI.Slider("move_size", "Size", _charScale, 0.2f, 50f, "x", delegate(float v) { _charScale = v; Cheats.SetBodyScale(v); Settings.SlPlayerSize.Value = v; }, 1f); MenuUI.Header("Gravity & Jump Power"); MenuUI.Toggle("No Gravity", Worldcraft.IsNoGravity, Worldcraft.NoGravity); _gravity = MenuUI.Slider("move_gravity", "Gravity", _gravity, -30f, 5f, "", delegate(float v) { _gravity = v; Cheats.SetGravityScalar(v); Settings.SlGravity.Value = v; }, -9.81f); _jumpPower = MenuUI.Slider("move_jumpPower", "Jump Power", _jumpPower, 0.5f, 50f, "x", delegate(float v) { _jumpPower = v; Cheats.SetJumpForceScalar(v); Settings.SlJumpPower.Value = v; }, 1f); MenuUI.Header("Equip Armour"); MenuUI.Help("Click a button to equip a full set of that armor type instantly."); for (int num = 0; num < PlayerTweaks.ArmourTypes.Length; num += 3) { GUILayout.BeginHorizontal((Il2CppReferenceArray)null); for (int num2 = 0; num2 < 3 && num + num2 < PlayerTweaks.ArmourTypes.Length; num2++) { string text = PlayerTweaks.ArmourTypes[num + num2]; if (MenuUI.Button(PlayerTweaks.ArmourLabel(text))) { PlayerTweaks.EquipArmour(text); } } GUILayout.EndHorizontal(); } } public static void ResetSliders() { _walk = PlayerTweaks.DefaultWalkSpeed; PlayerTweaks.SetWalkSpeed(_walk); _run = PlayerTweaks.DefaultRunSpeed; PlayerTweaks.SetRunSpeed(_run); _swim = PlayerTweaks.DefaultSwimSpeed; PlayerTweaks.SetSwimSpeed(_swim); _jump = PlayerTweaks.DefaultJumpMultiplier; PlayerTweaks.SetJumpMultiplier(_jump); PhantomFly.Speed = 10f; _charScale = 1f; Cheats.SetBodyScale(1f); _gravity = -9.81f; Cheats.SetGravityScalar(-9.81f); _jumpPower = 1f; Cheats.SetJumpForceScalar(1f); } } internal static class PlayerStatsTab { public static void Draw() { MenuUI.Header("Survival"); MenuUI.Toggle("God Mode", SurvivalState.InvulnerableMode, delegate(bool v) { SurvivalState.InvulnerableMode = v; PlayerTweaks.SetInvincible(v); Settings.Invincible.Value = v; }); MenuUI.Toggle("Infinite Stamina", SurvivalState.InfiniteEnergy, delegate(bool v) { SurvivalState.InfiniteEnergy = v; PlayerTweaks.InfiniteStamina(v); Settings.InfStam.Value = v; }); MenuUI.Toggle("No Hunger", SurvivalState.HungerOff, delegate(bool v) { SurvivalState.HungerOff = v; PlayerTweaks.NoHunger(v); Settings.NoHunger.Value = v; }); MenuUI.Toggle("No Thirst", SurvivalState.ThirstOff, delegate(bool v) { SurvivalState.ThirstOff = v; PlayerTweaks.NoThirst(v); Settings.NoThirst.Value = v; }); MenuUI.Toggle("No Sleep Loss", SurvivalState.SleepOff, delegate(bool v) { SurvivalState.SleepOff = v; PlayerTweaks.NoSleepLoss(v); Settings.NoSleep.Value = v; }); MenuUI.Toggle("No Fall Damage", SurvivalState.FallShield, delegate(bool v) { SurvivalState.FallShield = v; PlayerTweaks.NoFallDamage(v); Settings.NoFall.Value = v; }); MenuUI.Header("Continuous Heal"); MenuUI.Toggle("Infinite Heal", Cheats.ContinuousHealOn, delegate(bool v) { Cheats.SetContinuousHeal(v); Settings.InfHeal.Value = v; }); MenuUI.Toggle("Inf Lung Capacity", Cheats.LungReplenishOn, delegate(bool v) { Cheats.SetLungReplenish(v); Settings.InfLungCapacity.Value = v; }); MenuUI.Toggle("No Cold", Cheats.ColdImmunityOn, delegate(bool v) { Cheats.SetColdImmunity(v); Settings.NoCold.Value = v; }); MenuUI.Help("Continuous Heal regenerates HP every tick. Inf Lung lets you hold breath forever. No Cold ignores temperature."); MenuUI.Header("Stat Refill"); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); if (MenuUI.Button("Hunger")) { PlayerTweaks.RefillHunger(); } if (MenuUI.Button("Thirst")) { PlayerTweaks.RefillThirst(); } if (MenuUI.Button("Sleep")) { PlayerTweaks.RefillSleep(); } if (MenuUI.Button("Stamina")) { PlayerTweaks.RefillStamina(); } GUILayout.EndHorizontal(); MenuUI.Help("Fills the matching stat bar instantly."); MenuUI.Header("Status Effects"); MenuUI.Help("Apply the game's built-in status effects to yourself. Useful for testing or video recording."); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); if (MenuUI.Button("Burn")) { StatusEffects.Burn(); } if (MenuUI.Button("Stop Burn")) { StatusEffects.StopBurn(); } if (MenuUI.Button("Poison")) { StatusEffects.Poison(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); if (MenuUI.Button("Skunk Spray")) { StatusEffects.SkunkSpray(); } if (MenuUI.Button("Clear Skunk")) { StatusEffects.ClearSkunk(); } if (MenuUI.Button("Adrenaline Rush")) { StatusEffects.Adrenaline(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); if (MenuUI.Button("Get Muddy")) { StatusEffects.GetMuddy(); } if (MenuUI.Button("Get Bloody")) { StatusEffects.GetBloody(); } if (MenuUI.Button("Clean Up")) { StatusEffects.CleanUp(); } GUILayout.EndHorizontal(); } } internal static class SurvivalState { public static bool InvulnerableMode; public static bool InfiniteEnergy; public static bool HungerOff; public static bool ThirstOff; public static bool SleepOff; public static bool FallShield; } internal static class SpawnTab { private static string _searchBuf = ""; private static string _amountBuf = "1"; private static string _actorBuf = "Cannibal_Male_Painted"; private static bool _dropInWorld; private static Spawning.ItemCategory _cat = Spawning.ItemCategory.All; private static List<(string name, int id)> _searchResults = new List<(string, int)>(); private static Vector2 _scroll; private static float _animalMult = 1f; private static bool _spawnAtCursor; private static bool _init; public static void InvalidateItemCache() { _searchResults.Clear(); } public static void Draw() { //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) if (!_init) { _animalMult = Cheats.WildlifeSpawnMul; if (!float.IsNaN(Settings.SlAnimalMult.Value)) { _animalMult = Settings.SlAnimalMult.Value; Cheats.SetWildlifeSpawnMul(_animalMult); } _init = true; } MenuUI.Header("Item Spawner"); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label("Search", Theme.Label, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) }); string searchBuf = _searchBuf; _searchBuf = MenuUI.TextField("spawn_search", _searchBuf, GUILayout.ExpandWidth(true), GUILayout.Height(22f)); if (_searchBuf != searchBuf) { _searchResults = Spawning.SearchItems(_searchBuf, _cat, 9999); } GUILayout.EndHorizontal(); if (_searchResults.Count == 0) { _searchResults = ((string.IsNullOrEmpty(_searchBuf) && _cat == Spawning.ItemCategory.All) ? Spawning.AllItems(9999) : Spawning.SearchItems(_searchBuf, _cat, 9999)); } Spawning.ItemCategory[] array = (Spawning.ItemCategory[])Enum.GetValues(typeof(Spawning.ItemCategory)); for (int i = 0; i < array.Length; i += 3) { GUILayout.BeginHorizontal((Il2CppReferenceArray)null); for (int j = 0; j < 3 && i + j < array.Length; j++) { Spawning.ItemCategory itemCategory = array[i + j]; if (GUILayout.Button(CatLabel(itemCategory), Theme.Button, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(180f), GUILayout.Height(24f) })) { _cat = itemCategory; _searchResults = Spawning.SearchItems(_searchBuf, _cat, 9999); } if (itemCategory == _cat) { Rect lastRect = GUILayoutUtility.GetLastRect(); GUI.DrawTexture(new Rect(((Rect)(ref lastRect)).x, ((Rect)(ref lastRect)).yMax - 2f, ((Rect)(ref lastRect)).width, 2f), (Texture)(object)Theme.AccentTex); } } GUILayout.EndHorizontal(); } GUILayout.Space(6f); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label("Amount", Theme.Label, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) }); _amountBuf = MenuUI.TextField("spawn_amount", _amountBuf, GUILayout.Width(70f), GUILayout.Height(22f)); GUILayout.Space(8f); if (MenuUI.Button("1", 36f)) { _amountBuf = "1"; } if (MenuUI.Button("10", 36f)) { _amountBuf = "10"; } if (MenuUI.Button("50", 36f)) { _amountBuf = "50"; } if (MenuUI.Button("100", 40f)) { _amountBuf = "100"; } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); MenuUI.Toggle("Drop in world", _dropInWorld, delegate(bool v) { _dropInWorld = v; }); MenuUI.Toggle("Spawn at cursor", _spawnAtCursor, delegate(bool v) { _spawnAtCursor = v; }); MenuUI.Help("Search then click Spawn. Drop in world bypasses inventory stack limits. Spawn at cursor places the item where you're aiming."); GUILayout.Space(4f); if (_searchResults != null && _searchResults.Count > 0) { int.TryParse(_amountBuf, out var result); if (result < 1) { result = 1; } float num = Mathf.Min(320f, 28f * (float)_searchResults.Count + 8f); _scroll = GUILayout.BeginScrollView(_scroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(num) }); for (int num2 = 0; num2 < _searchResults.Count; num2++) { (string, int) tuple = _searchResults[num2]; GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }); GUILayout.Label(tuple.Item1, Theme.Label, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); GUILayout.Label($"#{tuple.Item2}", Theme.Small, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) }); if (MenuUI.Button($"Spawn x{result}", 96f)) { if (_spawnAtCursor) { Spawning.SpawnItemAtCursor(tuple.Item2, result); } else if (_dropInWorld) { Spawning.SpawnItemInWorld(tuple.Item2, result); } else { Spawning.SpawnItem(tuple.Item2, result); } } GUILayout.Space(8f); GUILayout.EndHorizontal(); } GUILayout.EndScrollView(); } else if (!string.IsNullOrEmpty(_searchBuf) || _cat != Spawning.ItemCategory.All) { GUILayout.Label("No items match.", Theme.Small, (Il2CppReferenceArray)null); } MenuUI.Header("Bulk Items"); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); if (MenuUI.Button("Add All Items")) { Cheats.AddAllItems(); } if (MenuUI.Button("Index Spawnable Items")) { Cheats.IndexSpawnableItems(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); if (MenuUI.Button("Give Chainsaw")) { Cheats.GiveChainsaw(); } if (MenuUI.Button("Give Katana")) { Cheats.GiveKatana(); } if (MenuUI.Button("Give Shotgun")) { Cheats.GiveShotgun(); } GUILayout.EndHorizontal(); MenuUI.Help("Add All Items stuffs every spawnable item into your inventory. Index Spawnable Items rebuilds the database list first."); MenuUI.Header("Vehicles"); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); if (MenuUI.Button("Knight V (EUC)")) { Spawning.GiveKnightV(); } if (MenuUI.Button("Hang Glider")) { Spawning.GiveHangGlider(); } GUILayout.EndHorizontal(); if (MenuUI.Button("Spawn Golf Cart (MP-only)")) { Spawning.SpawnGolfCart(); } MenuUI.Header("Actors / NPCs"); MenuUI.Help("Spawn NPCs by name. Use the exact class spelling (see the quick-spawn buttons). Remove Kelvin / Virginia wipes them from the world."); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label("Name", Theme.Label, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) }); _actorBuf = MenuUI.TextField("spawn_actor", _actorBuf, GUILayout.ExpandWidth(true), GUILayout.Height(22f)); if (MenuUI.Button("Spawn", 70f)) { Spawning.SpawnActor(_actorBuf); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); if (MenuUI.Button("Remove Kelvin")) { Spawning.RemoveKelvin(); } if (MenuUI.Button("Remove Virginia")) { Spawning.RemoveVirginia(); } GUILayout.EndHorizontal(); GUILayout.Label("Quick spawns:", Theme.Small, (Il2CppReferenceArray)null); for (int num3 = 0; num3 < Spawning.CommonActors.Length; num3 += 2) { GUILayout.BeginHorizontal((Il2CppReferenceArray)null); for (int num4 = 0; num4 < 2 && num3 + num4 < Spawning.CommonActors.Length; num4++) { string text = Spawning.CommonActors[num3 + num4]; if (MenuUI.Button(text)) { _actorBuf = text; Spawning.SpawnActor(text); } } GUILayout.EndHorizontal(); } MenuUI.Header("Animal Spawning"); _animalMult = MenuUI.Slider("spawn_animalMult", "Animal Mult", _animalMult, 0f, 100f, "x", delegate(float v) { _animalMult = v; Cheats.SetWildlifeSpawnMul(v); Settings.SlAnimalMult.Value = v; }, 1f); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); if (MenuUI.Button("Insane Animal Spawns")) { Cheats.InsaneAnimalSpawns(); _animalMult = Cheats.WildlifeSpawnMul; } if (MenuUI.Button("Creepy Attack Party")) { Cheats.CreepyAttackParty(); } GUILayout.EndHorizontal(); MenuUI.Help("Animal Mult scales wildlife spawn rate. Insane Animal Spawns maxes it out. Creepy Attack Party triggers a Creepy wave."); } public static void ResetSliders() { _animalMult = 1f; Cheats.SetWildlifeSpawnMul(1f); } private static string CatLabel(Spawning.ItemCategory c) { return c switch { Spawning.ItemCategory.All => "All", Spawning.ItemCategory.Weapon => "Weapon", Spawning.ItemCategory.Ammo => "Ammo", Spawning.ItemCategory.Edible => "Edible", Spawning.ItemCategory.Clothing => "Clothing", Spawning.ItemCategory.CraftingMaterial => "Crafting", Spawning.ItemCategory.StructureBlueprint => "Build", Spawning.ItemCategory.Special => "Special", Spawning.ItemCategory.Other => "Other", _ => c.ToString(), }; } } internal static class TeleportTab { private static string _wpNameBuf = ""; private static string _gotoBuf = ""; private static string _newFolderBuf = ""; private static int _saveFolderIdx; private static Dictionary _expandedFolders = new Dictionary(); private static Dictionary _expandedColors = new Dictionary(); private static Vector2 _scroll; public static void Draw() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Expected O, but got Unknown //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046e: Unknown result type (might be due to invalid IL or missing references) //IL_04a2: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_05ee: Unknown result type (might be due to invalid IL or missing references) //IL_05f3: Unknown result type (might be due to invalid IL or missing references) //IL_0636: Unknown result type (might be due to invalid IL or missing references) //IL_06bf: Unknown result type (might be due to invalid IL or missing references) //IL_0748: Unknown result type (might be due to invalid IL or missing references) //IL_0794: Unknown result type (might be due to invalid IL or missing references) Vector3 playerPosition = Teleport.PlayerPosition; MenuUI.Header("Position"); GUILayout.Label($"Pos: {playerPosition.x:0.0}, {playerPosition.y:0.0}, {playerPosition.z:0.0}", Theme.Small, (Il2CppReferenceArray)null); MenuUI.Header("Quick Teleport"); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label("Item", Theme.Label, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) }); _gotoBuf = MenuUI.TextField("tp_goto", _gotoBuf, GUILayout.ExpandWidth(true), GUILayout.Height(22f)); if (MenuUI.Button("Go To", 70f)) { Players.GotoItemByName(_gotoBuf); } GUILayout.EndHorizontal(); MenuUI.Toggle("Look Teleport (RMB)", Players.RaycastEnabled, Players.RaycastTeleport); MenuUI.Help("While on, right-click teleports you to where you're looking."); if (MenuUI.Button(Map.Show ? "Close Map Window" : "Open Interactive Map")) { Map.Toggle(); } MenuUI.Header("Waypoints"); MenuUI.Help("Waypoints save to BepInEx/config/AdminMenu_waypoints.json. Restored on launch."); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label("Folder", Theme.Label, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) }); _newFolderBuf = MenuUI.TextField("tp_newFolder", _newFolderBuf, GUILayout.ExpandWidth(true), GUILayout.Height(22f)); if (MenuUI.Button("New Folder", 100f)) { Teleport.CreateFolder(_newFolderBuf); _newFolderBuf = ""; } if (MenuUI.Button("Open Folder", 100f)) { try { Application.OpenURL("file:///" + Path.GetDirectoryName(Teleport.SavePath).Replace('\\', '/')); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(9, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("OpenURL: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } GUILayout.EndHorizontal(); if (_saveFolderIdx >= Teleport.Folders.Count) { _saveFolderIdx = 0; } GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label("Name", Theme.Label, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) }); _wpNameBuf = MenuUI.TextField("tp_wpName", _wpNameBuf, GUILayout.ExpandWidth(true), GUILayout.Height(22f)); string arg = ((Teleport.Folders.Count > 0) ? Teleport.Folders[_saveFolderIdx].Name : "Default"); if (MenuUI.Button($"in: {arg}", 110f)) { _saveFolderIdx = (_saveFolderIdx + 1) % Math.Max(1, Teleport.Folders.Count); } if (MenuUI.Button("Save", 70f)) { Teleport.SaveCurrent(_wpNameBuf, _saveFolderIdx); _wpNameBuf = ""; } GUILayout.EndHorizontal(); _scroll = GUILayout.BeginScrollView(_scroll, Array.Empty()); for (int i = 0; i < Teleport.Folders.Count; i++) { Teleport.Folder folder = Teleport.Folders[i]; if (!_expandedFolders.TryGetValue(i, out var value)) { value = i == 0; _expandedFolders[i] = value; } GUILayout.BeginHorizontal((Il2CppReferenceArray)null); if (MenuUI.Button((value ? "▼ " : "▶ ") + folder.Name + $" ({folder.SavedSpots.Count})")) { _expandedFolders[i] = !value; } if (i > 0 && MenuUI.Button("X", 30f)) { Teleport.RemoveFolder(i); break; } GUILayout.EndHorizontal(); if (!_expandedFolders[i]) { continue; } for (int j = 0; j < folder.SavedSpots.Count; j++) { Teleport.SavedSpot savedSpot = folder.SavedSpots[j]; int key = i * 1000 + j; GUILayout.BeginHorizontal((Il2CppReferenceArray)null); Color color = GUI.color; GUI.color = savedSpot.Color; GUI.DrawTexture(GUILayoutUtility.GetRect(14f, 14f, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(14f), GUILayout.Height(14f) }), (Texture)(object)Texture2D.whiteTexture); GUI.color = color; GUILayout.Label($"{savedSpot.Name} ({savedSpot.Pos.x:0}, {savedSpot.Pos.y:0}, {savedSpot.Pos.z:0})", Theme.Small, (Il2CppReferenceArray)null); GUILayout.FlexibleSpace(); if (MenuUI.Button("Color", 50f)) { _expandedColors[key] = !(_expandedColors.TryGetValue(key, out var value2) && value2); } if (MenuUI.Button("TP", 50f)) { Teleport.TeleportTo(i, j); } if (MenuUI.Button("X", 30f)) { Teleport.RemoveAt(i, j); break; } GUILayout.EndHorizontal(); if (_expandedColors.TryGetValue(key, out var value3) && value3) { Color color2 = savedSpot.Color; color2.r = MenuUI.Slider($"wp_r_{i}_{j}", "R", color2.r, 0f, 1f, "", delegate { }); color2.g = MenuUI.Slider($"wp_g_{i}_{j}", "G", color2.g, 0f, 1f, "", delegate { }); color2.b = MenuUI.Slider($"wp_b_{i}_{j}", "B", color2.b, 0f, 1f, "", delegate { }); Teleport.SetSavedSpotColor(i, j, color2); } } } GUILayout.EndScrollView(); } } internal static class UtilHelpTab { private static float _uiScale; private static bool _uiScaleInit; public static void Draw() { MenuUI.Header("Achievements"); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); if (MenuUI.Button("Unlock All")) { Achievements.UnlockAll(); } if (MenuUI.Button("Lock All")) { Achievements.LockAll(); } GUILayout.EndHorizontal(); MenuUI.Header("Display"); if (!_uiScaleInit) { _uiScale = Settings.UiScale.Value; _uiScaleInit = true; } _uiScale = MenuUI.Slider("util_uiScale", "UI Scale", _uiScale, 0.75f, 3f, "x", delegate(float v) { _uiScale = v; Settings.UiScale.Value = v; }, 1f); MenuUI.Help("Scales the entire menu. Try 1.5x-2.0x on 4K screens. Updates live."); MenuUI.Header("Item Dump"); if (MenuUI.Button("Dump Items to File")) { ItemDump.DumpItemsToFile(); } if (!string.IsNullOrEmpty(ItemDump.LastPath)) { GUILayout.Label($"Last: {ItemDump.LastPath}", Theme.Small, (Il2CppReferenceArray)null); } MenuUI.Header("Utility"); if (MenuUI.Button("Fix Stuck Mouse")) { Cheats.FixStuckMouse(); } MenuUI.Header("Auto-save"); MenuUI.Toggle("Re-apply toggles on save load", Settings.AutoApplyOnLoad.Value, delegate(bool v) { Settings.AutoApplyOnLoad.Value = v; }); MenuUI.Help("On: toggles restore when a save loads. Off: each session starts clean."); MenuUI.Header("Reset"); MenuUI.Help("Turns every toggle off, restores every slider default, clears the saved config."); if (MenuUI.Button("Reset All")) { Persist.ResetAll(); } MenuUI.Header("Danger Zone"); if (MenuUI.Button("Trigger Game Over (HOST)")) { Cheats.TriggerGameOver(); } MenuUI.Help("Ends the current game session. Host-only. Cannot be undone."); MenuUI.Header("Hotkeys"); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label("Toggle menu", Theme.Label, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(170f) }); GUILayout.Label("Tab", Theme.Small, (Il2CppReferenceArray)null); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label("WorldEdit grab", Theme.Label, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(170f) }); GUILayout.Label("E (when WorldEdit active)", Theme.Small, (Il2CppReferenceArray)null); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label("Raycast TP", Theme.Label, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(170f) }); GUILayout.Label("RMB (when toggle on)", Theme.Small, (Il2CppReferenceArray)null); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label("Map teleport", Theme.Label, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(170f) }); GUILayout.Label("RMB on map window", Theme.Small, (Il2CppReferenceArray)null); GUILayout.EndHorizontal(); MenuUI.Header("About"); GUILayout.Label("AdminMenu v2.0.5", Theme.Label, (Il2CppReferenceArray)null); GUILayout.Label("BepInEx 6 IL2CPP plugin. Drag the title bar to move the window.", Theme.Small, (Il2CppReferenceArray)null); } } internal static class VisualTab { private static float _maxDist = 200f; private static float _taaSharp; private static float _taaAnti; private static bool _init; public static void Draw() { if (!_init) { _maxDist = Esp.MaxDistance; try { GraphicsTweaks.RefreshFromCamera(); } catch { } _taaSharp = GraphicsTweaks.TaaSharpness; _taaAnti = GraphicsTweaks.TaaAntiFlicker; if (!float.IsNaN(Settings.SlEspMaxDistance.Value)) { _maxDist = Settings.SlEspMaxDistance.Value; Esp.MaxDistance = _maxDist; } if (!float.IsNaN(Settings.SlTaaSharp.Value)) { _taaSharp = Settings.SlTaaSharp.Value; GraphicsTweaks.SetTaaSharpness(_taaSharp); } if (!float.IsNaN(Settings.SlTaaAnti.Value)) { _taaAnti = Settings.SlTaaAnti.Value; GraphicsTweaks.SetTaaAntiFlicker(_taaAnti); } _init = true; } MenuUI.Header("ESP"); MenuUI.Toggle("Hostile ESP", Esp.ActorEsp, delegate(bool v) { Esp.ActorEsp = v; Settings.ActorEsp.Value = v; }); MenuUI.Toggle("Animal ESP", Esp.AnimalEsp, delegate(bool v) { Esp.AnimalEsp = v; Settings.AnimalEsp.Value = v; }); MenuUI.Toggle("Player ESP", Esp.PlayerEsp, delegate(bool v) { Esp.PlayerEsp = v; Settings.PlayerEsp.Value = v; }); MenuUI.Toggle("Radar (corner)", Esp.RadarEsp, delegate(bool v) { Esp.RadarEsp = v; Settings.RadarEsp.Value = v; }); MenuUI.Toggle("Waypoint ESP", Esp.WaypointEsp, delegate(bool v) { Esp.WaypointEsp = v; Settings.WaypointEsp.Value = v; }); MenuUI.Toggle("Item ESP", Esp.ItemEsp, delegate(bool v) { Esp.ItemEsp = v; Settings.ItemEsp.Value = v; if (v) { ItemEspScanner.Refresh(); } }); MenuUI.Toggle("Container ESP", Esp.ContainerEsp, delegate(bool v) { Esp.ContainerEsp = v; Settings.ContainerEsp.Value = v; if (v) { ItemEspScanner.Refresh(); } }); MenuUI.Toggle("Collectible ESP", Esp.CollectibleEsp, delegate(bool v) { Esp.CollectibleEsp = v; Settings.CollectibleEsp.Value = v; if (v) { ItemEspScanner.Refresh(); } }); MenuUI.Toggle("Show Dead", Esp.ShowDead, delegate(bool v) { Esp.ShowDead = v; Settings.ShowDead.Value = v; }); MenuUI.Toggle("Death Pin (auto waypoint)", Cheats.DeathPinOn, delegate(bool v) { Cheats.SetDeathPin(v); Settings.DeathPin.Value = v; }); _maxDist = MenuUI.Slider("vis_dist", "Max Distance", _maxDist, 50f, 1000f, "m", delegate(float v) { _maxDist = v; Esp.MaxDistance = v; Settings.SlEspMaxDistance.Value = v; }, 200f); MenuUI.Header("HUD"); MenuUI.Toggle("Center Crosshair", Cheats.CenterReticleOn, delegate(bool v) { Cheats.SetCenterReticle(v); Settings.CenterCrosshair.Value = v; }); MenuUI.Toggle("Cave Light", Cheats.CaveBrightnessOn, delegate(bool v) { Cheats.SetCaveBrightness(v); Settings.CaveLight.Value = v; }); MenuUI.Header("Camera"); MenuUI.Toggle("Free Camera", Cheats.DetachedViewOn, Cheats.SetDetachedView); MenuUI.Toggle("Capsule Mode", Cheats.CapsuleViewOn, Cheats.SetCapsuleView); MenuUI.Header("TAA"); _taaSharp = MenuUI.Slider("vis_taa_sharp", "Sharpness", _taaSharp, 0f, 2f, "", delegate(float v) { _taaSharp = v; GraphicsTweaks.SetTaaSharpness(v); Settings.SlTaaSharp.Value = v; }, GraphicsTweaks.OriginalTaaSharpness); _taaAnti = MenuUI.Slider("vis_taa_anti", "Anti-flicker", _taaAnti, 0f, 1f, "", delegate(float v) { _taaAnti = v; GraphicsTweaks.SetTaaAntiFlicker(v); Settings.SlTaaAnti.Value = v; }, GraphicsTweaks.OriginalTaaAntiFlicker); MenuUI.Header("World Edit"); MenuUI.Toggle("World Edit Mode", WorldEdit.Enabled, WorldEdit.SetEnabled); GUILayout.Label(string.Format("Aim at object, press E to grab. Active: {0}\n↑/↓: move Y · Q/R: rotate · ←/->: cycle axis (current={1})\nScroll: scale · Ctrl/Caps: snap to player · Del: destroy · RMB: release", ((Object)(object)WorldEdit.ActiveObject != (Object)null) ? ((Object)WorldEdit.ActiveObject).name : "(none)", WorldEdit.RotationAxis), Theme.Small, (Il2CppReferenceArray)null); } public static void ResetSliders() { _maxDist = 200f; Esp.MaxDistance = 200f; _taaSharp = GraphicsTweaks.OriginalTaaSharpness; GraphicsTweaks.SetTaaSharpness(_taaSharp); _taaAnti = GraphicsTweaks.OriginalTaaAntiFlicker; GraphicsTweaks.SetTaaAntiFlicker(_taaAnti); } } internal static class WorldBuildTab { public static void Draw() { MenuUI.Header("Build Cheats"); MenuUI.Toggle("Creative Mode", Worldcraft.FreeCraftFlag, Worldcraft.SetFreeCraftFlag); MenuUI.Toggle("Instant Build", Worldcraft.InstantPlace, Worldcraft.SetInstantPlace); MenuUI.Toggle("Infinite Build", Cheats.BuildResourceLockOn, Cheats.SetBuildResourceLock); MenuUI.Toggle("Infinite Logs", Cheats.LogResourceLockOn, Cheats.SetLogResourceLock); MenuUI.Help("Creative: build for free. Instant: skip the hammer animation. Inf Build/Logs: no resource cost."); MenuUI.Header("World Actions"); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); if (MenuUI.Button("Force Save")) { Worldcraft.ForceSave(); } if (MenuUI.Button("Kill All Enemies")) { Worldcraft.KillAllEnemies(); } GUILayout.EndHorizontal(); MenuUI.Help("Forces a save to your current slot. Use it before risky stuff in case of a crash."); MenuUI.Header("Danger Zone"); if (MenuUI.Button("Clear All Structures")) { Cheats.ClearAllStructures(); } MenuUI.Help("Permanently removes every player-built structure. Cannot be undone - save first."); } } internal static class WorldClimateTab { private static float _hour = 12f; private static float _timeMul = 1f; private static float _wind; private static float _sun = 1f; private static float _sunR = 1f; private static float _sunG = 1f; private static float _sunB = 1f; private static string _dayBuf = "1"; private static bool _init; public static void Draw() { //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Expected O, but got Unknown if (!_init) { try { _hour = Worldcraft.CurrentHour; } catch { _hour = 12f; } if (!float.IsNaN(Settings.SlTimeMul.Value)) { _timeMul = Settings.SlTimeMul.Value; Worldcraft.SetTimeMultiplier(_timeMul); } if (!float.IsNaN(Settings.SlWind.Value)) { _wind = Settings.SlWind.Value; Worldcraft.SetWindIntensity(_wind); } if (!float.IsNaN(Settings.SlSun.Value)) { _sun = Settings.SlSun.Value; Worldcraft.SetSunIntensity(_sun); } if (!float.IsNaN(Settings.SlSunR.Value)) { _sunR = Settings.SlSunR.Value; Worldcraft.SetSunColorR(_sunR); } if (!float.IsNaN(Settings.SlSunG.Value)) { _sunG = Settings.SlSunG.Value; Worldcraft.SetSunColorG(_sunG); } if (!float.IsNaN(Settings.SlSunB.Value)) { _sunB = Settings.SlSunB.Value; Worldcraft.SetSunColorB(_sunB); } _init = true; } MenuUI.Header("Time of Day"); MenuUI.Toggle("Lock Time of Day", Worldcraft.LockTime, delegate(bool v) { Worldcraft.ApplyLockTime(v, _hour); }); _hour = MenuUI.Slider("clim_hour", "Hour", _hour, 0f, 24f, "h", delegate(float v) { _hour = v; Worldcraft.SetTimeOfDay(v); }, 12f); _timeMul = MenuUI.Slider("clim_timeMul", "Time Speed", _timeMul, 0f, 10f, "x", delegate(float v) { _timeMul = v; Worldcraft.SetTimeMultiplier(v); Settings.SlTimeMul.Value = v; }, 1f); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label("Day", Theme.Label, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) }); _dayBuf = MenuUI.TextField("clim_day", _dayBuf, GUILayout.Width(80f), GUILayout.Height(22f)); if (MenuUI.Button("Set Day", 90f)) { if (int.TryParse(_dayBuf, out var result)) { Worldcraft.SetDay(result); } else { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(18, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SetDay: invalid '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(_dayBuf); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("'"); } log.LogWarning(val); } } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); MenuUI.Header("Time Presets"); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); if (MenuUI.Button("Morning (6)")) { _hour = 6f; Worldcraft.SetTimeOfDay(6f); } if (MenuUI.Button("Noon (12)")) { _hour = 12f; Worldcraft.SetTimeOfDay(12f); } if (MenuUI.Button("Sunset (18)")) { _hour = 18f; Worldcraft.SetTimeOfDay(18f); } if (MenuUI.Button("Midnight (0)")) { _hour = 0f; Worldcraft.SetTimeOfDay(0f); } GUILayout.EndHorizontal(); MenuUI.Header("Seasons"); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); if (MenuUI.Button("Spring")) { Worldcraft.SetSpring(); } if (MenuUI.Button("Summer")) { Worldcraft.SetSummer(); } if (MenuUI.Button("Autumn")) { Worldcraft.SetAutumn(); } if (MenuUI.Button("Winter")) { Worldcraft.SetWinter(); } GUILayout.EndHorizontal(); MenuUI.Header("Wind & Sun"); _wind = MenuUI.Slider("clim_wind", "Wind", _wind, 0f, 1f, "", delegate(float v) { _wind = v; Worldcraft.SetWindIntensity(v); Settings.SlWind.Value = v; }, 0f); _sun = MenuUI.Slider("clim_sun", "Sun", _sun, 0f, 3f, "x", delegate(float v) { _sun = v; Worldcraft.SetSunIntensity(v); Settings.SlSun.Value = v; }, 1f); MenuUI.Header("Sun Color"); _sunR = MenuUI.Slider("clim_sunR", "Red", _sunR, 0f, 2f, "", delegate(float v) { _sunR = v; Worldcraft.SetSunColorR(v); Settings.SlSunR.Value = v; }, 1f); _sunG = MenuUI.Slider("clim_sunG", "Green", _sunG, 0f, 2f, "", delegate(float v) { _sunG = v; Worldcraft.SetSunColorG(v); Settings.SlSunG.Value = v; }, 1f); _sunB = MenuUI.Slider("clim_sunB", "Blue", _sunB, 0f, 2f, "", delegate(float v) { _sunB = v; Worldcraft.SetSunColorB(v); Settings.SlSunB.Value = v; }, 1f); MenuUI.Header("Weather Presets"); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); if (MenuUI.Button("Clear")) { Cheats.WeatherClear(); } if (MenuUI.Button("Storm")) { Cheats.WeatherStorm(); } if (MenuUI.Button("Snow")) { Cheats.WeatherSnow(); } GUILayout.EndHorizontal(); MenuUI.Help("Weather may revert as the game's atmospheric system updates."); MenuUI.Header("Weather Events"); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); if (MenuUI.Button("Hurricane Wind")) { Cheats.HurricaneWind(); } if (MenuUI.Button("Force Rainstorm")) { Cheats.ForceRainStorm(); } GUILayout.EndHorizontal(); } public static void ResetSliders() { _hour = 12f; Worldcraft.SetTimeOfDay(12f); _timeMul = 1f; Worldcraft.SetTimeMultiplier(1f); _wind = 0f; Worldcraft.SetWindIntensity(0f); _sun = 1f; Worldcraft.SetSunIntensity(1f); _sunR = 1f; Worldcraft.SetSunColorR(1f); _sunG = 1f; Worldcraft.SetSunColorG(1f); _sunB = 1f; Worldcraft.SetSunColorB(1f); } } internal static class WorldTerrainTab { private static float _treeRegrow = 1f; private static float _bushRadius = 20f; private static bool _init; public static void Draw() { if (!_init) { if (!float.IsNaN(Settings.SlTreeRegrow.Value)) { _treeRegrow = Settings.SlTreeRegrow.Value; Worldcraft.TreeRegrowFactor(_treeRegrow); } if (!float.IsNaN(Settings.SlBushRadius.Value)) { _bushRadius = Settings.SlBushRadius.Value; } _init = true; } MenuUI.Header("Lakes & Ocean"); MenuUI.Toggle("Freeze Lakes", Worldcraft.IsFreezeLakes, Worldcraft.FreezeLakes); MenuUI.Toggle("No Lakes", Worldcraft.IsNoLakes, Worldcraft.NoLakes); MenuUI.Toggle("No Ocean", Worldcraft.IsNoOcean, Worldcraft.NoOcean); MenuUI.Toggle("No Waterfalls", Worldcraft.IsNoWaterfalls, Worldcraft.NoWaterfalls); MenuUI.Header("Trees"); _treeRegrow = MenuUI.Slider("terr_treeRegrow", "Tree Regrow", _treeRegrow, 0f, 50f, "x", delegate(float v) { _treeRegrow = v; Worldcraft.TreeRegrowFactor(v); Settings.SlTreeRegrow.Value = v; }, 1f); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); if (MenuUI.Button("Cut All Trees")) { Cheats.CutAllTrees(); } if (MenuUI.Button("Re-grow Trees")) { Cheats.RegrowTrees(); } if (MenuUI.Button("Falling Tree")) { Cheats.SpawnFallingTree(); } GUILayout.EndHorizontal(); MenuUI.Help("Tree Regrow controls how fast cut trees come back. 0 = never."); MenuUI.Header("Bushes"); _bushRadius = MenuUI.Slider("terr_bush", "Clear Radius", _bushRadius, 5f, 200f, "m", delegate(float v) { _bushRadius = v; Settings.SlBushRadius.Value = v; }); if (MenuUI.Button($"Clear Bushes ({_bushRadius:0}m radius)")) { Cheats.ClearBushesRadius(_bushRadius); } MenuUI.Help("Centered on your current position. Clears every bush inside the radius."); MenuUI.Header("Cleanup"); if (MenuUI.Button("Remove Dead Bodies")) { Cheats.RemoveDeadBodies(); } MenuUI.Help("Wipes dead bodies from the world. Helps with save bloat and frame rate."); } public static void ResetSliders() { _treeRegrow = 1f; Worldcraft.TreeRegrowFactor(1f); _bushRadius = 25f; } } } namespace AdminMenu.Patches { [HarmonyPatch(typeof(CoopAdminCommand), "CheckLocalPlayerIsAdminOrAbove")] internal static class ForceAdminCheck_CoopCommand { private static bool Prefix(ref bool __result) { if (!FeatureGate.IsActive(FeatureKey.AdminMask)) { return true; } __result = true; return false; } } [HarmonyPatch(typeof(MultiplayerPlayerRoles), "IsAdmin", new Type[] { typeof(ulong) })] internal static class ForceAdminCheck_RolesIsAdmin { private static bool Prefix(ref bool __result) { if (!FeatureGate.IsActive(FeatureKey.AdminMask)) { return true; } __result = true; return false; } } [HarmonyPatch(typeof(PlayerData), "IsAdmin")] internal static class ForceAdminCheck_PlayerDataAdmin { private static bool Prefix(ref bool __result) { if (!FeatureGate.IsActive(FeatureKey.AdminMask)) { return true; } __result = true; return false; } } [HarmonyPatch(typeof(PlayerData), "IsOwner")] internal static class ForceAdminCheck_PlayerDataOwner { private static bool Prefix(ref bool __result) { if (!FeatureGate.IsActive(FeatureKey.AdminMask)) { return true; } __result = true; return false; } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] internal static class ForceAdminCheck_LobbyOwner { private static bool Prefix(ref bool __result) { if (!FeatureGate.IsActive(FeatureKey.AdminMask)) { return true; } __result = true; return false; } } [HarmonyPatch(typeof(DebugConsole), "IsConsoleAllowed")] internal static class ForceAdminCheck_ConsoleAllowed { private static bool Prefix(ref bool __result) { if (!FeatureGate.IsActive(FeatureKey.AdminMask)) { return true; } __result = true; return false; } } [HarmonyPatch(typeof(DebugConsole), "CheckDebugInputs")] internal static class ForceAdminCheck_DebugInputs { private static bool Prefix(ref bool __result) { if (!FeatureGate.IsActive(FeatureKey.AdminMask)) { return true; } __result = true; return false; } } [HarmonyPatch(typeof(CoopClientCallbacks), "HandleKickDisconnect")] internal static class SwallowKickHandler { private static bool Prefix() { if (!FeatureGate.IsActive(FeatureKey.KickBlock)) { return true; } try { Plugin.Log.LogDebug((object)"SwallowKickHandler: blocked"); } catch { } return false; } } [HarmonyPatch(typeof(PlayerListElementView), "OnBanClick")] internal static class SwallowBanClick { private static bool Prefix() { if (!FeatureGate.IsActive(FeatureKey.BanBlock)) { return true; } try { Plugin.Log.LogDebug((object)"SwallowBanClick: blocked"); } catch { } return false; } } [HarmonyPatch(typeof(RangedWeaponController), "OnAmmoSpent")] internal static class BlockAmmoConsumption { private static bool Prefix() { if (FeatureGate.IsActive(FeatureKey.AmmoBlock)) { return false; } return true; } } [HarmonyPatch(typeof(VailActor), "ServerProcessImpact")] internal static class BoostPlayerDamage { private static void Prefix(ref float damage, bool fromPlayer) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown try { if (!fromPlayer) { return; } if (FeatureGate.IsActive(FeatureKey.DamageBoost)) { damage = FeatureGate.DamageValue(); return; } float damageMultiplier = Combat.DamageMultiplier; if (damageMultiplier > 0f && Math.Abs(damageMultiplier - 1f) > 0.0001f) { damage *= damageMultiplier; } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(19, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("BoostPlayerDamage: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } } [HarmonyPatch(typeof(SteamFriends), "GetPersonaName")] internal static class SwapSteamPersonaName { private static bool Prefix(ref string __result) { if (!FeatureGate.IsActive(FeatureKey.NameMask)) { return true; } __result = FeatureGate.NameMaskValue(); return false; } } [HarmonyPatch(typeof(GameSetup), "get_IsSinglePlayer")] internal static class MaskAsSinglePlayer { private static bool Prefix(ref bool __result) { if (!FeatureGate.IsActive(FeatureKey.MirrorActive)) { return true; } __result = true; return false; } } [HarmonyPatch(typeof(GameSetup), "get_IsMpClient")] internal static class MaskAsNonClient { private static bool Prefix(ref bool __result) { if (!FeatureGate.IsActive(FeatureKey.MirrorActive)) { return true; } __result = false; return false; } } [HarmonyPatch(typeof(VailActor), "CanSee", new Type[] { typeof(MonoBehaviourStimuli), typeof(bool) })] internal static class SkipActorSightWhenInvisible { private static bool Prefix(ref bool __result) { if (!FeatureGate.IsActive(FeatureKey.SightSuppress)) { return true; } __result = false; return false; } } [HarmonyPatch(typeof(PlayerName), "Update")] internal static class HideOtherPlayerLabelsWhenInvisible { private static readonly HashSet _hidden = new HashSet(); private static void Postfix(PlayerName __instance) { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown try { if (!((Object)(object)__instance == (Object)null) && !((Object)(object)((Component)__instance).gameObject == (Object)null) && FeatureGate.IsActive(FeatureKey.LabelHide) && ((Component)__instance).gameObject.activeSelf) { ((Component)__instance).gameObject.SetActive(false); _hidden.Add(__instance); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(36, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("HideOtherPlayerLabelsWhenInvisible: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } public static void RestoreAll() { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown try { foreach (PlayerName item in _hidden) { if ((Object)(object)item != (Object)null && (Object)(object)((Component)item).gameObject != (Object)null && !((Component)item).gameObject.activeSelf) { ((Component)item).gameObject.SetActive(true); } } _hidden.Clear(); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(47, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("HideOtherPlayerLabelsWhenInvisible.RestoreAll: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } } [HarmonyPatch(typeof(RangedWeapon), "Throw")] internal static class ScaleThrowVelocityRanged { private static void Postfix(Vector3 direction, Transform visualTransform, Vector3 physicalPosition) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) try { if (FeatureGate.IsActive(FeatureKey.ThrowBoost) && !((Object)(object)visualTransform == (Object)null)) { Rigidbody val = ((Component)visualTransform).GetComponentInChildren() ?? ((Component)visualTransform).GetComponent(); if ((Object)(object)val != (Object)null) { val.velocity *= FeatureGate.ThrowScalar(); } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(26, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("ScaleThrowVelocityRanged: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogError(val2); } } } [HarmonyPatch(typeof(ThrowableBodyInteraction), "Throw")] internal static class ScaleThrowVelocityBody { private static void Postfix(ThrowableBodyInteraction __instance, Vector3 throwDir) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) try { if (FeatureGate.IsActive(FeatureKey.ThrowBoost) && !((Object)(object)__instance == (Object)null)) { Rigidbody componentInChildren = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.velocity *= FeatureGate.ThrowScalar(); } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(24, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("ScaleThrowVelocityBody: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } } [HarmonyPatch(typeof(CarryBody), "SendDropBodyEvent")] internal static class ScaleDroppedBodyImpulse { private static void Prefix(ref Vector3 addVel) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_000a: 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_0019: Unknown result type (might be due to invalid IL or missing references) try { if (FeatureGate.IsActive(FeatureKey.ThrowBoost)) { addVel *= FeatureGate.ThrowScalar(); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(25, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("ScaleDroppedBodyImpulse: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } } [HarmonyPatch(typeof(CarryBody), "ApplyThrowPoseAndVelocity")] internal static class ScaleAppliedBodyImpulse { private static void Postfix(VailActor deadBody, Vector3 position, Quaternion rotation, Vector3 addVel) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) try { if (FeatureGate.IsActive(FeatureKey.ThrowBoost) && !((Object)(object)deadBody == (Object)null)) { Rigidbody componentInChildren = ((Component)deadBody).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.velocity *= FeatureGate.ThrowScalar(); } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(25, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("ScaleAppliedBodyImpulse: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); } } } }