WiIIiam278 / HuskSync

A modern, cross-server player data synchronisation system
https://william278.net/project/husksync
Apache License 2.0
169 stars 130 forks source link

Attribute key changes causing duplication stacking on 1.21 #326

Closed Skensian closed 3 months ago

Skensian commented 3 months ago

Hi, I'm running HuskSync on two Paper 1.21 servers behind a Velocity proxy. I invited my friend to help me stress test it and we found a bug with player attributes.

When a player is in the middle of an action that increases an attribute and leaves the world (tested via entering the secondary server, performing the action, and disconnecting) the attribute saves as the elevated state. (such as running increasing the player's base speed from ~0.1 to ~0.13) When the player rejoins that attribute stays elevated. (walking speed now is ~0.13 and run speed is now ~0.16)

We tested this with several attributes and got results with Movement Speed, Attack Speed, Armor Value, and Base Damage. There are probably more, but my friend is enjoying one-shotting me and bringing his stats to excessive levels

Below are some values of the player who is testing, as well as the latest save of the players stats.

[15:36:03] [Render thread/INFO]: [System] [CHAT] Value of attribute Attack Speed for entity Wierdslo is 0.0
[15:36:12] [Render thread/INFO]: [System] [CHAT] Value of attribute Armor for entity Wierdslo is 30.0
[15:36:16] [Render thread/INFO]: [System] [CHAT] Value of attribute Armor Toughness for entity Wierdslo is 20.0
[15:36:30] [Render thread/INFO]: [System] [CHAT] Value of attribute Knockback Resistance for entity Wierdslo is 1.0
[15:36:42] [Render thread/INFO]: [System] [CHAT] Value of attribute Speed for entity Wierdslo is 0.1820000051558018

Wierdslo_2024-06-19_15-35-40_world_save_f1fde586.json

WiIIiam278 commented 3 months ago

@Skensian Hi there, would you mind trying on the latest commit? Get in touch on Discord w/ proof of purchase and I can give this to you, or self-build. Note this build won't remove existing attributes but it should stop this happening further.

BAD7777 commented 3 months ago

The problem has not been solved. On this version, there is an error that I mentioned in #327 p.s. He writes to contact the administrator and no synchronization is carried out in general. I had to disable attribute in order for the plugin to work completely

WiIIiam278 commented 3 months ago

Please join our Discord for support.