* sstimer no longer delays maintenance tasks if its going over its tick.
This was leading to bugs if certain state operations happened while a task was delayed, furthermore if the timer subsystem was overloaded, the invoked timers list would bloat as it would never get cleared out, which would make all timer invocations take longer as they had to add to an ever growing list.
* Update timer.dm
* Fix error when a bucket has only one timer.
* simply timer loop logic & improve timer debug string
It would try to batch up linked list modifications and every issue we have ever had has been related to this, so now it just directly pulls the head of the linked list off, using bucketEject, rather then detect when it reaches the end of the linked list queue it will now just know because the bucket will be empty.
All bucketCount logic has been moved to bucketEject and bucketJoin(), which should also keep that more proper.
* Update timer.dm
* Update timer.dm
BINARY_INSERT used to only take typepaths like/this. Now, it expects them to be /like/this, to be more consistent with ther est of the code.
Adds documentation to COMPTYPE.
Adds a test for BINARY_INSERT.
A lot of issues happen when the tick overruns due to less important and more expensive subsystems. If timer is not ran or breaks, a lot of stuff breaks.
Makes use of the do while(FALSE) trick to give it its own context and makes it possible for the inserted value to be different from the compared value so #48747 can use it.
Before we only warned if the wait was 1 or higher to solve issues with objects settings timers on themselves while getting qdeleted, a common enough usecase to support (even if it is annoying), but then I remembered we could check for qdestroying directly.
Also fixes it so such `destory()` time timers actually run consistantly. before they would only work if called after the `..()` in `destroy()`
Because sstimer tracks timers internally in the terms of what "byond tick" they are suppose to run at; float wait values are now rounded *up* to the next Byond Tick rather then have byond round the resulting list index *down* at access time.
0 wait timers are now rounded *up* to `world.tick_lag` to avoid incompabilities with editing the current tick's bucket while it was being processed.
* Timer queuing tweaks: binary sorted inserts and rolling buckets.
Client time timers now uses a binary search algorithm for its sorted inserts.
Processing now uses a binary sorted insert, rather then sorting it with sortTim during bucket_shifts.
Buckets now automatically wrap around rather then get regenerated every minute. (Rolling queue)
* Fixes some queue management bugs.
* Fixes a Order of Operations goof up in the ticks<->ds macros.
@ninjanomnom your pain is my success
* Remove debug line
* Fixes some binary insert bugs, fixes client time timers, moved id over to GUID
* Fixes initialization-time timers fucking everything up
* More timer debugging for the debug gods.
* Its times like this I wish I could amend commit from the web interface
* git commit -a -amend&&git push --force
The list of active timers timer_id_dict identifies timers by their numerical id as a string. However this was done using embedded expressions inside the string, which calls num2text with a default of 6 significant figures. This means anything at or above 1 million is expressed in scientific notation.
"timer[1000000]" -> "timer1e+06"
"timer[1000001]" -> "timer1e+06"
Calling num2text manually with 8 significant figures kicks the collision problem down the road to 2^24 (16 million).
nextid is now selectively incremented and is looped back to 1 when reaching the 2^24 threshold.
Also now includes collision checking.