I'm currently working on a plugin where I need to know who has passed a checkpoint first in rounds mode. I thought I could just rely on the order of the 'onCheckpoint' events that I receive. So the first time executing the registered method will contain the informations about the player who crossed the cp first. But I had the feeling that this does not seem to be true so I logged the events in rounds mode and indeed it has revealed sth differently:
Code: Select all
[cpId, login, time on cp in thousandths of a second] [04/15,00:31:27] 0 stampertjeiscool 3950 [04/15,00:31:27] 0 vale07 3960 [04/15,00:31:27] 0 imjustgonnarace__p 3960 [04/15,00:31:27] 0 crookza 4000 [04/15,00:31:27] 0 cool_thing 3960 [04/15,00:32:50] 0 imjustgonnarace__p 3960 [04/15,00:32:50] 0 vale07 3960 [04/15,00:32:50] 0 crookza 3980 [04/15,00:32:51] 0 cool_thing 3950 [04/15,00:32:51] 0 stampertjeiscool 4030
As a workaround I first thought I could store the informations from the events and do some time-based sorting on it manually. But how do I then know when I finally received the event of the fastest time? You could argue you can just wait until all have passed the cp, but what if one guy will cross the cp 3 seconds after all others? That wouldn't be a very responsive solution anymore. One idea that popped into my mind was to introduce some time interval when the first event was fired and after that interval I just output the fastest time that I received until then. But this seems to be more of a hack than anything else since I do not know the correct interval to set, either and I have no idea yet how to actually implement such a custom interval with a coupled custom event fired
Do you have any ideas or encountered already a similar problem in the past?
Thanks for your help