EssentialsX

EssentialsX

2M Downloads

command-cooldown-persistence doesn't work.

andrewkm opened this issue ยท 9 comments

commented

command-cooldown-persistence: true

Simply doesn't work.
This is an example of how userdata looks:

  command-cooldowns:
  - pattern: repair( .*)?
    expiry: 1525095799134

On login, you can use a command which should be on a cooldown, and it just goes through and resets the above unix time to a new one. The cooldown works fine while the server is turned on, and obeys the expiry timestamp, however once a restart goes through, everyones cooldowns work again, and expiry isn't followed.

commented

Could you give us the full output of /ess version as requested in the issue template?

commented

First I remember hearing about this but thanks for the heads up.

commented

Some logs I've put in for debug:

[17:19:49] [Server thread/INFO]: xWILLISxFREAKx0 issued server command: /repair
[17:19:49] [Server thread/INFO]: [Essentials] Checking player xWILLISxFREAKx0's cooldowns on commands.
[17:19:49] [Server thread/INFO]: [Essentials] CommandCooldowns Map size: 0
[17:19:49] [Server thread/INFO]: [Essentials] checking if xWILLISxFREAKx0 has essentials.commandcooldowns.bypass - false
[17:19:49] [Server thread/INFO]: [Essentials] Command: repair /repair
[17:19:49] [Server thread/INFO]: [Essentials] Cooldown was not found.

Basically what this is showing is that the first time a player executes the command that is listed in cooldown in their userfile, it ignores it - the cooldown map is empty, therefore it has no cooldowns.

You can therefore see that the map is not being updated properly on player login after server start.
@md678685

commented

Then, re-doing the command after it fails:
[17:19:50] [Server thread/INFO]: xWILLISxFREAKx0 issued server command: /repair
[17:19:50] [Server thread/INFO]: [Essentials] Checking player xWILLISxFREAKx0's cooldowns on commands.
[17:19:50] [Server thread/INFO]: [Essentials] CommandCooldowns Map size: 1
[17:19:50] [Server thread/INFO]: [Essentials] checking if xWILLISxFREAKx0 has essentials.commandcooldowns.bypass - false

commented

@JamieSinn Thanks for looking into this. I'm assuming this means the map isn't loaded properly when it should have been - I don't remember whether this is the job of the PlayerLoginEvent listener or UserData.

commented

Currently it's done by UserData, but it should be done in PlayerLoginListener

commented

@andrewkm Please don't bump threads. I will update threads when I have something to add.

commented

@andrewkm Is this still an issue?

commented

Iโ€™ve fixed it long ago.
Was going over my old tickets on github.
It is however broken on EssentialsX though.