Waystones (Fabric Edition)

Waystones (Fabric Edition)

3M Downloads

Waystone name/activation desync on rename

Laike-Endaril opened this issue ยท 5 comments

commented

In multiplayer, if a player renames a waystone, any other players who have previously activated that waystone see the following effects:

Edited name and went from non-global to non-global...

  1. The waystone visually appears unactivated
  2. The waystone still appears on the teleport list, but with its old name
  3. Right clicking or teleporting to the waystone fixes it

Edited name and went from non-global to global...

  1. The waystone appears on the list twice, once under each name. One entry is global (yellow) and the other is non-global (white)...

...started noticing stranger issues as I continued tests; decided to stop testing and start looking at code.

I will start looking into this and possibly add a PR for it.

commented

Possibly related to #122
Possibly related to #150

commented

Began working on this and was able to alter the behavior, but need to know your preference on some things in order to finish this @blay09

Regarding changing waystones from global -> non-global or non-global -> global...

Situation A: Let's say a waystone starts global and someone changes it to non-global. Which of these should occur?

  1. The waystone is only activated for the editor (removes all other players' access to the waystone)
  2. The waystone is activated for all server members up to that point (somewhat removes the point of making it non-global?)
  3. The waystone is activated only for members who have activated/used it previously (if they never went to it while it was global, they may feel cheated)

Situation B: Next, we have a non-global waystone and 5/15 server members have it activated. Someone makes it global, then makes it non-global again. What should happen?

  1. The waystone is only activated for the editor (effectively allows editors to remove other members' access)
  2. The waystone is activated for all server members up to that point
  3. The waystone is activated only for members who have activated/used it previously

I'm unsure what approach would be best, or if there is an alternative I haven't thought of. Please leave me your thoughts when you get a chance.

commented

Global Waystones are locked to OPs in creative mode (usually set up by server administrators or map makers), so I don't really see the use case for special handling regarding switching from global to non-global or back.

Since things like the activated waystone name are redundantly stored in the player data currently, desyncs are hard to avoid in general, since the rename can only immediately notify players that are online at that moment.

The best solution might be to move to only storing UIDs in the player data, and keeping track of all waystones separately in world data. That way, the waystones list would be accurate 100% of the time and woud even allow for silk-touching waystones to move them. Since this change would either break existing worlds or require conversion code, I think it's best suited to be looked at for the 1.13 port.

If you manage to reproduce #122 or #150, it would be interesting to have a look at the global waystones nbt in the world data, as well as the player data to see what might have gone wrong.

commented

I was concerned about the config option which allows all players to change waystones' "globality", but for now I won't worry about the global -> non-global situations. Mostly because I honestly can't think of a good way to handle them gameplay-wise, to make sure it's not exploitable in some way.

I honestly hadn't considered offline player sync. I suppose it could still be fixed by loading up all player files and editing their tags, but at that point it would be much better to completely change their storage method as you said. Maybe I'll just wait until the 1.13 port is released.

I still haven't actually reproduced #122 or #150; they just seem like they both stem from some form of desync. If I reproduce either one I'll be sure to post all info in their respective threads.

Thanks for the response, and gl on the 1.13 ports!

commented

The rewrite for Minecraft 1.14 should hopefully fix this issue, but due to the large amount of changes it unfortunately won't be backported to 1.12.