Closed SlimeDog closed 6 years ago
Weird stuff, looking into when I come back from work
Yeah. The between timers should be started after completion of the current execution.
Okay, I see where the problem stands. But it has probably been there for a very long time (before 1.6.3). I'm still not sure if I try to fix this tonight or tomorrow. I've had a very long day and I am not sure if my brain is properly working x)
There is no hurry (for me); I config'd around it for now. As I said, I have no idea when it was introduced, and I didn't think it was worth the effort to isolate that, unless you couldn't find the problem. It looks like you did. So... sleep and fix it when brain is working properly. :)
:sleeping:
Yeah sorry, working on it but it has more implication that it first looked to. Got delayed because got ill last week.
No worries. Just a gentle nudge. Hope you're feeling better. :)
I think the update is done. I put it on my own server to make sure it is stable. If it is stable, I'll upload it on spigot.
Looking forward to it. Let me know if you want me to test.
I uploaded it here https://github.com/Nokorbis/ar-command-signs/releases/tag/v1.6.5 If you want to test it. If anything's wrong, tell me it here and put the v1.6.3 version back on your server and it should be fine.
Tested 1.6.5. It seems stable, but the scenario described above still fails.
Then I'm not sure what you want, this is actually the way I want it to be. In that example, You see that I define a command and put it with a wait time of 5 seconds, because I want the player to wait five 5 seconds once he clicked on the sign before the command is executed. Then, there is a between usage ("cooldown") of 4 seconds because I want the player to be unable to use that sign right away. (and thus, 4 seconds between each execution) Wasn't it what you wanted ?
My previous configuration:
"time_before_execution": 4,
"move_cancel_timer": false,
"move_reset_timer": false,
"global_time_between_usages": 5,
"player_time_between_usages": 5
I want command execution to be delayed 4 seconds (time_before_execution). I want the player to be unable to execute it for 5 seconds (player_time_between_usages), and I want no one else to be able to execute it for 5 seconds (global_time_between_usages). That configuration did what I wanted/expected until 1.6.x (I didn't test every new version, but it certainly failed to do so at 1.6.3). The problem appears to be that the delay prevents the command from executing at all. If I change the "between_usages" timers to 3, everything works, so that's how I configure it now. But it appears that the "between_usages" timers are started when the sign is executed, rather than after the (delayed) command execution.
I can live with it the way it is now, but that isn't what I expected, and it changed at some point.
Okay, there was something strange with what you told me because it's seemed weird, so I read the full process again, and I might have understood what's wrong. I've also seen a part that I forgot about (2.vi in the following list).
(Actually, while writing what's following, I did see what's wrong, which is of course linked to what I forgot about at point 2.vi)(I still write the full process since it might interest someone of it works someday)
So, here is the full process of an execution :
Funny how I now see how my code has evolded with the years :D
Thanks for sharing the algorithm.
Perhaps (7) is the step that is causing the issue.
I would also suggest that (2) is unnecessary, since it does't matter if the player has the permissions at that point, only after the timer has run. (And since the timer is usually 0, (2) and (5) usually occur in immediate sequence, so (2) is even less necessary.)
Sorry for the long wait. I've been moving in to a new place and was difficult to find time even for simple things. This version should fix your problem : https://github.com/Nokorbis/ar-command-signs/releases/download/v1.6.6/Spigot-CommandSigns.jar
Thank you. 1.6.6 works as expected. Much appreciated.
Spigot 1.12.2 CommandSigns 1.6.3
Timer implementation seems to have changed sometime in the last few versions (this is a test server, so I didn't notice immediately; apologies).
This code used to work:
Note the timer settings. In CS 1.6.3 I get two in-game messages, one expected:
and one not:
Changing
makes everything work, but this doesn't seem right, somehow. The _betweenusages timers are blocking the current execution.