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

items with dragonflyData constantly get resent #455

Closed
AndreasHGK opened this issue Mar 19, 2022 · 3 comments
Closed

items with dragonflyData constantly get resent #455

AndreasHGK opened this issue Mar 19, 2022 · 3 comments
Labels
bug Something isn't working
Milestone

Comments

@AndreasHGK
Copy link
Contributor

AndreasHGK commented Mar 19, 2022

Items that have any custom data added using (item.Stack).WIthValue() appear to be synced every time the player tries to interact (not necessarily holding the item)

Steps to reproduce

  • have an item with custom data in your inventory
  • right-click on the ground
  • watch the items constantly display pickup animation (the animation that happens every time you drop or pick up that item)
    if you are holding the item while right clicking itll also go up and down
    this 'works best' on windows where right clicking on a block will spam the interaction packet

other actions like dropping items also make this occur to a lesser extent
I assume the cause of the flicker is the server resending the item to the client

@Sandertv Sandertv added the bug Something isn't working label Mar 22, 2022
@Sandertv Sandertv added this to the v0.6.0 milestone Mar 22, 2022
@Sandertv
Copy link
Member

Guessing this is because of the resending done here: https://github.com/df-mc/dragonfly/blob/master/server/session/handler_inventory_transaction.go#L130. I feel like this might very well be because NBT is unordered in dragonfly and it'll change ordering randomly, making the client think the NBT's changed.

@Sandertv
Copy link
Member

Could you please see if 784c121 fixes this issue?

@AndreasHGK
Copy link
Contributor Author

panic: error decoding item user data: gob: decoding into local type *[]nbtconv.mapValue, received remote type 

goroutine 147 [running]:
github.com/df-mc/dragonfly/server/internal/nbtconv.readDragonflyData(0x2c9?, 0xc004014380)
        C:/Users/Andreas/go/pkg/mod/github.com/df-mc/dragonfly@v0.5.2-0.20220322202505-784c1216beda/server/internal/nbtconv/read.go:111 +0x445
github.com/df-mc/dragonfly/server/internal/nbtconv.ReadItem(0xccd125?, 0x0?)
        C:/Users/Andreas/go/pkg/mod/github.com/df-mc/dragonfly@v0.5.2-0.20220322202505-784c1216beda/server/internal/nbtconv/read.go:20 +0xe5
github.com/df-mc/dragonfly/server/player/playerdb.decodeItem({0xc003760c00, 0x1f9, 0x1fb})
        C:/Users/Andreas/go/pkg/mod/github.com/df-mc/dragonfly@v0.5.2-0.20220322202505-784c1216beda/server/player/playerdb/inventory.go:71 +0x172
github.com/df-mc/dragonfly/server/player/playerdb.dataToInv({{0xc003932480, 0x7, 0x9}, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, {0x0, ...}, ...})
        C:/Users/Andreas/go/pkg/mod/github.com/df-mc/dragonfly@v0.5.2-0.20220322202505-784c1216beda/server/player/playerdb/inventory.go:40 +0x347
github.com/df-mc/dragonfly/server/player/playerdb.fromJson({{0xc000141920, 0x24}, {0xc000f835a0, 0xa}, {0x40528ac440000000, 0x404c800060000000, 0x4060f00200000000}, {0x0, 0x0, 0x0}, ...})
        C:/Users/Andreas/go/pkg/mod/github.com/df-mc/dragonfly@v0.5.2-0.20220322202505-784c1216beda/server/player/playerdb/json.go:32 +0x138
github.com/df-mc/dragonfly/server/player/playerdb.(*Provider).Load(_, {0x20, 0xf0, 0xe9, 0x9f, 0xae, 0xc5, 0x36, 0x4f, 0xad, ...})
        C:/Users/Andreas/go/pkg/mod/github.com/df-mc/dragonfly@v0.5.2-0.20220322202505-784c1216beda/server/player/playerdb/leveldb.go:57 +0x138
github.com/df-mc/dragonfly/server.(*Server).finaliseConn(0xc00107a000, {0x15577f0, 0xc000b7e000}, {0x155ae18?, 0xc000d75900}, {0x1555710, 0xc0006d85a0}, 0xc000996280?)
        C:/Users/Andreas/go/pkg/mod/github.com/df-mc/dragonfly@v0.5.2-0.20220322202505-784c1216beda/server/server.go:414 +0x268
created by github.com/df-mc/dragonfly/server.(*Server).Listen.func1
        C:/Users/Andreas/go/pkg/mod/github.com/df-mc/dragonfly@v0.5.2-0.20220322202505-784c1216beda/server/server.go:355 +0x3ea
exit status 2

updating to that commit gave me the above error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants