Hey guys, @Wulf espessially. I was looking thro the assembly-csharp and found something interesting.
Assembly-CSharp/PlayerLoot.cs
andCode:public void StartLootingEntity(BaseEntity targetEntity, bool doPositionChecks = true) { this.Clear(); if (!(bool) ((UnityEngine.Object) targetEntity) || !targetEntity.OnStartBeingLooted(this.baseEntity)) return; Assert.IsTrue(targetEntity.isServer, "Assure is server"); this.PositionChecks = doPositionChecks; this.entitySource = targetEntity; this.itemSource = (Item) null; this.MarkDirty(); Interface.CallHook("IOnLootEntity", (object) this, (object) targetEntity); <--- }
andCode:public void StartLootingPlayer(BasePlayer player) { this.Clear(); if (!(bool) ((UnityEngine.Object) player) || !(bool) ((UnityEngine.Object) player.inventory)) return; this.AddContainer(player.inventory.containerWear); this.AddContainer(player.inventory.containerMain); this.AddContainer(player.inventory.containerBelt); this.PositionChecks = true; this.entitySource = (BaseEntity) player; this.itemSource = (Item) null; this.MarkDirty(); Interface.CallHook("IOnLootPlayer", (object) this, (object) player);<--- }
Also just found this - BaseCombatEntity.cs:Code:public void StartLootingItem(Item item) { this.Clear(); if (item == null || item.contents == null) return; this.PositionChecks = true; this.containers.Add(item.contents); item.contents.onDirty += new Action(this.MarkDirty); this.itemSource = item; this.entitySource = item.GetWorldEntity(); this.MarkDirty(); Interface.CallHook("IOnLootItem", (object) this, (object) item);<--- }----Code:if (Interface.CallHook("IOnBaseCombatEntityHurt", (object) this, (object) info) != null)
BaseMelee.cs:
What this "I" Doing in every hook? "IOnLootPlayer","IOnLootItem","IOnLootEntity" etc.Code:if (Interface.CallHook("IOnPlayerAttack", (object) this, (object) info) != null)
Should it be there? I haven't test or even ever use this hooks, but still - it looks strange.
This was actuallly found by @Vlad-00003, but for some reason he still didn't post it here.....
So? Is this a problem or I just didn't get it?
Solved Purpose of "I" prefixed hooks?
Discussion in 'Rust Development' started by Vlad-00003, Jun 22, 2017.
-
Wulf Community Admin
Hooks prefixed with "I" indicate they are internal, which plugins cannot access directly. These types of hooks are then wrapped via RustCore.cs and then a new hook without the "I" prefix is called for plugins to use. We've been using these for probably 2 years now; nothing wrong about them, they're supposed to be there.
-
Oh.... Ok, got it.
Also - is there any obj file for the patcher, that contains all of the hooks? Cos docs doesn't contain every hook. And also - it takes some time for them to be updated.
[DOUBLEPOST=1498162938][/DOUBLEPOST]Yes. Found it in the RustCore, thanks for the quick answer! -
Wulf Community Admin
PS. The Docs are open source, people can contribute if they see some missing (assuming someone told you some where.) ;P -
Can't find the obj anywhere - can you point me to the right direction?
I've cloned already both oxide source and patcher, but can't see anything related there. -
Wulf Community Admin
-
I'm f***ing blind.... Thanks again!