WorldGuard

WorldGuard

8M Downloads

notify-enter and notify-leave flags behave unexpectedly

totemo opened this issue ยท 4 comments

commented

WorldEdit Version

7.2.12

WorldGuard Version

7.0.7, 7.1.0-SNAPSHOT

Platform Version

git-Paper-270

Confirmations

  • I am using the most recent Minecraft release.
  • I am using a version of WorldEdit compatible with my Minecraft version.
  • I am using a version of WorldGuard compatible with my Minecraft version.
  • I am using the latest or recommended version of my platform software.
  • I am NOT using a hybrid server, e.g. a server that combines Bukkit and Forge. Examples include Arclight, Mohist, and Cardboard.
  • I am NOT using a fork of WorldEdit, such as FastAsyncWorldEdit (FAWE) or AsyncWorldEdit (AWE)

Bug Description

Two seemingly related problems:

  1. In WG 7.1.0-SNAPSHOT, players generate the "WG: playername left NOTIFY region" on logout, irrespective of the state of the notify-leave flag in any applicable regions.
  2. In WG 7.0.7, setting notify-enter false or notify-leave false causes WG to issue enter and leave notifications from the region as if those flags were set to true. To suppress those notifications, the flag must be unset. This is counter-intuitive.

Examination of the WG source code for NotifyEntryFlag.onSetValue() reveals that the method appears to always broadcast a notification, irrespective of the Boolean currentValue parameter to the method. I would say that is consistent with the observed problematic behaviour that the value of the flag is ignored.

Expected Behavior

I expect that:

  1. In the snapshot, if the notify-leave flag is not set, then the "WG: playername left NOTIFY region" notification would be silenced.
  2. In all WG versions, I expect that setting notify-enter false would silence region entry notifications, and setting notify-leave false would silence region leave notifications.

Reproduction Steps

  1. For the snapshot: give yourself the worldguard.notify permission and get a friend to log in and log out. The __global__ region is sufficient to test this and the notify-enter and notify-leave flags can be left unset.
  2. For the latest release: create a region, set notify-enter false, and enter the region with the worldguard.notify permission node. You will see the entry notification message.

Optional WorldGuard-Report

No response

Anything Else?

Since upgrading all the way to the snapshot was a mistake, we'll go down to the latest release and since no notify-enter or notify-leave flags are set, that should be the end of the problem. About to find out when the server restarts in 40 minutes.

commented

Downgrading to the latest release does indeed silence the WG: playername left NOTIFY region (from the snapshot) message on player log-out.

And confirming again that the notify-enter false flag still generates an unexpected notification when entering the region, even with the WG 7.0.7 release.

commented

everything works as expected

commented

We don't want to change the current behavior because it's a breaking change. Some people might have set the flag to false and want to get notification messages.

And changing anything is not needed, just unset the flag.

For 7.1.0-Snapshot: that version is not stable and shouldn't be used in a productive environment.

commented

@wizjany Why is this expected?

Why are the values of these boolean flags ignored?

Why aren't these flags state valued, like almost all regions flags except for these flags and only one other?

The documentation says:

  • notify-enter | boolean | Whether players with the worldguard.notify permission are notified when another player enters the region
  • notify-leave | boolean | Whether players with the worldguard.notify permission are notified when another player leaves the region

The implication from the use of the word "whether" is strongly that if the boolean is false, then players should not be notified.

I was hoping for a more reflective response from you that asks these questions, and asks whether the behaviour can be improved.