Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database is insert NBT tag on items that have no NBT tags #39

Open
phillipinman opened this issue Apr 16, 2019 · 9 comments
Open

Database is insert NBT tag on items that have no NBT tags #39

phillipinman opened this issue Apr 16, 2019 · 9 comments

Comments

@phillipinman
Copy link

phillipinman commented Apr 16, 2019

Issue Description:

InvSync is inserting a 0 NBt tag causing items to be considered separate. For example, minecraft:goldingot is becoming minecraft:goldingot with NBT tags 0 on logout. This results in two items essentially.

Screenshot:
image
image

What happens:

Results in two items, one with no NBT data and one with 0 NBT tags

What you expected to happen:

Both items to have null NBT data and combine into stacks

Steps to reproduce:

  1. Setup DB sync
  2. get a gold ingot and throw it on the ground, meanwhile put another one in your inventory and log out then back in
  3. pickup and compare the ingots, one will have nul NBT data and the other 0 NBT tags
    ...

Affected Versions (Do not use "latest"):

  • Minecraft: 1.12.2
  • InvSync: InvSync-0.6.19.298-DEV.jar
  • Sponge: spongeforge-1.12.2-2768-7.1.6-RC3643.jar
  • Other related mods: NA, forge is present
  • IMPORTANT: MariaDB is used instead of MySQL due to Redhat Licensing.

Your most recent log or stack trace file where the issue was present:

Most relevent log:

[21:03:39] [Server thread/INFO] [invsync]: {"potion_effects":{"data":[]},"mod.baubles":{"data":[]},"game_mode":{"data":"minecraft:survival"},"health":{"data":20.0},"ender_chest":{"data":[]},"inventory":{"selectedSlot":0,"inventory":[{"slot":0,"stack":{"ContentVersion":1,"ItemType":"minecraft:diamond_pickaxe","Count":1,"UnsafeDamage":2,"UnsafeData":{}}},{"slot":1,"stack":{"ContentVersion":1,"ItemType":"minecraft:cobblestone","Count":64,"UnsafeDamage":0,"UnsafeData":{}}}]},"experience":{"experience_since_level":20,"experience_level":11},"version":1,"hunger":{"saturation":1.0,"food_level":20}}
[21:03:39] [Server thread/DEBUG] [invsync]: Preparing statement: REPLACE INTO invsync_inventories (UUID, Active, Data) VALUES (?, FALSE, ?)
[21:03:39] [Server thread/DEBUG] [invsync]: Saving inventory for player Iron_Phildo69 (64f2ebea-4b08-4cbb-b288-7a772381ed27)
[21:03:39] [Server thread/INFO] [net.minecraft.server.dedicated.DedicatedServer]: Iron_Phildo69 left the game

@phillipinman
Copy link
Author

phillipinman commented Apr 16, 2019

Relevant information i suspect:

Oracle Mode
MariaDB starting with 10.3
In Oracle mode from MariaDB 10.3, PREPARE stmt FROM 'SELECT :1, :2' is used, instead of ?.

https://mariadb.com/kb/en/library/prepare-statement/

just some brain storming from someone that is not smart in SQL :P

I'm wondering if using MariaDB instead of MySQL could be the source of the issue?

@BrainStone
Copy link
Member

That looks like an issue with Sponge to me. The empty tags are in the debug data, which means either Sponge is serializing (my personal bet would be that) or deserializing it incorrectly.

I’m especially thinking that’s the case because the server version is 1.11.2. And there certainly are some serialization issues in that version.

@phillipinman
Copy link
Author

Ohh crap sorry, version is 1.12.2, i forgot to change the version sorry. Updated it

@BrainStone
Copy link
Member

Hm ok. Though it still looks like the serialization is messing up. (Or the deserialization)
There was another issue that was struggling with serialization too (#37) so I'll be reaching out to the Sponge team.

@phillipinman
Copy link
Author

Thank you :) I'll be eagerly awaiting an update

@BrainStone
Copy link
Member

Hi there. Is this still an issue?

@phillipinman
Copy link
Author

I have not tested as of late but can get back to you :)

@LivierG8
Copy link

LivierG8 commented Jan 8, 2020

Hi, I have the same issue on my server, with latest version released.

Here are the specs of my server :

  • Minecraft : 1.12.2
  • Forge: 14.23.5.2847
  • SpongeAPI: 7.1.0-ea50f0c2
  • Sponge: 1.12.2-7.1.9-SNAPSHOT
  • SpongeForge: 1.12.2-2838-7.1.9-RC3978
  • Database used : MySQL (I can't have more infos about it, sorry)
  • JVM: 1.8.0_202
  • Inventory Sync : 0.6.19.318

If needed, I can turn on debug mode to see exactly what is registered in database, but as I encounter the same issue, I think it's the same dataset type which is sent to database.

I hope I can help you fix this issue because we have an issue with inventories that we were able to fix only with your plugin as no other one offers sync over mysql (the other one known on Sponge Ore repository is MS DataSync which only saves ivnentory to MongoDB, but as we don't have a VPS, we only have access to one MySQL database (yes, only one, gladly each plugin using it has its own table prefix...)

@BrainStone
Copy link
Member

This is still an issue caused by forge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants