y_timers.inc 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /**--------------------------------------------------------------------------**\
  2. ====================================
  3. y_timers - Run timers efficiently.
  4. ====================================
  5. Description:
  6. Sets up repeating timers without requiring any SetTimers and arranges them
  7. so that they will be very unlikely to meet (at least for a long time) using
  8. scheduling algorithms to get timers with the same period to be offset. Also
  9. fixes arrays and strings in timers so they can be passed properly.
  10. Legal:
  11. Version: MPL 1.1
  12. The contents of this file are subject to the Mozilla Public License Version
  13. 1.1 (the "License"); you may not use this file except in compliance with
  14. the License. You may obtain a copy of the License at
  15. http://www.mozilla.org/MPL/
  16. Software distributed under the License is distributed on an "AS IS" basis,
  17. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  18. for the specific language governing rights and limitations under the
  19. License.
  20. The Original Code is the YSI timers include.
  21. The Initial Developer of the Original Code is Alex "Y_Less" Cole.
  22. Portions created by the Initial Developer are Copyright (C) 2011
  23. the Initial Developer. All Rights Reserved.
  24. Contributors:
  25. ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
  26. Thanks:
  27. JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
  28. ZeeX - Very productive conversations.
  29. koolk - IsPlayerinAreaEx code.
  30. TheAlpha - Danish translation.
  31. breadfish - German translation.
  32. Fireburn - Dutch translation.
  33. yom - French translation.
  34. 50p - Polish translation.
  35. Zamaroht - Spanish translation.
  36. Dracoblue, sintax, mabako, Xtreme, other coders - Producing other modes
  37. for me to strive to better.
  38. Pixels^ - Running XScripters where the idea was born.
  39. Matite - Pestering me to release it and using it.
  40. Very special thanks to:
  41. Thiadmer - PAWN, whose limits continue to amaze me!
  42. Kye/Kalcor - SA:MP.
  43. SA:MP Team past, present and future - SA:MP.
  44. Version:
  45. 2.0
  46. Changelog:
  47. 29/04/11:
  48. Added version 2 of the code with more advanced options.
  49. 21/03/11:
  50. Added debug printing to timer functions. Uses "P:C" in compiling.
  51. 26/10/10:
  52. Officially added simple calling.
  53. Added "delay" functions.
  54. 12/10/10:
  55. Rewrote for YSI 1.0 using y_scripting.
  56. 11/08/07:
  57. Removed millions of defines to reduce pre-processing.
  58. Added pickups.
  59. 03/08/07:
  60. First version.
  61. </remarks>
  62. \**--------------------------------------------------------------------------**/
  63. // y_uvars
  64. #if defined USE_Y_TIMERS_V1
  65. #error y_timers version 1 has not worked in years!
  66. #include "y_timers/v1"
  67. #endinput
  68. #endif
  69. #include "internal\y_plugins"
  70. #include "y_timers/impl"
  71. #if defined _YSI_PLUGINS_FIXES_2
  72. //#error V3
  73. #include "y_timers/v3"
  74. #else
  75. #include "y_timers/v2"
  76. #endif
  77. #if defined YSI_TESTS
  78. #include "y_testing"
  79. #include "y_timers/tests"
  80. #endif