Backpacks

Moved

Total Downloads: 15,963 - First Release: Oct 30, 2015 - Last Update: Mar 6, 2018

5/5, 49 likes
  1. all backpacks are kepted as files not as entities . they will not go away unless you wipe them. And they add up. With any plugin that saves data, over time it could be enough to impact server performance. but not sure if backpack files will or not.
     
  2. So basically all of these files are needed? They've only accumulated since the 19th of the month. It just seems like an awful lot of files for 19 players in 5 days. A decent chunk of which were only visitors.
     
  3. I have 7360 files since the first of the month. I don't think that's accurate but before I wiped it I also had 19k-22k files. from looking at them, it seems that it should only be 1 file per player or at least it should be.

    I haven't had 7360 players since the first of the month, so maybe there's duplicate files, I suppose you can look for duplicate files with the same SteamID, but you risk losing data/ items per player.
     
  4. Yeah. Not going to risk any of that. I was curious what was with all the files aside from the possibility of a folder cleanup. As long as it knows which files to read and doesn't cause my server to lag out I'm fine with it. I just ask a lot of questions. The more I ask now the less I ask later.
     
  5. A player on my server brought to my attention, that in the past on a different server...the server owner/admin was able to save the contents
    of the players Backpacks even after force wipe, to carry over after update.

    Would anyone know how this is possible? And what exactly is needed to accomplish this?

    Thanks!
     
  6. yes, don't delete the files in the folder "data/backpacks"
     
  7. That's all?...Just don't delete the files?...That's easy......but wait!.....will those files be deleted on the next oxide update?

    Like I would need to save them?.....Or oxide update will not mess with those files?
     
  8. they wont wipe unless you wipe them.
    [DOUBLEPOST=1508988204][/DOUBLEPOST]
    anyone else having this problem for the 2nd time I ask LOL :)
     
  9. Same here with the BPs in the backpack. If you put one in it goes blank when you go back into the backpack. If you put more than one in they stack as blank BPs.
     
  10. Okay so I've been scrolling through and either there isn't an answer or my eyes are failing me. With the setting "Erase On Death": false, If it's set to true do the backpacks just disappear or do they despawn on a timer? Apparently they are sticking around while it's set to false.
     
  11. post removed, problem fixed.

    As for the backpacks, they do survive a wipe if you dont remove data file, on death they generally stay around or about an hour on my server. which makes everyone happy who is killed by bot or animal and of course the heli
     
    Last edited by a moderator: Oct 27, 2017
  12. This is solution! Backpacks must be empty when update plugin!
    Code:
            private class BackpackInventory
            {
                public List<BackpackItem> Items = new List<BackpackItem>();            public class BackpackItem
                {
                    public int ID;
                    public int BlueprintID;
                    public int Amount;
                    public ulong Skin;
                    public float Fuel;
                    public int FlameFuel;
                    public float Condition;
                    public int Ammo;
                    public int AmmoType;
                    public bool Blueprint;                public List<BackpackItem> Contents = new List<BackpackItem>();                public Item ToItem()
                    {    
                        Item item = null;              
                        if(Blueprint)
                        {
                            item = ItemManager.CreateByItemID(-1887162396, Amount, Skin);
                            item.blueprintTarget = BlueprintID;
                            return item;
                        }
                        else
                        {
                            item = ItemManager.CreateByItemID(ID, Amount, Skin);
                        }
                        BaseProjectile.Magazine magazine = item.GetHeldEntity()?.GetComponent<BaseProjectile>()?.primaryMagazine;
                        FlameThrower flameThrower = item.GetHeldEntity()?.GetComponent<FlameThrower>();                    item.fuel = Fuel;
                        item.condition = Condition;                    if (Contents != null)
                            foreach (var contentItem in Contents)
                                contentItem.ToItem().MoveToContainer(item.contents);
                        else
                            item.contents = null;                    if (magazine != null)
                        {
                            magazine.contents = Ammo;
                            magazine.ammoType = ItemManager.FindItemDefinition(AmmoType);
                        }                    if (flameThrower != null)
                            flameThrower.ammo = FlameFuel;                    return item;
                    }                public static BackpackItem FromItem(Item item) => new BackpackItem
                    {
                        BlueprintID = item.blueprintTarget,
                        ID = item.info.itemid,
                        Ammo = item.GetHeldEntity()?.GetComponent<BaseProjectile>()?.primaryMagazine?.contents ?? 0,
                        AmmoType = item.GetHeldEntity()?.GetComponent<BaseProjectile>()?.primaryMagazine?.ammoType?.itemid ?? 0,
                        Amount = item.amount,
                        Condition = item.condition,
                        Fuel = item.fuel,
                        Skin = item.skin,
                        Contents = item.contents?.itemList?.Select(FromItem).ToList(),
                        FlameFuel = item.GetHeldEntity()?.GetComponent<FlameThrower>()?.ammo ?? 0,
                        Blueprint = item.IsBlueprint()
                    };
                }
            }
     
  13. I would not like this at all, especially as i usually update the plugin when game updates. so inventory is full
     
  14. This solution allows you to store blueprints in backpacks. It works all 100%. Will use this solution or not - it's your decide.
     
  15. yes I have that problem too. but its good that blueprints cant be placed,. Makes them work for it after wipe. lol
    [DOUBLEPOST=1509228174][/DOUBLEPOST]
    I did not or do not see your solution ?
     
  16. Replace the class in the plugin with that I posted. If you do not understand how to do this, then you better wait for the plugin update from the developer
     
  17. I know how to do that, but I obviously was blind and didn't realize you posted something to fix the blueprints. sorry man. :)
     
  18. Hey guys,
    today i added a Usergroup "vip" and now i want to give this group the permission to backbacks.use.medium.
    But there is no medium backpack.
    Large and small works perfect but medium wont work.
    If a vip opens backpack he opens a small backpack.
    Is there a way to use that medium-backpack ?
     
  19. LaserHydra updated Backpacks with a new update entry:

    2.0.9

     
  20. Boss, is the red durable property of items solved? Or it can be refreshed indefinitely
    [DOUBLEPOST=1509469425][/DOUBLEPOST]
    Boss, the red durable property of items will disappear, so no durable items will be reborn