1. I'm having a hard time trying to figure out how to place allowed items inside of a locker.

    background: I have a json array of items created from scanning a locker (itemId, amount, slotId , etc)
    I'm just trying to rebuild the locker from this data.

    ...
    Item item = ItemManager.CreateByItemID(itemId, amount, skinid);
    item.MoveToContainer(locker.inventory, slotId); // this looks to be ignored.
    ...

    I've noticed a RPC_Equip function, but not quite sure how to execute it.

    worst case, I can probably populate my personal inventory if I can figure out how to invoke the "swap" button on the container panel
     
  2. Using a decompiler and by looking at the Locker class I found out that the locker's inventory item filter is depending on the bool variable equippingActive. If this variable is true, you can add any item you want to the container, if it is false, you can add no item at all. Unfortunately this variable is only true while the client message for swapping is processed, and since it has private access, we cannot set it directly.

    However, we can temporarily alter the item filter by changing the inventory's canAcceptItem function.
    Code:
    Func<Item, bool> canAcceptItem = locker.inventory.canAcceptItem;
    locker.inventory.canAcceptItem = new Func<Item, bool>((Item i) => { return true; });Item item = ItemManager.CreateByItemID(itemId, amount, skinid);
    item.MoveToContainer(locker.inventory, slotId); // this shouldn't be ignored anymore now ;)locker.inventory.canAcceptItem = canAcceptItem;
     
  3. You can use reflection to modify the private bool, like so:
    Code:
    FieldInfo equippingActive = typeof(Locker).GetField("equippingActive", (BindingFlags.Instance | BindingFlags.NonPublic));private void SetLockerEquip(Locker locker, bool newVal) => equippingActive.SetValue(locker, newVal);
    
     
  4. Thank you both EnigmaticDragon and Shady757 for your assistance on this, This is very promising information that should let me continue development on my addon!