using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using DebugToolkit.Code; using DebugToolkit.Commands; using DebugToolkit.Permissions; using EntityStates; using EntityStates.TeleporterHealNovaController; using HG; using HG.Reflection; using IL.RoR2; using IL.RoR2.Networking; using IL.RoR2.UI; using KinematicCharacterController; using Microsoft.CodeAnalysis; using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.RuntimeDetour; using On.RoR2; using On.RoR2.Networking; using On.RoR2.UI; using R2API; using R2API.Utils; using Rewired; using RoR2; using RoR2.Artifacts; using RoR2.CharacterAI; using RoR2.ConVar; using RoR2.ExpansionManagement; using RoR2.Navigation; using RoR2.Networking; using RoR2.UI; using ShareSuite; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.AddressableAssets.ResourceLocators; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.UI; [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("DebugToolkit Contributors")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyProduct("DebugToolkit")] [assembly: AssemblyTitle("DebugToolkit")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/harbingerofme/DebugToolkit")] [assembly: AssemblyInformationalVersion("3.22.0+d1e2f0aa4b8ac4747547db0fcd87344953432f06")] [assembly: AssemblyCopyright("2026 DebugToolkit Contributors")] [assembly: AssemblyDescription("DebugToolkit is an expansive list of console commands for Risk of Rain 2, intended to make forcing specific situation easier. This is supposed to help with testing of interactions, mods, and what else.")] [assembly: AssemblyFileVersion("3.22.0.0")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("3.22.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] [CompilerGenerated] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace DebugToolkit { public static class ArgumentParser { public static bool AssertInARun(ConCommandArgs args) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)Run.instance)) { Log.MessageNetworked("This command only works when in a Run!", args, Log.LogLevel.MessageClientOnly); return false; } return true; } public static bool AssertInSimulacrumARun(ConCommandArgs args) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)Run.instance) || !(Run.instance is InfiniteTowerRun)) { Log.MessageNetworked("Must be in a Simulacrum Run!", args, Log.LogLevel.MessageClientOnly); return false; } return true; } public static bool AssertRequiredArguments(ConCommandArgs args, string defaultArgs, int required, int? requiredFromServer = null) { //IL_001f: 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) if (((ConCommandArgs)(ref args)).Count < required) { Log.MessageNetworked("Insufficient number of arguments. " + defaultArgs, args, Log.LogLevel.MessageClientOnly); return false; } if ((Object)(object)args.sender == (Object)null && requiredFromServer.HasValue && (((ConCommandArgs)(ref args)).Count < requiredFromServer.Value || ((ConCommandArgs)(ref args))[requiredFromServer.Value - 1] == "")) { Log.Message("Insufficient number of arguments. " + defaultArgs); return false; } return true; } public static bool AssertNotServer(ConCommandArgs args) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)args.sender == (Object)null) { Log.Message("This command has not yet been implemented to be run from a dedicated server."); return false; } return true; } public static bool AssertExpansionAvailable(ConCommandArgs args, ExpansionDef expansionDef, string typeName) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)expansionDef) && Object.op_Implicit((Object)(object)Run.instance) && !Run.instance.IsExpansionEnabled(expansionDef)) { Log.MessageNetworked($"An expansion is required for this {typeName}: {Util.GetExpansion(expansionDef)}", args, Log.LogLevel.MessageClientOnly); return false; } return true; } public static bool AssertLivingBody(ConCommandArgs args) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((ConCommandArgs)(ref args)).senderBody == (Object)null) { Log.MessageNetworked("Can't use this command while dead. Use 'respawn' to skip the wait.", args, Log.LogLevel.MessageClientOnly); return false; } return true; } public static bool TryParseArtifact(ConCommandArgs args, int index, out ArtifactDef artifactDef) { //IL_0010: 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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) artifactDef = null; ArtifactIndex artifactFromPartial = StringFinder.Instance.GetArtifactFromPartial(((ConCommandArgs)(ref args))[index]); if ((int)artifactFromPartial == -1) { Log.MessageNetworked(string.Format("No {0} with the name \"{1}\" could be found. Please use {2} for options.", "artifact", ((ConCommandArgs)(ref args))[index], "list_artifact"), args, Log.LogLevel.MessageClientOnly); return false; } artifactDef = ArtifactCatalog.GetArtifactDef(artifactFromPartial); return AssertExpansionAvailable(args, artifactDef.requiredExpansion, "artifact"); } public static bool TryParseBuff(ConCommandArgs args, int index, out BuffDef buffDef) { //IL_0010: 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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 //IL_0041: 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) buffDef = null; BuffIndex buffFromPartial = StringFinder.Instance.GetBuffFromPartial(((ConCommandArgs)(ref args))[index]); if ((int)buffFromPartial == -1) { Log.MessageNetworked(string.Format("No {0} with the name \"{1}\" could be found. Please use {2} for options.", "buff", ((ConCommandArgs)(ref args))[index], "list_buff"), args, Log.LogLevel.MessageClientOnly); return false; } buffDef = BuffCatalog.GetBuffDef(buffFromPartial); return true; } public static bool TryParseDot(ConCommandArgs args, int index, out DotIndex dotIndex) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected I4, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) dotIndex = (DotIndex)(int)StringFinder.Instance.GetDotFromPartial(((ConCommandArgs)(ref args))[index]); if ((int)dotIndex == -1) { Log.MessageNetworked(string.Format("No {0} with the name \"{1}\" could be found. Please use {2} for options.", "dot", ((ConCommandArgs)(ref args))[index], "list_dot"), args, Log.LogLevel.MessageClientOnly); return false; } return true; } public static bool TryParseItem(ConCommandArgs args, int index, out ItemDef itemDef) { //IL_0010: 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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) itemDef = null; ItemIndex itemFromPartial = StringFinder.Instance.GetItemFromPartial(((ConCommandArgs)(ref args))[index]); if ((int)itemFromPartial == -1) { Log.MessageNetworked(string.Format("No {0} with the name \"{1}\" could be found. Please use {2} for options.", "item", ((ConCommandArgs)(ref args))[index], "list_item"), args, Log.LogLevel.MessageClientOnly); return false; } itemDef = ItemCatalog.GetItemDef(itemFromPartial); return AssertExpansionAvailable(args, itemDef.requiredExpansion, "item"); } public static bool TryParseEquipmentOrRandom(ConCommandArgs args, int index, out EquipmentDef equipmentDef) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Invalid comparison between Unknown and I4 //IL_0027: 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_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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) equipmentDef = null; if (string.Equals(((ConCommandArgs)(ref args))[index], "RANDOM", StringComparison.InvariantCultureIgnoreCase)) { PickupIndex val = RoR2Application.rng.NextElementUniform(Run.instance.availableEquipmentDropList); equipmentDef = EquipmentCatalog.GetEquipmentDef(PickupCatalog.GetPickupDef(val).equipmentIndex); return true; } EquipmentIndex equipFromPartial = StringFinder.Instance.GetEquipFromPartial(((ConCommandArgs)(ref args))[index]); if ((int)equipFromPartial == -1) { Log.MessageNetworked(string.Format("No {0} with the name \"{1}\" could be found. Please use {2} for options.", "equip", ((ConCommandArgs)(ref args))[index], "list_equip"), args, Log.LogLevel.MessageClientOnly); return false; } equipmentDef = EquipmentCatalog.GetEquipmentDef(equipFromPartial); return AssertExpansionAvailable(args, equipmentDef.requiredExpansion, "equipment"); } public static bool TryParseBody(ConCommandArgs args, int index, out GameObject bodyPrefab) { //IL_0010: 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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 //IL_0041: 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) bodyPrefab = null; BodyIndex bodyFromPartial = StringFinder.Instance.GetBodyFromPartial(((ConCommandArgs)(ref args))[index]); if ((int)bodyFromPartial == -1) { Log.MessageNetworked(string.Format("No {0} with the name \"{1}\" could be found. Please use {2} for options.", "body", ((ConCommandArgs)(ref args))[index], "list_body"), args, Log.LogLevel.MessageClientOnly); return false; } bodyPrefab = BodyCatalog.GetBodyPrefab(bodyFromPartial); return true; } public static bool TryParseDrone(ConCommandArgs args, int index, out DroneDef droneDef) { //IL_0010: 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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 //IL_0041: 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) droneDef = null; DroneIndex droneFromPartial = StringFinder.Instance.GetDroneFromPartial(((ConCommandArgs)(ref args))[index]); if ((int)droneFromPartial == -1) { Log.MessageNetworked(string.Format("No {0} with the name \"{1}\" could be found. Please use {2} for options.", "drone", ((ConCommandArgs)(ref args))[index], "list_drone"), args, Log.LogLevel.MessageClientOnly); return false; } droneDef = DroneCatalog.GetDroneDef(droneFromPartial); return true; } public static bool TryParseMaster(ConCommandArgs args, int index, out GameObject masterObject) { //IL_0010: 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_0016: 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_004a: 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) masterObject = null; MasterIndex aiFromPartial = StringFinder.Instance.GetAiFromPartial(((ConCommandArgs)(ref args))[index]); if (aiFromPartial == MasterIndex.none) { Log.MessageNetworked(string.Format("No {0} with the name \"{1}\" could be found. Please use {2} for options.", "ai", ((ConCommandArgs)(ref args))[index], "list_ai"), args, Log.LogLevel.MessageClientOnly); return false; } masterObject = MasterCatalog.GetMasterPrefab(aiFromPartial); return true; } public static bool TryParseEliteOrDefault(ConCommandArgs args, int index, EliteDef defaultValue, out EliteDef eliteDef) { //IL_006a: 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) //IL_0033: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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) eliteDef = defaultValue; if (((ConCommandArgs)(ref args)).Count > index && ((ConCommandArgs)(ref args))[index] != "") { EliteIndex eliteFromPartial = StringFinder.Instance.GetEliteFromPartial(((ConCommandArgs)(ref args))[index]); if (eliteFromPartial == StringFinder.EliteIndex_NotFound) { Log.MessageNetworked(string.Format("No {0} with the name \"{1}\" could be found. Please use {2} for options.", "elite", ((ConCommandArgs)(ref args))[index], "list_elite"), args, Log.LogLevel.MessageClientOnly); return false; } eliteDef = EliteCatalog.GetEliteDef(eliteFromPartial); } return AssertExpansionAvailable(args, eliteDef?.eliteEquipmentDef?.requiredExpansion, "elite equipment"); } public static bool TryParseTeam(ConCommandArgs args, int index, out TeamIndex teamIndex) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected I4, but got Unknown //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Invalid comparison between I4 and Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) teamIndex = (TeamIndex)(int)StringFinder.Instance.GetTeamFromPartial(((ConCommandArgs)(ref args))[index]); if ((int)teamIndex == (int)StringFinder.TeamIndex_NotFound) { Log.MessageNetworked(string.Format("No {0} with the name \"{1}\" could be found. Please use {2} for options.", "team", ((ConCommandArgs)(ref args))[index], "list_team"), args, Log.LogLevel.MessageClientOnly); return false; } return true; } public static bool TryParseTeamOrDefault(ConCommandArgs args, int index, TeamIndex defaultValue, out TeamIndex teamIndex) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Expected I4, but got Unknown //IL_0021: Unknown result type (might be due to invalid IL or missing references) teamIndex = (TeamIndex)(int)defaultValue; if (((ConCommandArgs)(ref args)).Count > index && ((ConCommandArgs)(ref args))[index] != "") { return TryParseTeam(args, index, out teamIndex); } return true; } public static bool TryParseDifficulty(ConCommandArgs args, int index, out DifficultyIndex difficultyIndex) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected I4, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) difficultyIndex = (DifficultyIndex)(int)StringFinder.Instance.GetDifficultyFromPartial(((ConCommandArgs)(ref args))[index]); if ((int)difficultyIndex == -1) { Log.MessageNetworked(string.Format("No {0} with the name \"{1}\" could be found. Please use {2} for options.", "difficulty", ((ConCommandArgs)(ref args))[index], "list_difficulty"), args, Log.LogLevel.MessageClientOnly); return false; } return true; } public static bool TryParseScene(ConCommandArgs args, int index, bool includeOffline, out SceneDef sceneDef) { //IL_0011: 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_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Invalid comparison between Unknown and I4 //IL_0042: 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_0037: Unknown result type (might be due to invalid IL or missing references) sceneDef = null; SceneIndex sceneFromPartial = StringFinder.Instance.GetSceneFromPartial(((ConCommandArgs)(ref args))[index], includeOffline); if ((int)sceneFromPartial == -1) { Log.MessageNetworked(string.Format("No {0} with the name \"{1}\" could be found. Please use {2} for options.", "scene", ((ConCommandArgs)(ref args))[index], "list_scene"), args, Log.LogLevel.MessageClientOnly); return false; } sceneDef = SceneCatalog.GetSceneDef(sceneFromPartial); return AssertExpansionAvailable(args, sceneDef.requiredExpansion, "scene"); } public static bool TryParseInteractableCard(ConCommandArgs args, int index, out InteractableSpawnCard isc) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) isc = StringFinder.Instance.GetInteractableSpawnCardFromPartial(((ConCommandArgs)(ref args))[index]); if ((Object)(object)isc == (Object)null) { Log.MessageNetworked(string.Format("No {0} with the name \"{1}\" could be found. Please use {2} for options.", "isc", ((ConCommandArgs)(ref args))[index], "list_interactables"), args, Log.LogLevel.MessageClientOnly); return false; } return true; } public static bool TryParseDirectorCard(ConCommandArgs args, int index, out DirectorCard directorCard) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) directorCard = StringFinder.Instance.GetDirectorCardFromPartial(((ConCommandArgs)(ref args))[index]); if (directorCard == null) { Log.MessageNetworked(string.Format("No {0} with the name \"{1}\" could be found. Please use {2} for options.", "director_card", ((ConCommandArgs)(ref args))[index], "list_directorcards"), args, Log.LogLevel.MessageClientOnly); return false; } return true; } public static bool TryParseOptionalBool(ConCommandArgs args, int index, string variableName, bool defaultValue, out bool value) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) value = defaultValue; if (((ConCommandArgs)(ref args)).Count > index && ((ConCommandArgs)(ref args))[index] != "" && !Util.TryParseBool(((ConCommandArgs)(ref args))[index], out value)) { Log.MessageNetworked(string.Format("Unable to parse {0} to {1}.", variableName, "bool"), args, Log.LogLevel.MessageClientOnly); return false; } return true; } public static bool TryParseOptionalInt(ConCommandArgs args, int index, string variableName, int defaultValue, out int value, int? min = null, int? max = null) { //IL_0079: 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) value = defaultValue; if (((ConCommandArgs)(ref args)).Count > index && ((ConCommandArgs)(ref args))[index] != "" && !TextSerialization.TryParseInvariant(((ConCommandArgs)(ref args))[index], ref value)) { Log.MessageNetworked(string.Format("Unable to parse {0} to {1}.", variableName, "int"), args, Log.LogLevel.MessageClientOnly); return false; } if (min.HasValue && value < min.Value) { Log.MessageNetworked($"'{variableName}' can't be less than {min.Value}.", args, Log.LogLevel.MessageClientOnly); return false; } if (max.HasValue && value > max.Value) { Log.MessageNetworked($"'{variableName}' can't be greater than {max.Value}.", args, Log.LogLevel.MessageClientOnly); return false; } return true; } public static bool TryParseOptionalUInt(ConCommandArgs args, int index, string variableName, uint defaultValue, out uint value) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) value = defaultValue; if (((ConCommandArgs)(ref args)).Count > index && ((ConCommandArgs)(ref args))[index] != "" && !TextSerialization.TryParseInvariant(((ConCommandArgs)(ref args))[index], ref value)) { Log.MessageNetworked(string.Format("Unable to parse {0} to {1}.", variableName, "uint"), args, Log.LogLevel.MessageClientOnly); return false; } return true; } public static bool TryParseOptionalULong(ConCommandArgs args, int index, string variableName, ulong defaultValue, out ulong value) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) value = defaultValue; if (((ConCommandArgs)(ref args)).Count > index && ((ConCommandArgs)(ref args))[index] != "" && !TextSerialization.TryParseInvariant(((ConCommandArgs)(ref args))[index], ref value)) { Log.MessageNetworked(string.Format("Unable to parse {0} to {1}.", variableName, "ulong"), args, Log.LogLevel.MessageClientOnly); return false; } return true; } public static bool TryParseOptionalFloat(ConCommandArgs args, int index, string variableName, float defaultValue, out float value, float? min = null, float? max = null) { //IL_0079: 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) value = defaultValue; if (((ConCommandArgs)(ref args)).Count > index && ((ConCommandArgs)(ref args))[index] != "" && !TextSerialization.TryParseInvariant(((ConCommandArgs)(ref args))[index], ref value)) { Log.MessageNetworked(string.Format("Unable to parse {0} to {1}.", variableName, "float"), args, Log.LogLevel.MessageClientOnly); return false; } if (min.HasValue && value < min.Value) { Log.MessageNetworked($"'{variableName}' can't be less than {min.Value}.", args, Log.LogLevel.MessageClientOnly); return false; } if (max.HasValue && value > max.Value) { Log.MessageNetworked($"'{variableName}' can't be greater than {max.Value}.", args, Log.LogLevel.MessageClientOnly); return false; } return true; } public static bool TryParsePlayerOrDefault(ConCommandArgs args, int index, out CharacterMaster master, bool requireLiving = false) { //IL_0000: 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) //IL_0071: 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) NetworkUser sender = args.sender; master = ((ConCommandArgs)(ref args)).senderMaster; if (((ConCommandArgs)(ref args)).Count > index && ((ConCommandArgs)(ref args))[index] != "") { sender = Util.GetNetUserFromString(args.userArgs, index); if ((Object)(object)sender == (Object)null) { Log.MessageNetworked("Specified player not found or isn't alive. Please use list_player for options.", args, Log.LogLevel.MessageClientOnly); return false; } master = sender.master; } if (requireLiving && !Object.op_Implicit((Object)(object)master.bodyInstanceObject)) { Log.MessageNetworked("The target player is required alive for this command.", args, Log.LogLevel.MessageClientOnly); return false; } return true; } public static bool TryParsePlayerOrPingedTarget(ConCommandArgs args, int index, out Util.CommandTarget target) { //IL_009d: 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_003e: 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) target = default(Util.CommandTarget); CharacterMaster val = ((ConCommandArgs)(ref args)).senderMaster; if (((ConCommandArgs)(ref args)).Count > index && ((ConCommandArgs)(ref args))[index] != "") { val = Util.GetTargetFromArgs(args, index); if ((Object)(object)val == (Object)null && (Object)(object)args.sender != (Object)null && ((ConCommandArgs)(ref args))[index].ToUpperInvariant() == "PINGED") { val = Hooks.GetPingedTarget(((ConCommandArgs)(ref args)).senderMaster).master; if ((Object)(object)val == (Object)null) { Log.MessageNetworked("Pinged target not found. Either the last ping was not a character, or it has been destroyed since.", args, Log.LogLevel.MessageClientOnly); return false; } } } if ((Object)(object)val == (Object)null) { Log.MessageNetworked("Specified player not found or isn't alive. Please use list_player for options.", args, Log.LogLevel.MessageClientOnly); return false; } target.inventory = val.inventory; PlayerCharacterMasterController playerCharacterMasterController = val.playerCharacterMasterController; target.name = ((playerCharacterMasterController != null) ? playerCharacterMasterController.GetDisplayName() : null) ?? ((Object)((Component)val).gameObject).name; return true; } public static bool TryParsePlayerOrPingedBodyTarget(ConCommandArgs args, int index, out Util.CommandTarget target) { //IL_000f: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) target = default(Util.CommandTarget); CharacterBody val = ((ConCommandArgs)(ref args)).senderBody; bool flag = (Object)(object)args.sender == (Object)null; if (((ConCommandArgs)(ref args)).Count > index && ((ConCommandArgs)(ref args))[index] != "") { CharacterMaster targetFromArgs = Util.GetTargetFromArgs(args, index); if ((Object)(object)targetFromArgs == (Object)null && !flag && ((ConCommandArgs)(ref args))[index].ToUpperInvariant() == "PINGED") { val = Hooks.GetPingedTarget(((ConCommandArgs)(ref args)).senderMaster).body; if ((Object)(object)val == (Object)null) { Log.MessageNetworked("Pinged target not found. Either the last ping was not a character, or it has been destroyed since.", args, Log.LogLevel.MessageClientOnly); return false; } } else { val = ((targetFromArgs != null) ? targetFromArgs.GetBody() : null); } } if ((Object)(object)val == (Object)null) { Log.MessageNetworked("Specified player not found or isn't alive. Please use list_player for options.", args, Log.LogLevel.MessageClientOnly); return false; } CharacterMaster master = val.master; PlayerCharacterMasterController val2 = ((master != null) ? master.playerCharacterMasterController : null); target.body = val; target.name = ((val2 != null) ? val2.GetDisplayName() : null) ?? ((Object)((Component)val).gameObject).name; return true; } } [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] public sealed class AutoCompleteAttribute : Attribute { internal class Result { internal AutoCompleteParser parser; internal string signature; internal List[] parameters; internal Result(AutoCompleteParser parser, string signature, List[] parameters) { this.parser = parser; this.signature = signature; this.parameters = parameters; } } public string args; public AutoCompleteAttribute(string args) { this.args = args; } internal Result Parse(AutoCompleteParser parser) { MatchCollection matchCollection = Regex.Matches(args, "\\{(.*?)\\}|\\[(.*?)\\]|<(.*?)>"); List[] array = new List[matchCollection.Count]; for (int i = 0; i < matchCollection.Count; i++) { GroupCollection groups = matchCollection[i].Groups; string text = ((!string.IsNullOrEmpty(groups[1].Value)) ? groups[1] : ((!string.IsNullOrEmpty(groups[2].Value)) ? groups[2] : groups[3])).Value.Split(':')[0]; Match match = Regex.Match(text, "\\((.*)\\)"); array[i] = new List(); AutoCompleteParser.StaticCatalog catalog; AutoCompleteParser.DynamicCatalog catalog2; if (match.Success) { foreach (string item in from s in match.Groups[1].Value.Split('|') select s.Trim()) { string text2 = item.Trim(); if (text2.StartsWith("'") && text2.EndsWith("'")) { array[i].Add(text2); } else if (parser.TryGetStaticVariable(text2, out catalog) || parser.TryGetDynamicVariable(text2, out catalog2)) { array[i].Add(text2); } } } else { text = text.Trim(); if (parser.TryGetStaticVariable(text, out catalog) || parser.TryGetDynamicVariable(text, out catalog2)) { array[i].Add(text); } } } return new Result(parser, string.Join(" ", from Match m in matchCollection select m.Groups[0].Value), array); } } internal static class AutoCompleteManager { private static readonly Dictionary commands = new Dictionary(); internal static string CurrentCommand { get; private set; } internal static List[] CurrentParameters { get; private set; } internal static string CurrentSignature { get; private set; } internal static void PrepareCommandOptions(string commandName) { commandName = commandName.ToLower(); if (CurrentCommand == commandName) { return; } CurrentCommand = commandName; if (!commands.TryGetValue(commandName, out var value)) { CurrentParameters = new List[0]; CurrentSignature = null; return; } AutoCompleteParser parser = value.parser; List[] array = new List[value.parameters.Length]; for (int i = 0; i < array.Length; i++) { array[i] = new List(); foreach (string item in value.parameters[i]) { AutoCompleteParser.StaticCatalog catalog; AutoCompleteParser.DynamicCatalog catalog2; if (item.StartsWith("'") && item.EndsWith("'")) { array[i].Add(new AutoCompleteParser.AutoCompleteOption(item.Trim('\''))); } else if (parser.TryGetStaticVariable(item, out catalog)) { array[i].AddRange(catalog.options); } else if (parser.TryGetDynamicVariable(item, out catalog2)) { array[i].AddRange(catalog2.Rebuild()); } } } CurrentParameters = array; CurrentSignature = value.signature; } internal static void ClearCommandOptions() { CurrentCommand = null; CurrentParameters = null; CurrentSignature = null; } internal static void RegisterCommand(string commandName, AutoCompleteAttribute.Result parameters) { commands[commandName.ToLower()] = parameters; } internal static void RegisterAutoCompleteCommands() { //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) AutoCompleteParser autoCompleteParser = new AutoCompleteParser(); autoCompleteParser.RegisterStaticVariable("0", "0"); autoCompleteParser.RegisterStaticVariable("1", "1"); autoCompleteParser.RegisterStaticVariable("ai", MasterCatalog.allAiMasters.Select((CharacterMaster i) => $"{(int)i.masterIndex}|{((Object)i).name}|{StringFinder.GetLangInvar(StringFinder.GetMasterName(i))}"), 1); autoCompleteParser.RegisterStaticVariable("artifact", ArtifactCatalog.artifactDefs.Select((ArtifactDef i) => $"{(int)i.artifactIndex}|{i.cachedName}|{StringFinder.GetLangInvar(i.nameToken)}"), 1); autoCompleteParser.RegisterStaticVariable("body", BodyCatalog.allBodyPrefabBodyBodyComponents.Select((CharacterBody i) => $"{(int)i.bodyIndex}|{((Object)i).name}|{StringFinder.GetLangInvar(i.baseNameToken)}"), 1); autoCompleteParser.RegisterStaticVariable("buff", BuffCatalog.buffDefs.Select((BuffDef i) => $"{(int)i.buffIndex}|{StringFinder.GetLangInvar(((Object)i).name)}"), 1); autoCompleteParser.RegisterStaticVariable("difficulty", from kv in StringFinder.difficultyDefs orderby kv.Key select $"{(int)kv.Key}|{StringFinder.GetLangInvar(kv.Value.nameToken)}", 1); autoCompleteParser.RegisterStaticVariable("drone", DroneCatalog.allDroneDefs.Select((DroneDef i) => $"{(int)i.droneIndex}|{((Object)i).name}|{StringFinder.GetLangInvar(i.nameToken)}"), 1); autoCompleteParser.RegisterStaticVariable("droptable", from i in (IEnumerable)(object)ItemTierCatalog.allItemTierDefs orderby i.tier select $"{(int)i.tier}|{((Object)i).name}", 1); autoCompleteParser.RegisterStaticVariable("dot", DotController.dotDefs.Select((DotDef d, int i) => $"{i}|{(object)(DotIndex)i}"), 1); autoCompleteParser.RegisterStaticVariable("elite", new string[1] { "-1|None" }.Concat(EliteCatalog.eliteDefs.Select((EliteDef i) => $"{(int)i.eliteIndex}|{((Object)i).name}|{StringFinder.GetLangInvar(i.modifierToken)}")), 1); autoCompleteParser.RegisterStaticVariable("equip", EquipmentCatalog.equipmentDefs.Select((EquipmentDef i) => $"{(int)i.equipmentIndex}|{((Object)i).name}|{StringFinder.GetLangInvar(i.nameToken)}"), 1); autoCompleteParser.RegisterStaticVariable("item", ((IEnumerable)(object)ItemCatalog.allItemDefs).Select((ItemDef i) => $"{(int)i.itemIndex}|{((Object)i).name}|{StringFinder.GetLangInvar(i.nameToken)}"), 1); autoCompleteParser.RegisterStaticVariable("specific_stage", from i in (IEnumerable)(object)SceneCatalog.allSceneDefs where !i.isOfflineScene select $"{(int)i.sceneDefIndex}|{i.cachedName}|{StringFinder.GetLangInvar(i.nameToken)}", 1); autoCompleteParser.RegisterStaticVariable("team", new string[1] { "-1|None" }.Concat(TeamCatalog.teamDefs.Select((TeamDef t, int i) => $"{i}|{(object)(TeamIndex)(sbyte)i}")), 1); autoCompleteParser.RegisterStaticVariable("item_type", CollectEnumNames(typeof(Items.ItemType), typeof(int)).SkipLast(1), 1); autoCompleteParser.RegisterStaticVariable("permission_level", CollectEnumNames(typeof(Level), typeof(int)), 1); autoCompleteParser.RegisterDynamicVariable("director_card", StringFinder.Instance.DirectorCards, "spawnCard", isToken: false, showIndex: true, 1); autoCompleteParser.RegisterDynamicVariable("interactable", StringFinder.Instance.InteractableSpawnCards, "", isToken: false, showIndex: true, 1); autoCompleteParser.RegisterDynamicVariable("player", NetworkUser.instancesList, "userName"); autoCompleteParser.Scan(Assembly.GetExecutingAssembly()); } private static IEnumerable CollectEnumNames(Type enumType, Type castTo) { if (enumType == null) { Log.Message("Input type is null", Log.LogLevel.Warning, Log.Target.Bepinex); yield break; } if (!enumType.IsEnum) { Log.Message("Input type is not enum: " + enumType.Name, Log.LogLevel.Warning, Log.Target.Bepinex); yield break; } string[] enumNames = Enum.GetNames(enumType); Array enumValues = Enum.GetValues(enumType); for (int i = 0; i < enumValues.Length; i++) { if (enumNames[i] != "Count") { yield return $"{Convert.ChangeType(enumValues.GetValue(i), castTo)}|{enumNames[i]}"; } } } } public sealed class AutoCompleteParser { internal class AutoCompleteOption { internal string name; internal int index; internal AutoCompleteOption(string name, int index = 0) { this.name = name; this.index = index; } } internal class StaticCatalog { internal readonly AutoCompleteOption[] options; internal StaticCatalog(IEnumerable catalog, int autocompleteIndex = 0) { options = catalog.Select((string s) => new AutoCompleteOption(s, autocompleteIndex)).ToArray(); } } internal class DynamicCatalog { private readonly IEnumerable catalog; private readonly string nestedField; private readonly bool isToken; private readonly bool showIndex; private readonly int autocompleteIndex; internal DynamicCatalog(IEnumerable catalog, string nestedField, bool isToken, bool showIndex, int autocompleteIndex) { this.catalog = catalog; this.nestedField = nestedField; this.isToken = isToken; this.showIndex = showIndex; this.autocompleteIndex = autocompleteIndex; } internal IEnumerable Rebuild() { string[] block = ((!string.IsNullOrEmpty(nestedField)) ? nestedField.Split('/') : new string[0]); int index = 0; foreach (object item in catalog) { string text; if (block.Length != 0) { object fieldValue = Reflection.GetFieldValue(item, block[0]); for (int i = 1; i < block.Length; i++) { fieldValue = Reflection.GetFieldValue(fieldValue, block[i]); } text = fieldValue.ToString(); } else { text = item.ToString(); } if (text.Contains("(RoR")) { text = text.Substring(0, text.IndexOf('(')); } text = (isToken ? StringFinder.GetLangInvar(text) : StringFinder.RemoveSpacesAndAlike(text)); text = (showIndex ? $"{index}|{text}" : text); yield return new AutoCompleteOption(text, autocompleteIndex); index++; } } } private readonly Dictionary staticVariables = new Dictionary(); private readonly Dictionary dynamicVariables = new Dictionary(); public void RegisterStaticVariable(string name, string value) { RegisterStaticVariable(name, new string[1] { value }); } public void RegisterStaticVariable(string name, IEnumerable values, int autocompleteIndex = 0) { staticVariables[name] = new StaticCatalog(values, autocompleteIndex); } public void RegisterDynamicVariable(string name, IEnumerable catalog, string nestedField = "", bool isToken = false, bool showIndex = true, int autocompleteIndex = 0) { dynamicVariables[name] = new DynamicCatalog(catalog, nestedField, isToken, showIndex, autocompleteIndex); } internal bool TryGetStaticVariable(string name, out StaticCatalog catalog) { return staticVariables.TryGetValue(name, out catalog); } internal bool TryGetDynamicVariable(string name, out DynamicCatalog catalog) { return dynamicVariables.TryGetValue(name, out catalog); } public void Scan(Assembly assembly) { if (assembly == null) { Log.Message("Null assembly encountered for autocompletion scanning", Log.LogLevel.Warning, Log.Target.Bepinex); return; } Type[] source; try { source = assembly.GetTypes(); } catch (ReflectionTypeLoadException ex) { source = ex.Types.Where((Type x) => x != null).ToArray(); Exception[] loaderExceptions = ex.LoaderExceptions; for (int num = 0; num < loaderExceptions.Length; num++) { _ = loaderExceptions[num]; Log.Message(ex.Message, Log.LogLevel.Error, Log.Target.Bepinex); } } foreach (MethodInfo item in source.SelectMany((Type x) => x.GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic))) { object[] customAttributes; try { customAttributes = item.GetCustomAttributes(inherit: false); } catch (TypeLoadException ex2) { Log.Message(ex2.Message, Log.LogLevel.Error, Log.Target.Bepinex); continue; } catch (InvalidOperationException ex3) { Log.Message(ex3.Message, Log.LogLevel.Error, Log.Target.Bepinex); continue; } if (customAttributes == null) { continue; } AutoCompleteAttribute autoCompleteAttribute = customAttributes.OfType().DefaultIfEmpty(null).FirstOrDefault(); if (autoCompleteAttribute == null) { continue; } ConCommandAttribute[] array = customAttributes.OfType().ToArray(); if (array.Length != 0) { AutoCompleteAttribute.Result parameters = autoCompleteAttribute.Parse(this); ConCommandAttribute[] array2 = array; for (int num = 0; num < array2.Length; num++) { AutoCompleteManager.RegisterCommand(array2[num].commandName, parameters); } } } } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("iHarbHD.DebugToolkit", "DebugToolkit", "3.22.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class DebugToolkit : BaseUnityPlugin { public const string modname = "DebugToolkit"; public const string modver = "3.22.0"; public const string GUID = "iHarbHD.DebugToolkit"; internal static ConfigFile Configuration; internal static DebugToolkit Instance { get; private set; } private void Awake() { Instance = this; Configuration = ((BaseUnityPlugin)this).Config; new Log(((BaseUnityPlugin)this).Logger); Log.Message("Created by Harb, iDeathHD and . Based on RoR2Cheats by Morris1927.", Log.LogLevel.Info, Log.Target.Bepinex); MacroSystem.Init(); PermissionSystem.Init(); Hooks.InitializeHooks(); NetworkManager.Init(); ((BaseConVar)ConsoleWindow.cvConsoleEnabled).defaultValue = "1"; ConsoleWindow.cvConsoleEnabled.SetBool(true); } private void LogBuildInfo() { } private void Start() { _ = StringFinder.Instance; } private void Update() { MacroSystem.Update(); if (Object.op_Implicit((Object)(object)Run.instance) && Command_Noclip.IsActivated) { Command_Noclip.Update(); } } public static void InvokeCMD(NetworkUser user, string commandName, params string[] arguments) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) List list = arguments.ToList(); CmdSender val = default(CmdSender); ((CmdSender)(ref val))..ctor(user); if (Object.op_Implicit((Object)(object)Console.instance)) { Console.instance.RunCmd(val, commandName, list); } else { Log.Message("InvokeCMD called whilst no console instance exists.", Log.LogLevel.Error, Log.Target.Bepinex); } } public static string GetModVer() { return "3.22.0"; } } public sealed class Hooks { internal struct PingCache { internal CharacterBody body; internal CharacterMaster master; } internal struct MatchInfo { public int similarity; public string str; public int index; } [CompilerGenerated] private static class <>O { public static Manipulator <0>__UnlockConsole; public static hook_AwakeCoroutine <1>__InitCommandsAndFreeConvars; public static Manipulator <2>__WarnUserOfServerCommandOffline; public static Manipulator <3>__ToggleConsoleWindowWithCustomKey; public static hook_SetSearchString <4>__BetterAutoCompletion; public static Action <5>__InitDroptableData; public static Action <6>__InitPortals; public static Action <7>__RegisterAutoCompleteCommands; public static Action <8>__CollectItemTiers; public static hook_Start <9>__AddConCommandSignatureHint; public static hook_OnInputFieldValueChanged <10>__UpdateCommandSignature; public static Manipulator <11>__ApplyTextWithoutColorTags; public static Manipulator <12>__SmoothDropDownSuggestionNavigation; public static Manipulator <13>__AllowTabAutocompleteConCommands; public static Manipulator <14>__EnableCheatsInCCSetScene; public static hook_CCSceneList <15>__OverrideVanillaSceneList; public static hook_Save <16>__PreventSave; public static hook_RebuildPing <17>__InterceptPing; public static Manipulator <18>__InfiniteTowerRun_BeginNextWave; public static hook_SetNextSpawnAsBoss <19>__SetNextBossForDirector; public static hook_Initialize <20>__SetNextBossForSimulacrumDirector; public static hook_AttemptSpawnOnTarget <21>__OverrideBossCombatDirectorSpawnResult; public static hook_RebuildCards <22>__ForceFamilyEvent; public static hook_GenerateWeightedCategorySelection <23>__ForceFamilyEventForDccsPoolStages; public static hook_IsAvailable <24>__ForceFamilyDirectorCardCategorySelectionToBeAvailable; public static Action <25>__DenyInteractableSpawns; public static hook_SpendAllCreditsOnMapSpawns_Transform_WeightedSelection1 <26>__DenyMapSpawns; public static hook_AwardExperience <27>__DenyExperience; public static hook_Start <28>__CreateNetworkObject; public static hook_OnDestroy <29>__DestroyNetworkObject; public static hook_OnStopClient <30>__DisableOnStopClient; public static hook_TeleportBody <31>__DisableOOBCheck; public static Action <32>__DisableOnRunDestroy; public static hook_TakeDamage <33>__NonLethalDamage; public static hook_Awake <34>__SetGodMode; public static Manipulator <35>__FixCommandHelpText; public static Manipulator <36>__FixCCFind; } private const ConVarFlags AllFlagsNoCheat = (ConVarFlags)23; private const string GRAY = ""; private const string COMMAND_SIGNATURE = "{0} {1}"; private static int[] autoCompleteIndices; private static orig_RunCmd _origRunCmd; internal static bool buddha; internal static bool god; private static GameObject commandSignatureText; private static CombatDirector bossDirector; private static bool skipSpawnIfTooCheapBackup; private static readonly Dictionary pingedTargets = new Dictionary(); private const float changeSelectedItemTimer = 0.1f; private static float _lastSelectedItemChange; public static void InitializeHooks() { //IL_007b: 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_007b: Expected O, but got Unknown //IL_00cb: 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_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_009c: Expected O, but got Unknown //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Expected O, but got Unknown //IL_0119: 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_0124: Expected O, but got Unknown //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0144: 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_0211: Expected O, but got Unknown //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Expected O, but got Unknown //IL_0246: 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_0251: Expected O, but got Unknown //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Expected O, but got Unknown //IL_0286: 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_0291: Expected O, but got Unknown //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Expected O, but got Unknown //IL_02c6: 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_02d1: Expected O, but got Unknown //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Expected O, but got Unknown //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Expected O, but got Unknown //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Expected O, but got Unknown //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Expected O, but got Unknown //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Expected O, but got Unknown //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Expected O, but got Unknown //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Expected O, but got Unknown //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Expected O, but got Unknown //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Expected O, but got Unknown //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Unknown result type (might be due to invalid IL or missing references) //IL_0455: Expected O, but got Unknown //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0475: Expected O, but got Unknown //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Expected O, but got Unknown //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04af: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: Expected O, but got Unknown //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04cf: Unknown result type (might be due to invalid IL or missing references) //IL_04d5: Expected O, but got Unknown //IL_04ea: Unknown result type (might be due to invalid IL or missing references) //IL_04ef: Unknown result type (might be due to invalid IL or missing references) //IL_04f5: Expected O, but got Unknown //IL_052a: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Unknown result type (might be due to invalid IL or missing references) //IL_0535: Expected O, but got Unknown //IL_054a: Unknown result type (might be due to invalid IL or missing references) //IL_054f: Unknown result type (might be due to invalid IL or missing references) //IL_0555: Expected O, but got Unknown //IL_056a: Unknown result type (might be due to invalid IL or missing references) //IL_056f: Unknown result type (might be due to invalid IL or missing references) //IL_0575: Expected O, but got Unknown //IL_058a: Unknown result type (might be due to invalid IL or missing references) //IL_058f: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Expected O, but got Unknown BindingFlags bindingAttr = (BindingFlags)(-1); MethodInfo? methodInfo = typeof(Console).GetNestedTypes(bindingAttr).FirstOrDefault((Type t) => t.Name.Contains("AwakeCoroutine")).GetMethods(bindingAttr) .FirstOrDefault((MethodInfo m) => m.Name.Contains("MoveNext")); object obj = <>O.<0>__UnlockConsole; if (obj == null) { Manipulator val = UnlockConsole; <>O.<0>__UnlockConsole = val; obj = (object)val; } new ILHook((MethodBase)methodInfo, (Manipulator)obj); object obj2 = <>O.<1>__InitCommandsAndFreeConvars; if (obj2 == null) { hook_AwakeCoroutine val2 = InitCommandsAndFreeConvars; <>O.<1>__InitCommandsAndFreeConvars = val2; obj2 = (object)val2; } Console.AwakeCoroutine += (hook_AwakeCoroutine)obj2; _origRunCmd = new Hook((MethodBase)Reflection.GetMethodCached(typeof(Console), "RunCmd"), Reflection.GetMethodCached(typeof(Hooks), "LogNetworkCommandsAndCheckPermissions"), new HookConfig { Priority = 1 }).GenerateTrampoline(); object obj3 = <>O.<2>__WarnUserOfServerCommandOffline; if (obj3 == null) { Manipulator val3 = WarnUserOfServerCommandOffline; <>O.<2>__WarnUserOfServerCommandOffline = val3; obj3 = (object)val3; } Console.RunCmd += (Manipulator)obj3; object obj4 = <>O.<3>__ToggleConsoleWindowWithCustomKey; if (obj4 == null) { Manipulator val4 = ToggleConsoleWindowWithCustomKey; <>O.<3>__ToggleConsoleWindowWithCustomKey = val4; obj4 = (object)val4; } ConsoleWindow.CheckConsoleKey += (Manipulator)obj4; object obj5 = <>O.<4>__BetterAutoCompletion; if (obj5 == null) { hook_SetSearchString val5 = BetterAutoCompletion; <>O.<4>__BetterAutoCompletion = val5; obj5 = (object)val5; } AutoComplete.SetSearchString += (hook_SetSearchString)obj5; RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(Items.InitDroptableData)); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(Spawners.InitPortals)); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(AutoCompleteManager.RegisterAutoCompleteCommands)); Run.onRunStartGlobal += Items.CollectItemTiers; object obj6 = <>O.<9>__AddConCommandSignatureHint; if (obj6 == null) { hook_Start val6 = AddConCommandSignatureHint; <>O.<9>__AddConCommandSignatureHint = val6; obj6 = (object)val6; } ConsoleWindow.Start += (hook_Start)obj6; object obj7 = <>O.<10>__UpdateCommandSignature; if (obj7 == null) { hook_OnInputFieldValueChanged val7 = UpdateCommandSignature; <>O.<10>__UpdateCommandSignature = val7; obj7 = (object)val7; } ConsoleWindow.OnInputFieldValueChanged += (hook_OnInputFieldValueChanged)obj7; object obj8 = <>O.<11>__ApplyTextWithoutColorTags; if (obj8 == null) { Manipulator val8 = ApplyTextWithoutColorTags; <>O.<11>__ApplyTextWithoutColorTags = val8; obj8 = (object)val8; } ConsoleWindow.ApplyAutoComplete += (Manipulator)obj8; object obj9 = <>O.<12>__SmoothDropDownSuggestionNavigation; if (obj9 == null) { Manipulator val9 = SmoothDropDownSuggestionNavigation; <>O.<12>__SmoothDropDownSuggestionNavigation = val9; obj9 = (object)val9; } ConsoleWindow.Update += (Manipulator)obj9; object obj10 = <>O.<13>__AllowTabAutocompleteConCommands; if (obj10 == null) { Manipulator val10 = AllowTabAutocompleteConCommands; <>O.<13>__AllowTabAutocompleteConCommands = val10; obj10 = (object)val10; } HUD.Update += (Manipulator)obj10; object obj11 = <>O.<14>__EnableCheatsInCCSetScene; if (obj11 == null) { Manipulator val11 = EnableCheatsInCCSetScene; <>O.<14>__EnableCheatsInCCSetScene = val11; obj11 = (object)val11; } NetworkManagerSystem.CCSetScene += (Manipulator)obj11; object obj12 = <>O.<15>__OverrideVanillaSceneList; if (obj12 == null) { hook_CCSceneList val12 = OverrideVanillaSceneList; <>O.<15>__OverrideVanillaSceneList = val12; obj12 = (object)val12; } NetworkManagerSystem.CCSceneList += (hook_CCSceneList)obj12; object obj13 = <>O.<16>__PreventSave; if (obj13 == null) { hook_Save val13 = Profile.PreventSave; <>O.<16>__PreventSave = val13; obj13 = (object)val13; } SaveSystem.Save += (hook_Save)obj13; object obj14 = <>O.<17>__InterceptPing; if (obj14 == null) { hook_RebuildPing val14 = InterceptPing; <>O.<17>__InterceptPing = val14; obj14 = (object)val14; } PingerController.RebuildPing += (hook_RebuildPing)obj14; object obj15 = <>O.<18>__InfiniteTowerRun_BeginNextWave; if (obj15 == null) { Manipulator val15 = InfiniteTowerRun_BeginNextWave; <>O.<18>__InfiniteTowerRun_BeginNextWave = val15; obj15 = (object)val15; } InfiniteTowerRun.BeginNextWave += (Manipulator)obj15; object obj16 = <>O.<19>__SetNextBossForDirector; if (obj16 == null) { hook_SetNextSpawnAsBoss val16 = SetNextBossForDirector; <>O.<19>__SetNextBossForDirector = val16; obj16 = (object)val16; } CombatDirector.SetNextSpawnAsBoss += (hook_SetNextSpawnAsBoss)obj16; object obj17 = <>O.<20>__SetNextBossForSimulacrumDirector; if (obj17 == null) { hook_Initialize val17 = SetNextBossForSimulacrumDirector; <>O.<20>__SetNextBossForSimulacrumDirector = val17; obj17 = (object)val17; } InfiniteTowerExplicitSpawnWaveController.Initialize += (hook_Initialize)obj17; object obj18 = <>O.<21>__OverrideBossCombatDirectorSpawnResult; if (obj18 == null) { hook_AttemptSpawnOnTarget val18 = OverrideBossCombatDirectorSpawnResult; <>O.<21>__OverrideBossCombatDirectorSpawnResult = val18; obj18 = (object)val18; } CombatDirector.AttemptSpawnOnTarget += (hook_AttemptSpawnOnTarget)obj18; object obj19 = <>O.<22>__ForceFamilyEvent; if (obj19 == null) { hook_RebuildCards val19 = ForceFamilyEvent; <>O.<22>__ForceFamilyEvent = val19; obj19 = (object)val19; } ClassicStageInfo.RebuildCards += (hook_RebuildCards)obj19; object obj20 = <>O.<23>__ForceFamilyEventForDccsPoolStages; if (obj20 == null) { hook_GenerateWeightedCategorySelection val20 = ForceFamilyEventForDccsPoolStages; <>O.<23>__ForceFamilyEventForDccsPoolStages = val20; obj20 = (object)val20; } DccsPool.GenerateWeightedCategorySelection += (hook_GenerateWeightedCategorySelection)obj20; object obj21 = <>O.<24>__ForceFamilyDirectorCardCategorySelectionToBeAvailable; if (obj21 == null) { hook_IsAvailable val21 = ForceFamilyDirectorCardCategorySelectionToBeAvailable; <>O.<24>__ForceFamilyDirectorCardCategorySelectionToBeAvailable = val21; obj21 = (object)val21; } FamilyDirectorCardCategorySelection.IsAvailable += (hook_IsAvailable)obj21; Run.onRunDestroyGlobal += delegate { CurrentRun.ResetNextBoss(); CurrentRun.forceFamilyEvent = false; }; SceneDirector.onPrePopulateSceneServer += DenyInteractableSpawns; object obj22 = <>O.<26>__DenyMapSpawns; if (obj22 == null) { hook_SpendAllCreditsOnMapSpawns_Transform_WeightedSelection1 val22 = DenyMapSpawns; <>O.<26>__DenyMapSpawns = val22; obj22 = (object)val22; } CombatDirector.SpendAllCreditsOnMapSpawns_Transform_WeightedSelection1 += (hook_SpendAllCreditsOnMapSpawns_Transform_WeightedSelection1)obj22; object obj23 = <>O.<27>__DenyExperience; if (obj23 == null) { hook_AwardExperience val23 = DenyExperience; <>O.<27>__DenyExperience = val23; obj23 = (object)val23; } ExperienceManager.AwardExperience += (hook_AwardExperience)obj23; object obj24 = <>O.<28>__CreateNetworkObject; if (obj24 == null) { hook_Start val24 = NetworkManager.CreateNetworkObject; <>O.<28>__CreateNetworkObject = val24; obj24 = (object)val24; } NetworkSession.Start += (hook_Start)obj24; object obj25 = <>O.<29>__DestroyNetworkObject; if (obj25 == null) { hook_OnDestroy val25 = NetworkManager.DestroyNetworkObject; <>O.<29>__DestroyNetworkObject = val25; obj25 = (object)val25; } NetworkSession.OnDestroy += (hook_OnDestroy)obj25; object obj26 = <>O.<30>__DisableOnStopClient; if (obj26 == null) { hook_OnStopClient val26 = Command_Noclip.DisableOnStopClient; <>O.<30>__DisableOnStopClient = val26; obj26 = (object)val26; } NetworkManagerSystem.OnStopClient += (hook_OnStopClient)obj26; object obj27 = <>O.<31>__DisableOOBCheck; if (obj27 == null) { hook_TeleportBody val27 = Command_Noclip.DisableOOBCheck; <>O.<31>__DisableOOBCheck = val27; obj27 = (object)val27; } MapZone.TeleportBody += (hook_TeleportBody)obj27; Run.onRunDestroyGlobal += Command_Noclip.DisableOnRunDestroy; object obj28 = <>O.<33>__NonLethalDamage; if (obj28 == null) { hook_TakeDamage val28 = NonLethalDamage; <>O.<33>__NonLethalDamage = val28; obj28 = (object)val28; } HealthComponent.TakeDamage += (hook_TakeDamage)obj28; object obj29 = <>O.<34>__SetGodMode; if (obj29 == null) { hook_Awake val29 = SetGodMode; <>O.<34>__SetGodMode = val29; obj29 = (object)val29; } CharacterMaster.Awake += (hook_Awake)obj29; object obj30 = <>O.<35>__FixCommandHelpText; if (obj30 == null) { Manipulator val30 = FixCommandHelpText; <>O.<35>__FixCommandHelpText = val30; obj30 = (object)val30; } Console.ShowHelpText += (Manipulator)obj30; object obj31 = <>O.<36>__FixCCFind; if (obj31 == null) { Manipulator val31 = FixCCFind; <>O.<36>__FixCCFind = val31; obj31 = (object)val31; } Console.CCFind += (Manipulator)obj31; } private static void ToggleConsoleWindowWithCustomKey(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (!val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetKeyDown") })) { Log.Message("Failed to patch " + ((MemberReference)il.Method).Name); return; } val.EmitDelegate>((Func)delegate(bool isKeyPressed) { //IL_000a: 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_0010: 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) if (isKeyPressed) { return true; } KeyCode value = MacroSystem.ConsoleKey.Value; return (int)value != 0 && Input.GetKeyDown(value); }); } private static void FixCommandHelpText(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0024: 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_0041: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.Instrs.Count > 1) { Log.Message("Skipped patching the command help text method. Maybe fixed already?", Log.LogLevel.Warning, Log.Target.Bepinex); return; } val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Call, "GetHelpText"); val.Emit(OpCodes.Call, "Log"); } private static void FixCCFind(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (!val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "Find"), (Instruction x) => ILPatternMatchingExt.MatchPop(x) })) { Log.Message("Could not patch \"find\" command. Maybe fixed already?", Log.LogLevel.Warning, Log.Target.Bepinex); return; } val.Index += 1; val.Emit(OpCodes.Call, "Log"); val.Remove(); } private static void SetGodMode(orig_Awake orig, CharacterMaster self) { orig.Invoke(self); if (NetworkServer.active) { self.godMode |= Object.op_Implicit((Object)(object)self.playerCharacterMasterController) && god; } } private static void NonLethalDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_0016: 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_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) if (buddha && self.body.isPlayerControlled) { damageInfo.damageType |= DamageTypeCombo.op_Implicit((DamageType)1); } orig.Invoke(self, damageInfo); } private static void InfiniteTowerRun_BeginNextWave(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (!val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0) })) { Log.Message("Failed to patch RoR2.InfiniteTowerRun.BeginNextWave", Log.LogLevel.Warning, Log.Target.Bepinex); return; } val.Index += 1; val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(GameObject wavePrefab, InfiniteTowerRun run) { wavePrefab = CurrentRun.selectedWavePrefab ?? wavePrefab; CurrentRun.selectedWavePrefab = null; return wavePrefab; }); } private static void InterceptPing(orig_RebuildPing orig, PingerController self, PingInfo pingInfo) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, pingInfo); CharacterMaster component = ((Component)self).GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return; } if (Object.op_Implicit((Object)(object)self.pingIndicator) && Object.op_Implicit((Object)(object)self.pingIndicator.pingTarget)) { CharacterBody component2 = self.pingIndicator.pingTarget.GetComponent(); if ((Object)(object)component2 != (Object)null) { pingedTargets[component] = new PingCache { body = component2, master = component2.master }; } else { pingedTargets[component] = default(PingCache); } } else { pingedTargets[component] = default(PingCache); } } private static void OverrideVanillaSceneList(orig_CCSceneList orig, ConCommandArgs args) { //IL_0006: 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) StringBuilder stringBuilder = new StringBuilder(); foreach (SceneDef item in ((IEnumerable)(object)SceneCatalog.allSceneDefs).Where((SceneDef def) => !Object.op_Implicit((Object)(object)Run.instance) || !Object.op_Implicit((Object)(object)def.requiredExpansion) || Run.instance.IsExpansionEnabled(def.requiredExpansion))) { stringBuilder.AppendLine($"[{item.sceneDefIndex}] - {item.cachedName} "); } Log.Message(stringBuilder, Log.LogLevel.MessageClientOnly); } private static void EnableCheatsInCCSetScene(ILContext il) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_0061: 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_00aa: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); MethodInfo method = Reflection.GetMethodCached(typeof(SceneCatalog), "GetSceneDefFromSceneName"); MethodInfo methodCached = Reflection.GetMethodCached(typeof(Hooks), "FilterExpansionLockedScenes"); val.GotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)method) }); val.Remove(); val.Emit(OpCodes.Call, (MethodBase)methodCached); val.GotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_boolValue") }); val.Emit(OpCodes.Pop); val.Emit(OpCodes.Ldc_I4_1); } public static SceneDef FilterExpansionLockedScenes(string sceneName) { SceneDef sceneDefFromSceneName = SceneCatalog.GetSceneDefFromSceneName(sceneName); if (!Object.op_Implicit((Object)(object)sceneDefFromSceneName)) { return null; } if (!Object.op_Implicit((Object)(object)Run.instance) || !Object.op_Implicit((Object)(object)sceneDefFromSceneName.requiredExpansion) || Run.instance.IsExpansionEnabled(sceneDefFromSceneName.requiredExpansion)) { return sceneDefFromSceneName; } Debug.Log((object)string.Format("An expansion is required for this {0}: {1}", "scene", Util.GetExpansion(sceneDefFromSceneName.requiredExpansion))); return null; } private static void UnlockConsole(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCastclass(x, typeof(ConCommandAttribute)) }); val.EmitDelegate>((Func)delegate(ConCommandAttribute conAttr) { //IL_0002: 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) conAttr.flags = (ConVarFlags)(conAttr.flags & 0x17); if (conAttr.commandName == "run_set_stages_cleared") { conAttr.helpText = "Sets the amount of stages cleared. This does not change the current stage."; } return conAttr; }); } private static IEnumerator InitCommandsAndFreeConvars(orig_AwakeCoroutine orig, Console self) { IEnumerator iterator = orig.Invoke(self); while (iterator.MoveNext()) { yield return iterator.Current; } RemoveCheatFlag(self.FindConVar("sv_time_transmit_interval")); RemoveCheatFlag(self.FindConVar("run_scene_override")); RemoveCheatFlag(self.FindConVar("stage1_pod")); RemoveCheatFlag(self.FindConVar("spite_bomb_coefficient")); RemoveCheatFlag(self.FindConVar("bag_disable_breakout")); RemoveCheatFlag(self.FindConVar("bounce_velocity")); RemoveCheatFlag(self.FindConVar("junk_unlimited")); ExpandHelpText(self.FindConVar("timescale"), " Use time_scale instead!"); ExpandHelpText(self.FindConVar("director_combat_disable"), " Use no_enemies instead!"); ExpandHelpText(self.FindConVar("timestep"), " Let the DebugToolkit team know if you need this convar."); ExpandHelpText(self.FindConVar("cmotor_safe_collision_step_threshold"), " Let the DebugToolkit team know if you need this convar."); ExpandHelpText(self.FindConVar("ai_update_interval"), " Let the DebugToolkit team know if you need this convar."); ExpandHelpText(self.FindConVar("contact_damage_update_interval"), " Let the DebugToolkit team know if you need this convar."); ExpandHelpText(self.FindConVar("log_async_assets"), " Let the DebugToolkit team know if you need this convar."); ExpandHelpText(self.FindConVar("preload_scenes"), " Let the DebugToolkit team know if you need this convar."); ExpandHelpText(self.FindConVar("hitbox_show"), " Let the DebugToolkit team know if you need this convar."); ExpandHelpText(self.FindConVar("cheats"), " But you already have the DebugToolkit mod installed..."); static void ExpandHelpText(BaseConVar cv, string text) { if (cv != null) { cv.helpText += text; } } static void RemoveCheatFlag(BaseConVar cv) { //IL_0005: 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_000d: Unknown result type (might be due to invalid IL or missing references) if (cv != null) { cv.flags = (ConVarFlags)(cv.flags & 0x17); } } } private static void LogNetworkCommandsAndCheckPermissions(Console self, CmdSender sender, string concommandName, List userArgs) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_0046: 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_005a: 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_00fc: 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) StringBuilder sb = new StringBuilder(); userArgs.ForEach(delegate(string str) { sb.AppendLine(str); }); if ((Object)(object)sender.networkUser != (Object)null && sender.localUser == null) { Log.Message($"{sender.networkUser.userName}({sender.networkUser.id.value}) issued: {concommandName} {sb}"); } else if (Application.isBatchMode) { Log.Message(string.Format("{0}({1}) issued: {2} {3}", "Server", 0, concommandName, sb)); } bool flag = true; if ((Object)(object)sender.networkUser != (Object)null && sender.localUser == null && PermissionSystem.IsEnabled.Value) { flag = PermissionSystem.CanUserExecute(sender.networkUser, concommandName, userArgs); } if (flag) { _origRunCmd.Invoke(self, sender, concommandName, userArgs); ScrollConsoleDown(); } } private static void WarnUserOfServerCommandOffline(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_004e: 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_006c: 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) ILCursor val = new ILCursor(il); if (!val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "ForwardCmdToServer") })) { Log.Message("Failed to patch RoR2.Console.RunCmd", Log.LogLevel.Error, Log.Target.Bepinex); return; } Instruction next = val.Next; val.Emit(OpCodes.Call, "get_instance"); val.Emit(OpCodes.Brtrue_S, next); val.Emit(OpCodes.Ldstr, "This command requires a network or game session."); val.Emit(OpCodes.Call, "Log"); } private static void AddConCommandSignatureHint(orig_Start orig, ConsoleWindow self) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_006b: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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) orig.Invoke(self); Transform child = ((Component)self).gameObject.transform.GetChild(0).GetChild(1); commandSignatureText = new GameObject("CommandHint", new Type[1] { typeof(RectTransform) }); commandSignatureText.transform.SetParent(child); Transform transform = commandSignatureText.transform; Transform obj = ((transform is RectTransform) ? transform : null); ((RectTransform)obj).anchorMin = new Vector2(0f, 0f); ((RectTransform)obj).anchorMax = new Vector2(1f, 1f); ((RectTransform)obj).pivot = new Vector2(0f, 0.5f); ((RectTransform)obj).offsetMin = new Vector2(14f, 29f); ((RectTransform)obj).offsetMax = new Vector2(-26f, 19f); obj.localScale = ((Component)child).transform.GetChild(0).localScale; HGTextMeshProUGUI obj2 = commandSignatureText.AddComponent(); ((TMP_Text)obj2).fontSize = 14f; ((TMP_Text)obj2).overflowMode = (TextOverflowModes)1; ((TMP_Text)obj2).enableWordWrapping = false; } private static void UpdateCommandSignature(orig_OnInputFieldValueChanged orig, ConsoleWindow self, string text) { orig.Invoke(self, text); HGTextMeshProUGUI val = default(HGTextMeshProUGUI); if (Object.op_Implicit((Object)(object)commandSignatureText) && commandSignatureText.TryGetComponent(ref val)) { if (text == "") { AutoCompleteManager.ClearCommandOptions(); } string currentCommand = AutoCompleteManager.CurrentCommand; string currentSignature = AutoCompleteManager.CurrentSignature; if (currentCommand == null || currentSignature == null) { ((TMP_Text)val).text = ""; } else { ((TMP_Text)val).text = $"{currentCommand} {currentSignature}"; } } } internal static void ScrollConsoleDown() { if (Object.op_Implicit((Object)(object)ConsoleWindow.instance) && Object.op_Implicit((Object)(object)ConsoleWindow.instance.outputField.verticalScrollbar)) { ConsoleWindow.instance.outputField.verticalScrollbar.value = 1f; } } private static bool BetterAutoCompletion(orig_SetSearchString orig, AutoComplete self, string newSearchString) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (self.searchString == newSearchString) { return false; } self.searchString = newSearchString; List list = new Lexer(newSearchString).GetTokens().ToList(); list.RemoveAt(list.Count - 1); if (list.Count == 0) { return false; } int num = list.LastIndexOf(";") + 1; List list2 = new List(); if (list[list.Count - 1] == ";" || newSearchString.EndsWith(list[num])) { AutoCompleteManager.ClearCommandOptions(); List list3 = Console.instance.allConVars.Keys.ToList(); list3.AddRange(Console.instance.concommandCatalog.Keys); list3.Sort(); string text = ((list[list.Count - 1] == ";") ? "" : list[num].ToLowerInvariant()); foreach (string item in list3) { int num2 = item.IndexOf(text); if (num2 == 0) { list2.Add(new MatchInfo { similarity = 1000 + text.Length - item.Length, str = item.Substring(0, text.Length) + GrayOutText(item, text.Length) }); } else if (num2 > 0) { list2.Add(new MatchInfo { similarity = text.Length - item.Length, str = GrayOutText(item, 0, num2) + item.Substring(num2, text.Length) + GrayOutText(item, num2 + text.Length) }); } } } else { int num3 = list.Count - 1; if (!newSearchString.EndsWith(list[list.Count - 1])) { num3++; TMP_Dropdown autoCompleteDropdown = ConsoleWindow.instance.autoCompleteDropdown; if ((Object)(object)autoCompleteDropdown != (Object)null) { autoCompleteDropdown.SetValue(0, false); autoCompleteDropdown.Hide(); ((Selectable)ConsoleWindow.instance.inputField).Select(); } } string text2 = list[num].ToLowerInvariant(); if (text2 != AutoCompleteManager.CurrentCommand) { AutoCompleteManager.PrepareCommandOptions(text2); } List[] currentParameters = AutoCompleteManager.CurrentParameters; int num4 = num3 - num - 1; if (num4 < currentParameters.Length && currentParameters[num4].Count > 0) { List list4 = currentParameters[num4]; string text3 = ((num3 < list.Count) ? list[num3] : ""); if (text3 == "") { foreach (AutoCompleteParser.AutoCompleteOption item2 in list4) { list2.Add(new MatchInfo { similarity = int.MinValue, str = GrayOutText(item2.name, 0), index = item2.index }); } } else { int num5 = default(int); if (TextSerialization.TryParseInvariant(text3, ref num5)) { text3 = num5.ToString(); } foreach (AutoCompleteParser.AutoCompleteOption item3 in list4) { if (item3.name.IndexOf(text3, StringComparison.InvariantCultureIgnoreCase) < 0) { continue; } List list5 = new List(); int num6 = int.MinValue; string[] array = item3.name.Split('|'); foreach (string text4 in array) { int num7 = text4.IndexOf(text3, StringComparison.InvariantCultureIgnoreCase); if (num7 == 0) { num6 = Math.Max(1000 + text3.Length - text4.Length, num6); list5.Add(text4.Substring(0, text3.Length) + GrayOutText(text4, text3.Length)); } else if (num7 > 0) { num6 = Math.Max(text3.Length - text4.Length, num6); list5.Add(GrayOutText(text4, 0, num7) + text4.Substring(num7, text3.Length) + GrayOutText(text4, num7 + text3.Length)); } else { list5.Add(GrayOutText(text4, 0)); } } list2.Add(new MatchInfo { similarity = num6, str = string.Join("|", list5), index = item3.index }); } } } } list2 = list2.OrderByDescending((MatchInfo m) => m.similarity).ToList(); self.resultsList = list2.Select((MatchInfo m) => m.str).ToList(); autoCompleteIndices = list2.Select((MatchInfo m) => m.index).ToArray(); return true; static string GrayOutText(string text5, int startIndex, int length = -1) { text5 = ((length < 0) ? text5.Substring(startIndex) : text5.Substring(startIndex, length)); return "" + text5 + ""; } } private static void ApplyTextWithoutColorTags(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0047: 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) ILCursor val = new ILCursor(il); if (!val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, typeof(OptionData), "get_text") })) { Log.Message("Failed to patch ConsoleWindow", Log.LogLevel.Error, Log.Target.Bepinex); return; } val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Func)delegate(string text, ConsoleWindow consoleWindow, int optionIndex) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) string[] array = text.Split('|'); int num = autoCompleteIndices[optionIndex]; if (num >= array.Length) { num = 0; } text = array[num].Replace("", "").Replace("", ""); string text2 = consoleWindow.inputField.text; List list = new Lexer(text2).GetTokens().ToList(); list.RemoveAt(list.Count - 1); if (list.Count == 0) { return text; } string text3 = list[list.Count - 1]; return (!text2.EndsWith(text3)) ? (text2 + text) : (text2.Substring(0, text2.Length - text3.Length) + text); }); } private static void SmoothDropDownSuggestionNavigation(ILContext il) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); MethodReference operand = il.Import((MethodBase)Reflection.GetMethodCached(typeof(Input), "GetKey", new Type[1] { typeof(KeyCode) })); int inputKey = 273; val.GotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, inputKey), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetKeyDown") }); val.Prev.Operand = operand; val.Emit(OpCodes.Ldc_I4, inputKey); val.EmitDelegate>((Func)LimitChangeItemFrequency); inputKey = 274; val.GotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, inputKey), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetKeyDown") }); val.Prev.Operand = operand; val.Emit(OpCodes.Ldc_I4, inputKey); val.EmitDelegate>((Func)LimitChangeItemFrequency); ILLabel val2 = default(ILLabel); val.GotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 3), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val2) }); val.Index += 1; val.EmitDelegate>((Func)ScrollAutocompleteNextWithTab); for (int num = 0; num < 3; num++) { if (num != 1) { val.GotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 3), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val2) }); val.Index += 1; val.EmitDelegate>((Func)ScrollAutocompleteNextWithTab); } } val.GotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 2), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val2) }); val.Index += 1; val.EmitDelegate>((Func)((bool previousKeyPressed) => previousKeyPressed || (Input.GetKey((KeyCode)306) && Input.GetKeyDown((KeyCode)9)))); static bool LimitChangeItemFrequency(bool canChangeItem, int key) { if (canChangeItem && Time.timeScale > 0f) { float time = Time.time; if (time > 0.1f * Time.timeScale + _lastSelectedItemChange) { _lastSelectedItemChange = time; return true; } return false; } if (Time.timeScale <= 0f) { return Input.GetKeyDown((KeyCode)key); } return canChangeItem; } static bool ScrollAutocompleteNextWithTab(bool isNextKeyPressed) { if (!isNextKeyPressed) { if (!Input.GetKey((KeyCode)306)) { return Input.GetKeyDown((KeyCode)9); } return false; } return true; } } private static void AllowTabAutocompleteConCommands(ILContext il) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); ILLabel jumpLabel = null; if (!val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "info"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetButtonDown") }) || !val.TryGotoNext((MoveType)2, new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_targetBodyObject"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "op_Implicit"), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref jumpLabel) })) { Log.Message("Failed to patch RoR2.UI.HUD.Update", Log.LogLevel.Error, Log.Target.Bepinex); return; } val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(HUD self) { MPEventSystemProvider eventSystemProvider = self.eventSystemProvider; object obj; if (eventSystemProvider == null) { obj = null; } else { MPEventSystem eventSystem = eventSystemProvider.eventSystem; obj = ((eventSystem != null) ? ((EventSystem)eventSystem).currentSelectedGameObject : null); } GameObject val2 = (GameObject)obj; if (Object.op_Implicit((Object)(object)val2)) { ConsoleWindow instance = ConsoleWindow.instance; object obj2; if (instance == null) { obj2 = null; } else { TMP_InputField inputField = instance.inputField; obj2 = ((inputField != null) ? ((Component)inputField).gameObject : null); } return !((Object)(object)val2 == (Object)obj2); } return true; }); val.Emit(OpCodes.Brfalse_S, jumpLabel.Target); } private static WeightedSelection ForceFamilyEventForDccsPoolStages(orig_GenerateWeightedCategorySelection orig, DccsPool self) { WeightedSelection result = orig.Invoke(self); if (CurrentRun.forceFamilyEvent) { WeightedSelection val = new WeightedSelection(8); Category[] poolCategories = self.poolCategories; foreach (Category val2 in poolCategories) { if (ClassicStageInfo.instance.IsCategorySelectionAFamily(val2)) { val.AddChoice(val2, val2.categoryWeight); } } if (val.Count > 0) { return val; } } return result; } private static bool ForceFamilyDirectorCardCategorySelectionToBeAvailable(orig_IsAvailable orig, FamilyDirectorCardCategorySelection self) { if (!orig.Invoke(self)) { return CurrentRun.forceFamilyEvent; } return true; } internal static void ForceFamilyEvent(orig_RebuildCards orig, ClassicStageInfo self, DirectorCardCategorySelection forcedMonsterCategory, DirectorCardCategorySelection forcedInteractableCategory) { orig.Invoke(self, forcedMonsterCategory, forcedInteractableCategory); CurrentRun.forceFamilyEvent = false; } internal static void SetNextBossForDirector(orig_SetNextSpawnAsBoss orig, CombatDirector self) { orig.Invoke(self); if (CurrentRun.nextBoss != null && !((Object)((Component)self).gameObject).name.Contains("DeepVoidPortalBattery")) { bossDirector = self; DirectorCard nextBoss = CurrentRun.nextBoss; self.OverrideCurrentMonsterCard(nextBoss); EliteDef val = (self.currentActiveEliteDef = CurrentRun.nextBossElite); self.currentActiveEliteTier = Spawners.GetTierDef(val); string text = (((Object)(object)val == (Object)null) ? "non-elite" : ((Object)val).name); int nextBossCount = CurrentRun.nextBossCount; self.monsterCredit = (float)(nextBoss.cost * nextBossCount) * self.currentActiveEliteTier.costMultiplier; skipSpawnIfTooCheapBackup = self.skipSpawnIfTooCheap; self.skipSpawnIfTooCheap = false; Log.Message($"The director credits have been set to {self.monsterCredit} to spawn {nextBossCount} {text} {((Object)nextBoss.spawnCard).name}", Log.LogLevel.Info, Log.Target.Ror2); } } private static bool OverrideBossCombatDirectorSpawnResult(orig_AttemptSpawnOnTarget orig, CombatDirector self, Transform spawnTarget, PlacementMode placementMode) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) bool flag = orig.Invoke(self, spawnTarget, placementMode); if ((Object)(object)self != (Object)(object)bossDirector) { return flag; } if (bossDirector.spawnCountInCurrentWave >= CurrentRun.nextBossCount || !flag) { self.skipSpawnIfTooCheap = skipSpawnIfTooCheapBackup; bossDirector = null; CurrentRun.ResetNextBoss(); return false; } return flag; } internal static void SetNextBossForSimulacrumDirector(orig_Initialize orig, InfiniteTowerExplicitSpawnWaveController self, int waveIndex, Inventory enemyInventory, GameObject spawnTargetObject) { //IL_0012: 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_002e: Expected O, but got Unknown //IL_0046: 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) if (CurrentRun.nextBoss != null) { self.spawnList = (SpawnInfo[])(object)new SpawnInfo[1] { new SpawnInfo { spawnCard = (CharacterSpawnCard)CurrentRun.nextBoss.spawnCard, eliteDef = CurrentRun.nextBossElite, count = CurrentRun.nextBossCount } }; } orig.Invoke(self, waveIndex, enemyInventory, spawnTargetObject); CurrentRun.ResetNextBoss(); } internal static void SeedHook(orig_Awake orig, PreGameController self) { orig.Invoke(self); if (CurrentRun.seed != 0L) { self.runSeed = CurrentRun.seed; } } internal static void DenyMapSpawns(orig_SpendAllCreditsOnMapSpawns_Transform_WeightedSelection1 orig, CombatDirector self, Transform mapSpawnTarget, WeightedSelection list) { if (CurrentRun.noEnemies) { self.monsterCredit = 0f; } orig.Invoke(self, mapSpawnTarget, list); } internal static void DenyInteractableSpawns(SceneDirector sceneDirector) { if (CurrentRun.noInteractables) { sceneDirector.onPopulateCreditMultiplier = 0f; } } internal static void DenyExperience(orig_AwardExperience orig, ExperienceManager self, Vector3 origin, CharacterBody body, ulong amount) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (!CurrentRun.lockExp) { orig.Invoke(self, origin, body, amount); } } internal static PingCache GetPingedTarget(CharacterMaster player) { if (pingedTargets.TryGetValue(player, out var value)) { return value; } return default(PingCache); } } public static class Lang { public const string DROPTABLE_DEFAULT = "Tier1:100,Tier2:60,Tier3:4"; public const string ADDPORTAL_ARGS = "Requires 1 argument: {portal ('blue'|'celestial'|'gold'|'green'|'void'|'all')}"; public const string BAN_ARGS = "Requires 1 argument: {player}"; public const string BIND_ARGS = "Requires 2 arguments: {key} [console_commands]"; public const string BIND_DELETE_ARGS = "Requires 1 argument: {key}"; public const string CHANGETEAM_ARGS = "Requires 1 (2 if from server) argument: {team} [player:]"; public const string CHARGEZONE_ARGS = "Requires 0 argument: [charge]"; public const string CREATEPICKUP_ARGS = "Requires 1 (3 if from server) argument: {object (item|equip|'lunarcoin'|'voidcoin')} [item_type:Permanent] [search ('item'|'equip'|'both'):'both'] [player:]"; public const string CREATEPOTENTIAL_ARGS = "Requires 0 (3 if from server) arguments: [droptable (droptable|'all'):'Tier1:100,Tier2:60,Tier3:4'] [count:3] [player:]"; public const string DUMPSTATE_ARGS = "Requires 0 (1 if from server) argument: [target (player|'pinged'):]"; public const string DUMPSTATS_ARGS = "Requires 1 argument: {body}"; public const string ENABLE_ARGS = "Requires 0 or 1 arguments: [enable (0|1)]"; public const string FIXEDTIME_ARGS = "Requires 0 or 1 argument: [time]"; public const string FORCEWAVE_ARGS = "Requires 0 or 1 argument [wave_prefab]"; public const string GIVEBUFF_ARGS = "Requires 1 (4 if from server) arguments: {buff} [count:1] [duration:0] [target (player|'pinged'):]"; public const string GIVEDOT_ARGS = "Requires 1 (4 if from server) argument: {dot} [count:1] [target (player|'pinged'):] [attacker (player|'pinged'):]"; public const string GIVEEQUIP_ARGS = "Requires 1 (2 if from server) argument: {equip (equip|'random')} [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]"; public const string GIVEEQUIPEXTRA_ARGS = "Requires 3 (4 if from server) argument: {equip (equip|'random')} {slot} {set} [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]"; public const string GIVEITEM_ARGS = "Requires 1 (4 if from server) argument: {item} [count:1] [item_type:Permanent] [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]"; public const string GIVELUNAR_ARGS = "Requires 0 arguments: [amount:1]"; public const string GIVEMONEY_ARGS = "Requires 1 argument: {amount} [target (player|'all')]"; public const string HEAL_ARGS = "Requires 1 (2 if from server) argument: {amount} [target (player|'pinged'):]"; public const string HURT_ARGS = "Requires 1 (2 if from server) argument: {amount} [target (player|'pinged'):]"; public const string KICK_ARGS = "Requires 1 argument: {player}"; public const string KILL_ARGS = "Requires 0 arguments: [true_kill (0|1):0/false]"; public const string KILLALL_ARGS = "Requires 0 arguments: [team (team|'enemies'):'enemies'] [true_kill (0|1):0/false]"; public const string LISTSKIN_ARGS = "Requires 0 arguments: [selection (body|'all'|'body'|'self'):'all']"; public const string LISTQUERY_ARGS = "Requires 0 arguments: [query]"; public const string LOADOUTSKIN_ARGS = "Requires 2 argument: {body_name (body|'self')} {skin_index}"; public const string NEXTBOSS_ARGS = "Requires 1 argument: {director_card} [count:1] [elite:None]"; public const string NEXTSTAGE_ARGS = "Requires 0 arguments: [specific_stage]"; public const string NO_ARGS = "Requires 0 arguments."; public const string PERM_MOD_ARGS = "Requires 2 arguments: {permission_level} {player}"; public const string POSTSOUNDEVENT_ARGS = "Requires 1 argument: {sound_event (event_name|event_id)}"; public const string RANDOMITEM_ARGS = "Requires 1 (4 if from server) argument: {count} [droptable (droptable|'all'):'Tier1:100,Tier2:60,Tier3:4'] [item_type:Permanent] [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]"; public const string REMOVEALLBUFFS_ARGS = "Requires 0 (2 if from server) arguments: [timed (0|1):0/false] [target (player|'pinged'):]"; public const string REMOVEALLDOTS_ARGS = "Requires 0 (1 if from server) arguments: [target (player|'pinged'):]"; public const string REMOVEALLITEMS_ARGS = "Requires 0 (1 if from server) arguments: [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]"; public const string REMOVEALLMINIONS_ARGS = "Requires 0 (1 if from server) argument: [target (player|'pinged'):]"; public const string REMOVEBUFF_ARGS = "Requires 1 (4 if from server) arguments: {buff} [count:1] [timed (0|1):0/false] [target (player|'pinged'):]"; public const string REMOVEBUFFSTACKS_ARGS = "Requires 1 (3 if from server) arguments: {buff} [timed (0|1):0/false] [target (player|'pinged'):]"; public const string REMOVEDOT_ARGS = "Requires 1 (3 if from server) argument: {dot} [count:1] [target (player|'pinged'):]"; public const string REMOVEDOTSTACKS_ARGS = "Requires 1 (2 if from server) argument: {dot} [target (player|'pinged'):]"; public const string REMOVEEQUIP_ARGS = "Requires 0 (1 if from server) arguments: [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]"; public const string REMOVEEQUIPEXTRA_ARGS = "Requires 2 (3 if from server) arguments: {slot} {set} [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]"; public const string REMOVEITEMSTACKS_ARGS = "Requires 1 (2 if from server) argument: {item} [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]"; public const string RESPAWN_ARGS = "Requires 0 (1 if from server) arguments: [player:]"; public const string RESTOCKEQUIP_ARGS = "Requires 0 (2 if from server) arguments: [count:1] [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]"; public const string RUNSETWAVESCLEARED_ARGS = "Requires 1 argument {wave}"; public const string SEED_ARGS = "Requires 0 or 1 argument: [new_seed]"; public const string SETARTIFACT_ARGS = "Requires 1 (2 if using 'all') argument: {artifact (artifact|'all')} [enable (0|1)]"; public const string SETDIFFICULTY_ARGS = "Requires 1 argument: {difficulty}"; public const string SPAWNAI_ARGS = "Requires 1 argument: {ai} [count:1] [elite:None] [braindead (0|1):0/false] [team (team|'ally'):Monster]"; public const string SPAWNAS_ARGS = "Requires 1 (2 if from server) argument: {body} [player:]"; public const string SPAWNBODY_ARGS = "Requires 1 argument: {body}"; public const string SPAWNDRONE_ARGS = "Requires 1 argument: {drone} [count:1] [tier:0]"; public const string SPAWNINTERACTABLE_ARGS = "Requires 1 argument: {interactable}"; public const string SPAWNLEMURIAN_ARGS = "Requires 1 argument: {item} [level:0]"; public const string SPAWNPORTAL_ARGS = "Requires 1 argument: {portal ('artifact'|'blue'|'celestial'|'deepvoid'|'gold'|'green'|'null'|'void')}"; public const string TIMESCALE_ARGS = "Requires 0 argument: [time_scale]"; public const string TRUEKILL_ARGS = "Requires 0 (1 if from server) arguments: [player:]"; public const string ADDPORTAL_HELP = "Add a portal to the current Teleporter on completion. Requires 1 argument: {portal ('blue'|'celestial'|'gold'|'green'|'void'|'all')}"; public const string BAN_HELP = "Bans the specified player from the session. Requires 1 argument: {player}"; public const string BIND_HELP = "Bind a key to execute specific commands. Requires 2 arguments: {key} [console_commands]"; public const string BIND_DELETE_HELP = "Remove a custom bind from the macro system of DebugToolkit. Requires 1 argument: {key}"; public const string BIND_RELOAD_HELP = "Reload the macro system of DebugToolkit. Requires 0 arguments."; public const string BUDDHA_HELP = "Become immortal. Instead of refusing damage you just refuse to take lethal damage.\nIt works by giving all damage a player takes DamageType.NonLethal. Requires 0 or 1 arguments: [enable (0|1)]"; public const string CHANGETEAM_HELP = "Change the specified player to the specified team. Requires 1 (2 if from server) argument: {team} [player:]"; public const string CHARGEZONE_HELP = "Set the charge of all active holdout zones. Requires 0 argument: [charge]"; public const string CREATEPICKUP_HELP = "Creates a PickupDroplet in front of a player. Requires 1 (3 if from server) argument: {object (item|equip|'lunarcoin'|'voidcoin')} [item_type:Permanent] [search ('item'|'equip'|'both'):'both'] [player:]"; public const string CREATEPOTENTIAL_HELP = "Creates a potential PickupDroplet in front of a player. Requires 0 (3 if from server) arguments: [droptable (droptable|'all'):'Tier1:100,Tier2:60,Tier3:4'] [count:3] [player:]"; public const string CURSORTELEPORT_HELP = "Teleport you to where your cursor is currently aiming at. Requires 0 arguments."; public const string DUMPBUFFS_HELP = "List the buffs/debuffs of all spawned bodies. Requires 0 arguments."; public const string DUMPBUILD_HELP = "Generate a list of commands to replicate your current inventory and minion state. Requires 0 arguments."; public const string DUMPINVENTORIES_HELP = "List the inventory items and equipment of all spawned bodies. Requires 0 arguments."; public const string DUMPSTATE_HELP = "List the current stats, entity state, and skill cooldown of a specified body. Requires 0 (1 if from server) argument: [target (player|'pinged'):]"; public const string DUMPSTATS_HELP = "List the base stats of a specific body. Requires 1 argument: {body}"; public const string EVOLVELEMURIANS_HELP = "Evolve all Devoted Lemurians. Requires 0 arguments."; public const string FAMILYEVENT_HELP = "Forces a family event to occur during the next stage. Requires 0 arguments."; public const string FIXEDTIME_HELP = "Sets the run timer to the specified value. Requires 0 or 1 argument: [time]"; public const string FORCEWAVE_HELP = "Set the next wave prefab. Leave empty to see all options. Requires 0 or 1 argument [wave_prefab]"; public const string GIVEBUFF_HELP = "Gives the specified buff to a character. A duration of 0 means permanent. Requires 1 (4 if from server) arguments: {buff} [count:1] [duration:0] [target (player|'pinged'):]"; public const string GIVEDOT_HELP = "Gives the specified DoT to a character. Requires 1 (4 if from server) argument: {dot} [count:1] [target (player|'pinged'):] [attacker (player|'pinged'):]"; public const string GIVEEQUIP_HELP = "Gives the specified equipment to a target. Requires 1 (2 if from server) argument: {equip (equip|'random')} [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]"; public const string GIVEEQUIPEXTRA_HELP = "Gives the specific equipment to a target. Requires 3 (4 if from server) argument: {equip (equip|'random')} {slot} {set} [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]"; public const string GIVEITEM_HELP = "Gives the specified item to a target. Requires 1 (4 if from server) argument: {item} [count:1] [item_type:Permanent] [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]"; public const string GIVELUNAR_HELP = "Gives a lunar coin to you. Requires 0 arguments: [amount:1]"; public const string GIVEMONEY_HELP = "Gives the specified amount of money to the specified player. Requires 1 argument: {amount} [target (player|'all')]"; public const string GIVEVOID_HELP = "Gives a void coin to you. Requires 0 arguments: [amount:1]"; public const string GOD_HELP = "Become invincible. Requires 0 or 1 arguments: [enable (0|1)]"; public const string HEAL_HELP = "Heal yourself or another target. Requires 1 (2 if from server) argument: {amount} [target (player|'pinged'):]"; public const string HURT_HELP = "Deal generic damage to yourself or another target. Requires 1 (2 if from server) argument: {amount} [target (player|'pinged'):]"; public const string KICK_HELP = "Kicks the specified player from the session. Requires 1 argument: {player}"; public const string KILL_HELP = "Kills the pinged target. Requires 0 arguments: [true_kill (0|1):0/false]"; public const string KILLALL_HELP = "Kill all entities on the specified team. Requires 0 arguments: [team (team|'enemies'):'enemies'] [true_kill (0|1):0/false]"; public const string LISTAI_HELP = "List all Masters and their language invariants. Requires 0 arguments: [query]"; public const string LISTARTIFACT_HELP = "List all Artifacts and their language invariants. Requires 0 arguments: [query]"; public const string LISTBODY_HELP = "List all Bodies and their language invariants. Requires 0 arguments: [query]"; public const string LISTBUFF_HELP = "List all Buffs and whether they stack. Requires 0 arguments: [query]"; public const string LISTDIFFICULTY_HELP = "List all Difficulties. Requires 0 arguments: [query]"; public const string LISTDIRECTORCARDS_HELP = "List all Director Cards. Requires 0 arguments: [query]"; public const string LISTDOT_HELP = "List all DoTs. Requires 0 arguments: [query]"; public const string LISTDRONE_HELP = "List all Drones. Requires 0 arguments: [query]"; public const string LISTELITE_HELP = "List all Elites and their language invariants. Requires 0 arguments: [query]"; public const string LISTEQUIP_HELP = "List all equipment and their availability. Requires 0 arguments: [query]"; public const string LISTINTERACTABLE_HELP = "Lists all interactables. Requires 0 arguments: [query]"; public const string LISTITEMTIER_HELP = "List all item tiers. Requires 0 arguments: [query]"; public const string LISTITEM_HELP = "List all items and their availability. Requires 0 arguments: [query]"; public const string LISTPLAYER_HELP = "List all players and their ID. Requires 0 arguments: [query]"; public const string LISTSCENE_HELP = "List all scenes and their language invariants. Requires 0 arguments: [query]"; public const string LISTSKIN_HELP = "List all bodies with skins. Requires 0 arguments: [selection (body|'all'|'body'|'self'):'all']"; public const string LISTSURVIVOR_HELP = "List all survivors and their body/ai names. Requires 0 arguments: [query]"; public const string LISTTEAM_HELP = "List all Teams and their language invariants. Requires 0 arguments: [query]"; public const string LOADOUTSKIN_HELP = "Change your loadout's skin. Requires 2 argument: {body_name (body|'self')} {skin_index}"; public const string LOCKEXP_HELP = "Prevent Experience gain. Requires 0 or 1 arguments: [enable (0|1)]"; public const string MACRO_DTZOOM_HELP = "Gives you 20 hooves and 200 feathers for getting around quickly."; public const string MACRO_LATEGAME_HELP = "Sets the current run to the 'lategame' as defined by HG. This command is DESTRUCTIVE."; public const string MACRO_MIDGAME_HELP = "Sets the current run to the 'midgame' as defined by HG. This command is DESTRUCTIVE."; public const string MACRO_PEACE_HELP = "Kills all enemies, disables enemies spawning, and enables godmode."; public const string MACRO_SCANNER_HELP = "Gives the Radar Scanner equipment with reduced cooldown to easily search stages."; public const string NEXTBOSS_HELP = "Sets the next teleporter/simulacrum boss to the specified boss. Requires 1 argument: {director_card} [count:1] [elite:None]"; public const string NEXTSTAGE_HELP = "Forces a stage change to the specified stage. Requires 0 arguments: [specific_stage]"; public const string NEXTWAVE_HELP = "Advance to the next Simulacrum wave. Requires 0 arguments."; public const string NOCLIP_HELP = "Allow flying and going through objects. Sprinting will double the speed. Requires 0 or 1 arguments: [enable (0|1)]"; public const string NOENEMIES_HELP = "Prevent Monster spawning. Requires 0 or 1 arguments: [enable (0|1)]"; public const string NOINTERACTABLES_HELP = "Prevent Interactable spawning. Requires 0 or 1 arguments: [enable (0|1)]"; public const string PERM_ENABLE_HELP = "Enable or disable the permission system.Requires 0 or 1 arguments: [enable (0|1)]"; public const string PERM_MOD_HELP = "Change the permission level of the specified playerid/usernameRequires 2 arguments: {permission_level} {player}"; public const string PERM_RELOAD_HELP = "Reload the permission system, updates user and commands permissions."; public const string POSTSOUNDEVENT_HELP = "Post a sound event to the AkSoundEngine (WWise) either by its event name or event ID. Requires 1 argument: {sound_event (event_name|event_id)}"; public const string PREVENT_PROFILE_WRITING_HELP = "Prevent saving the user profile to avoid bogus data. Requires 0 or 1 arguments: [enable (0|1)]"; public const string RANDOMITEM_HELP = "Generate random items from the available item tiers. Requires 1 (4 if from server) argument: {count} [droptable (droptable|'all'):'Tier1:100,Tier2:60,Tier3:4'] [item_type:Permanent] [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]"; public const string RELOADCONFIG_HELP = "Reload all default config files from all loaded plugins."; public const string REMOVEALLBUFFS_HELP = "Removes all buffs from a character. Requires 0 (2 if from server) arguments: [timed (0|1):0/false] [target (player|'pinged'):]"; public const string REMOVEALLDOTS_HELP = "Removes all DoTs from a character. Requires 0 (1 if from server) arguments: [target (player|'pinged'):]"; public const string REMOVEALLITEMS_HELP = "Removes all items from a target. Requires 0 (1 if from server) arguments: [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]"; public const string REMOVEALLMINIONS_HELP = "Removes all minions from a target without leaving a trace. Requires 0 (1 if from server) argument: [target (player|'pinged'):]"; public const string REMOVEBUFF_HELP = "Removes a specified buff from a character. Timed buffs prioritise the longest expiration stack. Requires 1 (4 if from server) arguments: {buff} [count:1] [timed (0|1):0/false] [target (player|'pinged'):]"; public const string REMOVEBUFFSTACKS_HELP = "Removes all stacks of a specified buff from a character. Requires 1 (3 if from server) arguments: {buff} [timed (0|1):0/false] [target (player|'pinged'):]"; public const string REMOVEDOT_HELP = "Remove a DoT stack with the longest expiration from a character. Requires 1 (3 if from server) argument: {dot} [count:1] [target (player|'pinged'):]"; public const string REMOVEDOTSTACKS_HELP = "Remove all stacks of a specified DoT from a character. Requires 1 (2 if from server) argument: {dot} [target (player|'pinged'):]"; public const string REMOVEEQUIP_HELP = "Removes the equipment from a target. Requires 0 (1 if from server) arguments: [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]"; public const string REMOVEEQUIPEXTRA_HELP = "Removes the equipment in the specified slot/set from a target. Requires 2 (3 if from server) arguments: {slot} {set} [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]"; public const string REMOVEITEM_HELP = "Removes the specified quantities of an item from a target. Requires 1 (4 if from server) argument: {item} [count:1] [item_type:Permanent] [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]"; public const string REMOVEITEMSTACKS_HELP = "Removes all the stacks of a specified item from a target. Requires 1 (2 if from server) argument: {item} [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]"; public const string RESPAWN_HELP = "Respawns the specified player. Requires 0 (1 if from server) arguments: [player:]"; public const string RESTOCKEQUIP_HELP = "Restock charges for the current equipment. Requires 0 (2 if from server) arguments: [count:1] [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]"; public const string RUNSETWAVESCLEARED_HELP = "Set the Simulacrum waves cleared. Must be positive. Requires 1 argument {wave}"; public const string SEED_HELP = "Gets/Sets the game seed until game close. Use 0 to reset to vanilla generation. Requires 0 or 1 argument: [new_seed]"; public const string SETARTIFACT_HELP = "Enable/disable an Artifact. Requires 1 (2 if using 'all') argument: {artifact (artifact|'all')} [enable (0|1)]"; public const string SETDIFFICULTY_HELP = "Change the run difficulty. Requires 1 argument: {difficulty}"; public const string SPAWNAS_HELP = "Respawn the specified player using the specified body prefab. Requires 1 (2 if from server) argument: {body} [player:]"; public const string SPAWNAI_HELP = "Spawns the specified CharacterMaster. Requires 1 argument: {ai} [count:1] [elite:None] [braindead (0|1):0/false] [team (team|'ally'):Monster]"; public const string SPAWNBODY_HELP = "Spawns the specified dummy body. Requires 1 argument: {body}"; public const string SPAWNDRONE_HELP = "Spawns the specified drone as a minion at the appropriate tier. Requires 1 argument: {drone} [count:1] [tier:0]"; public const string SPAWNINTERACTABLE_HELP = "Spawns the specified interactable. List_Interactable for options. Requires 1 argument: {interactable}"; public const string SPAWNLEMURIAN_HELP = "Spawns a Devoted Lemurian. Requires 1 argument: {item} [level:0]"; public const string SPAWNPORTAL_HELP = "Spawns a portal in front of the player. Requires 1 argument: {portal ('artifact'|'blue'|'celestial'|'deepvoid'|'gold'|'green'|'null'|'void')}"; public const string STOPTIMER_HELP = "Pause/unpause the run timer. Requires 0 or 1 arguments: [enable (0|1)]"; public const string TIMESCALE_HELP = "Sets the Time Delta. Requires 0 argument: [time_scale]"; public const string TRUEKILL_HELP = "Ignore Dio's and kill the entity. Requires 0 (1 if from server) arguments: [player:]"; public const string CREATEPICKUP_AMBIGIOUS_2 = "Could not choose between {0} and {1}, please be more precise. Consider using 'equip' or 'item' as the second argument."; public const string CREATEPICKUP_NOTFOUND = "Could not find any item nor equipment with that name."; public const string CREATEPICKUP_SUCCESS_1 = "Successfully created the pickup {0}."; public const string CREATEPICKUP_SUCCESS_2 = "Successfully created a potential with {0} options."; public const string GIVELUNAR_2 = "{0} {1} {2} coin(s)."; public const string GIVEOBJECT = "Gave {0} to {1}."; public const string GIVEOBJECT_WITH_STACKS = "Gave {0} {1} to {2}."; public const string OBSOLETEWARNING = "This command has become obsolete and will be removed in the next version. "; public const string NETWORKING_OTHERPLAYER_4 = "{0}({1}) issued: {2} {3}"; public const string NOMESSAGE = "Yell at the modmakers if you see this message!"; public const string PARTIALIMPLEMENTATION_WARNING = "WARNING: PARTIAL IMPLEMENTATION. WIP."; public const string PLAYER_DEADRESPAWN = "Player will spawn as the specified body next round. Use 'respawn' to skip the wait."; public const string PLAYER_SKINCHANGERESPAWN = "Player will spawn with the specified skin next round. Use 'respawn' to skip the wait."; public const string REMOVEOBJECT = "Removed {0} from {1}."; public const string REMOVEOBJECT_WITH_STACKS = "Removed {0} {1} from {2}."; public const string RESETOBJECT = "Reset {0} for {1}."; public const string RUNSETSTAGESCLEARED_HELP = "Sets the amount of stages cleared. This does not change the current stage."; public const string SETTING_ENABLED = "{0} enabled."; public const string SETTING_DISABLED = "{0} disabled."; public const string SPAWN_ATTEMPT_1 = "Attempting to spawn: {0}"; public const string SPAWN_ATTEMPT_2 = "Attempting to spawn {0}: {1}"; public const string USE_RESPAWN = "Use 'respawn' to skip the wait."; public const string BODY_NOTFOUND = "Specified body not found. Please use list_body for options."; public const string DOTCONTROLLER_NOTFOUND = "The selected target has no DoTs."; public const string EXPANSION_LOCKED = "An expansion is required for this {0}: {1}"; public const string INSUFFICIENT_ARGS = "Insufficient number of arguments. "; public const string INVALID_ARG_VALUE = "Invalid value for {0}."; public const string NEGATIVE_ARG = "Negative value for {0} encountered. It needs to be zero or higher."; public const string NOCONNECTION_ERROR = "Not connected to a server."; public const string NOMATCH_ERROR = "No {0} found that match \"{1}\"."; public const string NOTINARUN_ERROR = "This command only works when in a Run!"; public const string NOTINASIMULACRUMRUN_ERROR = "Must be in a Simulacrum Run!"; public const string NOTINVOIDFIELDS_ERROR = "Must be on Void Fields!"; public const string OBJECT_NOTFOUND = "No {0} with the name \"{1}\" could be found. Please use {2} for options."; public const string PARSE_ERROR = "Unable to parse {0} to {1}."; public const string PINGEDBODY_NOTFOUND = "Pinged target not found. Either the last ping was not a character, or it has been destroyed since."; public const string PLAYER_NOTFOUND = "Specified player not found or isn't alive. Please use list_player for options."; public const string ALL = "ALL"; public const string ALLY = "ALLY"; public const string BOTH = "BOTH"; public const string COIN_LUNAR = "LUNARCOIN"; public const string COIN_VOID = "VOIDCOIN"; public const string DEFAULT_VALUE = ""; public const string DEVOTION = "DEVOTION"; public const string ENEMIES = "ENEMIES"; public const string EQUIP = "EQUIP"; public const string EVOLUTION = "EVOLUTION"; public const string ITEM = "ITEM"; public const string PINGED = "PINGED"; public const string RANDOM = "RANDOM"; public const string SIMULACRUM = "SIMULACRUM"; public const string VOIDFIELDS = "VOIDFIELDS"; public const string PS_ARGUSER_HAS_MORE_PERM = "Specified user {0} has a greater permission level than you."; public const string PS_ARGUSER_HAS_SAME_PERM = "Specified user {0} has the same permission level as you."; public const string PS_NO_REQUIRED_LEVEL = "You don't have the required permission {0} to use this command."; public const string DS_INVALIDARG = "This command doesn't support the '{0}' argument from a dedicated server."; public const string DS_NOTAVAILABLE = "This command doesn't make sense to run from a dedicated server."; public const string DS_NOTYETIMPLEMENTED = "This command has not yet been implemented to be run from a dedicated server."; } internal class Log { public enum LogLevel { Info = 0, Message = 1, Warning = 2, Error = 3, InfoClientOnly = 69, MessageClientOnly = 70, WarningClientOnly = 71, ErrorClientOnly = 72 } public enum Target { Bepinex = -2, Ror2 } private const bool BepinexInfoAlwaysLogs = true; private const int NetworkEnum = 69; private static ManualLogSource logger; public static BoolConVar DebugConvar = new BoolConVar("DebugToolkit".ToLower() + "_debug", (ConVarFlags)0, "0", "DebugToolkit extensive debugging"); public Log(ManualLogSource bepLogger) { logger = bepLogger; } internal static void InitRPC() { NetworkManager.DebugToolKitComponents.AddComponent(); } public static void Message(object input, LogLevel level = LogLevel.Message, Target target = Target.Ror2) { switch (target) { case Target.Ror2: Ror2Log(input, level); return; case Target.Bepinex: BepinexLog(input, level); return; } if (NetworkUser.readOnlyInstancesList.Count - 1 >= (int)target && target >= (Target)0) { if (input.GetType() != typeof(string)) { Message($"Couldn't send network message because the message was not a string: {input}.", LogLevel.Error, Target.Bepinex); return; } NetworkUser networkUser = NetworkUser.readOnlyInstancesList[(int)target]; MessageInfo($"Send a network message to {(int)target}, length={((string)input).Length}"); Message((string)input, networkUser, level); } else { Message($"Couldn't find target {(int)target} for message: {input}", LogLevel.Error, Target.Bepinex); } } public static void MessageNetworked(string input, ConCommandArgs args, LogLevel level = LogLevel.Message) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_001c: 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) if ((Object)(object)args.sender != (Object)null && !((NetworkBehaviour)args.sender).isLocalPlayer) { Message(input, args.sender, level); } if (level < LogLevel.InfoClientOnly || (Object)(object)args.sender == (Object)null || ((NetworkBehaviour)args.sender).isLocalPlayer) { Message(input, level, Target.Ror2); } } public static void Message(string input, NetworkUser networkUser, LogLevel level = LogLevel.Message) { if (!((Object)(object)networkUser == (Object)null)) { LogNet.Invoke(networkUser, input, (int)level); } } public static void MessageWarning(object input, Target target = Target.Ror2) { Message(input, LogLevel.Warning, target); } public static void MessageInfo(object input, Target target = Target.Ror2) { Message(input, LogLevel.Info, target); } private static void Ror2Log(object input, LogLevel level) { switch (level) { case LogLevel.Info: case LogLevel.InfoClientOnly: if (DebugConvar.value) { Debug.Log(input); } break; case LogLevel.Message: case LogLevel.MessageClientOnly: Debug.Log(input); break; case LogLevel.Warning: case LogLevel.WarningClientOnly: Debug.LogWarning(input); break; case LogLevel.Error: case LogLevel.ErrorClientOnly: Debug.LogError(input); break; } } private static void BepinexLog(object input, LogLevel level) { if (logger == null) { throw new NullReferenceException("Log Class in " + Assembly.GetExecutingAssembly().GetName().Name + " not initialized prior to message call!"); } switch (level) { case LogLevel.Info: case LogLevel.InfoClientOnly: logger.LogInfo(input); break; case LogLevel.Message: case LogLevel.MessageClientOnly: logger.LogMessage(input); break; case LogLevel.Warning: case LogLevel.WarningClientOnly: logger.LogWarning(input); break; case LogLevel.Error: case LogLevel.ErrorClientOnly: logger.LogError(input); break; } } } internal class LogNet : NetworkBehaviour { private static LogNet _instance; private static int kTargetRpcTargetLog; private void Awake() { _instance = this; } internal static void Invoke(NetworkUser networkUser, string msg, int level) { _instance.CallTargetLog(((NetworkBehaviour)networkUser).connectionToClient, msg, level); } [TargetRpc] private void TargetLog(NetworkConnection _, string msg, int level) { Log.Message(msg, (Log.LogLevel)level, Log.Target.Ror2); Hooks.ScrollConsoleDown(); } private void UNetVersion() { } protected static void InvokeRpcTargetLog(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"TargetRPC TargetLog called on server."); } else { ((LogNet)(object)obj).TargetLog(ClientScene.readyConnection, reader.ReadString(), (int)reader.ReadPackedUInt32()); } } public void CallTargetLog(NetworkConnection _, string msg, int level) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"TargetRPC Function TargetLog called on client."); return; } if (_ is ULocalConnectionToServer) { Debug.LogError((object)"TargetRPC Function TargetLog called on connection to server"); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)kTargetRpcTargetLog); val.Write(((Component)this).GetComponent().netId); val.Write(msg); val.WritePackedUInt32((uint)level); ((NetworkBehaviour)this).SendTargetRPCInternal(_, val, 0, "TargetLog"); } static LogNet() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown kTargetRpcTargetLog = -2011288276; NetworkBehaviour.RegisterRpcDelegate(typeof(LogNet), kTargetRpcTargetLog, new CmdDelegate(InvokeRpcTargetLog)); NetworkCRC.RegisterBehaviour("LogNet", 0); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { bool result = default(bool); return result; } public override void OnDeserialize(NetworkReader reader, bool initialState) { } } internal static class NetworkManager { internal static GameObject DebugToolKitComponents; private static GameObject _debugToolKitComponentsSpawned; internal static void Init() { //IL_0005: 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_001c: Expected O, but got Unknown //IL_0026: Expected O, but got Unknown GameObject val = new GameObject("dtcn"); val.AddComponent(); DebugToolKitComponents = PrefabAPI.InstantiateClone(val, "DebugToolKitComponentsNetworked"); Object.Destroy((Object)val); Log.InitRPC(); Command_Noclip.InitRPC(); Command_Teleport.InitRPC(); DebugToolKitComponents.AddComponent(); DebugToolKitComponents.AddComponent(); } internal static void CreateNetworkObject(orig_Start orig, NetworkSession self) { orig.Invoke(self); if (!Object.op_Implicit((Object)(object)_debugToolKitComponentsSpawned) && NetworkServer.active) { _debugToolKitComponentsSpawned = Object.Instantiate(DebugToolKitComponents); NetworkServer.Spawn(_debugToolKitComponentsSpawned); } } internal static void DestroyNetworkObject(orig_OnDestroy orig, NetworkSession self) { if (Object.op_Implicit((Object)(object)_debugToolKitComponentsSpawned) && NetworkServer.active) { NetworkServer.Destroy(_debugToolKitComponentsSpawned); _debugToolKitComponentsSpawned = null; } orig.Invoke(self); } } public sealed class StringFinder { private struct MatchSimilarity { public int similarity; public object item; } private static StringFinder instance; private static readonly List characterSpawnCard = new List(); private static readonly List interactableSpawnCards = new List(); internal static Dictionary difficultyDefs = new Dictionary(); internal static readonly string NAME_NOTFOUND = "???"; public static EliteIndex EliteIndex_NotFound = (EliteIndex)(-2); public static ItemTier ItemTier_NotFound = (ItemTier)(-1); public static TeamIndex TeamIndex_NotFound = (TeamIndex)(-2); public static StringFinder Instance => instance ?? (instance = new StringFinder()); public List DirectorCards => characterSpawnCard; public List InteractableSpawnCards => interactableSpawnCards; private StringFinder() { GatherCSCs(); GatherISCs(); } private static void GatherCSCs() { GatherAddressableAssets("/csc", delegate(CharacterSpawnCard asset) { //IL_0005: 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_0018: 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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown characterSpawnCard.Add(new DirectorCard { spawnCard = (SpawnCard)(object)asset, forbiddenUnlockableDef = null, minimumStageCompletions = 0, preventOverhead = true, spawnDistance = (MonsterSpawnDistance)0 }); }); } private void GatherISCs() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown GatherAddressableAssets("/isc", delegate(InteractableSpawnCard asset) { interactableSpawnCards.Add(asset); }); ClassicStageInfo.Start += new hook_Start(AddCurrentStageIscsToCache); } private static void GatherAddressableAssets(string filterKey, Action onAssetLoaded) { RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, (Action)delegate { //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) foreach (IResourceLocator resourceLocator in Addressables.ResourceLocators) { foreach (object key in resourceLocator.Keys) { string text = key.ToString(); if (text.Contains(filterKey)) { AsyncOperationHandle val = Addressables.LoadAssetAsync((object)text); val.Completed += delegate(AsyncOperationHandle completedAsyncOperation) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 if ((int)completedAsyncOperation.Status == 1) { onAssetLoaded(completedAsyncOperation.Result); } }; } } } }); } private void AddCurrentStageIscsToCache(orig_Start orig, ClassicStageInfo self) { orig.Invoke(self); if (!((Object)(object)self.interactableCategories != (Object)null)) { return; } IEnumerable collection = (from directorCard in self.interactableCategories.categories.SelectMany((Category category) => category.cards) select directorCard.spawnCard into spawnCard where spawnCard is InteractableSpawnCard && interactableSpawnCards.All((InteractableSpawnCard existingIsc) => ((Object)existingIsc).name != ((Object)spawnCard).name) select spawnCard).Cast(); interactableSpawnCards.AddRange(collection); } [SystemInitializer(new Type[] { typeof(RuleCatalog) })] private static void Init() { //IL_0018: 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: Invalid comparison between Unknown and I4 //IL_0020: 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_002c: 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) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (Chainloader.PluginInfos.ContainsKey("com.bepis.r2api.difficulty")) { CollectAllVanillaAndModdedDifficulties(); return; } for (DifficultyIndex val = (DifficultyIndex)0; (int)val < DifficultyCatalog.difficultyDefs.Length; val = (DifficultyIndex)(val + 1)) { difficultyDefs[val] = DifficultyCatalog.GetDifficultyDef(val); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static void CollectAllVanillaAndModdedDifficulties() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) foreach (KeyValuePair difficultyDefinition in DifficultyAPI.difficultyDefinitions) { if (difficultyDefinition.Value != null) { difficultyDefs[difficultyDefinition.Key] = difficultyDefinition.Value; } } } public ArtifactIndex GetArtifactFromPartial(string name) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) return GetArtifactsFromPartial(name).DefaultIfEmpty((ArtifactIndex)(-1)).First(); } public IEnumerable GetArtifactsFromPartial(string name) { int num = default(int); if (TextSerialization.TryParseInvariant(name, ref num)) { ArtifactIndex val = (ArtifactIndex)num; if ((Object)(object)ArtifactCatalog.GetArtifactDef(val) != (Object)null) { yield return val; } yield break; } name = name.ToUpperInvariant(); ArtifactDef[] artifactDefs = ArtifactCatalog.artifactDefs; foreach (ArtifactDef val2 in artifactDefs) { string text = GetLangInvar(val2.nameToken).ToUpper(); if (val2.cachedName.ToUpper().Contains(name) || text.Contains(name)) { yield return val2.artifactIndex; } } } public BuffIndex GetBuffFromPartial(string name) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) return GetBuffsFromPartial(name).DefaultIfEmpty((BuffIndex)(-1)).First(); } public IEnumerable GetBuffsFromPartial(string name) { int num = default(int); if (TextSerialization.TryParseInvariant(name, ref num)) { BuffIndex val = (BuffIndex)num; if ((Object)(object)BuffCatalog.GetBuffDef(val) != (Object)null) { yield return val; } yield break; } name = name.ToUpperInvariant(); List list = new List(); BuffDef[] buffDefs = BuffCatalog.buffDefs; foreach (BuffDef val2 in buffDefs) { if (((Object)val2).name.ToUpper().Contains(name)) { list.Add(new MatchSimilarity { similarity = GetSimilarity(((Object)val2).name, name), item = val2.buffIndex }); } } foreach (MatchSimilarity item in list.OrderByDescending((MatchSimilarity m) => m.similarity)) { yield return (BuffIndex)item.item; } } public DotIndex GetDotFromPartial(string name) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) return GetDotsFromPartial(name).DefaultIfEmpty((DotIndex)(-1)).First(); } public unsafe IEnumerable GetDotsFromPartial(string name) { int num = default(int); if (TextSerialization.TryParseInvariant(name, ref num)) { DotIndex val = (DotIndex)num; if (DotController.GetDotDef(val) != null) { yield return val; } yield break; } name = name.ToUpperInvariant(); List list = new List(); foreach (DotIndex item in Enum.GetValues(typeof(DotIndex)).Cast()) { if (DotController.GetDotDef(item) != null && ((object)(*(DotIndex*)(&item))/*cast due to .constrained prefix*/).ToString().ToUpper().Contains(name)) { list.Add(new MatchSimilarity { similarity = GetSimilarity(((object)(*(DotIndex*)(&item))/*cast due to .constrained prefix*/).ToString(), name), item = item }); } } foreach (MatchSimilarity item2 in list.OrderByDescending((MatchSimilarity m) => m.similarity)) { yield return (DotIndex)item2.item; } } public EquipmentIndex GetEquipFromPartial(string name) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) return GetEquipsFromPartial(name).DefaultIfEmpty((EquipmentIndex)(-1)).First(); } public IEnumerable GetEquipsFromPartial(string name) { int num = default(int); if (TextSerialization.TryParseInvariant(name, ref num)) { EquipmentIndex val = (EquipmentIndex)num; if ((Object)(object)EquipmentCatalog.GetEquipmentDef(val) != (Object)null) { yield return val; } yield break; } name = name.ToUpperInvariant(); List list = new List(); EquipmentDef[] equipmentDefs = EquipmentCatalog.equipmentDefs; foreach (EquipmentDef val2 in equipmentDefs) { string text = GetLangInvar(val2.nameToken).ToUpper(); if (((Object)val2).name.ToUpper().Contains(name) || text.Contains(name)) { list.Add(new MatchSimilarity { similarity = Math.Max(GetSimilarity(((Object)val2).name, name), GetSimilarity(text, name)), item = val2.equipmentIndex }); } } foreach (MatchSimilarity item in list.OrderByDescending((MatchSimilarity m) => m.similarity)) { yield return (EquipmentIndex)item.item; } } public ItemTier GetItemTierFromPartial(string name) { //IL_0007: 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) return GetItemTiersFromPartial(name).DefaultIfEmpty(ItemTier_NotFound).First(); } public IEnumerable GetItemTiersFromPartial(string name) { List list = ((IEnumerable)(object)ItemTierCatalog.allItemTierDefs).OrderBy((ItemTierDef t) => t.tier).ToList(); int num = default(int); if (TextSerialization.TryParseInvariant(name, ref num)) { ItemTier val = (ItemTier)num; foreach (ItemTierDef item in list) { if (item.tier == val) { yield return val; break; } } yield break; } name = name.ToUpperInvariant(); List list2 = new List(); foreach (ItemTierDef item2 in list) { if (((Object)item2).name.ToUpper().Contains(name)) { list2.Add(new MatchSimilarity { similarity = GetSimilarity(((Object)item2).name, name), item = item2.tier }); } } foreach (MatchSimilarity item3 in list2.OrderByDescending((MatchSimilarity m) => m.similarity)) { yield return (ItemTier)item3.item; } } public ItemIndex GetItemFromPartial(string name) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) return GetItemsFromPartial(name).DefaultIfEmpty((ItemIndex)(-1)).First(); } public IEnumerable GetItemsFromPartial(string name) { int num = default(int); if (TextSerialization.TryParseInvariant(name, ref num)) { ItemIndex val = (ItemIndex)num; if (ItemCatalog.IsIndexValid(ref val)) { yield return val; } yield break; } name = name.ToUpperInvariant(); List list = new List(); Enumerator enumerator = ItemCatalog.allItemDefs.GetEnumerator(); try { while (enumerator.MoveNext()) { ItemDef current = enumerator.Current; string text = GetLangInvar(current.nameToken).ToUpper(); if (((Object)current).name.ToUpper().Contains(name) || text.Contains(name)) { list.Add(new MatchSimilarity { similarity = Math.Max(GetSimilarity(((Object)current).name, name), GetSimilarity(text, name)), item = current.itemIndex }); } } } finally { ((IDisposable)enumerator/*cast due to .constrained prefix*/).Dispose(); } foreach (MatchSimilarity item in list.OrderByDescending((MatchSimilarity m) => m.similarity)) { yield return (ItemIndex)item.item; } } public NetworkUser GetPlayerFromPartial(string name) { return GetPlayersFromPartial(name).DefaultIfEmpty(null).First(); } public IEnumerable GetPlayersFromPartial(string name) { int num = default(int); if (TextSerialization.TryParseInvariant(name, ref num)) { if (num >= 0 && num < NetworkUser.readOnlyInstancesList.Count) { yield return NetworkUser.readOnlyInstancesList[num]; } yield break; } name = name.ToUpperInvariant(); List list = new List(); foreach (NetworkUser readOnlyInstances in NetworkUser.readOnlyInstancesList) { if (readOnlyInstances.userName.ToUpper().Contains(name)) { list.Add(new MatchSimilarity { similarity = GetSimilarity(readOnlyInstances.userName, name), item = readOnlyInstances }); } } foreach (MatchSimilarity item in list.OrderByDescending((MatchSimilarity m) => m.similarity)) { yield return (NetworkUser)item.item; } } public TeamIndex GetTeamFromPartial(string name) { //IL_0007: 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) return GetTeamsFromPartial(name).DefaultIfEmpty(TeamIndex_NotFound).First(); } public unsafe IEnumerable GetTeamsFromPartial(string name) { int num = default(int); if (TextSerialization.TryParseInvariant(name, ref num)) { TeamIndex val = (TeamIndex)(sbyte)num; if ((int)val == -1 || TeamCatalog.GetTeamDef(val) != null) { yield return val; } yield break; } name = name.ToUpperInvariant(); List list = new List(); foreach (TeamIndex item in from TeamIndex t in Enum.GetValues(typeof(TeamIndex)) orderby t select t) { if (((int)item == -1 || TeamCatalog.GetTeamDef(item) != null) && ((object)(*(TeamIndex*)(&item))/*cast due to .constrained prefix*/).ToString().ToUpper().Contains(name)) { list.Add(new MatchSimilarity { similarity = GetSimilarity(((object)(*(TeamIndex*)(&item))/*cast due to .constrained prefix*/).ToString(), name), item = item }); } } foreach (MatchSimilarity item2 in list.OrderByDescending((MatchSimilarity m) => m.similarity)) { yield return (TeamIndex)item2.item; } } public EliteIndex GetEliteFromPartial(string name) { //IL_0007: 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) return GetElitesFromPartial(name).DefaultIfEmpty(EliteIndex_NotFound).First(); } public IEnumerable GetElitesFromPartial(string name) { int num = default(int); if (TextSerialization.TryParseInvariant(name, ref num)) { EliteIndex val = (EliteIndex)num; if ((int)val == -1) { yield return val; } else if ((Object)(object)EliteCatalog.GetEliteDef(val) != (Object)null) { yield return val; } yield break; } name = name.ToUpperInvariant(); List list = new List(); if ("NONE".Contains(name)) { list.Add(new MatchSimilarity { similarity = GetSimilarity("None", name), item = (object)(EliteIndex)(-1) }); } EliteDef[] eliteDefs = EliteCatalog.eliteDefs; foreach (EliteDef val2 in eliteDefs) { string text = GetLangInvar(val2.modifierToken).ToUpper(); if (((Object)val2).name.ToUpper().Contains(name) || text.Contains(name)) { list.Add(new MatchSimilarity { similarity = Math.Max(GetSimilarity(((Object)val2).name, name), GetSimilarity(text, name)), item = val2.eliteIndex }); } } foreach (MatchSimilarity item in list.OrderByDescending((MatchSimilarity m) => m.similarity)) { yield return (EliteIndex)item.item; } } public DifficultyIndex GetDifficultyFromPartial(string name) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) return GetDifficultiesFromPartial(name).DefaultIfEmpty((DifficultyIndex)(-1)).First(); } public IEnumerable GetDifficultiesFromPartial(string name) { int num = default(int); if (TextSerialization.TryParseInvariant(name, ref num)) { DifficultyIndex val = (DifficultyIndex)num; if (difficultyDefs.ContainsKey(val)) { yield return val; } yield break; } List list = difficultyDefs.Keys.OrderBy((DifficultyIndex i) => i).ToList(); name = name.ToUpperInvariant(); List list2 = new List(); foreach (DifficultyIndex item in list) { string text = GetLangInvar(difficultyDefs[item].nameToken).ToUpper(); if (text.Contains(name)) { list2.Add(new MatchSimilarity { similarity = GetSimilarity(text, name), item = item }); } } foreach (MatchSimilarity item2 in list2.OrderByDescending((MatchSimilarity m) => m.similarity)) { yield return (DifficultyIndex)item2.item; } } public DirectorCard GetDirectorCardFromPartial(string name) { return GetDirectorCardsFromPartial(name).DefaultIfEmpty(null).First(); } public IEnumerable GetDirectorCardsFromPartial(string name) { int num = default(int); if (TextSerialization.TryParseInvariant(name, ref num)) { if (num >= 0 && num < characterSpawnCard.Count) { yield return characterSpawnCard[num]; } yield break; } name = name.ToUpperInvariant(); List list = new List(); foreach (DirectorCard item in characterSpawnCard) { if (((Object)item.spawnCard).name.ToUpper().Contains(name)) { list.Add(new MatchSimilarity { similarity = GetSimilarity(((Object)item.spawnCard).name, name), item = item }); } } foreach (MatchSimilarity item2 in list.OrderByDescending((MatchSimilarity m) => m.similarity)) { yield return (DirectorCard)item2.item; } } public InteractableSpawnCard GetInteractableSpawnCardFromPartial(string name) { return GetInteractableSpawnCardsFromPartial(name).DefaultIfEmpty(null).First(); } public IEnumerable GetInteractableSpawnCardsFromPartial(string name) { int num = default(int); if (TextSerialization.TryParseInvariant(name, ref num)) { if (num >= 0 && num < interactableSpawnCards.Count) { yield return interactableSpawnCards[num]; } yield break; } name = name.ToUpperInvariant(); List list = new List(); foreach (InteractableSpawnCard interactableSpawnCard in interactableSpawnCards) { string text = GetLangInvar(GetInteractableName(((SpawnCard)interactableSpawnCard).prefab)).ToUpper(); if (((Object)interactableSpawnCard).name.ToUpper().Contains(name) || text.Contains(name)) { list.Add(new MatchSimilarity { similarity = Math.Max(GetSimilarity(((Object)interactableSpawnCard).name, name), GetSimilarity(text, name)), item = interactableSpawnCard }); } } foreach (MatchSimilarity item in list.OrderByDescending((MatchSimilarity m) => m.similarity)) { yield return (InteractableSpawnCard)item.item; } } public BodyIndex GetBodyFromPartial(string name) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) return GetBodiesFromPartial(name).DefaultIfEmpty((BodyIndex)(-1)).First(); } public IEnumerable GetBodiesFromPartial(string name) { int num = default(int); if (TextSerialization.TryParseInvariant(name, ref num)) { BodyIndex val = (BodyIndex)num; if ((Object)(object)BodyCatalog.GetBodyPrefab(val) != (Object)null) { yield return val; } yield break; } name = name.ToUpperInvariant(); List list = new List(); foreach (CharacterBody allBodyPrefabBodyBodyComponent in BodyCatalog.allBodyPrefabBodyBodyComponents) { string text = GetLangInvar(allBodyPrefabBodyBodyComponent.baseNameToken).ToUpper(); if (((Object)allBodyPrefabBodyBodyComponent).name.ToUpper().Contains(name) || text.Contains(name)) { list.Add(new MatchSimilarity { similarity = Math.Max(GetSimilarity(((Object)allBodyPrefabBodyBodyComponent).name, name), GetSimilarity(text, name)), item = allBodyPrefabBodyBodyComponent.bodyIndex }); } } foreach (MatchSimilarity item in list.OrderByDescending((MatchSimilarity m) => m.similarity)) { yield return (BodyIndex)item.item; } } public MasterIndex GetAiFromPartial(string name) { //IL_0007: 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) return GetAisFromPartial(name).DefaultIfEmpty(MasterIndex.none).First(); } public IEnumerable GetAisFromPartial(string name) { int num = default(int); if (TextSerialization.TryParseInvariant(name, ref num)) { MasterIndex val = (MasterIndex)num; if ((Object)(object)MasterCatalog.GetMasterPrefab(val) != (Object)null) { yield return val; } yield break; } name = name.ToUpperInvariant(); List list = new List(); foreach (CharacterMaster allAiMaster in MasterCatalog.allAiMasters) { string text = GetLangInvar(GetMasterName(allAiMaster)).ToUpper(); if (((Object)allAiMaster).name.ToUpper().Contains(name) || text.Contains(name)) { list.Add(new MatchSimilarity { similarity = Math.Max(GetSimilarity(((Object)allAiMaster).name, name), GetSimilarity(text, name)), item = allAiMaster.masterIndex }); } } foreach (MatchSimilarity item in list.OrderByDescending((MatchSimilarity m) => m.similarity)) { yield return (MasterIndex)item.item; } } public SurvivorIndex GetSurvivorFromPartial(string name) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) return GetSurvivorsFromPartial(name).DefaultIfEmpty((SurvivorIndex)(-1)).First(); } public IEnumerable GetSurvivorsFromPartial(string name) { int num = default(int); if (TextSerialization.TryParseInvariant(name, ref num)) { SurvivorIndex val = (SurvivorIndex)num; if ((Object)(object)SurvivorCatalog.GetSurvivorDef(val) != (Object)null) { yield return val; } yield break; } name = name.ToUpperInvariant(); List list = new List(); foreach (SurvivorDef allSurvivorDef in SurvivorCatalog.allSurvivorDefs) { string text = GetLangInvar(allSurvivorDef.displayNameToken).ToUpper(); if (allSurvivorDef.cachedName.ToUpper().Contains(name) || text.Contains(name)) { list.Add(new MatchSimilarity { similarity = Math.Max(GetSimilarity(allSurvivorDef.cachedName, name), GetSimilarity(text, name)), item = allSurvivorDef.survivorIndex }); } } foreach (MatchSimilarity item in list.OrderByDescending((MatchSimilarity m) => m.similarity)) { yield return (SurvivorIndex)item.item; } } public DroneIndex GetDroneFromPartial(string name) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) return GetDronesFromPartial(name).DefaultIfEmpty((DroneIndex)(-1)).First(); } public IEnumerable GetDronesFromPartial(string name) { int num = default(int); if (TextSerialization.TryParseInvariant(name, ref num)) { DroneIndex val = (DroneIndex)num; if ((Object)(object)DroneCatalog.GetDroneDef(val) != (Object)null) { yield return val; } yield break; } name = name.ToUpperInvariant(); List list = new List(); foreach (DroneDef allDroneDef in DroneCatalog.allDroneDefs) { string text = GetLangInvar(allDroneDef.nameToken).ToUpper(); if (((Object)allDroneDef).name.ToUpper().Contains(name) || text.Contains(name)) { list.Add(new MatchSimilarity { similarity = Math.Max(GetSimilarity(((Object)allDroneDef).name, name), GetSimilarity(text, name)), item = allDroneDef.droneIndex }); } } foreach (MatchSimilarity item in list.OrderByDescending((MatchSimilarity m) => m.similarity)) { yield return (DroneIndex)item.item; } } public SceneIndex GetSceneFromPartial(string name, bool includeOffline) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) return GetScenesFromPartial(name, includeOffline).DefaultIfEmpty((SceneIndex)(-1)).FirstOrDefault(); } public IEnumerable GetScenesFromPartial(string name, bool includeOffline) { int num = default(int); if (TextSerialization.TryParseInvariant(name, ref num)) { SceneIndex val = (SceneIndex)num; SceneDef sceneDef = SceneCatalog.GetSceneDef(val); if ((Object)(object)sceneDef != (Object)null && (includeOffline || !sceneDef.isOfflineScene)) { yield return val; } yield break; } name = name.ToUpperInvariant(); List list = new List(); Enumerator enumerator = SceneCatalog.allSceneDefs.GetEnumerator(); try { while (enumerator.MoveNext()) { SceneDef current = enumerator.Current; string text = GetLangInvar(current.nameToken).ToUpper(); if ((current.cachedName.ToUpper().Contains(name) || text.Contains(name)) && (includeOffline || !current.isOfflineScene)) { list.Add(new MatchSimilarity { similarity = Math.Max(GetSimilarity(current.cachedName, name), GetSimilarity(text, name)), item = current.sceneDefIndex }); } } } finally { ((IDisposable)enumerator/*cast due to .constrained prefix*/).Dispose(); } foreach (MatchSimilarity item in list.OrderByDescending((MatchSimilarity m) => m.similarity)) { yield return (SceneIndex)item.item; } } public static string GetLangInvar(string baseToken) { if (baseToken == null) { return ""; } return RemoveSpacesAndAlike(Language.GetString(baseToken)); } public static string RemoveSpacesAndAlike(string input) { return Regex.Replace(input, "[ '(),-]|\\{\\d+\\}", string.Empty); } public static string GetInteractableName(GameObject prefab) { if ((Object)(object)prefab == (Object)null) { return NAME_NOTFOUND; } IDisplayNameProvider component = prefab.GetComponent(); if (component != null) { return component.GetDisplayName(); } MultiShopController component2 = prefab.GetComponent(); if ((Object)(object)component2 != (Object)null && Object.op_Implicit((Object)(object)component2.terminalPrefab)) { component = component2.terminalPrefab.GetComponent(); if (component != null) { return component.GetDisplayName(); } } return NAME_NOTFOUND; } public static string GetMasterName(CharacterMaster master) { if ((Object)(object)master == (Object)null) { return NAME_NOTFOUND; } GameObject bodyPrefab = master.bodyPrefab; CharacterBody val = ((bodyPrefab != null) ? bodyPrefab.GetComponent() : null); if ((Object)(object)val != (Object)null) { return val.GetDisplayName(); } return NAME_NOTFOUND; } private static int GetSimilarity(string s, string partial) { if (string.IsNullOrEmpty(partial) || !s.ToUpper().Contains(partial)) { return int.MinValue; } return (s.StartsWith(partial, StringComparison.InvariantCultureIgnoreCase) ? 1000 : 0) + partial.Length - s.Length; } public static TEnum GetEnumFromPartial(string name) { TryGetEnumFromPartial(name, out var result); return result; } public static bool TryGetEnumFromPartial(string name, out TEnum result) { sbyte result3; if (typeof(TEnum).GetEnumUnderlyingType() == typeof(int)) { if (int.TryParse(name, out var result2)) { if (Enum.IsDefined(typeof(TEnum), result2)) { result = (TEnum)Enum.ToObject(typeof(TEnum), result2); return true; } result = default(TEnum); return false; } } else if (typeof(TEnum).GetEnumUnderlyingType() == typeof(sbyte) && sbyte.TryParse(name, out result3)) { if (Enum.IsDefined(typeof(TEnum), result3)) { result = (TEnum)Enum.ToObject(typeof(TEnum), result3); return true; } result = default(TEnum); return false; } name = name.ToUpperInvariant(); List list = new List(); string[] names = Enum.GetNames(typeof(TEnum)); Array values = Enum.GetValues(typeof(TEnum)); for (int i = 0; i < values.Length; i++) { if (names[i].Contains(name, StringComparison.InvariantCultureIgnoreCase)) { list.Add(new MatchSimilarity { similarity = GetSimilarity(names[i], name), item = values.GetValue(i) }); } } if (list.Count == 0) { result = default(TEnum); return false; } result = (TEnum)list.OrderByDescending((MatchSimilarity m) => m.similarity).First().item; return true; } } public static class Util { public struct CommandTarget { public string name; public CharacterBody body; public Inventory inventory; public DevotionInventoryController devotionController; } internal static NetworkUser GetNetUserFromString(List args, int index = 0) { if (args.Count > 0 && index < args.Count) { return StringFinder.Instance.GetPlayerFromPartial(args[index]); } return null; } internal static CharacterMaster GetTargetFromArgs(ConCommandArgs args, int index) { //IL_0014: 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 (((ConCommandArgs)(ref args)).Count > 0 && index < ((ConCommandArgs)(ref args)).Count) { if ((Object)(object)args.sender != (Object)null && ((ConCommandArgs)(ref args))[index].ToUpperInvariant() == "PINGED") { return Hooks.GetPingedTarget(((ConCommandArgs)(ref args)).senderMaster).master; } NetworkUser netUserFromString = GetNetUserFromString(args.userArgs, index); if (netUserFromString == null) { return null; } return netUserFromString.master; } return null; } internal static string GetExpansion(ExpansionDef expansion) { if (!Object.op_Implicit((Object)(object)expansion) || string.IsNullOrEmpty(expansion.nameToken)) { return ""; } return Language.GetString(expansion.nameToken); } internal static bool TryParseBool(string input, out bool result) { if (bool.TryParse(input, out result)) { return true; } if (int.TryParse(input, out var result2)) { result = result2 > 0; return true; } return false; } } } namespace DebugToolkit.Permissions { [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] public class RequiredLevel : Attribute { internal readonly Level Level; public RequiredLevel(Level level = Level.SubAdmin) { Level = level; } } public enum Level { None, SubAdmin, Admin } public static class PermissionSystem { internal static ConfigEntry IsEnabled; private static ConfigEntry _adminList; private static ConfigEntry _subAdminList; private static readonly HashSet AdminSteamIdList = new HashSet(); private static readonly HashSet SubAdminSteamIdList = new HashSet(); private static ConfigEntry _roR2CommandsNeedPermission; private static ConfigEntry _defaultPermissionLevel; private static readonly Dictionary> AdminCommands = new Dictionary>(); public const string PERMISSION_SYSTEM_CONFIG_SECTION = "Permission System"; public const char PERMISSION_SYSTEM_ADMIN_LIST_SEPARATOR = ','; public const string ADMIN_LIST_CONFIG_NAME = "2. Admin"; public const string SUBADMIN_LIST_CONFIG_NAME = "3. Sub Admin List"; internal static void Init() { IsEnabled = DebugToolkit.Configuration.Bind("Permission System", "1. Enable", false, "Is the Permission System enabled."); if (IsEnabled.Value) { _adminList = DebugToolkit.Configuration.Bind("Permission System", "2. Admin", "76561197960265728, 76561197960265729", "Who is/are the admin(s). They are identified using their STEAM64 ID, the ID can be seen when the player connects to the server."); _subAdminList = DebugToolkit.Configuration.Bind("Permission System", "3. Sub Admin List", "76561197960265730, 76561197960265731", "Who is/are the sub admin(s)."); _defaultPermissionLevel = DebugToolkit.Configuration.Bind("Permission System", "4. Default Permission Level", Level.SubAdmin, "What is the default permission level to use DebugToolkit commands, available levels : None (0), SubAdmin (1), Admin (2)"); _roR2CommandsNeedPermission = DebugToolkit.Configuration.Bind("Permission System", "5. RoR2 Console Commands use the Permission System", false, "When enabled, all the RoR2 Console Commands will be added to this config file and will only be fired if the permission check says so."); UpdateAdminListCache(); UpdateSubAdminListCache(); DebugToolkit.Configuration.SettingChanged += UpdateAdminListCacheOnConfigChange; AdminCommands.Clear(); AddPermissionCheckToConCommands(); if (_roR2CommandsNeedPermission.Value) { AddPermissionCheckToConCommands(typeof(RoR2Application).Assembly); } } } private static void UpdateAdminListCache() { List list = (from s in _adminList.Value.Split(',') select s.Trim()).ToList(); AdminSteamIdList.Clear(); foreach (string item in list) { if (ulong.TryParse(item, out var result)) { AdminSteamIdList.Add(result); } else { Log.Message("Can't parse correctly the given STEAMID64 : $" + item + " for admins", Log.LogLevel.Error, Log.Target.Ror2); } } } private static void UpdateSubAdminListCache() { List list = (from s in _subAdminList.Value.Split(',') select s.Trim()).ToList(); SubAdminSteamIdList.Clear(); foreach (string item in list) { if (ulong.TryParse(item, out var result)) { SubAdminSteamIdList.Add(result); } else { Log.Message("Can't parse correctly the given STEAMID64 : $" + item + " for sub admins", Log.LogLevel.Error, Log.Target.Ror2); } } } private static void UpdateAdminListCacheOnConfigChange(object _, SettingChangedEventArgs settingChangedEventArgs) { ConfigEntryBase changedSetting = settingChangedEventArgs.ChangedSetting; if (changedSetting.Definition.Section == "Permission System") { if (changedSetting.Definition.Key == "2. Admin") { UpdateAdminListCache(); } else if (changedSetting.Definition.Key == "3. Sub Admin List") { UpdateSubAdminListCache(); } } } public static void AddPermissionCheckToConCommands(Assembly assembly = null) { //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Invalid comparison between Unknown and I4 if (assembly == null) { assembly = Assembly.GetCallingAssembly(); } Type[] source; try { source = assembly.GetTypes(); } catch (ReflectionTypeLoadException ex) { source = ex.Types.Where((Type x) => x != null).ToArray(); Exception[] loaderExceptions = ex.LoaderExceptions; for (int num = 0; num < loaderExceptions.Length; num++) { _ = loaderExceptions[num]; Log.Message(ex.Message, Log.LogLevel.Error, Log.Target.Bepinex); } } foreach (MethodInfo item in source.SelectMany((Type x) => x.GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic))) { object[] customAttributes; try { customAttributes = item.GetCustomAttributes(inherit: false); } catch (TypeLoadException ex2) { Log.Message(ex2.Message, Log.LogLevel.Error, Log.Target.Bepinex); continue; } catch (InvalidOperationException ex3) { Log.Message(ex3.Message, Log.LogLevel.Error, Log.Target.Bepinex); continue; } if (customAttributes == null) { continue; } ConCommandAttribute[] array = customAttributes.OfType().ToArray(); if (array.Length == 0) { continue; } Level level = item.GetCustomAttribute(inherit: false)?.Level ?? _defaultPermissionLevel.Value; ConCommandAttribute[] array2 = array; foreach (ConCommandAttribute val in array2) { if ((val.flags & 1) == 1) { if (val.commandName == "say") { level = Level.None; } ConfigEntry value = DebugToolkit.Configuration.Bind("Permission System", "Override: " + val.commandName, level, "Override Required Permission Level for the " + val.commandName + " command"); AdminCommands.Add(val.commandName, value); } } } } [ConCommand(/*Could not decode attribute arguments.*/)] [RequiredLevel(Level.Admin)] private static void CCReloadPermissionSystem(ConCommandArgs args) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) DebugToolkit.Configuration.Reload(); Init(); Log.MessageNetworked("Config File of DebugToolkit / Permission System successfully reloaded.", args, Log.LogLevel.Info); } [RequiredLevel(Level.Admin)] [AutoComplete("Requires 0 or 1 arguments: [enable (0|1)]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCPermissionEnable(ConCommandArgs args) { //IL_0047: 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) if (((ConCommandArgs)(ref args)).Count == 0) { IsEnabled.Value = !IsEnabled.Value; } else { if (!Util.TryParseBool(((ConCommandArgs)(ref args))[0], out var result)) { Log.MessageNetworked(string.Format("Unable to parse {0} to {1}.", "value", "bool"), args, Log.LogLevel.ErrorClientOnly); return; } IsEnabled.Value = result; } string text = string.Format(IsEnabled.Value ? "{0} enabled." : "{0} disabled.", "Permission System"); if (IsEnabled.Value) { text += ". Saving and reloading the permission system."; } Log.MessageNetworked(text, args, Log.LogLevel.Info); DebugToolkit.Configuration.Save(); Init(); } [ConCommand(/*Could not decode attribute arguments.*/)] [RequiredLevel(Level.Admin)] [AutoComplete("Requires 2 arguments: {permission_level} {player}")] private static void CCPermissionAddUser(ConCommandArgs args) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_0093: 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_0212: Unknown result type (might be due to invalid IL or missing references) if (!IsEnabled.Value) { Log.MessageNetworked("The permission system is currently disabled, enable it first with perm_enable", args); return; } if (((ConCommandArgs)(ref args)).Count < 2) { Log.MessageNetworked("Insufficient number of arguments. Requires 2 arguments: {permission_level} {player}", args, Log.LogLevel.MessageClientOnly); return; } NetworkUser netUserFromString = Util.GetNetUserFromString(args.userArgs, 1); if ((Object)(object)netUserFromString == (Object)null) { Log.MessageNetworked("Specified player not found or isn't alive. Please use list_player for options.", args, Log.LogLevel.MessageClientOnly); return; } NetworkPlayerName networkPlayerName = netUserFromString.GetNetworkPlayerName(); ulong item = (ulong)((PlatformID)(ref networkPlayerName.playerId)).value; if (!Enum.TryParse(((ConCommandArgs)(ref args))[0], out var result)) { Log.MessageNetworked(string.Format("Unable to parse {0} to {1}.", "permission_level", "Level"), args, Log.LogLevel.MessageClientOnly); return; } switch (result) { case Level.Admin: if (!AdminSteamIdList.Contains(item)) { AdminSteamIdList.Add(item); _adminList.Value = string.Join(", ", AdminSteamIdList); } if (SubAdminSteamIdList.Contains(item)) { SubAdminSteamIdList.Remove(item); _subAdminList.Value = string.Join(", ", SubAdminSteamIdList); } break; case Level.SubAdmin: if (AdminSteamIdList.Contains(item)) { AdminSteamIdList.Remove(item); _adminList.Value = string.Join(", ", AdminSteamIdList); } if (!SubAdminSteamIdList.Contains(item)) { SubAdminSteamIdList.Add(item); _subAdminList.Value = string.Join(", ", SubAdminSteamIdList); } break; case Level.None: if (AdminSteamIdList.Contains(item)) { AdminSteamIdList.Remove(item); _adminList.Value = string.Join(", ", AdminSteamIdList); } if (SubAdminSteamIdList.Contains(item)) { SubAdminSteamIdList.Remove(item); _subAdminList.Value = string.Join(", ", SubAdminSteamIdList); } break; default: Log.MessageNetworked("Inappropriate value for 'permission level', available levels : None (0), SubAdmin (1), Admin (2)", args, Log.LogLevel.MessageClientOnly); return; } Log.MessageNetworked($"{netUserFromString.userName}'s permission level has been updated to {result}", args); } public static bool CanUserExecute(NetworkUser networkUser, string conCommandName, List userArgs) { //IL_0021: 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_0040: 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) if (AdminCommands.TryGetValue(conCommandName, out var value)) { if (networkUser.GetPermissionLevel() >= value.Value) { return true; } ConCommandArgs args = new ConCommandArgs { commandName = conCommandName, sender = networkUser, userArgs = userArgs }; Log.MessageNetworked($"You don't have the required permission {value.Value.ToString()} to use this command.", args); return false; } return true; } public static bool HasMorePerm(NetworkUser sender, NetworkUser target, ConCommandArgs args) { //IL_002d: 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) Level level = (Object.op_Implicit((Object)(object)sender) ? sender.GetPermissionLevel() : ((Level)3)); Level permissionLevel = target.GetPermissionLevel(); if (level < permissionLevel) { Log.MessageNetworked($"Specified user {target.userName} has a greater permission level than you.", args, Log.LogLevel.Error); return false; } if (level == permissionLevel) { Log.MessageNetworked($"Specified user {target.userName} has the same permission level as you.", args, Log.LogLevel.Error); return false; } return true; } private static Level GetPermissionLevel(this NetworkUser networkUser) { //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) NetworkPlayerName networkPlayerName = networkUser.GetNetworkPlayerName(); ulong item = (ulong)((PlatformID)(ref networkPlayerName.playerId)).value; if (AdminSteamIdList.Contains(item)) { return Level.Admin; } if (SubAdminSteamIdList.Contains(item)) { return Level.SubAdmin; } return Level.None; } } } namespace DebugToolkit.Code { internal static class MacroSystem { private class MacroConfigEntry { private string _consoleCommandsBlob; internal ConfigEntry ConfigEntry { get; } private string[] BlobArray { get; } internal string KeyBind { get; private set; } internal string Key { get; private set; } internal string[] Modifiers { get; private set; } internal string[] MissingModifiers { get; private set; } internal string[] ConsoleCommands { get; set; } internal MacroConfigEntry(ConfigEntry configEntry) { BlobArray = SplitBindCmd(configEntry.Value); ConfigEntry = configEntry; } private static string[] SplitBindCmd(string bindCmdBlob) { Match match = Regex.Match(bindCmdBlob, "dt_bind\\s+(\\((?.+)\\)\\s+(?.+)|(?[^\\s]+)\\s+(?.+))"); if (match.Success) { return new string[2] { match.Groups["key"].Value, match.Groups["command"].Value }; } return Array.Empty(); } internal bool IsCorrectlyFormatted() { if (BlobArray.Length < 2) { Log.Message("Missing parameters for macro config entry called " + ((ConfigEntryBase)ConfigEntry).Definition.Key + ".", Log.LogLevel.ErrorClientOnly, Log.Target.Ror2); return false; } KeyBind = BlobArray[0]; _consoleCommandsBlob = BlobArray[1]; ConsoleCommands = SplitConsoleCommandsBlob(_consoleCommandsBlob); string[] array; (Modifiers, MissingModifiers, array) = KeyBindParser(KeyBind); if (array.Length == 0) { Log.Message("No key was defined for the macro '" + KeyBind + "'.", Log.LogLevel.ErrorClientOnly, Log.Target.Ror2); return false; } if (array.Length > 1) { Log.Message("Multiple keys '" + string.Join("+", array) + "' were defined for the macro '" + KeyBind + "'.", Log.LogLevel.ErrorClientOnly, Log.Target.Ror2); return false; } Key = array[0]; try { Input.GetKeyDown(Key); } catch (ArgumentException) { Log.Message("Specified key '" + Key + "' for the macro '" + KeyBind + "' does not exist.", Log.LogLevel.ErrorClientOnly, Log.Target.Ror2); return false; } string keyBindInvariant = GetKeyBindInvariant(Modifiers, new string[1] { Key }); if (keyBindInvariant != KeyBind) { KeyBind = keyBindInvariant; ConfigEntry.Value = string.Format(KeyBind.Contains(" ") ? MACRO_DTBIND_2 : MACRO_DTBIND_1, KeyBind, _consoleCommandsBlob); } return true; } } private static readonly string[] MODIFIERS = new string[6] { "left alt", "left ctrl", "left shift", "right alt", "right ctrl", "right shift" }; private static readonly string MACRO_DTBIND_1 = "dt_bind {0} {1}"; private static readonly string MACRO_DTBIND_2 = "dt_bind ({0}) {1}"; private static readonly Dictionary MacroConfigEntries = new Dictionary(); private static readonly PropertyInfo OrphanedEntriesProperty = typeof(ConfigFile).GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.NonPublic); private static ConfigEntry AllowKeybindsWithUi; internal static ConfigEntry ConsoleKey; private const string MACRO_SECTION_NAME = "Macros"; private const string DEFAULT_MACRO_NAME = "Do not remove this example macro"; private const string DEFAULT_MACRO_KEYBIND = "f15"; private const string DEFAULT_MACRO_VALUE = "dt_bind f15 help"; private const string DEFAULT_MACRO_DESCRIPTION = "Custom keybind for executing console commands."; private const char DEFAULT_COMMAND_SEPARATOR = ';'; private const string MACRO_MINI_TUTORIAL = "\nMust start with dt_bind {KeyBind} {ConsoleCommands}.\nExample : dt_bind x noclip;kill_all\nWhen you'll press x key on keyboard it'll activate noclip and kill every monster.\nFor adding new macros, just add new lines under the example, must be formatted like this :\nMacro 2 = dt_bind z no_enemies;give_item hoof 10\nMacro 3 = dt_bind x give_item dagger 5;give_item syringe 10\nOr use the in-game console and use the dt_bind console command.\nWhen doing it from the in game console, don't forget to use double quotes, especially when chaining commands !\ndt_bind b \"give_item dio 1;spawn_ai beetle 1\"\nBinding a key whose name has a space also requires double quotes from the console:\ndt_bind \"page down\" kill_all\nWhile here it is formatted with brackets like this:\ndt_bind (page down) kill_all\nIt is also possible to define a key combination with \"+\" and any combination of \"alt\", \"ctrl\", or \"shift\" as modifiers:\ndt_bind \"left shift+r\" respawn\nYou can also delete existing bind like this:\ndt_bind_delete {KeyBind}"; private static GameObject runtimeInspector; private static GameObject unityInspector; private static Dictionary OrphanedEntries => (Dictionary)OrphanedEntriesProperty.GetValue(DebugToolkit.Configuration); private static (string[], string[], string[]) KeyBindParser(string keyBind) { HashSet hashSet = (from x in Regex.Matches(keyBind, "(.+?)(?:(? list = new List(); List list2 = new List(); string[] mODIFIERS = MODIFIERS; foreach (string item in mODIFIERS) { if (hashSet.Contains(item)) { list.Add(item); hashSet.Remove(item); } else { list2.Add(item); } } return (list.ToArray(), list2.ToArray(), hashSet.OrderBy((string x) => x).ToArray()); } private static string GetKeyBindInvariant(string keyBind) { var (modifiers, _, keys) = KeyBindParser(keyBind); return GetKeyBindInvariant(modifiers, keys); } private static string GetKeyBindInvariant(string[] modifiers, string[] keys) { string text = string.Join("+", keys); if (modifiers.Length != 0) { return string.Join("+", modifiers) + "+" + text; } return text; } internal static void Init() { DebugToolkit.Configuration.Save(); Reload(); DebugToolkit.Configuration.SettingChanged += OnMacroSettingChanged; RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(CollectInspectorObjects)); } private static void CollectInspectorObjects() { Transform[] array = Resources.FindObjectsOfTypeAll(); foreach (Transform val in array) { if (((Object)((Component)val).gameObject).name == "RuntimeInspectorCanvas") { runtimeInspector = ((Component)val).gameObject; } else if (((Object)((Component)val).gameObject).name == "com.sinai.unityexplorer_Root") { unityInspector = ((Component)val).gameObject; } } } private static void OnMacroSettingChanged(object sender, SettingChangedEventArgs e) { if (e.ChangedSetting.Definition.Section == "Macros") { Reload(); } } private static void Reload() { MacroConfigEntries.Clear(); DebugToolkit.Configuration.Reload(); BindExampleMacro(); BindExistingEntries(); RetrieveOrphanedMacroEntries(); BindSettings(); } private static void BindExampleMacro() { AddMacroFromConfigEntry(DebugToolkit.Configuration.Bind("Macros", "Do not remove this example macro", "dt_bind f15 help", "Custom keybind for executing console commands.\nMust start with dt_bind {KeyBind} {ConsoleCommands}.\nExample : dt_bind x noclip;kill_all\nWhen you'll press x key on keyboard it'll activate noclip and kill every monster.\nFor adding new macros, just add new lines under the example, must be formatted like this :\nMacro 2 = dt_bind z no_enemies;give_item hoof 10\nMacro 3 = dt_bind x give_item dagger 5;give_item syringe 10\nOr use the in-game console and use the dt_bind console command.\nWhen doing it from the in game console, don't forget to use double quotes, especially when chaining commands !\ndt_bind b \"give_item dio 1;spawn_ai beetle 1\"\nBinding a key whose name has a space also requires double quotes from the console:\ndt_bind \"page down\" kill_all\nWhile here it is formatted with brackets like this:\ndt_bind (page down) kill_all\nIt is also possible to define a key combination with \"+\" and any combination of \"alt\", \"ctrl\", or \"shift\" as modifiers:\ndt_bind \"left shift+r\" respawn\nYou can also delete existing bind like this:\ndt_bind_delete {KeyBind}")); } private static void BindExistingEntries() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown foreach (ConfigDefinition key in DebugToolkit.Configuration.Keys) { if (key.Section == "Macros" && key.Key != "Do not remove this example macro") { AddMacroFromConfigEntry(DebugToolkit.Configuration.Bind(key, "dt_bind f15 help", new ConfigDescription("Custom keybind for executing console commands.", (AcceptableValueBase)null, Array.Empty()))); } } } private static void RetrieveOrphanedMacroEntries() { Dictionary orphanedEntries = OrphanedEntries; List<(ConfigDefinition, string)> list = new List<(ConfigDefinition, string)>(); foreach (var (val2, text2) in orphanedEntries) { if (val2.Section == "Macros" && !string.IsNullOrEmpty(text2)) { list.Add((val2, text2)); } } foreach (var (key, customValue) in list) { orphanedEntries.Remove(key); AddMacroFromConfigEntry(BindNewConfigEntry(customValue)); } } private static void BindSettings() { AllowKeybindsWithUi = DebugToolkit.Configuration.Bind("Macros.Settings", "AllowKeybindsWithUi", true, "Allow keybinds to execute when a UI window is open, e.g., Console or an Inspector."); ConsoleKey = DebugToolkit.Configuration.Bind("Console", "Console Key", (KeyCode)280, "Custom key to toggle the console window. Ignores current language. Set to 'None' to disable the feature."); } private static ConfigEntry BindNewConfigEntry(string customValue) { string text = "Macro "; HashSet hashSet = new HashSet(); foreach (ConfigDefinition key in DebugToolkit.Configuration.Keys) { if (key.Section == "Macros" && key.Key.StartsWith(text) && int.TryParse(key.Key.Substring(text.Length - 1), out var result)) { hashSet.Add(result); } } int i; for (i = 2; hashSet.Contains(i); i++) { } ConfigEntry obj = DebugToolkit.Configuration.Bind("Macros", text + i, "dt_bind f15 help", "Custom keybind for executing console commands."); obj.Value = customValue; return obj; } private static void AddMacroFromConfigEntry(ConfigEntry macroEntry) { MacroConfigEntry macroConfigEntry = new MacroConfigEntry(macroEntry); if (macroConfigEntry.IsCorrectlyFormatted()) { MacroConfigEntries[macroConfigEntry.KeyBind] = macroConfigEntry; } } private static string[] SplitConsoleCommandsBlob(string consoleCommandsBlob) { return consoleCommandsBlob.Split(new char[1] { ';' }, StringSplitOptions.RemoveEmptyEntries); } internal static void Update() { if (IsAnyInputFieldActive() || (Object.op_Implicit((Object)(object)PauseManager.pauseScreenInstance) && PauseManager.pauseScreenInstance.activeSelf) || (!AllowKeybindsWithUi.Value && IsAnyUIWindowOpen())) { return; } foreach (string item in new List(MacroConfigEntries.Keys)) { if (MacroConfigEntries.TryGetValue(item, out var value) && Input.GetKeyDown(value.Key) && ((IEnumerable)value.Modifiers).All((Func)Input.GetKey) && !((IEnumerable)value.MissingModifiers).Any((Func)Input.GetKey)) { string[] consoleCommands = value.ConsoleCommands; foreach (string text in consoleCommands) { Console.instance.SubmitCmd(NetworkUser.readOnlyLocalPlayersList.FirstOrDefault(), text, false); } } } } private static bool IsAnyUIWindowOpen() { if (!Object.op_Implicit((Object)(object)ConsoleWindow.instance) && (!Object.op_Implicit((Object)(object)runtimeInspector) || !runtimeInspector.activeSelf)) { if (Object.op_Implicit((Object)(object)unityInspector)) { return unityInspector.activeSelf; } return false; } return true; } private static bool IsAnyInputFieldActive() { if (MPEventSystem.instancesList == null || !MPEventSystem.instancesList.Any((MPEventSystem eventSystem) => Object.op_Implicit((Object)(object)eventSystem) && Object.op_Implicit((Object)(object)((EventSystem)eventSystem).currentSelectedGameObject))) { if (Object.op_Implicit((Object)(object)EventSystem.current)) { return Object.op_Implicit((Object)(object)EventSystem.current.currentSelectedGameObject); } return false; } return true; } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Bind a key to execute specific commands. Requires 2 arguments: {key} [console_commands]")] private static void CCBindMacro(ConCommandArgs args) { if (((ConCommandArgs)(ref args)).Count >= 2) { BindExampleMacro(); string text = string.Format(((ConCommandArgs)(ref args))[0].Contains(" ") ? MACRO_DTBIND_2 : MACRO_DTBIND_1, ((ConCommandArgs)(ref args))[0], ((ConCommandArgs)(ref args))[1]); string keyBindInvariant = GetKeyBindInvariant(((ConCommandArgs)(ref args))[0]); string consoleCommandsBlob = ((ConCommandArgs)(ref args))[1]; if (MacroConfigEntries.TryGetValue(keyBindInvariant, out var value)) { value.ConfigEntry.Value = text; value.ConsoleCommands = SplitConsoleCommandsBlob(consoleCommandsBlob); } else { AddMacroFromConfigEntry(BindNewConfigEntry(text)); } } else if (((ConCommandArgs)(ref args)).Count == 1) { Log.Message(MacroConfigEntries.TryGetValue(GetKeyBindInvariant(((ConCommandArgs)(ref args))[0]), out var value2) ? value2.ConfigEntry.Value : "This key has no macro associated to it."); } else { Log.Message("Insufficient number of arguments. Requires 2 arguments: {key} [console_commands]", Log.LogLevel.ErrorClientOnly, Log.Target.Ror2); } } [AutoComplete("Requires 1 argument: {key}")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCBindDeleteMacro(ConCommandArgs args) { if (((ConCommandArgs)(ref args)).Count == 1) { string text = ((ConCommandArgs)(ref args))[0]; if (text == "f15") { Log.Message("You can't delete the default macro.", Log.LogLevel.ErrorClientOnly, Log.Target.Ror2); return; } text = GetKeyBindInvariant(text); if (MacroConfigEntries.TryGetValue(text, out var value)) { DebugToolkit.Configuration.Remove(((ConfigEntryBase)value.ConfigEntry).Definition); DebugToolkit.Configuration.Save(); MacroConfigEntries.Remove(text); } } else { Log.Message("Insufficient number of arguments. Requires 1 argument: {key}", Log.LogLevel.ErrorClientOnly, Log.Target.Ror2); } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCBindReloadMacro(ConCommandArgs _) { Reload(); } } } namespace DebugToolkit.Commands { internal class Buffs { [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 0 arguments: [query]")] private static void CCListBuff(ConCommandArgs args) { //IL_0034: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected I4, but got Unknown //IL_00a8: Unknown result type (might be due to invalid IL or missing references) StringBuilder stringBuilder = new StringBuilder(); string text = ((((ConCommandArgs)(ref args)).Count > 0) ? ((ConCommandArgs)(ref args))[0] : ""); foreach (BuffIndex item in StringFinder.Instance.GetBuffsFromPartial(text)) { BuffDef buffDef = BuffCatalog.GetBuffDef(item); stringBuilder.AppendLine($"[{(int)item}]{((Object)buffDef).name} (stackable={buffDef.canStack})"); } Log.MessageNetworked((stringBuilder.Length > 0) ? stringBuilder.ToString().TrimEnd('\n') : string.Format("No {0} found that match \"{1}\".", "buffs", text), args, Log.LogLevel.MessageClientOnly); } [AutoComplete("Requires 0 arguments: [query]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCListDot(ConCommandArgs args) { //IL_0034: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected I4, but got Unknown //IL_0046: 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) StringBuilder stringBuilder = new StringBuilder(); string text = ((((ConCommandArgs)(ref args)).Count > 0) ? ((ConCommandArgs)(ref args))[0] : ""); foreach (DotIndex item in StringFinder.Instance.GetDotsFromPartial(text)) { stringBuilder.AppendLine($"[{(int)item}]{item}"); } Log.MessageNetworked((stringBuilder.Length > 0) ? stringBuilder.ToString().TrimEnd('\n') : string.Format("No {0} found that match \"{1}\".", "DoT", text), args, Log.LogLevel.MessageClientOnly); } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCDumpBuffs(ConCommandArgs args) { //IL_0000: 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_00d3: 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_006e: Unknown result type (might be due to invalid IL or missing references) if (!ArgumentParser.AssertInARun(args)) { return; } StringBuilder stringBuilder = new StringBuilder(); foreach (CharacterBody readOnlyInstances in CharacterBody.readOnlyInstancesList) { stringBuilder.AppendLine($"--- {((Object)readOnlyInstances).name} {readOnlyInstances.corePosition}"); BuffDef[] buffDefs = BuffCatalog.buffDefs; foreach (BuffDef val in buffDefs) { int buffCount = readOnlyInstances.GetBuffCount(val); if (buffCount != 0) { string arg = Util.RGBToHex(Color32.op_Implicit(val.buffColor)); stringBuilder.AppendLine($"{((Object)val).name} {buffCount}"); } } stringBuilder.AppendLine(); } Log.MessageNetworked(stringBuilder.ToString().TrimEnd('\n'), args, Log.LogLevel.MessageClientOnly); } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 1 (4 if from server) arguments: {buff} [count:1] [duration:0] [target (player|'pinged'):]")] private static void CCGiveBuff(ConCommandArgs args) { //IL_0000: 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_001c: 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_0048: 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_013f: 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) if (!ArgumentParser.AssertInARun(args) || !ArgumentParser.AssertRequiredArguments(args, "Requires 1 (4 if from server) arguments: {buff} [count:1] [duration:0] [target (player|'pinged'):]", 1, 4) || !ArgumentParser.TryParseBuff(args, 0, out var buffDef) || !ArgumentParser.TryParseOptionalInt(args, 1, "count", 1, out var value, 0) || !ArgumentParser.TryParseOptionalFloat(args, 2, "duration", 0f, out var value2, 0f) || !ArgumentParser.TryParsePlayerOrPingedBodyTarget(args, 3, out var target)) { return; } string name = ((Object)buffDef).name; bool canStack = buffDef.canStack; CharacterBody body = target.body; if (value2 == 0f) { if (!canStack) { value = Math.Min(value, 1 - body.GetBuffCount(buffDef)); } for (int i = 0; i < value; i++) { body.AddBuff(buffDef); } Log.MessageNetworked($"Gave {value} {name} to {target.name}.", args); return; } if (!canStack) { value = Math.Min(value, 1); } for (int j = 0; j < value; j++) { body.AddTimedBuff(buffDef, value2); } Log.MessageNetworked($"Gave {value} {name} to {target.name} for {value2} seconds", args); } [AutoComplete("Requires 1 (4 if from server) arguments: {buff} [count:1] [timed (0|1):0/false] [target (player|'pinged'):]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCRemoveBuff(ConCommandArgs args) { //IL_0000: 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_001c: 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_0048: 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_0127: 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_0095: 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_0109: Unknown result type (might be due to invalid IL or missing references) if (!ArgumentParser.AssertInARun(args) || !ArgumentParser.AssertRequiredArguments(args, "Requires 1 (4 if from server) arguments: {buff} [count:1] [timed (0|1):0/false] [target (player|'pinged'):]", 1, 4) || !ArgumentParser.TryParseBuff(args, 0, out var buffDef) || !ArgumentParser.TryParseOptionalInt(args, 1, "count", 1, out var value, 0) || !ArgumentParser.TryParseOptionalBool(args, 2, "timed", defaultValue: false, out var value2) || !ArgumentParser.TryParsePlayerOrPingedBodyTarget(args, 3, out var target)) { return; } string name = ((Object)buffDef).name; CharacterBody body = target.body; if (value2) { int num = 0; foreach (TimedBuff timedBuff in body.timedBuffs) { if (timedBuff.buffIndex == buffDef.buffIndex) { num++; } } value = Math.Min(value, num); if (value == num) { body.ClearTimedBuffs(buffDef); } else { for (int i = 0; i < value; i++) { body.RemoveOldestTimedBuff(buffDef); } } Log.MessageNetworked($"Removed the {value} oldest timed {name} from {target.name}.", args); } else { int buffCount = body.GetBuffCount(buffDef); value = Math.Min(value, buffCount); body.SetBuffCount(buffDef.buffIndex, buffCount - value); Log.MessageNetworked($"Removed {value} {name} from {target.name}.", args); } } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 1 (3 if from server) arguments: {buff} [timed (0|1):0/false] [target (player|'pinged'):]")] private static void CCRemoveBuffStacks(ConCommandArgs args) { //IL_0000: 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_001c: 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_0038: 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_00fe: 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_0076: 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) if (!ArgumentParser.AssertInARun(args) || !ArgumentParser.AssertRequiredArguments(args, "Requires 1 (3 if from server) arguments: {buff} [timed (0|1):0/false] [target (player|'pinged'):]", 1, 3) || !ArgumentParser.TryParseBuff(args, 0, out var buffDef) || !ArgumentParser.TryParseOptionalBool(args, 1, "timed", defaultValue: false, out var value) || !ArgumentParser.TryParsePlayerOrPingedBodyTarget(args, 2, out var target)) { return; } string name = ((Object)buffDef).name; CharacterBody body = target.body; if (value) { int num = 0; foreach (TimedBuff timedBuff in body.timedBuffs) { if (timedBuff.buffIndex == buffDef.buffIndex) { num++; } } body.ClearTimedBuffs(buffDef); Log.MessageNetworked(string.Format("Removed {0} {1} from {2}.", num, "timed " + name, target.name), args); } else { int buffCount = body.GetBuffCount(buffDef); body.SetBuffCount(buffDef.buffIndex, 0); Log.MessageNetworked($"Removed {buffCount} {name} from {target.name}.", args); } } [AutoComplete("Requires 0 (2 if from server) arguments: [timed (0|1):0/false] [target (player|'pinged'):]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCRemoveAllBuffs(ConCommandArgs args) { //IL_0000: 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_001c: 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_00a9: 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) if (!ArgumentParser.AssertInARun(args) || !ArgumentParser.AssertRequiredArguments(args, "Requires 0 (2 if from server) arguments: [timed (0|1):0/false] [target (player|'pinged'):]", 0, 2) || !ArgumentParser.TryParseOptionalBool(args, 0, "is_timed", defaultValue: false, out var value) || !ArgumentParser.TryParsePlayerOrPingedBodyTarget(args, 1, out var target)) { return; } CharacterBody body = target.body; if (value) { for (int i = 0; i < BuffCatalog.buffCount; i++) { body.ClearTimedBuffs((BuffIndex)i); } Log.MessageNetworked(string.Format("Reset {0} for {1}.", "all timed buffs", target.name), args); } else { for (int j = 0; j < BuffCatalog.buffCount; j++) { body.SetBuffCount((BuffIndex)j, 0); } Log.MessageNetworked(string.Format("Reset {0} for {1}.", "all buffs", target.name), args); } } [AutoComplete("Requires 1 (4 if from server) argument: {dot} [count:1] [target (player|'pinged'):] [attacker (player|'pinged'):]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCGiveDot(ConCommandArgs args) { //IL_0000: 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_001c: 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_0048: 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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected I4, but got Unknown //IL_0188: 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_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: 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_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_0210: 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) if (ArgumentParser.AssertInARun(args) && ArgumentParser.AssertRequiredArguments(args, "Requires 1 (4 if from server) argument: {dot} [count:1] [target (player|'pinged'):] [attacker (player|'pinged'):]", 1, 4) && ArgumentParser.TryParseDot(args, 0, out var dotIndex) && ArgumentParser.TryParseOptionalInt(args, 1, "count", 1, out var value, 0) && ArgumentParser.TryParsePlayerOrPingedBodyTarget(args, 2, out var target) && ArgumentParser.TryParsePlayerOrPingedBodyTarget(args, 3, out var target2)) { float num = 5f; float damageMultiplier = 1f; uint? maxStacksFromAttacker = null; switch ((int)dotIndex) { case 0: num = 4f; break; case 1: num = 3f; break; case 2: num = 12f; break; case 3: num = 8f; break; case 4: num = 10f; break; case 5: num = 5f; break; case 6: num = 15f; break; case 7: { num = 3f; Inventory inventory = target2.body.inventory; int num2 = ((!((Object)(object)inventory != (Object)null)) ? 1 : Math.Max(inventory.GetItemCountEffective(Items.StrengthenBurn), 1)); damageMultiplier = 1 + 3 * num2; break; } case 8: num = DotController.GetDotDef((DotIndex)8).interval; break; case 9: num = 5f; break; case 11: num = 4.7f; maxStacksFromAttacker = 1u; break; default: Log.MessageNetworked($"No explicit duration set for this DoT, defaulting to {num}. " + "Yell at the modmakers if you see this message!", args, Log.LogLevel.MessageClientOnly); break; } InflictDotInfo val = new InflictDotInfo { victimObject = ((Component)target.body).gameObject, attackerObject = ((Component)target2.body).gameObject, dotIndex = dotIndex, duration = num, damageMultiplier = damageMultiplier, maxStacksFromAttacker = maxStacksFromAttacker }; for (int i = 0; i < value; i++) { DotController.InflictDot(ref val); } Log.MessageNetworked($"Added {value} {dotIndex} to {target.name} from {target2.name}", args); } } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 1 (3 if from server) argument: {dot} [count:1] [target (player|'pinged'):]")] private static void CCRemoveDot(ConCommandArgs args) { //IL_0000: 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_001c: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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) //IL_0134: 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) if (!ArgumentParser.AssertInARun(args) || !ArgumentParser.AssertRequiredArguments(args, "Requires 1 (3 if from server) argument: {dot} [count:1] [target (player|'pinged'):]", 1, 3) || !ArgumentParser.TryParseDot(args, 0, out var dotIndex) || !ArgumentParser.TryParseOptionalInt(args, 1, "count", 1, out var value, 0) || !ArgumentParser.TryParsePlayerOrPingedBodyTarget(args, 2, out var target)) { return; } DotController val = DotController.FindDotController(((Component)target.body).gameObject); if ((Object)(object)val == (Object)null) { Log.MessageNetworked("The selected target has no DoTs.", args, Log.LogLevel.MessageClientOnly); return; } List> list = new List>(); for (int num = val.dotStackList.Count - 1; num >= 0; num--) { DotStack val2 = val.dotStackList[num]; if (val2.dotIndex == dotIndex) { list.Add(new KeyValuePair(num, val2.timer)); } } list.Sort((KeyValuePair p1, KeyValuePair p2) => p2.Value.CompareTo(p1.Value)); value = Math.Min(value, list.Count); for (int num2 = 0; num2 < value; num2++) { val.RemoveDotStackAtServer(list[num2].Key); } Log.MessageNetworked($"Removed {value} {dotIndex} from {target.name}.", args); } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 1 (2 if from server) argument: {dot} [target (player|'pinged'):]")] private static void CCRemoveDotStacks(ConCommandArgs args) { //IL_0000: 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_001c: 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_0052: 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_0080: 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_00ce: Unknown result type (might be due to invalid IL or missing references) if (!ArgumentParser.AssertInARun(args) || !ArgumentParser.AssertRequiredArguments(args, "Requires 1 (2 if from server) argument: {dot} [target (player|'pinged'):]", 1, 2) || !ArgumentParser.TryParseDot(args, 0, out var dotIndex) || !ArgumentParser.TryParsePlayerOrPingedBodyTarget(args, 1, out var target)) { return; } DotController val = DotController.FindDotController(((Component)target.body).gameObject); if ((Object)(object)val == (Object)null) { Log.MessageNetworked("The selected target has no DoTs.", args, Log.LogLevel.MessageClientOnly); return; } int num = 0; for (int num2 = val.dotStackList.Count - 1; num2 >= 0; num2--) { if (val.dotStackList[num2].dotIndex == dotIndex) { val.RemoveDotStackAtServer(num2); num++; } } if (val.dotStackList.Count == 0) { Object.Destroy((Object)(object)((Component)val).gameObject); } Log.MessageNetworked($"Removed {num} {dotIndex} from {target.name}.", args); } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 0 (1 if from server) arguments: [target (player|'pinged'):]")] private static void CCRemoveAllDots(ConCommandArgs args) { //IL_0000: 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_001c: 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 (ArgumentParser.AssertInARun(args) && ArgumentParser.AssertRequiredArguments(args, "Requires 0 (1 if from server) arguments: [target (player|'pinged'):]", 0, 1) && ArgumentParser.TryParsePlayerOrPingedBodyTarget(args, 0, out var target)) { DotController.RemoveAllDots(((Component)target.body).gameObject); Log.MessageNetworked(string.Format("Reset {0} for {1}.", "all DoTs", target.name), args); } } } internal static class Command_Noclip { internal static bool IsActivated; private static NetworkUser _currentNetworkUser; private static CharacterBody _currentBody; internal static void InitRPC() { NetworkManager.DebugToolKitComponents.AddComponent(); } internal static void InternalToggle(bool enabled, bool shouldLog) { //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_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) if (enabled != IsActivated) { if (PlayerCommands.UpdateCurrentPlayerBody(out _currentNetworkUser, out _currentBody)) { KinematicCharacterMotor component = ((Component)_currentBody).GetComponent(); Rigidbody component2 = ((Component)_currentBody).GetComponent(); CharacterMotor characterMotor = _currentBody.characterMotor; if (IsActivated) { if (Object.op_Implicit((Object)(object)component)) { component.RebuildCollidableLayers(); } else if (Object.op_Implicit((Object)(object)component2)) { Collider component3 = ((Component)component2).GetComponent(); if (Object.op_Implicit((Object)(object)component3)) { component3.isTrigger = false; } } if (Object.op_Implicit((Object)(object)characterMotor)) { CharacterGravityParameters gravityParameters = characterMotor.gravityParameters; characterMotor.useGravity = ((CharacterGravityParameters)(ref gravityParameters)).CheckShouldUseGravity(); } } else { if (Object.op_Implicit((Object)(object)component)) { component.CollidableLayers = LayerMask.op_Implicit(0); } else if (Object.op_Implicit((Object)(object)component2)) { Collider component4 = ((Component)component2).GetComponent(); if (Object.op_Implicit((Object)(object)component4)) { component4.isTrigger = true; } } if (Object.op_Implicit((Object)(object)characterMotor)) { characterMotor.useGravity = false; } } } IsActivated = !IsActivated; } if (shouldLog) { Log.Message(string.Format(IsActivated ? "{0} enabled." : "{0} disabled.", "noclip")); } } internal static void Update() { if (PlayerCommands.UpdateCurrentPlayerBody(out _currentNetworkUser, out _currentBody)) { Loop(); } } private static void Loop() { //IL_001f: 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) //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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0117: 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_0124: 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_015e: 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) KinematicCharacterMotor component = ((Component)_currentBody).GetComponent(); Rigidbody component2 = ((Component)_currentBody).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { if (LayerMask.op_Implicit(component.CollidableLayers) != 0) { InternalToggle(enabled: false, shouldLog: false); InternalToggle(enabled: true, shouldLog: false); } } else if (Object.op_Implicit((Object)(object)component2)) { Collider component3 = ((Component)component2).GetComponent(); if (Object.op_Implicit((Object)(object)component3) && !component3.isTrigger) { InternalToggle(enabled: false, shouldLog: false); InternalToggle(enabled: true, shouldLog: false); } } InputBankTest component4 = ((Component)_currentBody).GetComponent(); CharacterMotor characterMotor = _currentBody.characterMotor; if (Object.op_Implicit((Object)(object)component4) && (Object.op_Implicit((Object)(object)characterMotor) || Object.op_Implicit((Object)(object)component2))) { Vector3 normalized = ((Vector3)(ref component4.moveVector)).normalized; Vector3 aimDirection = component4.aimDirection; Vector3 normalized2 = ((Vector3)(ref aimDirection)).normalized; bool flag = Vector3.Dot(normalized, normalized2) > 0f; bool button = _currentNetworkUser.inputPlayer.GetButton("Sprint"); bool flag2 = _currentNetworkUser.inputPlayer.GetAxis("MoveVertical") != 0f; float num = (button ? 100f : 50f); Vector3 velocity = normalized * num; if (flag2) { velocity.y = normalized2.y * (flag ? num : (0f - num)); } if (component4.jump.down) { velocity.y = 50f; } if (Object.op_Implicit((Object)(object)characterMotor)) { characterMotor.velocity = velocity; } else { component2.velocity = velocity; } } } internal static void DisableOnStopClient(orig_OnStopClient orig, NetworkManagerSystem self) { if (IsActivated) { InternalToggle(enabled: false, shouldLog: true); } orig.Invoke(self); } internal static void DisableOOBCheck(orig_TeleportBody orig, MapZone self, CharacterBody characterBody) { if (!IsActivated || !characterBody.isPlayerControlled) { orig.Invoke(self, characterBody); } } internal static void DisableOnRunDestroy(Run run) { if (IsActivated) { InternalToggle(enabled: false, shouldLog: true); } } } internal class NoclipNet : NetworkBehaviour { private static NoclipNet _instance; private static int kTargetRpcTargetNoclipSet; private static int kTargetRpcTargetNoclipToggle; private void Awake() { _instance = this; } internal static void Invoke(NetworkUser argsSender, bool enabled) { _instance.CallTargetNoclipSet(((NetworkBehaviour)argsSender).connectionToClient, enabled); } [TargetRpc] private void TargetNoclipSet(NetworkConnection _, bool enabled) { Command_Noclip.InternalToggle(enabled, shouldLog: true); } internal static void Invoke(NetworkUser argsSender) { _instance.CallTargetNoclipToggle(((NetworkBehaviour)argsSender).connectionToClient); } [TargetRpc] private void TargetNoclipToggle(NetworkConnection _) { Command_Noclip.InternalToggle(!Command_Noclip.IsActivated, shouldLog: true); } private void UNetVersion() { } protected static void InvokeRpcTargetNoclipSet(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"TargetRPC TargetNoclipSet called on server."); } else { ((NoclipNet)(object)obj).TargetNoclipSet(ClientScene.readyConnection, reader.ReadBoolean()); } } protected static void InvokeRpcTargetNoclipToggle(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"TargetRPC TargetNoclipToggle called on server."); } else { ((NoclipNet)(object)obj).TargetNoclipToggle(ClientScene.readyConnection); } } public void CallTargetNoclipSet(NetworkConnection _, bool enabled) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"TargetRPC Function TargetNoclipSet called on client."); return; } if (_ is ULocalConnectionToServer) { Debug.LogError((object)"TargetRPC Function TargetNoclipSet called on connection to server"); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)kTargetRpcTargetNoclipSet); val.Write(((Component)this).GetComponent().netId); val.Write(enabled); ((NetworkBehaviour)this).SendTargetRPCInternal(_, val, 0, "TargetNoclipSet"); } public void CallTargetNoclipToggle(NetworkConnection _) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"TargetRPC Function TargetNoclipToggle called on client."); return; } if (_ is ULocalConnectionToServer) { Debug.LogError((object)"TargetRPC Function TargetNoclipToggle called on connection to server"); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)kTargetRpcTargetNoclipToggle); val.Write(((Component)this).GetComponent().netId); ((NetworkBehaviour)this).SendTargetRPCInternal(_, val, 0, "TargetNoclipToggle"); } static NoclipNet() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown kTargetRpcTargetNoclipSet = 750075788; NetworkBehaviour.RegisterRpcDelegate(typeof(NoclipNet), kTargetRpcTargetNoclipSet, new CmdDelegate(InvokeRpcTargetNoclipSet)); kTargetRpcTargetNoclipToggle = -1169461270; NetworkBehaviour.RegisterRpcDelegate(typeof(NoclipNet), kTargetRpcTargetNoclipToggle, new CmdDelegate(InvokeRpcTargetNoclipToggle)); NetworkCRC.RegisterBehaviour("NoclipNet", 0); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { bool result = default(bool); return result; } public override void OnDeserialize(NetworkReader reader, bool initialState) { } } public static class Command_Teleport { private static CharacterBody _currentBody; internal static void InitRPC() { NetworkManager.DebugToolKitComponents.AddComponent(); } internal static void InternalActivation() { //IL_0022: 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_0054: 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_005e: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) if (PlayerCommands.UpdateCurrentPlayerBody(out var _, out _currentBody)) { InputBankTest inputBank = _currentBody.inputBank; RaycastHit val = default(RaycastHit); if (Object.op_Implicit((Object)(object)inputBank) && Physics.Raycast(inputBank.aimOrigin, inputBank.aimDirection, ref val, float.PositiveInfinity, 2048)) { Vector3 val2 = _currentBody.transform.position - _currentBody.footPosition; TeleportHelper.TeleportGameObject(((Component)_currentBody).gameObject, ((RaycastHit)(ref val)).point + val2); } } } } internal class TeleportNet : NetworkBehaviour { private static TeleportNet _instance; private static int kTargetRpcTargetToggle; private void Awake() { _instance = this; } internal static void Invoke(NetworkUser argsSender) { _instance.CallTargetToggle(((NetworkBehaviour)argsSender).connectionToClient); } [TargetRpc] private void TargetToggle(NetworkConnection _) { Command_Teleport.InternalActivation(); } private void UNetVersion() { } protected static void InvokeRpcTargetToggle(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"TargetRPC TargetToggle called on server."); } else { ((TeleportNet)(object)obj).TargetToggle(ClientScene.readyConnection); } } public void CallTargetToggle(NetworkConnection _) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"TargetRPC Function TargetToggle called on client."); return; } if (_ is ULocalConnectionToServer) { Debug.LogError((object)"TargetRPC Function TargetToggle called on connection to server"); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)kTargetRpcTargetToggle); val.Write(((Component)this).GetComponent().netId); ((NetworkBehaviour)this).SendTargetRPCInternal(_, val, 0, "TargetToggle"); } static TeleportNet() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown kTargetRpcTargetToggle = 1394001363; NetworkBehaviour.RegisterRpcDelegate(typeof(TeleportNet), kTargetRpcTargetToggle, new CmdDelegate(InvokeRpcTargetToggle)); NetworkCRC.RegisterBehaviour("TeleportNet", 0); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { bool result = default(bool); return result; } public override void OnDeserialize(NetworkReader reader, bool initialState) { } } public static class CurrentRun { [CompilerGenerated] private static class <>O { public static hook_Awake <0>__SeedHook; } internal static bool noEnemies = false; internal static bool noInteractables = false; internal static bool lockExp = false; internal static ulong seed; internal static bool forceFamilyEvent = false; internal static DirectorCard nextBoss; internal static int nextBossCount = 1; internal static EliteDef nextBossElite; internal static GameObject selectedWavePrefab; internal static void ResetNextBoss() { nextBoss = null; nextBossCount = 0; nextBossElite = null; } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 1 argument: {portal ('blue'|'celestial'|'gold'|'green'|'void'|'all')}")] private static void CCAddPortal(ConCommandArgs args) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: 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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) if (!ArgumentParser.AssertInARun(args) || !ArgumentParser.AssertRequiredArguments(args, "Requires 1 argument: {portal ('blue'|'celestial'|'gold'|'green'|'void'|'all')}", 1)) { return; } TeleporterInteraction teleporterInteraction = TeleporterInteraction.instance; if (!Object.op_Implicit((Object)(object)teleporterInteraction)) { Log.MessageNetworked("No teleporter interaction instance!", args, Log.LogLevel.WarningClientOnly); return; } switch (((ConCommandArgs)(ref args))[0].ToUpperInvariant()) { case "BLUE": teleporterInteraction.shouldAttemptToSpawnShopPortal = true; break; case "GOLD": teleporterInteraction.shouldAttemptToSpawnGoldshoresPortal = true; break; case "GREEN": QueuePortal("GREEN"); break; case "CELESTIAL": teleporterInteraction.shouldAttemptToSpawnMSPortal = true; break; case "VOID": QueuePortal("VOID"); break; case "ALL": teleporterInteraction.shouldAttemptToSpawnShopPortal = true; teleporterInteraction.shouldAttemptToSpawnMSPortal = true; teleporterInteraction.shouldAttemptToSpawnGoldshoresPortal = true; QueuePortal("GREEN"); QueuePortal("VOID"); break; default: Log.MessageNetworked(string.Format("Invalid value for {0}.", "portal"), args, Log.LogLevel.MessageClientOnly); break; } void QueuePortal(string portalName) { //IL_0043: 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_00ea: 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_012e: Unknown result type (might be due to invalid IL or missing references) Quaternion? val = null; string text; if (!(portalName == "GREEN")) { if (!(portalName == "VOID")) { Log.MessageNetworked("Yell at the modmakers if you see this message!", args, Log.LogLevel.MessageClientOnly); return; } text = "iscVoidPortal"; val = Quaternion.Euler(0f, 0f, 270f); } else { text = "iscColossusPortal"; } PortalSpawner[] portalSpawners = teleporterInteraction.portalSpawners; foreach (PortalSpawner val2 in portalSpawners) { if (((Object)val2.portalSpawnCard).name == text && Object.op_Implicit((Object)(object)val2.previewChild) && !val2.previewChild.activeSelf) { if (Object.op_Implicit((Object)(object)val2.requiredExpansion) && !Run.instance.IsExpansionEnabled(val2.requiredExpansion)) { Log.MessageNetworked("The " + portalName.ToLower() + " portal requires an expansion to be enabled.", args, Log.LogLevel.MessageClientOnly); } else if (!string.IsNullOrEmpty(val2.bannedEventFlag) && Run.instance.GetEventFlag(val2.bannedEventFlag)) { Log.MessageNetworked("The " + portalName.ToLower() + " portal cannot spawn in this game mode.", args, Log.LogLevel.MessageClientOnly); } else { val2.spawnChance = 1f; val2.minStagesCleared = 0; val2.validStages = Array.Empty(); val2.invalidStages = Array.Empty(); val2.validStageTiers = Array.Empty(); if (val.HasValue) { val2.previewChild.transform.localRotation = val.Value; } val2.Start(); } break; } } } } [AutoComplete("Requires 0 or 1 arguments: [enable (0|1)]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCNoEnemies(ConCommandArgs args) { //IL_0000: 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) if (ArgumentParser.TryParseOptionalBool(args, 0, "enable", !noEnemies, out var value)) { noEnemies = value; CombatDirector.cvDirectorCombatDisable.SetBool(noEnemies); Log.MessageNetworked(string.Format(noEnemies ? "{0} enabled." : "{0} disabled.", "no_enemies"), args); } } [ConCommand(/*Could not decode attribute arguments.*/)] [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 0 or 1 arguments: [enable (0|1)]")] private static void CCNoInteractables(ConCommandArgs args) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) if (ArgumentParser.TryParseOptionalBool(args, 0, "enable", !noInteractables, out var value)) { noInteractables = value; Log.MessageNetworked(string.Format(noInteractables ? "{0} enabled." : "{0} disabled.", args.commandName), args); } } [AutoComplete("Requires 0 or 1 arguments: [enable (0|1)]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCLockExperience(ConCommandArgs args) { //IL_0000: 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) if (ArgumentParser.TryParseOptionalBool(args, 0, "enable", !lockExp, out var value)) { lockExp = value; Log.MessageNetworked(string.Format(lockExp ? "{0} enabled." : "{0} disabled.", "lock_exp"), args); } } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 0 arguments: [true_kill (0|1):0/false]")] private static void CCKill(ConCommandArgs args) { //IL_0000: 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_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_00c5: 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) if (!ArgumentParser.AssertNotServer(args) || !ArgumentParser.AssertInARun(args) || !ArgumentParser.TryParseOptionalBool(args, 0, "true_kill", defaultValue: false, out var value)) { return; } CharacterBody body = Hooks.GetPingedTarget(((ConCommandArgs)(ref args)).senderMaster).body; if ((Object)(object)body == (Object)null) { Log.MessageNetworked("Pinged target not found. Either the last ping was not a character, or it has been destroyed since.", args, Log.LogLevel.MessageClientOnly); return; } CharacterMaster master = body.master; object obj; if (master == null) { obj = null; } else { PlayerCharacterMasterController playerCharacterMasterController = master.playerCharacterMasterController; obj = ((playerCharacterMasterController != null) ? playerCharacterMasterController.GetDisplayName() : null); } if (obj == null) { obj = ((Object)((Component)body).gameObject).name; } string text = (string)obj; if (body.healthComponent.godMode) { Log.MessageNetworked("Cannot kill " + text + " because they have god mode.", args); return; } if (value) { if (Object.op_Implicit((Object)(object)body.master)) { body.master.TrueKill(); } else { body.healthComponent.Suicide((GameObject)null, (GameObject)null, default(DamageTypeCombo)); } } else { body.healthComponent.Suicide((GameObject)null, (GameObject)null, default(DamageTypeCombo)); } Log.MessageNetworked("Killed " + text + ".", args); } [AutoComplete("Requires 0 arguments: [team (team|'enemies'):'enemies'] [true_kill (0|1):0/false]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCKillAll(ConCommandArgs args) { //IL_0000: 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_000f: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Invalid comparison between Unknown and I4 //IL_0055: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_0167: 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) //IL_016c: 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_01af: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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) if (!ArgumentParser.AssertInARun(args)) { return; } TeamMask val = TeamMask.AllExcept((TeamIndex)0); ((TeamMask)(ref val)).RemoveTeam((TeamIndex)1); string text = "enemies"; if (((ConCommandArgs)(ref args)).Count > 0 && ((ConCommandArgs)(ref args))[0] != "" && ((ConCommandArgs)(ref args))[0].ToUpperInvariant() != "ENEMIES") { if (!ArgumentParser.TryParseTeam(args, 0, out var teamIndex)) { return; } val = TeamMask.none; ((TeamMask)(ref val)).AddTeam(teamIndex); text = $"{teamIndex} characters"; } if (!ArgumentParser.TryParseOptionalBool(args, 1, "true_kill", defaultValue: false, out var value)) { return; } int num = 0; TeamIndex val2 = (TeamIndex)0; while ((int)val2 < (int)(sbyte)TeamCatalog.teamDefs.Length) { if (((TeamMask)(ref val)).HasTeam(val2)) { foreach (TeamComponent item in TeamComponent.GetTeamMembers(val2).ToList()) { HealthComponent component = ((Component)item).GetComponent(); if (!Object.op_Implicit((Object)(object)component) || component.godMode || !component.alive) { continue; } if (value) { if (Object.op_Implicit((Object)(object)component.body.master)) { component.body.master.TrueKill(); } else { component.Suicide((GameObject)null, (GameObject)null, default(DamageTypeCombo)); } } else { component.Suicide((GameObject)null, (GameObject)null, default(DamageTypeCombo)); } if (!component.alive) { num++; } } } val2 = (TeamIndex)(sbyte)(val2 + 1); } if (num == 1) { text = ((text == "enemies") ? "enemy" : text.TrimEnd('s')); } Log.MessageNetworked($"Killed {num} {text}.", args); } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 0 argument: [time_scale]")] private static void CCTimeScale(ConCommandArgs args) { //IL_001f: 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) float value; if (((ConCommandArgs)(ref args)).Count == 0) { Log.MessageNetworked(Time.timeScale.ToString(), args, Log.LogLevel.MessageClientOnly); } else if (ArgumentParser.TryParseOptionalFloat(args, 0, "time_scale", 1f, out value)) { Time.timeScale = value; RunNet.InvokeTimescale(value); } } [AutoComplete("Requires 0 or 1 arguments: [enable (0|1)]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCPauseTimer(ConCommandArgs args) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Invalid comparison between Unknown and I4 //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Invalid comparison between Unknown and I4 //IL_0034: 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_007f: Unknown result type (might be due to invalid IL or missing references) if (ArgumentParser.AssertInARun(args)) { SceneDef mostRecentSceneDef = SceneCatalog.mostRecentSceneDef; bool value; if ((int)mostRecentSceneDef.sceneType != 1 && (int)mostRecentSceneDef.sceneType != 4) { Log.MessageNetworked("The run timer can't be changed for this stage.", args, Log.LogLevel.MessageClientOnly); } else if (ArgumentParser.TryParseOptionalBool(args, 0, "enable", !Run.instance.isRunStopwatchPaused, out value)) { Run.instance.SetForcePauseRunStopwatch(value); Log.MessageNetworked(string.Format(Run.instance.isRunStopwatchPaused ? "{0} enabled." : "{0} disabled.", "Paused timer"), args); } } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCFamilyEvent(ConCommandArgs args) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) forceFamilyEvent = true; Log.MessageNetworked("The next stage will contain a family event if available!", args); } [AutoComplete("Requires 1 argument: {director_card} [count:1] [elite:None]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCNextBoss(ConCommandArgs args) { //IL_0000: 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_001f: 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_005d: 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) if (!ArgumentParser.AssertInARun(args) || !ArgumentParser.AssertRequiredArguments(args, "Requires 1 argument: {director_card} [count:1] [elite:None]", 1) || !ArgumentParser.TryParseDirectorCard(args, 0, out nextBoss) || !ArgumentParser.TryParseOptionalInt(args, 1, "count", 1, out nextBossCount, 1, (Run.instance is InfiniteTowerRun) ? 10 : 6) || !ArgumentParser.TryParseEliteOrDefault(args, 2, null, out nextBossElite)) { ResetNextBoss(); return; } string input = ((!Object.op_Implicit((Object)(object)nextBossElite)) ? $"Next boss: {((Object)nextBoss.spawnCard).name}, count: {nextBossCount}." : $"Next boss: {((Object)nextBoss.spawnCard).name}, count: {nextBossCount}, elite: {((Object)nextBossElite).name}."); Log.MessageNetworked(input, args); } [AutoComplete("Requires 0 arguments: [specific_stage]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCNextStage(ConCommandArgs args) { //IL_0000: 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_002b: 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) if (ArgumentParser.AssertInARun(args)) { SceneDef sceneDef; if (((ConCommandArgs)(ref args)).Count == 0) { Run.instance.AdvanceStage(Run.instance.nextStageScene); Log.MessageNetworked("Stage advanced.", args); } else if (ArgumentParser.TryParseScene(args, 0, includeOffline: false, out sceneDef)) { Run.instance.AdvanceStage(sceneDef); Log.MessageNetworked("Stage advanced to " + sceneDef.cachedName + ".", args); } } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCNextWave(ConCommandArgs args) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (ArgumentParser.AssertInSimulacrumARun(args)) { Run instance = Run.instance; InfiniteTowerRun val = (InfiniteTowerRun)(object)((instance is InfiniteTowerRun) ? instance : null); if (Object.op_Implicit((Object)(object)val.waveInstance) && Object.op_Implicit((Object)(object)val.waveController) && !val.waveController.isFinished) { val.waveController.combatDirector.totalCreditsSpent = val.waveController.totalWaveCredits; val.waveController.KillSquad(); } } } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 1 argument {wave}")] private static void CCRunSetWavesCleared(ConCommandArgs args) { //IL_0000: 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_001f: Unknown result type (might be due to invalid IL or missing references) if (ArgumentParser.AssertInSimulacrumARun(args) && ArgumentParser.AssertRequiredArguments(args, "Requires 1 argument {wave}", 1) && ArgumentParser.TryParseOptionalInt(args, 0, "wave", 0, out var value, 0)) { Run instance = Run.instance; ((InfiniteTowerRun)((instance is InfiniteTowerRun) ? instance : null)).Network_waveIndex = value; } } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 0 or 1 argument [wave_prefab]")] private static void CCForceWave(ConCommandArgs args) { //IL_0000: 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_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_003d: 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_0118: 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) if (!ArgumentParser.AssertInSimulacrumARun(args)) { return; } Run instance = Run.instance; Run obj = ((instance is InfiniteTowerRun) ? instance : null); Dictionary dictionary = new Dictionary(); InfiniteTowerWaveCategory[] waveCategories = ((InfiniteTowerRun)obj).waveCategories; for (int i = 0; i < waveCategories.Length; i++) { WeightedWave[] wavePrefabs = waveCategories[i].wavePrefabs; foreach (WeightedWave val in wavePrefabs) { string name = ((Object)val.wavePrefab).name; name = name.Replace("InfiniteTowerWave", "").Replace("Artifact", ""); dictionary[name] = val.wavePrefab; } } selectedWavePrefab = null; if (((ConCommandArgs)(ref args)).Count == 0) { Log.MessageNetworked("You can choose from: " + string.Join(", ", dictionary.Keys), args, Log.LogLevel.MessageClientOnly); return; } string value = ((ConCommandArgs)(ref args))[0].ToLowerInvariant(); foreach (KeyValuePair item in dictionary) { if (item.Key.ToLowerInvariant().Contains(value)) { selectedWavePrefab = item.Value; Log.MessageNetworked("Selected " + item.Key, args); return; } } Log.MessageNetworked("Wave prefab not found. You can choose from: " + string.Join(", ", dictionary.Keys), args, Log.LogLevel.MessageClientOnly); } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 0 argument: [charge]")] private static void CCChargeZone(ConCommandArgs args) { //IL_0000: 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) if (!ArgumentParser.AssertInARun(args) || !ArgumentParser.TryParseOptionalFloat(args, 0, "charge", 100f, out var value)) { return; } value /= 100f; EntityStateMachine val2 = default(EntityStateMachine); foreach (HoldoutZoneController instances in InstanceTracker.GetInstancesList()) { instances.charge = value; bool flag = value >= 1f; if (flag && instances.wasCharged != flag && instances.onCharged != null) { instances.wasCharged = flag; ((UnityEvent)(object)instances.onCharged).Invoke(instances); } TeleporterInteraction component = ((Component)instances).GetComponent(); if (Object.op_Implicit((Object)(object)component) && value < 1f) { ((Behaviour)component.bonusDirector).enabled = true; } GameObject[] healingNovaGeneratorsByTeam = instances.healingNovaGeneratorsByTeam; foreach (GameObject val in healingNovaGeneratorsByTeam) { if (Object.op_Implicit((Object)(object)val) && val.TryGetComponent(ref val2)) { EntityState state = val2.state; TeleporterHealNovaGeneratorMain val3 = (TeleporterHealNovaGeneratorMain)(object)((state is TeleporterHealNovaGeneratorMain) ? state : null); if (val3 != null) { val3.previousPulseFraction = value; } } } } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCEvolveLemurians(ConCommandArgs args) { //IL_0000: 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_0048: Unknown result type (might be due to invalid IL or missing references) if (ArgumentParser.AssertInARun(args)) { bool isDevotionEnable = DevotionInventoryController.isDevotionEnable; if (!isDevotionEnable) { DevotionInventoryController.OnDevotionArtifactEnabled(RunArtifactManager.instance, Artifacts.Devotion); } DevotionInventoryController.ActivateAllDevotedEvolution(); if (!isDevotionEnable) { DevotionInventoryController.OnDevotionArtifactDisabled(RunArtifactManager.instance, Artifacts.Devotion); } if (DevotionInventoryController.InstanceList.Count > 0) { Log.MessageNetworked("Evolved all Devoted Lemurians.", args); } else { Log.MessageNetworked("No Devoted Lemurians found.", args); } } } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 1 (2 if using 'all') argument: {artifact (artifact|'all')} [enable (0|1)]")] private static void CCSetArtifact(ConCommandArgs args) { //IL_0000: 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_001f: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) if (!ArgumentParser.AssertInARun(args) || !ArgumentParser.AssertRequiredArguments(args, "Requires 1 (2 if using 'all') argument: {artifact (artifact|'all')} [enable (0|1)]", 1) || !ArgumentParser.TryParseOptionalBool(args, 1, "enable", defaultValue: false, out var value)) { return; } if (((ConCommandArgs)(ref args))[0].ToUpperInvariant() == "ALL" && ((ConCommandArgs)(ref args)).Count < 2) { Log.MessageNetworked("The 'enable' argument is required when using 'all'.", args, Log.LogLevel.MessageClientOnly); } else if (((ConCommandArgs)(ref args))[0].ToUpperInvariant() == "ALL") { bool flag = RunArtifactManager.instance.IsArtifactEnabled(Artifacts.MonsterTeamGainsItems) != value; ArtifactDef[] artifactDefs = ArtifactCatalog.artifactDefs; foreach (ArtifactDef val in artifactDefs) { if (!Object.op_Implicit((Object)(object)val.requiredExpansion) || Run.instance.IsExpansionEnabled(val.requiredExpansion)) { RunArtifactManager.instance.SetArtifactEnabled(val, value); } } if (!value && Object.op_Implicit((Object)(object)Stage.instance)) { Stage.instance.singleMonsterTypeBodyIndex = (BodyIndex)(-1); } if (!flag) { EnemyInfoPanel.RefreshAll(); } Log.MessageNetworked(string.Format(value ? "{0} enabled." : "{0} disabled.", "All artifacts"), args); } else { if (!ArgumentParser.TryParseArtifact(args, 0, out var artifactDef)) { return; } if (((ConCommandArgs)(ref args)).Count < 2) { value = !RunArtifactManager.instance.IsArtifactEnabled(artifactDef); } if (RunArtifactManager.instance.IsArtifactEnabled(artifactDef) == value) { Log.MessageNetworked("Nothing happened", args); return; } RunArtifactManager.instance.SetArtifactEnabled(artifactDef, value); if ((Object)(object)artifactDef == (Object)(object)Artifacts.SingleMonsterType && Object.op_Implicit((Object)(object)Stage.instance)) { if (!value) { Stage.instance.singleMonsterTypeBodyIndex = (BodyIndex)(-1); } EnemyInfoPanel.RefreshAll(); } else if ((Object)(object)artifactDef == (Object)(object)Artifacts.MixEnemy && RunArtifactManager.instance.IsArtifactEnabled(Artifacts.SingleMonsterType)) { EnemyInfoPanel.RefreshAll(); } Log.MessageNetworked(string.Format(value ? "{0} enabled." : "{0} disabled.", artifactDef.cachedName), args); } } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 1 argument: {difficulty}")] private static void CCSetDifficulty(ConCommandArgs args) { //IL_0000: 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_001f: 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_0035: 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_003d: 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_00e6: 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_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Invalid comparison between Unknown and I4 //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Invalid comparison between Unknown and I4 if (!ArgumentParser.AssertInARun(args) || !ArgumentParser.AssertRequiredArguments(args, "Requires 1 argument: {difficulty}", 1) || !ArgumentParser.TryParseDifficulty(args, 0, out var difficultyIndex)) { return; } if (Run.instance.selectedDifficulty == difficultyIndex) { Log.MessageNetworked("The difficulty remained unchanged.", args); return; } DifficultyDef val = StringFinder.difficultyDefs[difficultyIndex]; foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { instance.master.inventory.ResetItemPermanent(Items.DrizzlePlayerHelper); instance.master.inventory.ResetItemPermanent(Items.MonsoonPlayerHelper); if ((int)difficultyIndex == 0) { instance.master.inventory.GiveItemPermanent(Items.DrizzlePlayerHelper, 1); } else if (val.countsAsHardMode) { instance.master.inventory.GiveItemPermanent(Items.MonsoonPlayerHelper, 1); } } Run.instance.selectedDifficulty = difficultyIndex; Log.MessageNetworked("Difficulty changed to " + StringFinder.GetLangInvar(val.nameToken) + ".", args); RunNet.InvokeHudUpdate(difficultyIndex); if ((int)difficultyIndex < 0 || (int)difficultyIndex > DifficultyCatalog.difficultyDefs.Length) { Log.MessageNetworked("Changing to a modded difficulty in the middle of a run may have unintended consequences.", args, Log.LogLevel.Warning); } } [AutoComplete("Requires 0 or 1 argument: [new_seed]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCUseSeed(ConCommandArgs args) { //IL_005c: 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_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_00ba: Expected O, but got Unknown //IL_0118: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Expected O, but got Unknown if (((ConCommandArgs)(ref args)).Count == 0) { string text = "Current Seed is "; text = ((!Object.op_Implicit((Object)(object)PreGameController.instance)) ? (text + ((seed == 0L) ? "random" : seed.ToString())) : (text + PreGameController.instance.runSeed)); Log.MessageNetworked(text, args, Log.LogLevel.MessageClientOnly); } else { if (!ArgumentParser.TryParseOptionalULong(args, 0, "new_seed", 0uL, out var value)) { return; } if (Object.op_Implicit((Object)(object)PreGameController.instance)) { PreGameController.instance.runSeed = ((value == 0L) ? RoR2Application.rng.nextUlong : value); } if (seed == 0L && value != 0L) { object obj = <>O.<0>__SeedHook; if (obj == null) { hook_Awake val = Hooks.SeedHook; <>O.<0>__SeedHook = val; obj = (object)val; } PreGameController.Awake += (hook_Awake)obj; } else if (seed != 0L && value == 0L) { object obj2 = <>O.<0>__SeedHook; if (obj2 == null) { hook_Awake val2 = Hooks.SeedHook; <>O.<0>__SeedHook = val2; obj2 = (object)val2; } PreGameController.Awake -= (hook_Awake)obj2; } seed = value; Log.MessageNetworked("Seed set to " + ((seed == 0L) ? "vanilla generation" : seed.ToString()) + ".", args); } } [AutoComplete("Requires 0 or 1 argument: [time]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCSetTime(ConCommandArgs args) { //IL_0000: 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_002b: 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) if (ArgumentParser.AssertInARun(args)) { float value; if (((ConCommandArgs)(ref args)).Count == 0) { Log.MessageNetworked($"Run time is {Run.instance.GetRunStopwatch()}.", args, Log.LogLevel.MessageClientOnly); } else if (ArgumentParser.TryParseOptionalFloat(args, 0, "time", 0f, out value, 0f)) { Run.instance.SetRunStopwatch(value); Log.MessageNetworked($"Run timer set to {value}.", args); } } } } public class RunNet : NetworkBehaviour { private static RunNet _instance; private static int kRpcRpcApplyTimescale; private static int kRpcRpcUpdateHudDifficulty; private void Awake() { _instance = this; } internal static void InvokeTimescale(float scale) { _instance.CallRpcApplyTimescale(scale); } [ClientRpc] private void RpcApplyTimescale(float scale) { Time.timeScale = scale; Log.Message($"Timescale set to {scale}."); } internal static void InvokeHudUpdate(DifficultyIndex difficultyIndex) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) _instance.CallRpcUpdateHudDifficulty(difficultyIndex); } [ClientRpc] private void RpcUpdateHudDifficulty(DifficultyIndex difficultyIndex) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)Run.instance) || !StringFinder.difficultyDefs.TryGetValue(difficultyIndex, out var value)) { return; } Image val = default(Image); foreach (GameObject uiInstance in Run.instance.uiInstances) { CurrentDifficultyIconController componentInChildren = uiInstance.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren) && ((Component)componentInChildren).TryGetComponent(ref val)) { val.sprite = value.GetIconSprite(); } } } private void UNetVersion() { } protected static void InvokeRpcRpcApplyTimescale(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcApplyTimescale called on server."); } else { ((RunNet)(object)obj).RpcApplyTimescale(reader.ReadSingle()); } } protected static void InvokeRpcRpcUpdateHudDifficulty(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcUpdateHudDifficulty called on server."); } else { ((RunNet)(object)obj).RpcUpdateHudDifficulty((DifficultyIndex)reader.ReadInt32()); } } public void CallRpcApplyTimescale(float scale) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcApplyTimescale called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)kRpcRpcApplyTimescale); val.Write(((Component)this).GetComponent().netId); val.Write(scale); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcApplyTimescale"); } public void CallRpcUpdateHudDifficulty(DifficultyIndex difficultyIndex) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: 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_0055: Expected I4, but got Unknown if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcUpdateHudDifficulty called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)kRpcRpcUpdateHudDifficulty); val.Write(((Component)this).GetComponent().netId); val.Write((int)difficultyIndex); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcUpdateHudDifficulty"); } static RunNet() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown kRpcRpcApplyTimescale = 1989138231; NetworkBehaviour.RegisterRpcDelegate(typeof(RunNet), kRpcRpcApplyTimescale, new CmdDelegate(InvokeRpcRpcApplyTimescale)); kRpcRpcUpdateHudDifficulty = -1048553887; NetworkBehaviour.RegisterRpcDelegate(typeof(RunNet), kRpcRpcUpdateHudDifficulty, new CmdDelegate(InvokeRpcRpcUpdateHudDifficulty)); NetworkCRC.RegisterBehaviour("RunNet", 0); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { bool result = default(bool); return result; } public override void OnDeserialize(NetworkReader reader, bool initialState) { } } internal class Items { internal enum ItemType { None = -1, Permanent, Temp } private static readonly Dictionary> availableDropLists = new Dictionary>(); private static BasicPickupDropTable droptable; private static GameObject potentialPrefab; [AutoComplete("Requires 0 arguments: [query]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCListItemTier(ConCommandArgs args) { //IL_0034: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected I4, but got Unknown //IL_0046: 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) StringBuilder stringBuilder = new StringBuilder(); string text = ((((ConCommandArgs)(ref args)).Count > 0) ? ((ConCommandArgs)(ref args))[0] : ""); foreach (ItemTier item in StringFinder.Instance.GetItemTiersFromPartial(text)) { stringBuilder.AppendLine($"[{(int)item}]{((Object)ItemTierCatalog.GetItemTierDef(item)).name}"); } Log.MessageNetworked((stringBuilder.Length > 0) ? stringBuilder.ToString().TrimEnd('\n') : string.Format("No {0} found that match \"{1}\".", "item tiers", text), args, Log.LogLevel.MessageClientOnly); } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 0 arguments: [query]")] private static void CCListItem(ConCommandArgs args) { //IL_0034: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Expected I4, but got Unknown //IL_00e6: Unknown result type (might be due to invalid IL or missing references) StringBuilder stringBuilder = new StringBuilder(); string text = ((((ConCommandArgs)(ref args)).Count > 0) ? ((ConCommandArgs)(ref args))[0] : ""); foreach (ItemIndex item in StringFinder.Instance.GetItemsFromPartial(text)) { ItemDef itemDef = ItemCatalog.GetItemDef(item); string localizedStringByToken = Language.currentLanguage.GetLocalizedStringByToken(itemDef.nameToken); bool flag = Object.op_Implicit((Object)(object)Run.instance) && Run.instance.IsItemAvailable(item); stringBuilder.AppendLine($"[{(int)item}]{((Object)itemDef).name} \"{localizedStringByToken}\" (enabled={flag})"); } Log.MessageNetworked((stringBuilder.Length > 0) ? stringBuilder.ToString().TrimEnd('\n') : string.Format("No {0} found that match \"{1}\".", "items", text), args, Log.LogLevel.MessageClientOnly); } [AutoComplete("Requires 0 arguments: [query]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCListEquip(ConCommandArgs args) { //IL_0034: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Expected I4, but got Unknown //IL_00e6: Unknown result type (might be due to invalid IL or missing references) StringBuilder stringBuilder = new StringBuilder(); string text = ((((ConCommandArgs)(ref args)).Count > 0) ? ((ConCommandArgs)(ref args))[0] : ""); foreach (EquipmentIndex item in StringFinder.Instance.GetEquipsFromPartial(text)) { EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(item); string localizedStringByToken = Language.currentLanguage.GetLocalizedStringByToken(equipmentDef.nameToken); bool flag = Object.op_Implicit((Object)(object)Run.instance) && Run.instance.IsEquipmentAvailable(item); stringBuilder.AppendLine($"[{(int)item}]{((Object)equipmentDef).name} \"{localizedStringByToken}\" (enabled={flag})"); } Log.MessageNetworked((stringBuilder.Length > 0) ? stringBuilder.ToString().TrimEnd('\n') : string.Format("No {0} found that match \"{1}\".", "equipment", text), args, Log.LogLevel.MessageClientOnly); } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCDumpInventories(ConCommandArgs args) { //IL_0000: 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_01c3: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_008b: 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) if (!ArgumentParser.AssertInARun(args)) { return; } StringBuilder stringBuilder = new StringBuilder(); foreach (CharacterBody readOnlyInstances in CharacterBody.readOnlyInstancesList) { Inventory inventory = readOnlyInstances.inventory; if (!Object.op_Implicit((Object)(object)inventory)) { continue; } stringBuilder.AppendLine($"--- {((Object)readOnlyInstances).name} {readOnlyInstances.corePosition}"); foreach (ItemIndex item in inventory.itemAcquisitionOrder) { int itemCountEffective = inventory.GetItemCountEffective(item); if (itemCountEffective != 0) { ItemDef itemDef = ItemCatalog.GetItemDef(item); string colorHexString = ColorCatalog.GetColorHexString(itemDef.colorIndex); string arg = ((itemDef.nameToken != "") ? Language.GetString(itemDef.nameToken) : ((Object)itemDef).name); stringBuilder.AppendLine($"{arg} {itemCountEffective}"); } } for (uint num = 0u; num < inventory.GetEquipmentSlotCount(); num++) { for (uint num2 = 0u; num2 < inventory.GetEquipmentSetCount(num); num2++) { EquipmentDef equipmentDef = inventory.GetEquipment(num, num2).equipmentDef; string colorHexString2 = ColorCatalog.GetColorHexString((ColorIndex)5); string text = (((Object)(object)equipmentDef != (Object)null) ? Language.GetString(equipmentDef.nameToken) : ""); stringBuilder.AppendLine("" + text + ""); } } stringBuilder.AppendLine(); } Log.MessageNetworked(stringBuilder.ToString().TrimEnd('\n'), args, Log.LogLevel.MessageClientOnly); } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 1 (4 if from server) argument: {item} [count:1] [item_type:Permanent] [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCGiveItem(ConCommandArgs args) { //IL_0000: 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_001c: 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_004c: 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_0082: 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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_012f: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) if (ArgumentParser.AssertInARun(args) && ArgumentParser.AssertRequiredArguments(args, "Requires 1 (4 if from server) argument: {item} [count:1] [item_type:Permanent] [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]", 1, 4) && ArgumentParser.TryParseItem(args, 0, out var itemDef) && ArgumentParser.TryParseOptionalInt(args, 1, "count", 1, out var value) && TryParseItemType(args, 2, out var itemType) && TryParseInventoryTarget(args, 3, out var target)) { string arg = ((Object)itemDef).name; if (itemType != ItemType.Permanent) { arg = $"{itemType} {arg}"; } int num = ((args.commandName == "give_item") ? 1 : (-1)) * value; Inventory inventory = target.inventory; if (num > 0) { GiveItem(inventory, itemDef.itemIndex, num, itemType); Log.MessageNetworked($"Gave {num} {arg} to {target.name}.", args); } else if (num < 0) { num = Math.Min(-num, GetItemCount(inventory, itemDef.itemIndex, itemType)); RemoveItem(inventory, itemDef.itemIndex, num, itemType); Log.MessageNetworked($"Removed {num} {arg} from {target.name}.", args); } else { Log.MessageNetworked("Nothing happened", args); } if (Object.op_Implicit((Object)(object)target.devotionController)) { target.devotionController.UpdateAllMinions(false); } } } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 1 (4 if from server) argument: {count} [droptable (droptable|'all'):'Tier1:100,Tier2:60,Tier3:4'] [item_type:Permanent] [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]")] private static void CCRandomItems(ConCommandArgs args) { //IL_0000: 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_001c: 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_0047: 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_0076: 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_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_00b4: 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_00fa: Unknown result type (might be due to invalid IL or missing references) if (!ArgumentParser.AssertInARun(args) || !ArgumentParser.AssertRequiredArguments(args, "Requires 1 (4 if from server) argument: {count} [droptable (droptable|'all'):'Tier1:100,Tier2:60,Tier3:4'] [item_type:Permanent] [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]", 1, 4) || !ArgumentParser.TryParseOptionalInt(args, 0, "count", 0, out var value, 1) || !TryParseDroptable(args, 1, canDropBeReplaced: false) || !TryParseItemType(args, 2, out var itemType) || !TryParseInventoryTarget(args, 3, out var target)) { return; } WeightedSelection selector = droptable.selector; if (selector.Count == 0) { Log.MessageNetworked("No items found to draw from.", args, Log.LogLevel.MessageClientOnly); } else if (value > 0) { for (int i = 0; i < value; i++) { PickupDef pickupDef = PickupCatalog.GetPickupDef(selector.Evaluate(Random.value).pickupIndex); ItemIndex itemIndex = (ItemIndex)((pickupDef != null) ? ((int)pickupDef.itemIndex) : (-1)); GiveItem(target.inventory, itemIndex, 1, itemType); } if (Object.op_Implicit((Object)(object)target.devotionController)) { target.devotionController.UpdateAllMinions(false); } if (itemType == ItemType.Permanent) { Log.MessageNetworked($"Generated {value} items for {target.name}!", args); } else { Log.MessageNetworked($"Generated {value} {itemType} items for {target.name}!", args); } } } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 1 (2 if from server) argument: {equip (equip|'random')} [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]")] private static void CCGiveEquipment(ConCommandArgs args) { //IL_0000: 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_001c: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) if (ArgumentParser.AssertInARun(args) && ArgumentParser.AssertRequiredArguments(args, "Requires 1 (2 if from server) argument: {equip (equip|'random')} [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]", 1, 2) && ArgumentParser.TryParseEquipmentOrRandom(args, 0, out var equipmentDef) && TryParseInventoryTarget(args, 1, out var target)) { target.inventory.SetEquipmentIndex(equipmentDef.equipmentIndex, false); Log.MessageNetworked($"Gave {((Object)equipmentDef).name} to {target.name}.", args); } } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 3 (4 if from server) argument: {equip (equip|'random')} {slot} {set} [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]")] private static void CCGiveEquipmentExtra(ConCommandArgs args) { //IL_0000: 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_001c: 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_0038: 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_0062: 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) if (ArgumentParser.AssertInARun(args) && ArgumentParser.AssertRequiredArguments(args, "Requires 3 (4 if from server) argument: {equip (equip|'random')} {slot} {set} [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]", 3, 4) && ArgumentParser.TryParseEquipmentOrRandom(args, 0, out var equipmentDef) && ArgumentParser.TryParseOptionalUInt(args, 1, "slot", 0u, out var value) && ArgumentParser.TryParseOptionalUInt(args, 2, "set", 0u, out var value2) && TryParseInventoryTarget(args, 3, out var target)) { Inventory inventory = target.inventory; inventory.UpdateEquipmentSetCount(); inventory.SetEquipmentIndexForSlot(equipmentDef.equipmentIndex, value, value2); Log.MessageNetworked($"Gave {((Object)equipmentDef).name} to {target.name} in position ({value}, {value2})", args); } } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 1 (3 if from server) argument: {object (item|equip|'lunarcoin'|'voidcoin')} [item_type:Permanent] [search ('item'|'equip'|'both'):'both'] [player:]")] private static void CCCreatePickup(ConCommandArgs args) { //IL_0000: 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_001c: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_00f0: 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_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: 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_0101: 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_01d1: 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_01e1: 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_01f7: 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_0212: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013e: Invalid comparison between Unknown and I4 //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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Invalid comparison between Unknown and I4 //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Invalid comparison between Unknown and I4 //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Invalid comparison between Unknown and I4 //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Invalid comparison between Unknown and I4 //IL_014a: 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_0190: 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_0183: 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_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) if (!ArgumentParser.AssertInARun(args) || !ArgumentParser.AssertRequiredArguments(args, "Requires 1 (3 if from server) argument: {object (item|equip|'lunarcoin'|'voidcoin')} [item_type:Permanent] [search ('item'|'equip'|'both'):'both'] [player:]", 1, 4) || !TryParseItemType(args, 1, out var itemType) || !ArgumentParser.TryParsePlayerOrDefault(args, 3, out var master, requireLiving: true)) { return; } bool flag = true; bool flag2 = true; if (((ConCommandArgs)(ref args)).Count > 2 && ((ConCommandArgs)(ref args))[2] != "") { switch (((ConCommandArgs)(ref args))[2].ToUpperInvariant()) { case "ITEM": flag = false; break; case "EQUIP": flag2 = false; break; default: Log.MessageNetworked(string.Format("Invalid value for {0}.", "search"), args, Log.LogLevel.MessageClientOnly); return; case "BOTH": break; } } PickupIndex none = PickupIndex.none; EquipmentIndex val = (EquipmentIndex)(-1); ItemIndex val2 = (ItemIndex)(-1); string text = ((ConCommandArgs)(ref args))[0].ToUpperInvariant(); if (!(text == "LUNARCOIN")) { if (text == "VOIDCOIN") { none = PickupCatalog.FindPickupIndex("MiscPickupIndex.VoidCoin"); } else { if (flag) { val = StringFinder.Instance.GetEquipFromPartial(((ConCommandArgs)(ref args))[0]); } if (flag2) { val2 = StringFinder.Instance.GetItemFromPartial(((ConCommandArgs)(ref args))[0]); } if ((int)val2 == -1 && (int)val == -1) { Log.MessageNetworked("Could not find any item nor equipment with that name.", args, Log.LogLevel.MessageClientOnly); return; } if ((int)val2 != -1 && (int)val != -1) { Log.MessageNetworked($"Could not choose between {val2} and {val}, please be more precise. Consider using 'equip' or 'item' as the second argument.", args, Log.LogLevel.MessageClientOnly); return; } none = (((int)val == -1) ? PickupCatalog.FindPickupIndex(val2) : PickupCatalog.FindPickupIndex(val)); } } else { none = PickupCatalog.FindPickupIndex("LunarCoin.Coin0"); } CharacterBody body = master.GetBody(); CreatePickupInfo val3 = default(CreatePickupInfo); ((CreatePickupInfo)(ref val3)).pickup = new UniquePickup { pickupIndex = none, decayValue = ((itemType == ItemType.Temp) ? 1f : 0f) }; PickupDropletController.CreatePickupDroplet(val3, body.transform.position, body.inputBank.aimDirection * 30f); Log.MessageNetworked($"Successfully created the pickup {none}.", args); } [AutoComplete("Requires 0 (3 if from server) arguments: [droptable (droptable|'all'):'Tier1:100,Tier2:60,Tier3:4'] [count:3] [player:]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCCreatePotential(ConCommandArgs args) { //IL_0000: 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_001c: 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_0047: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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_011e: 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_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (ArgumentParser.AssertInARun(args) && ArgumentParser.AssertRequiredArguments(args, "Requires 0 (3 if from server) arguments: [droptable (droptable|'all'):'Tier1:100,Tier2:60,Tier3:4'] [count:3] [player:]", 0, 3) && TryParseDroptable(args, 0, canDropBeReplaced: true) && ArgumentParser.TryParseOptionalInt(args, 1, "count", 3, out var value, 1) && ArgumentParser.TryParsePlayerOrDefault(args, 2, out var master, requireLiving: true)) { ItemTier val = (ItemTier)0; if (((ConCommandArgs)(ref args)).Count > 0 && ((ConCommandArgs)(ref args))[0] != "" && ((ConCommandArgs)(ref args))[0].ToUpperInvariant() != "ALL") { val = StringFinder.Instance.GetItemTierFromPartial(((ConCommandArgs)(ref args))[0].Split(',')[0].Split(':')[0]); } CharacterBody body = master.GetBody(); CreatePickupInfo val2 = new CreatePickupInfo { pickerOptions = PickupPickerController.GenerateOptionsFromDropTable(value, (PickupDropTable)(object)droptable, RoR2Application.rng), prefabOverride = potentialPrefab, position = body.transform.position, rotation = Quaternion.identity }; ((CreatePickupInfo)(ref val2)).pickup = new UniquePickup(PickupCatalog.FindPickupIndex(val)); PickupDropletController.CreatePickupDroplet(val2, body.transform.position, body.inputBank.aimDirection * 30f); Log.MessageNetworked($"Successfully created a potential with {Math.Min(value, droptable.selector.Count)} options.", args); } } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 1 (2 if from server) argument: {item} [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]")] private static void CCRemoveItemStacks(ConCommandArgs args) { //IL_0000: 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_001c: 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_0054: 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) if (ArgumentParser.AssertInARun(args) && ArgumentParser.AssertRequiredArguments(args, "Requires 1 (2 if from server) argument: {item} [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]", 1, 2) && ArgumentParser.TryParseItem(args, 0, out var itemDef) && TryParseInventoryTarget(args, 1, out var target)) { Inventory inventory = target.inventory; int num = inventory.GetItemCountPermanent(itemDef) + inventory.GetItemCountTemp(itemDef); inventory.RemoveItemPermanent(itemDef, num); inventory.RemoveItemTemp(itemDef.itemIndex, (float)num); if (Object.op_Implicit((Object)(object)target.devotionController)) { target.devotionController.UpdateAllMinions(false); } Log.MessageNetworked($"Removed {num} {((Object)itemDef).name} from {target.name}.", args); } } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 0 (1 if from server) arguments: [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]")] private static void CCRemoveAllItems(ConCommandArgs args) { //IL_0000: 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_001c: Unknown result type (might be due to invalid IL or missing references) //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_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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) if (!ArgumentParser.AssertInARun(args) || !ArgumentParser.AssertRequiredArguments(args, "Requires 0 (1 if from server) arguments: [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]", 0, 1) || !TryParseInventoryTarget(args, 0, out var target)) { return; } InventoryChangeScope val = default(InventoryChangeScope); ((InventoryChangeScope)(ref val))..ctor(target.inventory); try { target.inventory.CleanInventory(); List list = default(List); DisposableRental> val2 = CollectionPool>.RentCollection(ref list); try { ((TempItemsStorage)(ref target.inventory.tempItemsStorage)).GetNonZeroIndices(list); foreach (ItemIndex item in list) { target.inventory.ResetItemTemp(item); } } finally { val2.Dispose(); } } finally { ((InventoryChangeScope)(ref val)).Dispose(); } if (Object.op_Implicit((Object)(object)target.devotionController)) { target.devotionController.UpdateAllMinions(false); } Log.MessageNetworked(string.Format("Reset {0} for {1}.", "all items", target.name), args); } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 0 (1 if from server) arguments: [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]")] private static void CCRemoveEquipment(ConCommandArgs args) { //IL_0000: 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_001c: 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) if (ArgumentParser.AssertInARun(args) && ArgumentParser.AssertRequiredArguments(args, "Requires 0 (1 if from server) arguments: [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]", 0, 1) && TryParseInventoryTarget(args, 0, out var target)) { target.inventory.SetEquipmentIndex((EquipmentIndex)(-1), true); Log.MessageNetworked(string.Format("Removed {0} from {1}.", "current Equipment", target.name), args); } } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 2 (3 if from server) arguments: {slot} {set} [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]")] private static void CCRemoveEquipmentExtra(ConCommandArgs args) { //IL_0000: 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_001c: 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_003e: 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_00a0: Unknown result type (might be due to invalid IL or missing references) if (ArgumentParser.AssertInARun(args) && ArgumentParser.AssertRequiredArguments(args, "Requires 2 (3 if from server) arguments: {slot} {set} [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]", 2, 3) && ArgumentParser.TryParseOptionalUInt(args, 0, "slot", 0u, out var value) && ArgumentParser.TryParseOptionalUInt(args, 1, "set", 0u, out var value2) && TryParseInventoryTarget(args, 2, out var target)) { Inventory inventory = target.inventory; if (inventory._equipmentStateSlots.Length < value || inventory._equipmentStateSlots[value].Length < value2) { Log.MessageNetworked("Unassigned equipment slot/set. Nothing to remove.", args, Log.LogLevel.MessageClientOnly); return; } inventory.SetEquipmentIndexForSlot((EquipmentIndex)(-1), value, value2); Log.MessageNetworked($"Removed equipment from {target.name} in position ({value}, {value2})", args); } } [AutoComplete("Requires 0 (2 if from server) arguments: [count:1] [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCRestockEquip(ConCommandArgs args) { //IL_0000: 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_001c: 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_00cd: 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_008f: 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) if (ArgumentParser.AssertInARun(args) && ArgumentParser.AssertRequiredArguments(args, "Requires 0 (2 if from server) arguments: [count:1] [target (player|'pinged'|'evolution'|'simulacrum'|'voidfields'|'devotion'):]", 0, 2) && ArgumentParser.TryParseOptionalInt(args, 0, "count", 1, out var value, 0) && TryParseInventoryTarget(args, 1, out var target)) { Inventory inventory = target.inventory; byte activeEquipmentSlot = inventory.activeEquipmentSlot; if (inventory.activeEquipmentSet.Length > activeEquipmentSlot) { byte b = inventory.activeEquipmentSet[inventory.activeEquipmentSlot]; byte charges = inventory.GetEquipment((uint)activeEquipmentSlot, (uint)b).charges; inventory.RestockEquipmentCharges(activeEquipmentSlot, b, value); byte charges2 = inventory.GetEquipment((uint)activeEquipmentSlot, (uint)b).charges; Log.MessageNetworked($"Restocked {charges2 - charges} for the current equipment of {target.name}", args); } else { Log.MessageNetworked(target.name + " has never held an equipment in the current equipment slot.", args); } } } private static int GetItemCount(Inventory inventory, ItemIndex itemIndex, ItemType type) { //IL_000a: 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) switch (type) { case ItemType.Permanent: return inventory.GetItemCountPermanent(itemIndex); case ItemType.Temp: return inventory.GetItemCountTemp(itemIndex); default: Log.Message("Yell at the modmakers if you see this message!", Log.LogLevel.Warning, Log.Target.Ror2); return 0; } } private static void GiveItem(Inventory inventory, ItemIndex itemIndex, int count, ItemType type) { //IL_000a: 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) switch (type) { case ItemType.Permanent: inventory.GiveItemPermanent(itemIndex, count); break; case ItemType.Temp: inventory.GiveItemTemp(itemIndex, (float)count); break; default: Log.Message("Yell at the modmakers if you see this message!", Log.LogLevel.Warning, Log.Target.Ror2); break; } } private static void RemoveItem(Inventory inventory, ItemIndex itemIndex, int count, ItemType type) { //IL_000a: 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) switch (type) { case ItemType.Permanent: inventory.RemoveItemPermanent(itemIndex, count); break; case ItemType.Temp: inventory.RemoveItemTemp(itemIndex, (float)count); break; default: Log.Message("Yell at the modmakers if you see this message!", Log.LogLevel.Warning, Log.Target.Ror2); break; } } private static bool TryParseItemType(ConCommandArgs args, int index, out ItemType itemType) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) itemType = ItemType.Permanent; if (((ConCommandArgs)(ref args)).Count > index && ((ConCommandArgs)(ref args))[index] != "" && (!StringFinder.TryGetEnumFromPartial(((ConCommandArgs)(ref args))[index], out itemType) || itemType == ItemType.None)) { Log.MessageNetworked(string.Format("Invalid value for {0}.", "item_type"), args, Log.LogLevel.MessageClientOnly); return false; } return true; } private static bool TryParseInventoryTarget(ConCommandArgs args, int index, out Util.CommandTarget target) { //IL_01ba: 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_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) target = default(Util.CommandTarget); if (((ConCommandArgs)(ref args)).Count > index && ((ConCommandArgs)(ref args))[index] != "") { switch (((ConCommandArgs)(ref args))[index].ToUpperInvariant()) { case "EVOLUTION": target.inventory = MonsterTeamGainsItemsArtifactManager.monsterTeamInventory; target.name = ((Object)((Component)target.inventory).gameObject).name; return true; case "SIMULACRUM": { Run instance = Run.instance; InfiniteTowerRun val = (InfiniteTowerRun)(object)((instance is InfiniteTowerRun) ? instance : null); if (!Object.op_Implicit((Object)(object)val)) { Log.MessageNetworked("Must be in a Simulacrum Run!", args, Log.LogLevel.MessageClientOnly); return false; } target.inventory = val.enemyInventory; target.name = ((Object)((Component)target.inventory).gameObject).name; return true; } case "VOIDFIELDS": { ArenaMissionController instance2 = ArenaMissionController.instance; if (!Object.op_Implicit((Object)(object)instance2)) { Log.MessageNetworked("Must be on Void Fields!", args, Log.LogLevel.MessageClientOnly); return false; } target.inventory = instance2.inventory; target.name = ((Object)((Component)target.inventory).gameObject).name; return true; } case "DEVOTION": { if ((Object)(object)args.sender == (Object)null) { Log.MessageNetworked(string.Format("This command doesn't support the '{0}' argument from a dedicated server.", "devotion"), args, Log.LogLevel.MessageClientOnly); return false; } CharacterMaster senderMaster = ((ConCommandArgs)(ref args)).senderMaster; if ((Object)(object)senderMaster == (Object)null) { Log.MessageNetworked("Specified player not found or isn't alive. Please use list_player for options.", args, Log.LogLevel.MessageClientOnly); return false; } target.devotionController = GetDevotionController(senderMaster); target.inventory = target.devotionController._devotionMinionInventory; PlayerCharacterMasterController playerCharacterMasterController = senderMaster.playerCharacterMasterController; target.name = (((playerCharacterMasterController != null) ? playerCharacterMasterController.GetDisplayName() : null) ?? ((Object)((Component)senderMaster).gameObject).name) + "'s Devotion Inventory"; return true; } } } return ArgumentParser.TryParsePlayerOrPingedTarget(args, index, out target); } private static bool TryParseDroptable(ConCommandArgs args, int index, bool canDropBeReplaced) { //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: 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_00f0: 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_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_0065: 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_016a: 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) droptable.selector.Clear(); ((PickupDropTable)droptable).canDropBeReplaced = canDropBeReplaced; if (((ConCommandArgs)(ref args)).Count > index && ((ConCommandArgs)(ref args))[index].ToUpperInvariant() == "ALL") { foreach (ItemTier item in StringFinder.Instance.GetItemTiersFromPartial("")) { droptable.Add(availableDropLists[item], 1f); } } else { string text = "Tier1:100,Tier2:60,Tier3:4"; if (((ConCommandArgs)(ref args)).Count > index && ((ConCommandArgs)(ref args))[index].ToUpperInvariant() != "") { text = ((ConCommandArgs)(ref args))[index]; } string[] array = text.Split(','); for (int i = 0; i < array.Length; i++) { string[] array2 = array[i].Split(':'); ItemTier itemTierFromPartial = StringFinder.Instance.GetItemTierFromPartial(array2[0]); if (itemTierFromPartial == StringFinder.ItemTier_NotFound) { Log.MessageNetworked(string.Format("No {0} with the name \"{1}\" could be found. Please use {2} for options.", "item tier", array2[0], "list_itemtier"), args, Log.LogLevel.MessageClientOnly); return false; } float num = 1f; if (array2.Length > 1 && !TextSerialization.TryParseInvariant(array2[1], ref num)) { Log.MessageNetworked(string.Format("Unable to parse {0} to {1}.", "droptable weight", "float"), args, Log.LogLevel.MessageClientOnly); return false; } if (num < 0f) { Log.MessageNetworked(string.Format("Negative value for {0} encountered. It needs to be zero or higher.", "droptable weight"), args, Log.LogLevel.MessageClientOnly); return false; } droptable.Add(availableDropLists[itemTierFromPartial], num); } } return true; } internal static void InitDroptableData() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) droptable = ScriptableObject.CreateInstance(); ((Object)droptable).name = "dtDebugToolkit"; potentialPrefab = Addressables.LoadAssetAsync((object)"RoR2/DLC1/OptionPickup/OptionPickup.prefab").WaitForCompletion(); } internal unsafe static void CollectItemTiers(Run run) { //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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected I4, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_00b7: 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_013d: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0113: 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_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: 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_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0190: 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_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) availableDropLists.Clear(); Dictionary> dictionary = new Dictionary>(); foreach (ItemTier item in StringFinder.Instance.GetItemTiersFromPartial("")) { switch ((int)item) { case 0: availableDropLists[item] = Run.instance.availableTier1DropList; break; case 1: availableDropLists[item] = Run.instance.availableTier2DropList; break; case 2: availableDropLists[item] = Run.instance.availableTier3DropList; break; case 3: availableDropLists[item] = Run.instance.availableLunarItemDropList; break; case 4: availableDropLists[item] = Run.instance.availableBossDropList; break; case 6: availableDropLists[item] = Run.instance.availableVoidTier1DropList; break; case 7: availableDropLists[item] = Run.instance.availableVoidTier2DropList; break; case 8: availableDropLists[item] = Run.instance.availableVoidTier3DropList; break; case 9: availableDropLists[item] = Run.instance.availableVoidBossDropList; break; default: dictionary[item] = new List(); break; } } if (dictionary.Count <= 0) { return; } AllItemsEnumerator enumerator2 = ItemCatalog.allItems.GetEnumerator(); try { while (((AllItemsEnumerator)(ref enumerator2)).MoveNext()) { ItemIndex current2 = ((AllItemsEnumerator)(ref enumerator2)).Current; ItemDef itemDef = ItemCatalog.GetItemDef(current2); if (run.availableItems.Contains(current2) && itemDef.DoesNotContainTag((ItemTag)9) && dictionary.TryGetValue(itemDef.tier, out var value)) { value.Add(PickupCatalog.FindPickupIndex(current2)); } } } finally { ((IDisposable)(*(AllItemsEnumerator*)(&enumerator2))/*cast due to .constrained prefix*/).Dispose(); } foreach (KeyValuePair> item2 in dictionary) { availableDropLists[item2.Key] = item2.Value; } } private static DevotionInventoryController GetDevotionController(CharacterMaster master) { //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) DevotionInventoryController val = null; foreach (DevotionInventoryController instance in DevotionInventoryController.InstanceList) { if ((Object)(object)instance.SummonerMaster == (Object)(object)master) { val = instance; break; } } if ((Object)(object)val == (Object)null) { GameObject obj = Object.Instantiate(Addressables.LoadAssetAsync((object)"RoR2/CU8/LemurianEgg/DevotionMinionInventory.prefab").WaitForCompletion()); val = obj.GetComponent(); ((Component)val).GetComponent().teamIndex = (TeamIndex)1; val.SummonerMaster = master; NetworkServer.Spawn(obj); } return val; } } internal class Lists { [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 0 arguments: [query]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCListInteractables(ConCommandArgs args) { //IL_00c2: Unknown result type (might be due to invalid IL or missing references) StringBuilder stringBuilder = new StringBuilder(); string text = ((((ConCommandArgs)(ref args)).Count > 0) ? ((ConCommandArgs)(ref args))[0] : ""); HashSet hashSet = new HashSet(StringFinder.Instance.GetInteractableSpawnCardsFromPartial(text)); for (int i = 0; i < StringFinder.Instance.InteractableSpawnCards.Count; i++) { InteractableSpawnCard val = StringFinder.Instance.InteractableSpawnCards[i]; if (hashSet.Contains(val)) { string langInvar = StringFinder.GetLangInvar(StringFinder.GetInteractableName(((SpawnCard)val).prefab)); stringBuilder.AppendLine($"[{i}]{((Object)val).name}={langInvar}"); } } Log.MessageNetworked((stringBuilder.Length > 0) ? stringBuilder.ToString().TrimEnd('\n') : string.Format("No {0} found that match \"{1}\".", "interactables", text), args, Log.LogLevel.MessageClientOnly); } [AutoComplete("Requires 0 arguments: [query]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCListPlayer(ConCommandArgs args) { //IL_0091: 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) StringBuilder stringBuilder = new StringBuilder(); string text = ((((ConCommandArgs)(ref args)).Count > 0) ? ((ConCommandArgs)(ref args))[0] : ""); HashSet hashSet = new HashSet(StringFinder.Instance.GetPlayersFromPartial(text)); for (int i = 0; i < NetworkUser.readOnlyInstancesList.Count; i++) { NetworkUser val = NetworkUser.readOnlyInstancesList[i]; if (hashSet.Contains(val)) { stringBuilder.AppendLine($"[{i}]{val.userName}"); } } if (stringBuilder.Length > 0) { Log.MessageNetworked(stringBuilder.ToString().TrimEnd('\n'), args, Log.LogLevel.MessageClientOnly); } else { Log.MessageNetworked(NetworkClient.active ? string.Format("No {0} found that match \"{1}\".", "players", text) : "Not connected to a server.", args, Log.LogLevel.MessageClientOnly); } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCListArtifact(ConCommandArgs args) { //IL_0034: 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_003a: 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_005c: Expected I4, but got Unknown //IL_00ac: Unknown result type (might be due to invalid IL or missing references) StringBuilder stringBuilder = new StringBuilder(); string text = ((((ConCommandArgs)(ref args)).Count > 0) ? ((ConCommandArgs)(ref args))[0] : ""); foreach (ArtifactIndex item in StringFinder.Instance.GetArtifactsFromPartial(text)) { ArtifactDef artifactDef = ArtifactCatalog.GetArtifactDef(item); string langInvar = StringFinder.GetLangInvar(artifactDef.nameToken); stringBuilder.AppendLine($"[{(int)item}]{artifactDef.cachedName}={langInvar}"); } Log.MessageNetworked((stringBuilder.Length > 0) ? stringBuilder.ToString().TrimEnd('\n') : string.Format("No {0} found that match \"{1}\".", "artifacts", text), args, Log.LogLevel.MessageClientOnly); } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 0 arguments: [query]")] private static void CCListAI(ConCommandArgs args) { //IL_0034: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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) StringBuilder stringBuilder = new StringBuilder(); string text = ((((ConCommandArgs)(ref args)).Count > 0) ? ((ConCommandArgs)(ref args))[0] : ""); foreach (MasterIndex item in StringFinder.Instance.GetAisFromPartial(text)) { CharacterMaster component = MasterCatalog.GetMasterPrefab(item).GetComponent(); string langInvar = StringFinder.GetLangInvar(StringFinder.GetMasterName(component)); stringBuilder.AppendLine($"[{(int)item}]{((Object)component).name}={langInvar}"); } Log.MessageNetworked((stringBuilder.Length > 0) ? stringBuilder.ToString().TrimEnd('\n') : string.Format("No {0} found that match \"{1}\".", "masters", text), args, Log.LogLevel.MessageClientOnly); } [AutoComplete("Requires 0 arguments: [query]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCListBody(ConCommandArgs args) { //IL_0034: 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_003a: 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_005c: Expected I4, but got Unknown //IL_00ac: Unknown result type (might be due to invalid IL or missing references) StringBuilder stringBuilder = new StringBuilder(); string text = ((((ConCommandArgs)(ref args)).Count > 0) ? ((ConCommandArgs)(ref args))[0] : ""); foreach (BodyIndex item in StringFinder.Instance.GetBodiesFromPartial(text)) { CharacterBody bodyPrefabBodyComponent = BodyCatalog.GetBodyPrefabBodyComponent(item); string langInvar = StringFinder.GetLangInvar(bodyPrefabBodyComponent.baseNameToken); stringBuilder.AppendLine($"[{(int)item}]{((Object)bodyPrefabBodyComponent).name}={langInvar}"); } Log.MessageNetworked((stringBuilder.Length > 0) ? stringBuilder.ToString().TrimEnd('\n') : string.Format("No {0} found that match \"{1}\".", "bodies", text), args, Log.LogLevel.MessageClientOnly); } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 0 arguments: [query]")] private static void CCListSurvivor(ConCommandArgs args) { //IL_0037: 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_003d: 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_0098: 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_008f: 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_00d2: Expected I4, but got Unknown StringBuilder stringBuilder = new StringBuilder(); string text = ((((ConCommandArgs)(ref args)).Count > 0) ? ((ConCommandArgs)(ref args))[0] : ""); foreach (SurvivorIndex item in StringFinder.Instance.GetSurvivorsFromPartial(text)) { SurvivorDef survivorDef = SurvivorCatalog.GetSurvivorDef(item); string langInvar = StringFinder.GetLangInvar(survivorDef.displayNameToken); GameObject bodyPrefab = survivorDef.bodyPrefab; string text2 = ((bodyPrefab != null) ? ((Object)bodyPrefab).name : null) ?? StringFinder.NAME_NOTFOUND; GameObject bodyPrefab2 = survivorDef.bodyPrefab; CharacterBody val = ((bodyPrefab2 != null) ? bodyPrefab2.GetComponent() : null); GameObject masterPrefab = MasterCatalog.GetMasterPrefab(Object.op_Implicit((Object)(object)val) ? MasterCatalog.FindAiMasterIndexForBody(val.bodyIndex) : MasterIndex.none); string text3 = ((masterPrefab != null) ? ((Object)masterPrefab).name : null) ?? StringFinder.NAME_NOTFOUND; stringBuilder.AppendLine($"[{(int)item}]{survivorDef.cachedName}={langInvar} ({text2}, {text3})"); } Log.MessageNetworked((stringBuilder.Length > 0) ? stringBuilder.ToString().TrimEnd('\n') : string.Format("No {0} found that match \"{1}\".", "survivors", text), args, Log.LogLevel.MessageClientOnly); } [AutoComplete("Requires 0 arguments: [query]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCListDrone(ConCommandArgs args) { //IL_0034: 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_003a: 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_005c: Expected I4, but got Unknown //IL_00ac: Unknown result type (might be due to invalid IL or missing references) StringBuilder stringBuilder = new StringBuilder(); string text = ((((ConCommandArgs)(ref args)).Count > 0) ? ((ConCommandArgs)(ref args))[0] : ""); foreach (DroneIndex item in StringFinder.Instance.GetDronesFromPartial(text)) { DroneDef droneDef = DroneCatalog.GetDroneDef(item); string langInvar = StringFinder.GetLangInvar(droneDef.nameToken); stringBuilder.AppendLine($"[{(int)item}]{((Object)droneDef).name}={langInvar}"); } Log.MessageNetworked((stringBuilder.Length > 0) ? stringBuilder.ToString().TrimEnd('\n') : string.Format("No {0} found that match \"{1}\".", "drones", text), args, Log.LogLevel.MessageClientOnly); } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 0 arguments: [query]")] private static void CCListDifficulties(ConCommandArgs args) { //IL_0034: 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_003f: 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: Expected I4, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) StringBuilder stringBuilder = new StringBuilder(); string text = ((((ConCommandArgs)(ref args)).Count > 0) ? ((ConCommandArgs)(ref args))[0] : ""); foreach (DifficultyIndex item in StringFinder.Instance.GetDifficultiesFromPartial(text)) { string langInvar = StringFinder.GetLangInvar(StringFinder.difficultyDefs[item].nameToken); stringBuilder.AppendLine($"[{(int)item}]{langInvar}"); } Log.MessageNetworked((stringBuilder.Length > 0) ? stringBuilder.ToString().TrimEnd('\n') : string.Format("No {0} found that match \"{1}\".", "difficulties", text), args, Log.LogLevel.MessageClientOnly); } [AutoComplete("Requires 0 arguments: [query]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCListElites(ConCommandArgs args) { //IL_0034: 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_003a: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected I4, but got Unknown StringBuilder stringBuilder = new StringBuilder(); string text = ((((ConCommandArgs)(ref args)).Count > 0) ? ((ConCommandArgs)(ref args))[0] : ""); foreach (EliteIndex item in StringFinder.Instance.GetElitesFromPartial(text)) { EliteDef eliteDef = EliteCatalog.GetEliteDef(item); string arg = ((eliteDef != null) ? ((Object)eliteDef).name : null) ?? "None"; string arg2 = StringFinder.GetLangInvar(eliteDef?.modifierToken).Replace("{0}", ""); stringBuilder.AppendLine($"[{(int)item}]{arg}={arg2}"); } Log.MessageNetworked((stringBuilder.Length > 0) ? stringBuilder.ToString().TrimEnd('\n') : string.Format("No {0} found that match \"{1}\".", "elites", text), args, Log.LogLevel.MessageClientOnly); } [AutoComplete("Requires 0 arguments: [query]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCListTeams(ConCommandArgs args) { //IL_0034: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected I4, but got Unknown //IL_0046: 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) StringBuilder stringBuilder = new StringBuilder(); string text = ((((ConCommandArgs)(ref args)).Count > 0) ? ((ConCommandArgs)(ref args))[0] : ""); foreach (TeamIndex item in StringFinder.Instance.GetTeamsFromPartial(text)) { stringBuilder.AppendLine($"[{(int)item}]{item}"); } Log.MessageNetworked((stringBuilder.Length > 0) ? stringBuilder.ToString().TrimEnd('\n') : string.Format("No {0} found that match \"{1}\".", "teams", text), args, Log.LogLevel.MessageClientOnly); } [AutoComplete("Requires 0 arguments: [query]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCListDirectorCards(ConCommandArgs args) { //IL_00d1: Unknown result type (might be due to invalid IL or missing references) StringBuilder stringBuilder = new StringBuilder(); string text = ((((ConCommandArgs)(ref args)).Count > 0) ? ((ConCommandArgs)(ref args))[0] : ""); HashSet hashSet = new HashSet(StringFinder.Instance.GetDirectorCardsFromPartial(text)); for (int i = 0; i < StringFinder.Instance.DirectorCards.Count; i++) { DirectorCard val = StringFinder.Instance.DirectorCards[i]; if (hashSet.Contains(val)) { string langInvar = StringFinder.GetLangInvar(StringFinder.GetMasterName(val.spawnCard.prefab.GetComponent())); stringBuilder.AppendLine($"[{i}]{((Object)val.spawnCard).name}={langInvar}"); } } Log.MessageNetworked((stringBuilder.Length > 0) ? stringBuilder.ToString().TrimEnd('\n') : string.Format("No {0} found that match \"{1}\".", "director cards", text), args, Log.LogLevel.MessageClientOnly); } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 0 arguments: [query]")] private static void CCListScene(ConCommandArgs args) { //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_003b: 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_00cb: Unknown result type (might be due to invalid IL or missing references) StringBuilder stringBuilder = new StringBuilder(); string text = ((((ConCommandArgs)(ref args)).Count > 0) ? ((ConCommandArgs)(ref args))[0] : ""); foreach (SceneIndex item in StringFinder.Instance.GetScenesFromPartial(text, includeOffline: true)) { SceneDef sceneDef = SceneCatalog.GetSceneDef(item); string langInvar = StringFinder.GetLangInvar(sceneDef.nameToken); stringBuilder.AppendLine($"[{item}]{sceneDef.cachedName}={langInvar} (offline={sceneDef.isOfflineScene})"); } Log.MessageNetworked((stringBuilder.Length > 0) ? stringBuilder.ToString().TrimEnd('\n') : string.Format("No {0} found that match \"{1}\".", "scenes", text), args, Log.LogLevel.MessageClientOnly); } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 0 arguments: [selection (body|'all'|'body'|'self'):'all']")] private static void CCListSkin(ConCommandArgs args) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: 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_01a4: Invalid comparison between Unknown and I4 //IL_0112: 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_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: 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) StringBuilder stringBuilder = new StringBuilder(); if (((ConCommandArgs)(ref args)).Count == 0) { args.userArgs.Add("ALL"); } if (((ConCommandArgs)(ref args)).Count >= 1) { CharacterBody val; switch (((ConCommandArgs)(ref args))[0].ToUpperInvariant()) { case "BODY": foreach (CharacterBody allBodyPrefabBodyBodyComponent in BodyCatalog.allBodyPrefabBodyBodyComponents) { AppendSkinIndices(stringBuilder, allBodyPrefabBodyBodyComponent); } break; case "ALL": { HashSet hashSet = new HashSet(); SkinDef[] allSkinDefs = SkinCatalog.allSkinDefs; foreach (SkinDef val2 in allSkinDefs) { if (!hashSet.Contains(val2)) { hashSet.Add(val2); string langInvar = StringFinder.GetLangInvar(val2.nameToken); stringBuilder.AppendLine($"[{val2.skinIndex}] {((Object)val2).name}={langInvar}"); } } break; } case "SELF": if ((Object)(object)args.sender == (Object)null) { Log.Message("Can't choose self if not in-game!", Log.LogLevel.Error, Log.Target.Ror2); return; } val = (Object.op_Implicit((Object)(object)((ConCommandArgs)(ref args)).senderBody) ? ((ConCommandArgs)(ref args)).senderBody : ((!Object.op_Implicit((Object)(object)((ConCommandArgs)(ref args)).senderMaster) || !Object.op_Implicit((Object)(object)((ConCommandArgs)(ref args)).senderMaster.bodyPrefab)) ? BodyCatalog.GetBodyPrefabBodyComponent(args.sender.bodyIndexPreference) : ((ConCommandArgs)(ref args)).senderMaster.bodyPrefab.GetComponent())); goto IL_01bc; default: { BodyIndex bodyFromPartial = StringFinder.Instance.GetBodyFromPartial(((ConCommandArgs)(ref args))[0]); if ((int)bodyFromPartial == -1) { Log.MessageNetworked("Please use list_body to print CharacterBodies", args, Log.LogLevel.MessageClientOnly); return; } val = BodyCatalog.GetBodyPrefabBodyComponent(bodyFromPartial); goto IL_01bc; } IL_01bc: if (Object.op_Implicit((Object)(object)val)) { AppendSkinIndices(stringBuilder, val); break; } Log.MessageNetworked("Please use list_body to print CharacterBodies", args, Log.LogLevel.MessageClientOnly); return; } } Log.MessageNetworked(stringBuilder.ToString(), args, Log.LogLevel.MessageClientOnly); } private static void AppendSkinIndices(StringBuilder stringBuilder, CharacterBody body) { //IL_0001: 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_0077: Unknown result type (might be due to invalid IL or missing references) SkinDef[] bodySkinDefs = SkinCatalog.GetBodySkinDefs(body.bodyIndex); if (bodySkinDefs.Length != 0) { string langInvar = StringFinder.GetLangInvar(body.baseNameToken); stringBuilder.AppendLine($"[{body.bodyIndex}]{((Object)body).name}={langInvar}"); int num = 0; SkinDef[] array = bodySkinDefs; foreach (SkinDef val in array) { langInvar = StringFinder.GetLangInvar(val.nameToken); stringBuilder.AppendLine($"\t[{num}={val.skinIndex}] {((Object)val).name}={langInvar}"); num++; } } } } internal class LobbyManagement { [AutoComplete("Requires 1 argument: {player}")] [RequiredLevel(Level.SubAdmin)] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCKick(ConCommandArgs args) { //IL_0000: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown if (ArgumentParser.AssertRequiredArguments(args, "Requires 1 argument: {player}", 1)) { NetworkConnection clientFromArgs = GetClientFromArgs(args); if (clientFromArgs != null) { SimpleLocalizedKickReason val = new SimpleLocalizedKickReason("KICK_REASON_KICK", Array.Empty()); NetworkManagerSystem.singleton.ServerKickClient(clientFromArgs, (BaseKickReason)(object)val); } } } [AutoComplete("Requires 1 argument: {player}")] [ConCommand(/*Could not decode attribute arguments.*/)] [RequiredLevel(Level.SubAdmin)] private static void CCBan(ConCommandArgs args) { //IL_0000: 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) if (ArgumentParser.AssertRequiredArguments(args, "Requires 1 argument: {player}", 1)) { NetworkConnection clientFromArgs = GetClientFromArgs(args); if (clientFromArgs != null) { NetworkManagerSystem.singleton.ServerBanClient(clientFromArgs); } } } [AutoComplete("Requires 0 (1 if from server) arguments: [player:]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCTrueKill(ConCommandArgs args) { //IL_0000: 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_001c: 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) if (ArgumentParser.AssertInARun(args) && ArgumentParser.AssertRequiredArguments(args, "Requires 0 (1 if from server) arguments: [player:]", 0, 1) && ArgumentParser.TryParsePlayerOrDefault(args, 0, out var master, requireLiving: true)) { master.TrueKill(); Log.MessageNetworked(master.playerCharacterMasterController.GetDisplayName() + " was killed by server.", args); } } private static NetworkConnection GetClientFromArgs(ConCommandArgs args) { //IL_0000: 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_0079: 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_008d: 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_00dd: Unknown result type (might be due to invalid IL or missing references) NetworkUser netUserFromString = Util.GetNetUserFromString(args.userArgs); if ((Object)(object)netUserFromString == (Object)null) { Log.MessageNetworked("Specified player not found or isn't alive. Please use list_player for options.", args, Log.LogLevel.Error); return null; } if (!Application.isBatchMode) { foreach (NetworkUser readOnlyLocalPlayers in NetworkUser.readOnlyLocalPlayersList) { if ((Object)(object)readOnlyLocalPlayers == (Object)(object)netUserFromString) { Log.MessageNetworked("Specified user is hosting.", args, Log.LogLevel.Error); return null; } } } else if (PermissionSystem.IsEnabled.Value && !PermissionSystem.HasMorePerm(args.sender, netUserFromString, args)) { Log.MessageNetworked("The target has a higher permission level that you.", args, Log.LogLevel.Error); return null; } NetworkConnection val = null; foreach (NetworkConnection connection in NetworkServer.connections) { if (((NetworkBehaviour)netUserFromString).connectionToClient == connection) { val = connection; break; } } if (val == null) { Log.MessageNetworked("Error trying to find the associated connection with the user", args, Log.LogLevel.Error); return null; } return val; } } internal static class Macros { [ConCommand(/*Could not decode attribute arguments.*/)] private static void Midgame(ConCommandArgs args) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) NetworkUser sender = args.sender; Invoke(sender, "fixed_time", "1325"); Invoke(sender, "run_set_stages_cleared", "5"); Invoke(sender, "team_set_level", "1", "15"); foreach (NetworkUser readOnlyInstances in NetworkUser.readOnlyInstancesList) { Invoke(sender, "remove_all_items", readOnlyInstances.userName); Invoke(sender, "random_items", "23", "Tier1:100,Tier2:60,Tier3:4", readOnlyInstances.userName); Invoke(sender, "give_equip", "random", readOnlyInstances.userName); } Invoke(sender, "set_scene", "bazaar"); } [ConCommand(/*Could not decode attribute arguments.*/)] private static void LateGame(ConCommandArgs args) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) NetworkUser sender = args.sender; Invoke(sender, "fixed_time", "3420"); Invoke(sender, "run_set_stages_cleared", "8"); Invoke(sender, "team_set_level", "1", "24"); foreach (NetworkUser readOnlyInstances in NetworkUser.readOnlyInstancesList) { Invoke(sender, "remove_all_items", readOnlyInstances.userName); Invoke(sender, "random_items", "75", "Tier1:100,Tier2:60,Tier3:4", readOnlyInstances.userName); Invoke(sender, "give_equip", "random", readOnlyInstances.userName); } Invoke(sender, "set_scene", "bazaar"); } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCPeace(ConCommandArgs args) { //IL_0000: 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_0044: Unknown result type (might be due to invalid IL or missing references) Invoke(args.sender, "kill_all", "enemies", "1"); Invoke(args.sender, "no_enemies", "1"); Invoke(args.sender, "god", "1"); } [ConCommand(/*Could not decode attribute arguments.*/)] public static void CCScanner(ConCommandArgs args) { //IL_0000: 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) Invoke(args.sender, "give_item", "BoostEquipmentRecharge", "50"); Invoke(args.sender, "give_equip", "Scanner"); } [ConCommand(/*Could not decode attribute arguments.*/)] private static void Zoom(ConCommandArgs args) { //IL_0000: 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) Invoke(args.sender, "give_item", "hoof", "20"); Invoke(args.sender, "give_item", "feather", "200"); } private static void Invoke(NetworkUser user, string commandname, params string[] args) { DebugToolkit.InvokeCMD(user, commandname, args); } } internal class Miscellaneous { [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 1 argument: {sound_event (event_name|event_id)}")] private static void CCPostSoundEvent(ConCommandArgs args) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) uint num = default(uint); if ((bool)typeof(RoR2Application).GetField("isDedicatedServer").GetValue(RoR2Application.instance)) { Log.MessageWarning("This command doesn't make sense to run from a dedicated server."); } else if (ArgumentParser.AssertRequiredArguments(args, "Requires 1 argument: {sound_event (event_name|event_id)}", 1) && ((!TextSerialization.TryParseInvariant(((ConCommandArgs)(ref args))[0], ref num)) ? AkSoundEngine.PostEvent(((ConCommandArgs)(ref args))[0], ((Component)CameraRigController.readOnlyInstancesList[0]).gameObject) : AkSoundEngine.PostEvent(num, ((Component)CameraRigController.readOnlyInstancesList[0]).gameObject)) == 0) { Log.Message("Sound not found."); } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCReloadAllConfig(ConCommandArgs args) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) foreach (PluginInfo value in Chainloader.PluginInfos.Values) { try { ConfigFile config = value.Instance.Config; if (config != null) { config.Reload(); } } catch { Log.MessageNetworked($"The config file for {value} doesn't exist or has a custom name.", args, Log.LogLevel.Warning); } } } } internal class Money { [AutoComplete("Requires 0 arguments: [amount:1]")] [ConCommand(/*Could not decode attribute arguments.*/)] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCGiveLunar(ConCommandArgs args) { //IL_0000: 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_0028: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) if (!ArgumentParser.AssertInARun(args)) { return; } string text = (args.commandName.Contains("lunar") ? "lunar" : "void"); if ((Object)(object)args.sender == (Object)null) { Log.Message("Can't modify " + text + " coins of other users directly.", Log.LogLevel.MessageClientOnly, Log.Target.Ror2); } else { if (!ArgumentParser.TryParseOptionalInt(args, 0, "amount", 1, out var value)) { return; } string input = "Nothing happened. Big surprise."; NetworkUser sender = args.sender; if (value > 0) { if (text == "lunar") { sender.AwardLunarCoins((uint)value); } else { sender.master.voidCoins = HGMath.UintSafeAdd(sender.master.voidCoins, (uint)value); } input = string.Format("{0} {1} {2} coin(s).", "Gave", value, text); } if (value < 0) { value *= -1; if (text == "lunar") { sender.DeductLunarCoins((uint)value); } else { sender.master.voidCoins = HGMath.UintSafeSubtract(sender.master.voidCoins, (uint)value); } input = string.Format("{0} {1} {2} coin(s).", "Removed", value, text); } Log.MessageNetworked(input, args); } } [AutoComplete("Requires 1 argument: {amount} [target (player|'all')]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCGiveMoney(ConCommandArgs args) { //IL_0000: 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_001f: 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_009e: 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_00c7: Unknown result type (might be due to invalid IL or missing references) if (!ArgumentParser.AssertInARun(args) || !ArgumentParser.AssertRequiredArguments(args, "Requires 1 argument: {amount} [target (player|'all')]", 1) || !ArgumentParser.TryParseOptionalInt(args, 0, "amount", 0, out var value)) { return; } if (Chainloader.PluginInfos.ContainsKey("com.funkfrog_sipondo.sharesuite") && UseShareSuite()) { ShareSuiteGive(value); return; } if (((ConCommandArgs)(ref args)).Count > 1 && ((ConCommandArgs)(ref args))[1].ToUpperInvariant() != "ALL" && ((ConCommandArgs)(ref args))[1].ToUpperInvariant() != "") { NetworkUser netUserFromString = Util.GetNetUserFromString(args.userArgs, 1); if (!((Object)(object)netUserFromString != (Object)null)) { Log.MessageNetworked("Specified player not found or isn't alive. Please use list_player for options.", args, Log.LogLevel.MessageClientOnly); return; } GiveMasterMoney(netUserFromString.master, value); } else { GiveTeamMoney((TeamIndex)(((Object)(object)((ConCommandArgs)(ref args)).senderMaster == (Object)null) ? 1 : ((int)((ConCommandArgs)(ref args)).senderMaster.teamIndex)), value); } Log.MessageNetworked("$$$", args); } private static void GiveMasterMoney(CharacterMaster master, int amount) { if (amount > 0) { master.GiveMoney((uint)amount); } else { master.money = (uint)Math.Max(0L, master.money + amount); } } private static void GiveTeamMoney(TeamIndex teamIndex, int money) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) List list = new List(); foreach (TeamComponent teamMember in TeamComponent.GetTeamMembers(teamIndex)) { CharacterBody body = teamMember.body; if (Object.op_Implicit((Object)(object)body) && body.isPlayerControlled && Object.op_Implicit((Object)(object)body.master)) { list.Add(body.master); } } int count = list.Count; if (count == 0) { return; } money = Mathf.CeilToInt((float)money / (float)count); foreach (CharacterMaster item in list) { GiveMasterMoney(item, money); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static void ShareSuiteGive(int amount) { amount = Math.Max(-MoneySharingHooks.SharedMoneyValue, amount); MoneySharingHooks.AddMoneyExternal(amount); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static bool UseShareSuite() { if (ShareSuite.MoneyIsShared.Value) { return GeneralHooks.IsMultiplayer(); } return false; } } internal class PlayerCommands { [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 0 or 1 arguments: [enable (0|1)]")] private static void CCGodModeToggle(ConCommandArgs args) { //IL_0000: 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) if (!ArgumentParser.TryParseOptionalBool(args, 0, "enable", !Hooks.god, out var value)) { return; } Hooks.god = value; foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { instance.master.godMode = value; instance.master.UpdateBodyGodMode(); } Log.MessageNetworked(string.Format(value ? "{0} enabled." : "{0} disabled.", "God mode"), args); } [ConCommand(/*Could not decode attribute arguments.*/)] [ConCommand(/*Could not decode attribute arguments.*/)] [ConCommand(/*Could not decode attribute arguments.*/)] [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 0 or 1 arguments: [enable (0|1)]")] private static void CCBuddhaModeToggle(ConCommandArgs args) { //IL_0000: 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) if (ArgumentParser.TryParseOptionalBool(args, 0, "enable", !Hooks.buddha, out var value)) { Hooks.buddha = value; Log.MessageNetworked(string.Format(value ? "{0} enabled." : "{0} disabled.", "Buddha mode"), args); } } [AutoComplete("Requires 0 or 1 arguments: [enable (0|1)]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCNoclip(ConCommandArgs args) { //IL_0000: 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_0026: 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_0038: Unknown result type (might be due to invalid IL or missing references) if (ArgumentParser.AssertNotServer(args) && ArgumentParser.AssertInARun(args)) { bool value; if (((ConCommandArgs)(ref args)).Count == 0) { NoclipNet.Invoke(args.sender); } else if (ArgumentParser.TryParseOptionalBool(args, 0, "enable", defaultValue: false, out value)) { NoclipNet.Invoke(args.sender, value); } } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCCursorTeleport(ConCommandArgs args) { //IL_0000: 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_0010: 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) if (ArgumentParser.AssertNotServer(args) && ArgumentParser.AssertInARun(args) && ArgumentParser.AssertLivingBody(args)) { TeleportNet.Invoke(args.sender); } } [AutoComplete("Requires 1 (2 if from server) argument: {body} [player:]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCSpawnAs(ConCommandArgs args) { //IL_0000: 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_001c: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) if (!ArgumentParser.AssertInARun(args) || !ArgumentParser.AssertRequiredArguments(args, "Requires 1 (2 if from server) argument: {body} [player:]", 1, 2) || !ArgumentParser.TryParseBody(args, 0, out var bodyPrefab) || !ArgumentParser.TryParsePlayerOrDefault(args, 1, out var master)) { return; } ExpansionRequirementComponent component = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component) && !component.PlayerCanUseBody(master.playerCharacterMasterController)) { Log.MessageNetworked(string.Format("An expansion is required for this {0}: {1}", "body", Util.GetExpansion(component.requiredExpansion)), args, Log.LogLevel.MessageClientOnly); return; } master.originalBodyPrefab = bodyPrefab; master.bodyPrefab = bodyPrefab; Log.MessageNetworked(master.playerCharacterMasterController.GetDisplayName() + " is spawning as " + ((Object)bodyPrefab).name + ".", args); if (!Object.op_Implicit((Object)(object)master.GetBody())) { Log.MessageNetworked("Player will spawn as the specified body next round. Use 'respawn' to skip the wait.", args); } else { master.TransformBody(((Object)bodyPrefab).name); } } [AutoComplete("Requires 0 (1 if from server) arguments: [player:]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCRespawnPlayer(ConCommandArgs args) { //IL_0000: 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_001c: 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_0048: 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_0074: 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_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_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_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_00d0: 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_00ee: 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_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) if (!ArgumentParser.AssertInARun(args) || !ArgumentParser.AssertRequiredArguments(args, "Requires 0 (1 if from server) arguments: [player:]", 0, 1) || !ArgumentParser.TryParsePlayerOrDefault(args, 0, out var master)) { return; } CharacterBody val = master.GetBody() ?? master.bodyPrefab.GetComponent(); Vector3 val2 = (master.hasBody ? master.GetBody().footPosition : master.deathFootPosition); Quaternion val3 = Quaternion.Euler(0f, Random.Range(0f, 360f), 0f); if (Object.op_Implicit((Object)(object)DirectorCore.instance)) { val2 = Run.instance.FindSafeTeleportPositionSimplified(val.hullClassification, val2, float.NegativeInfinity, float.NegativeInfinity); } else { val2 = Vector3.zero; Transform playerSpawnTransform = Stage.instance.GetPlayerSpawnTransform(); if (Object.op_Implicit((Object)(object)playerSpawnTransform)) { val2 = playerSpawnTransform.position; val3 = playerSpawnTransform.rotation; } } master.Respawn(val2, val3, false); Log.MessageNetworked($"Attempting to spawn: {master.playerCharacterMasterController.GetDisplayName()}", args); } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 1 (2 if from server) argument: {amount} [target (player|'pinged'):]")] private static void CCHurt(ConCommandArgs args) { //IL_0000: 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_001c: 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_0071: 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_007d: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_00a9: 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) if (ArgumentParser.AssertInARun(args) && ArgumentParser.AssertRequiredArguments(args, "Requires 1 (2 if from server) argument: {amount} [target (player|'pinged'):]", 1, 2) && ArgumentParser.TryParseOptionalFloat(args, 0, "amount", 0f, out var value, 0f) && ArgumentParser.TryParsePlayerOrPingedBodyTarget(args, 1, out var target)) { if (value == 0f) { Log.MessageNetworked("Nothing happened.", args, Log.LogLevel.MessageClientOnly); return; } target.body.healthComponent.TakeDamage(new DamageInfo { damage = value, position = target.body.corePosition }); Log.MessageNetworked($"Damaged {target.name} for {value} hp.", args); } } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 1 (2 if from server) argument: {amount} [target (player|'pinged'):]")] private static void CCHeal(ConCommandArgs args) { //IL_0000: 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_001c: 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_0074: 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_0098: 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) if (ArgumentParser.AssertInARun(args) && ArgumentParser.AssertRequiredArguments(args, "Requires 1 (2 if from server) argument: {amount} [target (player|'pinged'):]", 1, 2) && ArgumentParser.TryParseOptionalFloat(args, 0, "amount", 0f, out var value, 0f) && ArgumentParser.TryParsePlayerOrPingedBodyTarget(args, 1, out var target)) { if (value == 0f) { Log.MessageNetworked("Nothing happened.", args, Log.LogLevel.MessageClientOnly); return; } target.body.healthComponent.Heal(value, default(ProcChainMask), true); Log.MessageNetworked($"Healed {target.name} for {value} hp.", args); } } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 1 (2 if from server) argument: {team} [player:]")] private static void CCChangeTeam(ConCommandArgs args) { //IL_0000: 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_001c: 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_0035: 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_006f: 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) if (ArgumentParser.AssertInARun(args) && ArgumentParser.AssertRequiredArguments(args, "Requires 1 (2 if from server) argument: {team} [player:]", 1, 2) && ArgumentParser.TryParseTeam(args, 0, out var teamIndex) && ArgumentParser.TryParsePlayerOrDefault(args, 1, out var master)) { master.teamIndex = teamIndex; if (master.hasBody) { master.GetBody().teamComponent.teamIndex = teamIndex; } Log.MessageNetworked($"Changed {master.playerCharacterMasterController.GetDisplayName()} to team {teamIndex}.", args); } } [AutoComplete("Requires 0 (1 if from server) argument: [target (player|'pinged'):]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCRemoveAllMinions(ConCommandArgs args) { //IL_0000: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) if (!ArgumentParser.AssertInARun(args) || !ArgumentParser.AssertRequiredArguments(args, "Requires 0 (1 if from server) argument: [target (player|'pinged'):]", 0, 1) || !ArgumentParser.TryParsePlayerOrPingedTarget(args, 0, out var target)) { return; } MinionGroupDestroyer component = ((Component)target.inventory).GetComponent(); if ((Object)(object)component == (Object)null || component.group == null || component.group.memberCount == 0) { Log.MessageNetworked(target.name + " has no minions to remove.", args); return; } int num = 0; MinionOwnership[] members = component.group.members; CharacterMaster val2 = default(CharacterMaster); foreach (MinionOwnership val in members) { if (Object.op_Implicit((Object)(object)val) && ((Component)val).TryGetComponent(ref val2)) { val2.DestroyBody(); Object.Destroy((Object)(object)((Component)val2).gameObject, 1f); num++; } } Log.MessageNetworked(string.Format("Removed {0} {1} from {2}.", num, "minions", target.name), args); } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCDumpBuild(ConCommandArgs args) { //IL_0000: 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_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_0041: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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_0183: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_0229: 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_029e: 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) if (!ArgumentParser.AssertNotServer(args) || !ArgumentParser.AssertInARun(args)) { return; } StringBuilder stringBuilder = new StringBuilder(); CharacterMaster senderMaster = ((ConCommandArgs)(ref args)).senderMaster; Inventory inventory = senderMaster.inventory; foreach (ItemIndex item in inventory.itemAcquisitionOrder) { string name = ((Object)ItemCatalog.GetItemDef(item)).name; int itemCountPermanent = inventory.GetItemCountPermanent(item); if (itemCountPermanent > 0) { if (itemCountPermanent > 1) { stringBuilder.Append($"give_item {name} {itemCountPermanent};"); } else { stringBuilder.Append("give_item " + name + ";"); } } int itemCountTemp = inventory.GetItemCountTemp(item); if (itemCountTemp > 0) { stringBuilder.Append($"give_item {name} {itemCountTemp} Temp;"); } } int equipmentSlotCount = inventory.GetEquipmentSlotCount(); for (uint num = 0u; num < equipmentSlotCount; num++) { int equipmentSetCount = inventory.GetEquipmentSetCount(num); for (uint num2 = 0u; num2 < equipmentSetCount; num2++) { EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(inventory.GetEquipment(num, num2).equipmentIndex); if ((Object)(object)equipmentDef != (Object)null) { stringBuilder.Append($"give_equip_extra {((Object)equipmentDef).name} {num} {num2};"); } } } MinionGroup val = MinionGroup.FindGroup(((NetworkBehaviour)senderMaster).netId); if (val != null && val.memberCount > 0) { MasterIndex val2 = MasterCatalog.FindMasterIndex("DevotedLemurianMaster"); Dictionary dictionary = new Dictionary(); CharacterMaster val3 = default(CharacterMaster); foreach (DroneDef allDroneDef in DroneCatalog.allDroneDefs) { GameObject masterPrefab = allDroneDef.masterPrefab; if (Object.op_Implicit((Object)(object)masterPrefab) && Object.op_Implicit((Object)(object)masterPrefab.GetComponent()) && masterPrefab.TryGetComponent(ref val3)) { dictionary[val3.masterIndex] = allDroneDef; } } MinionOwnership[] members = val.members; CharacterMaster val5 = default(CharacterMaster); foreach (MinionOwnership val4 in members) { if (!Object.op_Implicit((Object)(object)val4) || !((Component)val4).TryGetComponent(ref val5)) { continue; } DroneDef value; if (val5.masterIndex == val2) { DevotedLemurianController component = ((Component)val5).GetComponent(); ItemDef itemDef = ItemCatalog.GetItemDef(component.DevotionItem); int devotedEvolutionLevel = component.DevotedEvolutionLevel; if (devotedEvolutionLevel > 0) { stringBuilder.Append($"spawn_lemurian {((Object)itemDef).name} {devotedEvolutionLevel};"); } else { stringBuilder.Append("spawn_lemurian " + ((Object)itemDef).name + ";"); } } else if (dictionary.TryGetValue(val5.masterIndex, out value)) { int itemCountPermanent2 = val5.inventory.GetItemCountPermanent(Items.DroneUpgradeHidden); if (itemCountPermanent2 > 0) { stringBuilder.Append($"spawn_drone {((Object)value).name} 1 {itemCountPermanent2};"); } else { stringBuilder.Append("spawn_drone " + ((Object)value).name + ";"); } } } } Log.Message(stringBuilder.ToString()); } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 1 argument: {body}")] private static void CCDumpStats(ConCommandArgs args) { //IL_0000: 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_01be: 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) if (ArgumentParser.AssertRequiredArguments(args, "Requires 1 argument: {body}", 1) && ArgumentParser.TryParseBody(args, 0, out var bodyPrefab)) { CharacterBody component = bodyPrefab.GetComponent(); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine("Body: " + ((Object)component).name); stringBuilder.AppendLine($"Health: {component.baseMaxHealth} ({FormatLevelStat(component.levelMaxHealth)}/level)"); stringBuilder.AppendLine($"Regen: {component.baseRegen} ({FormatLevelStat(component.levelRegen)}/level)"); stringBuilder.AppendLine($"Damage: {component.baseDamage} ({FormatLevelStat(component.levelDamage)}/level)"); stringBuilder.AppendLine($"Armor: {component.baseArmor}"); stringBuilder.AppendLine($"Speed: {component.baseMoveSpeed}"); stringBuilder.AppendLine($"Acceleration: {component.baseAcceleration}"); stringBuilder.AppendLine($"Sprinting Modifier: {component.sprintingSpeedMultiplier}"); stringBuilder.AppendLine($"Crit: {component.baseCrit}"); stringBuilder.AppendLine($"Attack speed: {component.baseAttackSpeed}"); stringBuilder.AppendLine($"Jump Count: {component.baseJumpCount}"); stringBuilder.AppendLine($"Jump Power: {component.baseJumpPower}"); stringBuilder.AppendLine($"Vision Distance: {component.baseVisionDistance}"); stringBuilder.Append($"Body Flags: {component.bodyFlags}"); Log.MessageNetworked(stringBuilder.ToString(), args, Log.LogLevel.MessageClientOnly); } } private static string FormatLevelStat(float value) { return value.ToString("+0.##;-0.##;+0"); } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 0 (1 if from server) argument: [target (player|'pinged'):]")] private static void CCDumpState(ConCommandArgs args) { //IL_0000: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_0423: Unknown result type (might be due to invalid IL or missing references) if (!ArgumentParser.AssertInARun(args) || !ArgumentParser.AssertRequiredArguments(args, "Requires 0 (1 if from server) argument: [target (player|'pinged'):]", 0, 1) || !ArgumentParser.TryParsePlayerOrPingedBodyTarget(args, 0, out var target)) { return; } CharacterBody body = target.body; HealthComponent component = ((Component)body).GetComponent(); StringBuilder stringBuilder = new StringBuilder(); string text = "(Clone)"; stringBuilder.AppendLine("Body: " + (((Object)body).name.EndsWith(text) ? ((Object)body).name.Substring(0, ((Object)body).name.Length - text.Length) : ((Object)body).name)); stringBuilder.AppendLine($"Level: {body.level}"); stringBuilder.AppendLine($"Health: {component.health}/{body.maxHealth} ({body.regen} regen/sec)"); stringBuilder.AppendLine($"Shield: {component.shield}/{body.maxShield}"); stringBuilder.AppendLine($"Barrier: {component.barrier}/{body.maxBarrier} ({0f - component.GetBarrierDecayRate()} decay/sec)"); stringBuilder.AppendLine($"Acceleration: {body.acceleration}"); stringBuilder.AppendLine(string.Format(arg1: (body.moveSpeed == 0f) ? "stationary" : ((body.notMovingStopwatch > 1f) ? "standing" : ((!body.isSprinting) ? "walking" : "sprintning")), format: "Speed: {0} ({1})", arg0: body.moveSpeed)); stringBuilder.AppendLine($"Attack speed: {body.attackSpeed}"); stringBuilder.AppendLine($"Damage: {body.damage}"); stringBuilder.AppendLine($"Armor: {body.armor} (+{component.adaptiveArmorValue} adaptive)"); CharacterMotor characterMotor = body.characterMotor; stringBuilder.AppendLine($"Jump: {(((Object)(object)characterMotor != (Object)null) ? (body.maxJumpCount - characterMotor.jumpCount) : 0)}/{body.maxJumpCount} ({body.jumpPower} jump power)"); SkillLocator skillLocator = body.skillLocator; if ((Object)(object)skillLocator != (Object)null) { foreach (KeyValuePair item in new List> { new KeyValuePair("Primary", skillLocator.primary), new KeyValuePair("Secondary", skillLocator.secondary), new KeyValuePair("Utility", skillLocator.utility), new KeyValuePair("Special", skillLocator.special) }) { if ((Object)(object)item.Value != (Object)null) { GenericSkill value = item.Value; stringBuilder.AppendLine($"{item.Key}: [{value.baseSkill.skillName} {value.skillName} {value.skillNameToken}] {value.stock}/{value.maxStock} ({value.cooldownRemaining}/{value.finalRechargeInterval} cooldown)"); } else { stringBuilder.AppendLine(item.Key + ": -"); } } } Inventory inventory = body.inventory; if ((Object)(object)inventory != (Object)null) { for (uint num = 0u; num < inventory.GetEquipmentSlotCount(); num++) { for (uint num2 = 0u; num2 < inventory.GetEquipmentSetCount(num); num2++) { EquipmentState equipment = inventory.GetEquipment(num, num2); EquipmentDef equipmentDef = equipment.equipmentDef; if ((Object)(object)equipmentDef != (Object)null) { stringBuilder.AppendLine($"Equipment {num + 1}: {((Object)equipmentDef).name} {equipment.charges}/{inventory.GetEquipmentSlotMaxCharges()} ({((FixedTimeStamp)(ref equipment.chargeFinishTime)).timeUntil}/{equipmentDef.cooldown * inventory.CalculateEquipmentCooldownScale()} cooldown)"); } else { stringBuilder.AppendLine($"Equipment {num + 1}: - 0/0 ({((FixedTimeStamp)(ref equipment.chargeFinishTime)).timeUntil}/0 cooldown)"); } } } } GatherObjectState(stringBuilder, (Component)(object)body); CharacterMaster master = body.master; if ((Object)(object)master != (Object)null) { GatherObjectState(stringBuilder, (Component)(object)master); BaseAI[] components = ((Component)master).GetComponents(); foreach (BaseAI val in components) { stringBuilder.AppendLine("AI skill driver: " + (val.skillDriverEvaluation.dominantSkillDriver?.customName ?? string.Empty)); } } Log.MessageNetworked(stringBuilder.ToString().TrimEnd('\n'), args, Log.LogLevel.MessageClientOnly); } private static void GatherObjectState(StringBuilder sb, Component component) { EntityStateMachine[] components = component.GetComponents(); foreach (EntityStateMachine val in components) { sb.AppendLine(val.customName + " state: " + (((object)val.state)?.ToString() ?? string.Empty)); } } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 2 argument: {body_name (body|'self')} {skin_index}")] public static void CCLoadoutSetSkinVariant(ConCommandArgs args) { //IL_0019: 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_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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Invalid comparison between Unknown and I4 //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Expected O, but got Unknown //IL_0130: 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_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_00ac: 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_00b7: 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_01dd: Unknown result type (might be due to invalid IL or missing references) if (((ConCommandArgs)(ref args)).Count < 2) { Log.MessageNetworked("Insufficient number of arguments. Requires 2 argument: {body_name (body|'self')} {skin_index}", args, Log.LogLevel.MessageClientOnly); return; } BodyIndex val = (BodyIndex)(-1); bool flag = false; if (((ConCommandArgs)(ref args))[0].ToUpperInvariant() == "SELF") { flag = true; if ((Object)(object)args.sender == (Object)null) { Log.Message("Can't choose self if not in-game!", Log.LogLevel.Error, Log.Target.Ror2); return; } val = (Object.op_Implicit((Object)(object)((ConCommandArgs)(ref args)).senderBody) ? ((ConCommandArgs)(ref args)).senderBody.bodyIndex : ((!Object.op_Implicit((Object)(object)((ConCommandArgs)(ref args)).senderMaster) || !Object.op_Implicit((Object)(object)((ConCommandArgs)(ref args)).senderMaster.bodyPrefab)) ? args.sender.bodyIndexPreference : ((ConCommandArgs)(ref args)).senderMaster.bodyPrefab.GetComponent().bodyIndex)); } else { val = StringFinder.Instance.GetBodyFromPartial(((ConCommandArgs)(ref args))[0]); if ((int)val == -1) { Log.MessageNetworked("Specified body not found. Please use list_body for options.", args, Log.LogLevel.MessageClientOnly); return; } } int num = default(int); if (!TextSerialization.TryParseInvariant(((ConCommandArgs)(ref args))[1], ref num)) { Log.MessageNetworked(string.Format("Unable to parse {0} to {1}.", "skin_index", "int"), args, Log.LogLevel.MessageClientOnly); } Loadout val2 = new Loadout(); UserProfile userProfile = ((ConCommandArgs)(ref args)).GetSenderLocalUser().userProfile; userProfile.loadout.Copy(val2); val2.bodyLoadoutManager.SetSkinIndex(val, (uint)num); userProfile.SetLoadout(val2); if (Object.op_Implicit((Object)(object)((ConCommandArgs)(ref args)).senderMaster)) { ((ConCommandArgs)(ref args)).senderMaster.SetLoadoutServer(val2); } if (Object.op_Implicit((Object)(object)((ConCommandArgs)(ref args)).senderBody)) { ((ConCommandArgs)(ref args)).senderBody.SetLoadoutServer(val2); if (Object.op_Implicit((Object)(object)((ConCommandArgs)(ref args)).senderBody.modelLocator) && Object.op_Implicit((Object)(object)((ConCommandArgs)(ref args)).senderBody.modelLocator.modelTransform)) { ModelSkinController component = ((Component)((ConCommandArgs)(ref args)).senderBody.modelLocator.modelTransform).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.ApplySkin(num); } } } if (flag && !Object.op_Implicit((Object)(object)((ConCommandArgs)(ref args)).senderBody)) { Log.MessageNetworked("Player will spawn with the specified skin next round. Use 'respawn' to skip the wait.", args, Log.LogLevel.MessageClientOnly); } } internal static bool UpdateCurrentPlayerBody(out NetworkUser networkUser, out CharacterBody characterBody) { LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser(); networkUser = ((firstLocalUser != null) ? firstLocalUser.currentNetworkUser : null); characterBody = null; if (Object.op_Implicit((Object)(object)networkUser)) { CharacterMaster master = networkUser.master; if (Object.op_Implicit((Object)(object)master) && Object.op_Implicit((Object)(object)master.GetBody())) { characterBody = master.GetBody(); return true; } } return false; } } internal class Profile { private static bool canSaveProfile = true; [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 0 or 1 arguments: [enable (0|1)]")] private static void CCPreventProfileWriting(ConCommandArgs args) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (((ConCommandArgs)(ref args)).Count > 0) { if (!ArgumentParser.TryParseOptionalBool(args, 0, "enable", defaultValue: false, out var value)) { return; } canSaveProfile = !value; } Log.MessageNetworked(string.Format((!canSaveProfile) ? "{0} enabled." : "{0} disabled.", "Prevent writing"), args); } internal static bool PreventSave(orig_Save orig, SaveSystem self, UserProfile data, bool blocking) { if (canSaveProfile) { return orig.Invoke(self, data, blocking); } return false; } } internal class Spawners { private static readonly Dictionary portals = new Dictionary(); [ConCommand(/*Could not decode attribute arguments.*/)] [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 1 argument: {interactable}")] private static void CCSpawnInteractable(ConCommandArgs args) { //IL_0000: 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_0010: 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_002f: 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_013f: 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_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0197: 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_01aa: Expected O, but got Unknown //IL_01a5: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015b: 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) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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) if (!ArgumentParser.AssertNotServer(args) || !ArgumentParser.AssertInARun(args) || !ArgumentParser.AssertLivingBody(args) || !ArgumentParser.AssertRequiredArguments(args, "Requires 1 argument: {interactable}", 1) || !ArgumentParser.TryParseInteractableCard(args, 0, out var isc)) { return; } Collider[] componentsInChildren = ((SpawnCard)isc).prefab.GetComponentsInChildren(); float num = 0f; Collider[] array = componentsInChildren; foreach (Collider val in array) { if (!val.isTrigger && val.enabled) { BoxCollider val2 = (BoxCollider)(object)((val is BoxCollider) ? val : null); CapsuleCollider val3 = (CapsuleCollider)(object)((val is CapsuleCollider) ? val : null); SphereCollider val4 = (SphereCollider)(object)((val is SphereCollider) ? val : null); Vector3 lossyScale = ((Component)val).transform.lossyScale; if (Object.op_Implicit((Object)(object)val2)) { float num2 = val2.size.x * lossyScale.x; float num3 = val2.size.y * lossyScale.y; num = Mathf.Max(num, Mathf.Sqrt(num2 * num2 + num3 * num3) * 0.5f); } else if (Object.op_Implicit((Object)(object)val3)) { num = Mathf.Max(num, val3.radius); } else if (Object.op_Implicit((Object)(object)val4)) { num = Mathf.Max(num, val4.radius); } } } Vector3 val5 = ((ConCommandArgs)(ref args)).senderBody.footPosition; if (num > 0f) { Vector3 aimDirection = ((ConCommandArgs)(ref args)).senderBody.inputBank.aimDirection; val5 += (((ConCommandArgs)(ref args)).senderBody.radius + num) * new Vector3(aimDirection.x, 0f, aimDirection.z); } if (!((SpawnCard)isc).DoSpawn(val5, default(Quaternion), new DirectorSpawnRequest((SpawnCard)(object)isc, (DirectorPlacementRule)null, RoR2Application.rng)).success) { Log.MessageNetworked("Failed to spawn interactable.", args, Log.LogLevel.MessageClientOnly); } } [AutoComplete("Requires 1 argument: {portal ('artifact'|'blue'|'celestial'|'deepvoid'|'gold'|'green'|'null'|'void')}")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCSpawnPortal(ConCommandArgs args) { //IL_0000: 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_0010: 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_005d: 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_00f9: 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_010b: Unknown result type (might be due to invalid IL or missing references) if (!ArgumentParser.AssertNotServer(args) || !ArgumentParser.AssertInARun(args) || !ArgumentParser.AssertLivingBody(args) || !ArgumentParser.AssertRequiredArguments(args, "Requires 1 argument: {portal ('artifact'|'blue'|'celestial'|'deepvoid'|'gold'|'green'|'null'|'void')}", 1)) { return; } string text = ((ConCommandArgs)(ref args))[0].ToLowerInvariant(); if (!portals.TryGetValue(text, out var value)) { Log.MessageNetworked(string.Format("Invalid value for {0}.", "portal"), args, Log.LogLevel.MessageClientOnly); return; } SceneDef sceneDef = Stage.instance.sceneDef; if (sceneDef.cachedName == "voidraid" && text == "deepvoid") { value = ((SpawnCard)StringFinder.Instance.GetInteractableSpawnCardFromPartial("VoidOutroPortal")).prefab; } Vector3 footPosition = ((ConCommandArgs)(ref args)).senderBody.footPosition; if (((Object)value).name == "DeepVoidPortal") { footPosition.y += 4f; } else if (((Object)value).name == "PortalArtifactworld") { footPosition.y += 10f; } GameObject val = Object.Instantiate(value, footPosition, Quaternion.LookRotation(((ConCommandArgs)(ref args)).senderBody.characterDirection.forward)); SceneExitController component = val.GetComponent(); if (text == "artifact") { component.destinationScene = SceneCatalog.FindSceneDef("artifactworld"); } if (sceneDef.cachedName == "voidraid" && ((Object)val).name.Contains("VoidOutroPortal")) { component.useRunNextStageScene = false; } else { component.useRunNextStageScene = (Object)(object)component.destinationScene == (Object)(object)sceneDef; } NetworkServer.Spawn(val); } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 1 argument: {ai} [count:1] [elite:None] [braindead (0|1):0/false] [team (team|'ally'):Monster]")] private static void CCSpawnAI(ConCommandArgs args) { //IL_0000: 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_0010: 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_0030: 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_005c: 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_00b9: 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_00b5: 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_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0130: 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_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Expected O, but got Unknown //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Expected O, but got Unknown //IL_011d: 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_016f: 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_018b: Invalid comparison between Unknown and I4 //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_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_01e8: 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_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020a: 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_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) if (!ArgumentParser.AssertNotServer(args) || !ArgumentParser.AssertInARun(args) || !ArgumentParser.AssertLivingBody(args) || !ArgumentParser.AssertRequiredArguments(args, "Requires 1 argument: {ai} [count:1] [elite:None] [braindead (0|1):0/false] [team (team|'ally'):Monster]", 1) || !ArgumentParser.TryParseMaster(args, 0, out var masterObject) || !ArgumentParser.TryParseOptionalInt(args, 1, "count", 1, out var value, 1) || !ArgumentParser.TryParseEliteOrDefault(args, 2, null, out var eliteDef) || !ArgumentParser.TryParseOptionalBool(args, 3, "braindead", defaultValue: false, out var value2)) { return; } bool flag = false; int num = 4; TeamIndex teamIndex; if (((ConCommandArgs)(ref args)).Count > num && string.Equals(((ConCommandArgs)(ref args))[num], "ALLY", StringComparison.InvariantCultureIgnoreCase)) { flag = true; teamIndex = ((ConCommandArgs)(ref args)).senderBody.teamComponent.teamIndex; } else if (!ArgumentParser.TryParseTeamOrDefault(args, num, (TeamIndex)2, out teamIndex)) { return; } SpawnCard val = StringFinder.Instance.GetDirectorCardFromPartial(((Object)masterObject).name)?.spawnCard; if ((Object)(object)val == (Object)null) { val = (SpawnCard)(object)ScriptableObject.CreateInstance(); val.prefab = masterObject; val.sendOverNetwork = true; GameObject bodyPrefab = val.prefab.GetComponent().bodyPrefab; val.nodeGraphType = GetBodyPrefabGraphType(bodyPrefab); } DirectorSpawnRequest val2 = new DirectorSpawnRequest(val, new DirectorPlacementRule { placementMode = (PlacementMode)0, position = ((ConCommandArgs)(ref args)).senderBody.footPosition }, RoR2Application.rng); val2.summonerBodyObject = (flag ? ((Component)((ConCommandArgs)(ref args)).senderBody).gameObject : null); val2.teamIndexOverride = teamIndex; val2.ignoreTeamMemberLimit = true; bool flag2 = (int)val.nodeGraphType == 1; GetSpawnPosition(masterObject, ((ConCommandArgs)(ref args)).senderBody, flag2, value, out var position, out var radius); Log.MessageNetworked($"Attempting to spawn {value}: {((Object)masterObject).name}", args); for (int i = 0; i < value; i++) { Vector3 val3 = position; if (flag2) { Vector3 val4 = Quaternion.AngleAxis(360f * ((float)i / (float)value), ((ConCommandArgs)(ref args)).senderBody.transform.up) * ((ConCommandArgs)(ref args)).senderBody.transform.forward; val3 = position + val4 * radius; } GameObject spawnedInstance = val.DoSpawn(val3, Quaternion.identity, val2).spawnedInstance; if (!Object.op_Implicit((Object)(object)spawnedInstance)) { continue; } CharacterMaster component = spawnedInstance.GetComponent(); if (Object.op_Implicit((Object)(object)eliteDef)) { component.inventory.SetEquipmentIndex(eliteDef.eliteEquipmentDef.equipmentIndex, false); component.inventory.GiveItemPermanent(Items.BoostHp, Mathf.RoundToInt((eliteDef.healthBoostCoefficient - 1f) * 10f)); component.inventory.GiveItemPermanent(Items.BoostDamage, Mathf.RoundToInt(eliteDef.damageBoostCoefficient - 1f) * 10); } if (value2) { BaseAI[] aiComponents = component.aiComponents; for (int j = 0; j < aiComponents.Length; j++) { Object.Destroy((Object)(object)aiComponents[j]); } component.aiComponents = Array.Empty(); } } } [AutoComplete("Requires 1 argument: {body}")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCSpawnBody(ConCommandArgs args) { //IL_0000: 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_0010: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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) if (ArgumentParser.AssertNotServer(args) && ArgumentParser.AssertInARun(args) && ArgumentParser.AssertLivingBody(args) && ArgumentParser.AssertRequiredArguments(args, "Requires 1 argument: {body}", 1) && ArgumentParser.TryParseBody(args, 0, out var bodyPrefab)) { NetworkServer.Spawn(Object.Instantiate(bodyPrefab, ((ConCommandArgs)(ref args)).senderBody.transform.position, Quaternion.identity)); Log.MessageNetworked($"Attempting to spawn: {((Object)bodyPrefab).name}", args); } } [AutoComplete("Requires 1 argument: {drone} [count:1] [tier:0]")] [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCSpawnDrone(ConCommandArgs args) { //IL_0000: 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_0010: 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_0030: 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_005c: 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_0094: Invalid comparison between Unknown and I4 //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00df: 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_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_014c: 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_0168: 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_017b: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: 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_011e: 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_0122: 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_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) if (!ArgumentParser.AssertNotServer(args) || !ArgumentParser.AssertInARun(args) || !ArgumentParser.AssertLivingBody(args) || !ArgumentParser.AssertRequiredArguments(args, "Requires 1 argument: {drone} [count:1] [tier:0]", 1) || !ArgumentParser.TryParseDrone(args, 0, out var droneDef) || !ArgumentParser.TryParseOptionalInt(args, 1, "count", 1, out var value, 0) || !ArgumentParser.TryParseOptionalInt(args, 2, "tier", 0, out var value2, 0)) { return; } bool flag = (int)GetBodyPrefabGraphType(droneDef.masterPrefab.GetComponent().bodyPrefab) == 1; GetSpawnPosition(droneDef.masterPrefab, ((ConCommandArgs)(ref args)).senderBody, flag, value, out var position, out var radius); Log.MessageNetworked($"Spawned {value} tier {value2} {((Object)droneDef.masterPrefab).name}.", args); CharacterMaster val3 = default(CharacterMaster); for (int i = 0; i < value; i++) { Vector3 position2 = position; if (flag) { Vector3 val = Quaternion.AngleAxis(360f * ((float)i / (float)value), ((ConCommandArgs)(ref args)).senderBody.transform.up) * ((ConCommandArgs)(ref args)).senderBody.transform.forward; position2 = position + val * radius; } CharacterMaster val2 = new MasterSummon { masterPrefab = droneDef.masterPrefab, position = position2, rotation = Quaternion.identity, summonerBodyObject = ((Component)((ConCommandArgs)(ref args)).senderBody).gameObject, ignoreTeamMemberLimit = true, useAmbientLevel = true, enablePrintController = true }.Perform(); if (Object.op_Implicit((Object)(object)val2) && ((Component)val2).TryGetComponent(ref val3)) { val3.inventory.GiveItemPermanent(Items.DroneUpgradeHidden, value2); } } } [ConCommand(/*Could not decode attribute arguments.*/)] [AutoComplete("Requires 1 argument: {item} [level:0]")] private static void CCSpawnLemurian(ConCommandArgs args) { //IL_0000: 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_0010: 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_0030: 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_0062: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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_0152: 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_01bd: Unknown result type (might be due to invalid IL or missing references) if (!ArgumentParser.AssertNotServer(args) || !ArgumentParser.AssertInARun(args) || !ArgumentParser.AssertLivingBody(args) || !ArgumentParser.AssertRequiredArguments(args, "Requires 1 argument: {item} [level:0]", 1) || !ArgumentParser.TryParseItem(args, 0, out var itemDef) || !ArgumentParser.TryParseOptionalInt(args, 1, "level", 0, out var value, 0)) { return; } GameObject masterPrefab = MasterCatalog.GetMasterPrefab(MasterCatalog.FindMasterIndex("DevotedLemurianMaster")); if (value > 1) { masterPrefab.GetComponent().bodyPrefab = ((Component)BodyPrefabs.DevotedLemurianBruiserBody).gameObject; } GetSpawnPosition(masterPrefab, ((ConCommandArgs)(ref args)).senderBody, isFlyer: false, 1, out var position, out var _); Log.MessageNetworked($"Spawned a level {value} Devoted Lemurian with {((Object)itemDef).name}.", args); CharacterMaster val = new MasterSummon { masterPrefab = masterPrefab, position = position, rotation = Quaternion.identity, summonerBodyObject = ((Component)((ConCommandArgs)(ref args)).senderBody).gameObject, ignoreTeamMemberLimit = true, useAmbientLevel = true }.Perform(); if (value > 1) { masterPrefab.GetComponent().bodyPrefab = ((Component)BodyPrefabs.DevotedLemurianBody).gameObject; } if (Object.op_Implicit((Object)(object)val)) { bool isDevotionEnable = DevotionInventoryController.isDevotionEnable; if (!isDevotionEnable) { DevotionInventoryController.OnDevotionArtifactEnabled(RunArtifactManager.instance, Artifacts.Devotion); } DevotionInventoryController orCreateDevotionInventoryController = DevotionInventoryController.GetOrCreateDevotionInventoryController(((Component)((ConCommandArgs)(ref args)).senderBody).GetComponent()); orCreateDevotionInventoryController.GiveItem(itemDef.itemIndex, 1 + value); DevotedLemurianController component = ((Component)val).GetComponent(); component.InitializeDevotedLemurian(itemDef.itemIndex, orCreateDevotionInventoryController); component.DevotedEvolutionLevel = value; List list = null; if (value == 1) { list = DevotionInventoryController.lowLevelEliteBuffs; } else if (value >= 3) { list = DevotionInventoryController.highLevelEliteBuffs; } if (list != null && list.Count > 0) { int index = Random.Range(0, list.Count); ((Component)val).GetComponent().SetEquipmentIndex(list[index], false); } orCreateDevotionInventoryController.UpdateAllMinions(false); if (!isDevotionEnable) { DevotionInventoryController.OnDevotionArtifactDisabled(RunArtifactManager.instance, Artifacts.Devotion); } } } internal static void InitPortals() { //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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0093: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: 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_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) portals.Add("artifact", Addressables.LoadAssetAsync((object)"RoR2/Base/PortalArtifactworld/PortalArtifactworld.prefab").WaitForCompletion()); portals.Add("blue", Addressables.LoadAssetAsync((object)"RoR2/Base/PortalShop/PortalShop.prefab").WaitForCompletion()); portals.Add("celestial", Addressables.LoadAssetAsync((object)"RoR2/Base/PortalMS/PortalMS.prefab").WaitForCompletion()); portals.Add("deepvoid", Addressables.LoadAssetAsync((object)"RoR2/DLC1/DeepVoidPortal/DeepVoidPortal.prefab").WaitForCompletion()); portals.Add("gold", Addressables.LoadAssetAsync((object)"RoR2/Base/PortalGoldshores/PortalGoldshores.prefab").WaitForCompletion()); portals.Add("green", Addressables.LoadAssetAsync((object)"RoR2/DLC2/PortalColossus.prefab").WaitForCompletion()); portals.Add("null", Addressables.LoadAssetAsync((object)"RoR2/Base/PortalArena/PortalArena.prefab").WaitForCompletion()); portals.Add("void", Addressables.LoadAssetAsync((object)"RoR2/DLC1/PortalVoid/PortalVoid.prefab").WaitForCompletion()); } internal static EliteTierDef GetTierDef(EliteDef eliteDef) { if (!Object.op_Implicit((Object)(object)eliteDef)) { return CombatDirector.eliteTiers[0]; } EliteTierDef[] eliteTiers = CombatDirector.eliteTiers; foreach (EliteTierDef val in eliteTiers) { if (val == null) { continue; } EliteDef[] eliteTypes = val.eliteTypes; foreach (EliteDef val2 in eliteTypes) { if (Object.op_Implicit((Object)(object)val2) && (Object)(object)val2 == (Object)(object)eliteDef) { return val; } } } return CombatDirector.eliteTiers[0]; } private static void GetSpawnPosition(GameObject masterPrefab, CharacterBody spawnerBody, bool isFlyer, int amount, out Vector3 position, out float radius) { //IL_006b: 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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_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) radius = 1f; GameObject bodyPrefab = masterPrefab.GetComponent().bodyPrefab; if (Object.op_Implicit((Object)(object)bodyPrefab)) { CapsuleCollider component = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { radius = component.radius; } else { SphereCollider component2 = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { radius = component2.radius; } } } if (((Object)bodyPrefab).name.Equals("GrandParentBody")) { radius = 0f; } position = spawnerBody.footPosition + spawnerBody.transform.forward * (spawnerBody.radius + radius); if (isFlyer) { position = spawnerBody.transform.position; if (Object.op_Implicit((Object)(object)spawnerBody.characterMotor)) { position.y += 0.5f * spawnerBody.characterMotor.capsuleHeight + 2f; } radius *= Mathf.Max(1f, 0.5f * (float)amount); } } private static GraphType GetBodyPrefabGraphType(GameObject bodyPrefab) { if (Object.op_Implicit((Object)(object)bodyPrefab)) { if (Object.op_Implicit((Object)(object)bodyPrefab.GetComponent())) { return (GraphType)0; } if ((Object)(object)bodyPrefab.GetComponent() != (Object)null || Object.op_Implicit((Object)(object)bodyPrefab.GetComponent())) { return (GraphType)1; } } return (GraphType)0; } } }