using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HG.Reflection; using On.RoR2; using On.RoR2.UI; using R2API; using RoR2; using RoR2.Artifacts; using RoR2.UI; using TILER2; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.EventSystems; using UnityEngine.Networking; using UnityEngine.ResourceManagement.AsyncOperations; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Yeet")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+b35d1c6a89ec45c0324ac9636a9ea3be05a8f8cc")] [assembly: AssemblyProduct("Yeet")] [assembly: AssemblyTitle("Yeet")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace ThinkInvisible.Jfork.Yeet; [BepInPlugin("com.ThinkInvisible.Jfork.Yeet", "Yeet", "3.0.6")] [BepInDependency("com.bepis.r2api", "5.3.0")] public class YeetPlugin : BaseUnityPlugin { public class ServerBlacklist : AutoConfigContainer { [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOCheckbox(null, null)] public bool preventEquipment { get; private set; } = false; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOCheckbox(null, null)] public bool preventLunarEquipment { get; private set; } = false; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOCheckbox(null, null)] public bool preventNonLunarEquipment { get; private set; } = false; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOCheckbox(null, null)] public bool preventItems { get; private set; } = false; [AutoConfig(/*Could not decode attribute arguments.*/)] public bool preventHidden { get; private set; } = true; [AutoConfig(/*Could not decode attribute arguments.*/)] public bool preventCantRemove { get; private set; } = true; [AutoConfig(/*Could not decode attribute arguments.*/)] public bool preventTierless { get; private set; } = true; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOString(null, null)] public string blacklistTier { get; private set; } = "LunarTierDef, VoidTier1Def, VoidTier2Def, VoidTier3Def, VoidBossDef"; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOString(null, null)] public string blacklistItem { get; private set; } = ""; } public class ServerConfig : AutoConfigContainer { [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOCheckbox(null, null)] public bool allowYeet { get; private set; } = true; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOCheckbox(null, null)] public bool preventRecycling { get; private set; } = false; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOCheckbox(null, null)] public bool commandExtraCheesyMode { get; private set; } = false; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOCheckbox(null, null)] public bool announce { get; private set; } = true; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOCheckbox(null, null)] public bool theConcequencesOfYourActions { get; private set; } = true; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOSlider("{0:N1} m/s", 0f, 500f, null, null)] public float lowThrowForce { get; private set; } = 30f; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOSlider("{0:N1} m/s", 0f, 500f, null, null)] public float highThrowForce { get; private set; } = 150f; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOIntSlider("{0:N0}", 1, 100, null, null)] public int maxThrowCount { get; private set; } = 1; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOSlider("{0:N1} s", 0f, 300f, null, null)] public float yoinkCooldown { get; private set; } = 5f; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOSlider("{0:N1} s", 0f, 300f, null, null)] public float yeetCooldown { get; private set; } = 10f; } public class ClientConfig : AutoConfigContainer { [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOSlider("{0:N1} s", 0f, 10f, null, null)] public float highThrowTime { get; private set; } = 2f; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOIntSlider("{0:N0}", -100, 100, null, null)] public int primaryQuantity { get; private set; } = 1; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOIntSlider("{0:N0}", -100, 100, null, null)] public int secondaryQuantity { get; private set; } = 1; } public const string ModVer = "3.0.6"; public const string ModName = "Yeet"; public const string ModGuid = "com.ThinkInvisible.Jfork.Yeet"; public static readonly ServerConfig serverConfig = new ServerConfig(); public static readonly ClientConfig clientConfig = new ClientConfig(); public static readonly ServerBlacklist serverBlacklist = new ServerBlacklist(); internal static ManualLogSource _logger; private static GameObject yeetPickupPrefab; private static readonly HashSet _blacklistTier = new HashSet(); private static readonly HashSet _blacklistItem = new HashSet(); public void Awake() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Expected O, but got Unknown //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) _logger = ((BaseUnityPlugin)this).Logger; ConfigFile val = new ConfigFile(Path.Combine(Paths.ConfigPath, "com.ThinkInvisible.Jfork.Yeet.cfg"), true); ((AutoConfigContainer)serverBlacklist).ConfigEntryChanged += delegate(object sender, AutoConfigUpdateActionEventArgs args) { if (args.target.boundProperty.Name == "blacklistTier" || args.target.boundProperty.Name == "blacklistItem") { UpdateBlacklists(); } }; ((AutoConfigContainer)serverConfig).BindAll(val, "Yeet", "Server"); ((AutoConfigContainer)clientConfig).BindAll(val, "Yeet", "Client"); ((AutoConfigContainer)serverBlacklist).BindAll(val, "Yeet", "ServerBlacklist"); UpdateBlacklists(); ItemIcon.Awake += new hook_Awake(ItemIcon_Awake); EquipmentIcon.Update += new hook_Update(EquipmentIcon_Update); PickupDropletController.OnCollisionEnter += new hook_OnCollisionEnter(PickupDropletController_OnCollisionEnter); GenericPickupController.CreatePickup += new hook_CreatePickup(GenericPickupController_CreatePickup); GenericPickupController.GetInteractability += new hook_GetInteractability(GenericPickupController_GetInteractability); GenericPickupController.OnTriggerStay += new hook_OnTriggerStay(GenericPickupController_OnTriggerStay); AsyncOperationHandle val2 = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/GenericPickup.prefab"); val2.Completed += delegate(AsyncOperationHandle obj) { GameObject result = obj.Result; if (!Object.op_Implicit((Object)(object)result)) { _logger.LogError((object)"Failed to load GenericPickup prefab to copy homework off of. The YoinkCooldown setting will not work (no extra cooldown will be added)."); } else { GameObject val3 = PrefabAPI.InstantiateClone(result, "YeetPickupPrefabPrefab"); val3.AddComponent(); val3.AddComponent(); val3.AddComponent(); yeetPickupPrefab = PrefabAPI.InstantiateClone(val3, "YeetPickupPrefab", true); } }; } private void UpdateBlacklists() { _blacklistItem.Clear(); _blacklistItem.UnionWith(from x in serverBlacklist.blacklistItem.Split(',') select x.Trim()); _blacklistTier.Clear(); _blacklistTier.UnionWith(from x in serverBlacklist.blacklistTier.Split(',') select x.Trim()); } [ConCommand(/*Could not decode attribute arguments.*/)] private static void ConCmdYeet(ConCommandArgs args) { //IL_001b: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Expected I4, but got Unknown //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Expected I4, but got Unknown //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Invalid comparison between Unknown and I4 //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_04c3: Unknown result type (might be due to invalid IL or missing references) //IL_04d1: Unknown result type (might be due to invalid IL or missing references) //IL_0532: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_0476: Unknown result type (might be due to invalid IL or missing references) //IL_047b: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_05ae: Unknown result type (might be due to invalid IL or missing references) //IL_0716: Unknown result type (might be due to invalid IL or missing references) //IL_05e8: Unknown result type (might be due to invalid IL or missing references) //IL_0754: Unknown result type (might be due to invalid IL or missing references) //IL_0759: Unknown result type (might be due to invalid IL or missing references) //IL_07ec: Unknown result type (might be due to invalid IL or missing references) //IL_07f3: Unknown result type (might be due to invalid IL or missing references) //IL_080f: Unknown result type (might be due to invalid IL or missing references) //IL_0814: Unknown result type (might be due to invalid IL or missing references) //IL_079c: Unknown result type (might be due to invalid IL or missing references) //IL_079e: Unknown result type (might be due to invalid IL or missing references) //IL_07a3: Unknown result type (might be due to invalid IL or missing references) //IL_07ac: Unknown result type (might be due to invalid IL or missing references) //IL_07b4: Unknown result type (might be due to invalid IL or missing references) //IL_07b9: Unknown result type (might be due to invalid IL or missing references) //IL_07c0: Unknown result type (might be due to invalid IL or missing references) //IL_07c2: Unknown result type (might be due to invalid IL or missing references) //IL_07cd: Unknown result type (might be due to invalid IL or missing references) //IL_07cf: Unknown result type (might be due to invalid IL or missing references) //IL_0672: Unknown result type (might be due to invalid IL or missing references) //IL_06f9: Unknown result type (might be due to invalid IL or missing references) //IL_06fe: Unknown result type (might be due to invalid IL or missing references) if (!serverConfig.allowYeet) { if (Object.op_Implicit((Object)(object)args.sender)) { NetUtil.ServerSendChatMsg(args.sender, "Yeet mod has been temporarily disabled by the server host."); } return; } if (!Object.op_Implicit((Object)(object)((ConCommandArgs)(ref args)).senderBody)) { _logger.LogError((object)"ConCmdYeet: called by nonexistent player!"); return; } if (((ConCommandArgs)(ref args)).Count < 1) { _logger.LogError((object)"ConCmdYeet: not enough arguments! Need at least 1 (item ID), received 0."); return; } YeetData yeetData = ((Component)((ConCommandArgs)(ref args)).senderBody).GetComponent(); if (!Object.op_Implicit((Object)(object)yeetData)) { yeetData = ((Component)((ConCommandArgs)(ref args)).senderBody).gameObject.AddComponent(); yeetData.age = serverConfig.yeetCooldown; } if (yeetData.age < serverConfig.yeetCooldown) { float num = serverConfig.yeetCooldown - yeetData.age; NetUtil.ServerSendChatMsg(args.sender, string.Format("You must wait {0:0} second{1} before yeeting another item.", num, (num < 2f) ? "" : "s")); return; } bool valueOrDefault = ((ConCommandArgs)(ref args)).TryGetArgBool(1) == true; if (valueOrDefault ? serverBlacklist.preventEquipment : serverBlacklist.preventItems) { return; } string itemSearch = ((ConCommandArgs)(ref args)).TryGetArgString(0); if (itemSearch == null) { _logger.LogError((object)"ConCmdYeet: could not read first argument (item ID)!"); return; } if (int.TryParse(itemSearch, out var result)) { if (valueOrDefault) { EquipmentIndex val = (EquipmentIndex)result; if (!EquipmentCatalog.IsIndexValid(ref val)) { _logger.LogError((object)"ConCmdYeet: first argument (equipment ID as integer EquipmentIndex) is out of range; no equipment with that ID exists!"); return; } } else { ItemIndex val2 = (ItemIndex)result; if (!ItemCatalog.IsIndexValid(ref val2)) { _logger.LogError((object)"ConCmdYeet: first argument (item ID as integer ItemIndex) is out of range; no item with that ID exists!"); return; } } } else if (valueOrDefault) { IEnumerable source = ((IEnumerable)(object)EquipmentCatalog.allEquipment).Where(delegate(EquipmentIndex searchInd) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) string nameToken = EquipmentCatalog.GetEquipmentDef(searchInd).nameToken; string text2 = Language.GetString(nameToken); return text2.ToUpper().Contains(itemSearch.ToUpper()); }); if (source.Count() < 1) { _logger.LogError((object)"ConCmdYeet: first argument (equipment ID as string EquipmentName) not found in EquipmentCatalog; no equipment with a name containing that string exists!"); return; } if (source.Count() > 1) { _logger.LogWarning((object)"ConCmdYeet: first argument (item ID as string EquipmentName) matched multiple equipments; using first."); } result = (int)source.First(); } else { IEnumerable source2 = ((IEnumerable)(object)ItemCatalog.allItems).Where(delegate(ItemIndex searchInd) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) string nameToken = ItemCatalog.GetItemDef(searchInd).nameToken; string text2 = Language.GetString(nameToken); return text2.ToUpper().Contains(itemSearch.ToUpper()); }); if (source2.Count() < 1) { _logger.LogError((object)"ConCmdYeet: first argument (item ID as string ItemName) not found in ItemCatalog; no item with a name containing that string exists!"); return; } if (source2.Count() > 1) { _logger.LogWarning((object)"ConCmdYeet: first argument (item ID as string ItemName) matched multiple items; using first."); } result = (int)source2.First(); } float num2 = Mathf.Lerp(serverConfig.lowThrowForce, serverConfig.highThrowForce, Mathf.Clamp01(((ConCommandArgs)(ref args)).TryGetArgFloat(2).GetValueOrDefault())); int num3 = 1; string text; PickupIndex val3; if (valueOrDefault) { EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef((EquipmentIndex)result); string colorHexString = ColorCatalog.GetColorHexString(equipmentDef.colorIndex); text = "" + Language.GetString(equipmentDef.nameToken) + ""; if ((int)((ConCommandArgs)(ref args)).senderBody.inventory.GetEquipmentIndex() != result) { _logger.LogWarning((object)"ConCmdYeet: someone's trying to drop an equipment they don't have"); NetUtil.ServerSendChatMsg(args.sender, "Can't yeet " + text + ": you don't have it."); return; } if (equipmentDef.isLunar ? serverBlacklist.preventLunarEquipment : serverBlacklist.preventNonLunarEquipment) { NetUtil.ServerSendChatMsg(args.sender, "Can't yeet " + text + ": tier blacklisted by server."); return; } if (_blacklistItem.Contains(equipmentDef.nameToken)) { NetUtil.ServerSendChatMsg(args.sender, "Can't yeet " + text + ": equipment blacklisted by server."); return; } ((ConCommandArgs)(ref args)).senderBody.inventory.SetEquipmentIndex((EquipmentIndex)(-1), true); val3 = PickupCatalog.FindPickupIndex((EquipmentIndex)result); } else { FakeInventory component = ((Component)((ConCommandArgs)(ref args)).senderBody).GetComponent(); int num4 = (Object.op_Implicit((Object)(object)component) ? component.GetRealItemCount((ItemIndex)result) : ((ConCommandArgs)(ref args)).senderBody.inventory.GetItemCountPermanent((ItemIndex)result)); ItemDef itemDef = ItemCatalog.GetItemDef((ItemIndex)result); ItemTierDef itemTierDef = ItemTierCatalog.GetItemTierDef(itemDef.tier); string colorHexString2 = ColorCatalog.GetColorHexString(itemTierDef.colorIndex); text = "" + Language.GetString(itemDef.nameToken) + ""; if (num4 < 1) { _logger.LogWarning((object)"ConCmdYeet: someone's trying to drop an item they don't have any of"); NetUtil.ServerSendChatMsg(args.sender, "Can't yeet " + text + ": you don't have any."); return; } if ((serverBlacklist.preventHidden && itemDef.hidden) || (serverBlacklist.preventCantRemove && !itemDef.canRemove) || ((!Object.op_Implicit((Object)(object)itemTierDef)) ? serverBlacklist.preventTierless : _blacklistTier.Contains(((Object)itemTierDef).name))) { NetUtil.ServerSendChatMsg(args.sender, "Can't yeet " + text + ": tier blacklisted by server."); return; } if (_blacklistItem.Contains(itemDef.nameToken)) { NetUtil.ServerSendChatMsg(args.sender, "Can't yeet " + text + ": item blacklisted by server."); return; } if (serverConfig.theConcequencesOfYourActions && num4 < 2 && (((Object)itemTierDef).name == "VoidTier1Def" || ((Object)itemTierDef).name == "VoidTier2Def" || ((Object)itemTierDef).name == "VoidTier3Def" || ((Object)itemTierDef).name == "VoidBossDef")) { NetUtil.ServerSendChatMsg(args.sender, "Can't yeet " + text + ": you must live with the consequences of your actions."); return; } int num5 = ((ConCommandArgs)(ref args)).TryGetArgInt(3) ?? 1; if (num5 < 0) { num5 = Mathf.CeilToInt((float)num4 / ((float)(-num5) * 100f)); } num3 = Mathf.Clamp(num5, 1, Mathf.Min(serverConfig.maxThrowCount, num4)); ((ConCommandArgs)(ref args)).senderBody.inventory.RemoveItemPermanent((ItemIndex)result, num3); val3 = PickupCatalog.FindPickupIndex((ItemIndex)result); } if (serverConfig.announce) { NetUtil.ServerSendGlobalChatMsg($"{Util.EscapeRichTextForTextMeshPro(args.sender.userName)} yeeted {num3}x {text}"); } for (int num6 = 0; num6 < num3; num6++) { GameObject val4 = Object.Instantiate(PickupDropletController.pickupDropletPrefab, ((ConCommandArgs)(ref args)).senderBody.inputBank.aimOrigin, Quaternion.identity); YeetData yeetData2 = val4.AddComponent(); yeetData2.yeeter = ((ConCommandArgs)(ref args)).senderBody; PickupDropletController component2 = val4.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.pickupState = ((UniquePickup)(ref component2.pickupState)).WithPickupIndex(val3); CreatePickupInfo createPickupInfo = new CreatePickupInfo { rotation = Quaternion.identity }; ((CreatePickupInfo)(ref createPickupInfo)).pickup = new UniquePickup(val3); component2.createPickupInfo = createPickupInfo; } Rigidbody component3 = val4.GetComponent(); component3.velocity = ((ConCommandArgs)(ref args)).senderBody.inputBank.aimDirection * num2; component3.AddTorque(Random.Range(150f, 120f) * Random.onUnitSphere); NetworkServer.Spawn(val4); } yeetData.age = 0f; } private void GenericPickupController_OnTriggerStay(orig_OnTriggerStay orig, GenericPickupController self, Collider other) { if (NetworkServer.active) { CharacterBody component = ((Component)other).GetComponent(); YeetData component2 = ((Component)self).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component2) && (Object)(object)component2.yeeter == (Object)(object)component && component2.age < serverConfig.yoinkCooldown) { return; } } orig.Invoke(self, other); } private Interactability GenericPickupController_GetInteractability(orig_GetInteractability orig, GenericPickupController self, Interactor activator) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0051: 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) Interactability result = orig.Invoke(self, activator); YeetData component = ((Component)self).GetComponent(); CharacterBody component2 = ((Component)activator).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component2) && (Object)(object)component.yeeter == (Object)(object)component2 && component.age < serverConfig.yoinkCooldown) { return (Interactability)0; } return result; } private void PickupDropletController_OnCollisionEnter(orig_OnCollisionEnter orig, PickupDropletController self, Collision collision) { //IL_0058: 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_0109: 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_01e8: 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_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || !self.alive) { orig.Invoke(self, collision); return; } bool flag = false; YeetData component = ((Component)self).GetComponent(); Debug.Log((object)component); if (Object.op_Implicit((Object)(object)component)) { if (!serverConfig.commandExtraCheesyMode) { flag = ((IEnumerable)(object)RunArtifactManager.enabledArtifactsEnumerable).Contains(Artifacts.Command); } ((BaseUnityPlugin)this).Logger.LogDebug((object)("Command settings " + flag + " " + serverConfig.commandExtraCheesyMode)); if (flag) { RunArtifactManager.instance.SetArtifactEnabledServer(Artifacts.Command, false); ((BaseUnityPlugin)this).Logger.LogDebug((object)"bit ran"); } if (!Object.op_Implicit((Object)(object)yeetPickupPrefab)) { orig.Invoke(self, collision); } else { self.alive = false; self.createPickupInfo.position = ((Component)self).transform.position; GameObject val = null; if (serverConfig.commandExtraCheesyMode && ((IEnumerable)(object)RunArtifactManager.enabledArtifactsEnumerable).Contains(Artifacts.Command)) { orig.Invoke(self, collision); GameObject commandCubePrefab = CommandArtifactManager.commandCubePrefab; if (!Object.op_Implicit((Object)(object)commandCubePrefab)) { orig.Invoke(self, collision); ((BaseUnityPlugin)this).Logger.LogDebug((object)"not sure this is suposed to run"); return; } val = Object.Instantiate(commandCubePrefab, self.createPickupInfo.position, self.createPickupInfo.rotation); val.AddComponent(); PickupPickerController component2 = val.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { Option[] optionsFromPickupState = PickupPickerController.GetOptionsFromPickupState(((CreatePickupInfo)(ref self.createPickupInfo)).pickup); component2.SetOptionsServer(optionsFromPickupState); } } else { val = Object.Instantiate(yeetPickupPrefab, self.createPickupInfo.position, self.createPickupInfo.rotation); GenericPickupController component3 = val.GetComponent(); if (Object.op_Implicit((Object)(object)component3)) { component3.Network_pickupState = ((CreatePickupInfo)(ref self.createPickupInfo)).pickup; if (serverConfig.preventRecycling) { component3.NetworkRecycled = true; } } } PickupIndexNetworker component4 = val.GetComponent(); if (Object.op_Implicit((Object)(object)component4)) { ((BaseUnityPlugin)this).Logger.LogDebug((object)"pickupnetworker is here"); } component4.NetworkpickupState = ((CreatePickupInfo)(ref self.createPickupInfo)).pickup; YeetData component5 = val.GetComponent(); component5.age = component.age; component5.yeeter = component.yeeter; NetworkServer.Spawn(val); Object.Destroy((Object)(object)((Component)self).gameObject); } if (flag) { RunArtifactManager.instance.SetArtifactEnabledServer(Artifacts.Command, true); } } else { orig.Invoke(self, collision); } } private GenericPickupController GenericPickupController_CreatePickup(orig_CreatePickup orig, ref CreatePickupInfo createPickupInfo) { return orig.Invoke(ref createPickupInfo); } private void ItemIcon_Awake(orig_Awake orig, ItemIcon self) { orig.Invoke(self); ((Component)self).gameObject.AddComponent(); } private void EquipmentIcon_Update(orig_Update orig, EquipmentIcon self) { orig.Invoke(self); if (!Object.op_Implicit((Object)(object)((Component)self).gameObject.GetComponent())) { YeetButton yeetButton = ((Component)self).gameObject.AddComponent(); yeetButton.isEquipment = true; } } } public class YeetData : MonoBehaviour { public CharacterBody yeeter; public float age = 0f; private void FixedUpdate() { age += Time.fixedDeltaTime; } } public class YeetButton : MonoBehaviour, IPointerDownHandler, IEventSystemHandler, IPointerUpHandler { private float holdTimeL = 0f; private float holdTimeR = 0f; public bool isEquipment = false; void IPointerDownHandler.OnPointerDown(PointerEventData eventData) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Invalid comparison between Unknown and I4 if ((int)eventData.button == 0) { holdTimeL = Time.unscaledTime; } else if ((int)eventData.button == 1) { holdTimeR = Time.unscaledTime; } } void IPointerUpHandler.OnPointerUp(PointerEventData eventData) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Invalid comparison between Unknown and I4 //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected I4, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected I4, but got Unknown bool flag = (int)eventData.button == 0; bool flag2 = (int)eventData.button == 1; if (flag || flag2) { float num = Time.unscaledTime - (flag ? holdTimeL : holdTimeR); string text = (isEquipment ? ((int)((Component)this).GetComponent().targetInventory.GetEquipmentIndex()).ToString() : ((int)((Component)this).GetComponent().itemIndex).ToString()); if (NetworkUser.localPlayers.Count > 0) { Console.instance.SubmitCmd(NetworkUser.localPlayers[0], $"yeet {text} {(isEquipment ? 1 : 0)} {num:N4} {(flag ? YeetPlugin.clientConfig.primaryQuantity : YeetPlugin.clientConfig.secondaryQuantity)}", false); } else { YeetPlugin._logger.LogError((object)"Received inventory click event with no active local players!"); } } } }