コード例 #1
0
 public ItemMoveEvent(Inventory inst, int fromSlot, Inventory toInventory, int toSlot, Inventory.SlotOperationsInfo info)
 {
     _from  = inst;
     _to    = toInventory;
     _fslot = fromSlot;
     _tslot = toSlot;
     _iinfo = info;
     if (toInventory._netListeners != null) // This is null when Rust is placing items.
     {
         foreach (uLink.NetworkPlayer netplayer in toInventory._netListeners)
         {
             try
             {
                 NetUser user = netplayer.GetLocalData() as NetUser;
                 if (user != null)
                 {
                     _pl = Fougerite.Server.GetServer().FindPlayer(user.userID);
                     break;
                 }
             }
             catch
             {
                 //ignore
             }
         }
     }
 }
コード例 #2
0
 public ItemMoveEvent(Inventory inst, int fromSlot, Inventory toInventory, int toSlot, Inventory.SlotOperationsInfo info)
 {
     _from  = inst;
     _to    = toInventory;
     _fslot = fromSlot;
     _tslot = toSlot;
     _iinfo = info;
     foreach (uLink.NetworkPlayer netplayer in toInventory._netListeners)
     {
         NetUser user = netplayer.GetLocalData() as NetUser;
         if (user != null)
         {
             if (Fougerite.Server.Cache.ContainsKey(user.userID))
             {
                 _pl = Fougerite.Server.Cache[user.userID];
             }
             break;
         }
     }
 }
コード例 #3
0
 public static bool Inventory_SlotOperation(Inventory fromInventory, int fromSlot, Inventory moveInventory, int moveSlot, Inventory.SlotOperationsInfo info)
 {
     object[] args = new object[]
     {
         fromInventory,
         fromSlot,
         moveInventory,
         moveSlot,
         info
     };
     return(Method.Invoke("RustExtended.RustHook.Inventory_SlotOperation", args).AsBoolean);
 }