WorldGuard

WorldGuard

8M Downloads

Time-lock flag does not set when logging into the region.

LadyCailinBot opened this issue ยท 8 comments

commented

WORLDGUARD-3893 - Reported by mibby

WorldGuard 6.2.2 dev 1709
Paper dev 1238 (Spigot 1.12.2)

If you log into the server inside a region that has a time-lock flag set, the time does not get sent to your client. Instead you get the time of the current world. Leaving and re-entering the region, the correct time-lock time applies to the client.


use-player-move-event: true
use-player-teleports: true

    spawn:
        min: {x: -216.0, y: 0.0, z: -166.0}
        max: {x: 252.0, y: 255.0, z: 179.0}
        members: {}
        flags:
            time-lock: '62500'
        owners: {}
        type: cuboid
        priority: 1

I did set the gamerule doDaylightCycle false in the world because seeing the sky constantly move and flicker back a few ticks was obnoxious. The region has the time set to night while the rest of the world has a time frozen at day.

Is the player login not providing worldguard a teleport event when logging into the region perhaps?

commented

Comment by mibby

Seems to be similar. I have not tested whether the first connection to the server inside the region since restart sets time appropriately but I have relogged frequently while inside the same region throughout the day with the server still up - to have the time-lock not set on me logging into the region at times.

Is there no workaround to this issue to always force a time check / set on login?

commented

Comment by wizjany

possibly try running /wg flushstates on player login.

commented

Comment by mibby

Having to force a command for every single person that logs in when they may not login to that region seems like a terrible solution. :(

commented

Comment by wizjany

we'd be doing the exact same thing programmatically by discarding sessions when players log in.

feel free to come up with a better solution.

commented

Comment by mibby

Why not have it discard the player session when they disconnect then automatically?

commented

Comment by wizjany

because the entire point is to persist those things.
honestly, you're welcome to maintain your own fork of WG. stop telling me what to do though.

commented

Comment by mibby

You asked me to come up with a better solution, that's what I came up with... If you didn't want me to say anything, shouldn't have asked.

Having a config option to force sessions to be discarded on logout rather than keep it persisted would resolve this issue. Or alternatively actually have it resend the region time when logging into a region since the actual intended function of the flag is to set a forced time. It is clearly not functioning as intended when you can login with the world time rather than the set region time.

commented

Comment by wizjany

same as WORLDGUARD-3616? i tested pretty extensively for that one.