22.11.2014, 00:24
(
Последний раз редактировалось Ygzeb; 30.12.2014 в 18:10.
)
NEW TIMER BUG
I am creating this thread to warn server owners that there is a timer bug that creates an infinite timer (or even more timers) that can not be killed. This bug only affects if a timer is repeated; if your timer only works once you do not to worry about it.I know this is an old bug (I called this thread "New Timer Bug" because few people know about it, as I saw it in some servers...), bugging and lagging their own servers.
It is a programming mistake; you can call it a bug, error, whatever; I call it a bug
It consists in creating a timer with SetTimerEx and calling it twice without killing it. This will create an infinite timer that can be killed just with restarting the server.
This can be dangerous in some cases (specially in big servers), as it produces bugs, lag, player crash, server crash, etc.
If this thread is not clear you can try this code; just type /Timer twice, then try to kill it with /Killer and you will see the result:
Pastebin
How to prevent this? Easy, just kill the timer before creating a new one; for example:
pawn Код:
KillTimer(Connect[playerid]);
Connect[playerid] = SetTimerEx("Test", 1000, true, "i", playerid);