BentoBoxWorld / InvSwitcher

World inventory switcher. Handles health, exp, advancements, inventory, etc.
Eclipse Public License 2.0
2 stars 5 forks source link

I keep losing my inventory #2

Closed Ironic8b498 closed 5 years ago

Ironic8b498 commented 5 years ago

Description I log out and when I return my inventory is missing for all three worlds.

Steps to reproduce the behavior:

  1. Not sure what causes is yet, I thought it had something to do when deleting world folders during setup of server
  2. I logged out last night and when I logged back in today all my stuff was gone. I can replace my stuff easy, it is becoming annoying

Expected behavior to have my armor and items in my inventory where I left them

Screenshots If applicable, add screenshots to help explain your problem.

Server Information:

[Please complete the following information:]

Additional context Add any other context about the problem here.

tastybento commented 5 years ago

There is something weird going on. It looks like the world is not loading (it's null). I don't think the database was fully reset or the world you are using isn't being loaded correctly. Can you tell me what add-ons you are actually running?

tastybento commented 5 years ago

It would be good to see your console log during the server startup phase. You can zip it up and drag and drop it to this ticket. Thanks.

Ironic8b498 commented 5 years ago

logs https://paste.helpch.at/riyujoheje.md acidisland-1.3.0.jar bskyblock-1.3.0-#193.jar challenges-0.6.0-#140.jar InvSwitcher-0.0.1-SNAPSHOT.jar level-1.3.0.jar WelcomeWarpSigns-0.1.0-SNAPSHOT.jar

krustymk commented 5 years ago

ERROR [BentoBox] Could not load object from database! java.util.List Related? Losing inv when switching world from skyblock to normal world, then doing a server restart and logging back in and going to skyblock, inv is empty

tastybento commented 5 years ago

@krustymk It looks like there's an item in your inventory that cannot be loaded. Are you using YAML? If this happens, then it'd be good to get a copy of the YAML file in the BentoBox database in the Inventory Switcher folder.

krustymk commented 5 years ago

https://pastebin.com/2tsGg3Aw https://pastebin.com/1S2Z4G7p

I only have 2 players with access currently so ive copied both files

cab2ff56-9182-4151-802e-4911fc93d18e has only has never had creative and only been building an island for an hour or so, its this character i noticed the inventory loss with (Im not saying the other hasnt lost items ive not checked yet)

BONNe commented 5 years ago

So, the issue is with these -null.

I have also encounter it in Challenges addon. Sometimes it did not correctly stores items and ruins it. You will not be able to get items back, but if you remove these -null then it will work again.

krustymk commented 5 years ago

Its all still in 'break it and see what needs fixing stage' so its cool if anything is lost, ill just delete the files and let them regenerate, if the -null comes back ill remove them and see what happens

krustymk commented 5 years ago

The -null just appears to be an empty slot in your inventory. As soon as i changed worlds it generated a new YAML file full of -null's

krustymk commented 5 years ago

restarted server and went back to skyblock and inv clear again with '[Server] ERROR [BentoBox] Could not load object from database! java.util.List

wellnesscookie commented 5 years ago

Same goes for me. I've installed this addon to test it for our upcoming server database restart and my inventory stuff deleted. Steps to reproduce:

BBox output:

[14:45:32 INFO]: Running SPIGOT 1.13.2.
[14:45:32 INFO]: BentoBox version: 1.5.0-SNAPSHOT
[14:45:32 INFO]: Loaded Game Worlds:
[14:45:32 INFO]: AcidIsland_world (AcidIsland)
[14:45:32 INFO]: skyblock (skyblock)
[14:45:32 INFO]: Loaded Addons:
[14:45:32 INFO]: AcidIsland 1.4.0
[14:45:32 INFO]: BentoBox-InvSwitcher 0.0.2-SNAPSHOT
[14:45:32 INFO]: BSkyBlock 1.4.2
[14:45:32 INFO]: Challenges 0.7.0-SNAPSHOT-#159
[14:45:32 INFO]: Level 1.4.0
[14:45:32 INFO]: Limits 0.2.0-SNAPSHOT
[14:45:32 INFO]: SerbCraftAddon 2.0
[14:45:32 INFO]: WelcomeWarps 1.2.1-SNAPSHOT

Additional:

tastybento commented 5 years ago

Okay, I'm looking into this. This never used to be a problem, so I'm not sure why it changed, but maybe a change to how the server operates.

tastybento commented 5 years ago

@BONNe The issue is that I don't have recursive deserialization with YAML. So the inventory Map<String, List> (World name, Inventory list) is not being correctly deserialized. The add-on works fine on JSON and other databases. So, there's a few things I could do:

  1. Change the way this addon stores data so it avoids using nested collections.
  2. Fix BentoBox so the YAML database handles recursive collections.
  3. Remove YAML as an option for database storage, and just support JSON for flat file. YAML could still be used for configs.

Analysis:

  1. is just a bandaid
  2. is hard. Could be done, but needs to be weighed against 3
  3. I'm liking this one. Is there any real need for YAML database files? JSON should be sufficient.

I'll need @Poslovitch input about this too.

tastybento commented 5 years ago

A variation on 3 would be to still support it, but deprecate it and make JSON the default.

tastybento commented 5 years ago

Database migration is supported now. Closing.