EssentialsX

EssentialsX

2M Downloads

Essentials Discord inaccurate online count on quit messages

TheCyberQuake opened this issue ยท 0 comments

commented

Type of bug

Other unexpected behaviour

/ess dump all output

https://essentialsx.net/dump.html?id=2a1864422be1498996bfd9c4f861c20d

Error log (if applicable)

No response

Bug description

Looks like something that was changed since 2.19.7 is causing join/leave messages sent to discord via EssentialsDiscord to have an incorrect player count when using the {online} variable. Seems like when users join the correct amount is displayed, but leaving in particular doesn't go down in count properly.
So when a user joins, if there are 3 people on including themselves, the {online} variable when sent to discord will show 3. When one of those users leave, the quit message will still fill that {online} variable with 3 even though there are only two people on, and when another person leaves the quit message will show that 2 people are on even though one person is on. And when that final person leaves, the message now shows 1 person online

Basically, it seems quit messages lags behind for online player count by 1, while the join messages are always accurate. It seems likely that the online count isn't counting the fact that one player is leaving, or it's not being updated by whatever is listening for that event fast enough to happen before the message is being sent out.

Steps to reproduce

  1. Have any number of people join the server with discord join/quit messages enabled and using {online} variable in the message
  2. have any number of people quit
  3. user count in those quit messages won't properly reflect actual number of online users.

Expected behaviour

Count for online players in quit messages

Actual behaviour

Count for online players in discord messages shows player count that is 1 higher than it should be.