y_master.inc 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /* *
  2. * *
  3. * _____ ______ ______ ____ ______ _ ______ __ ______ ____ _____ *
  4. * / ____| ____| ____| | _ \| ____| | / __ \ \ / / | ____/ __ \| __ \ *
  5. * | (___ | |__ | |__ | |_) | |__ | | | | | \ \ /\ / / | |__ | | | | |__) | *
  6. * \___ \| __| | __| | _ <| __| | | | | | |\ \/ \/ / | __|| | | | _ / *
  7. * ____) | |____| |____ | |_) | |____| |___| |__| | \ /\ / | | | |__| | | \ \ *
  8. * |_____/|______|______| |____/|______|______\____/ \/ \/ |_| \____/|_| \_\ *
  9. * *
  10. * _____ ____ _____ _ _ __ __ ______ _ _ _______ _______ _____ ____ _ _ *
  11. * | __ \ / __ \ / ____| | | | \/ | ____| \ | |__ __|/\|__ __|_ _/ __ \| \ | | *
  12. * | | | | | | | | | | | | \ / | |__ | \| | | | / \ | | | || | | | \| | *
  13. * | | | | | | | | | | | | |\/| | __| | . ` | | | / /\ \ | | | || | | | . ` | *
  14. * | |__| | |__| | |____| |__| | | | | |____| |\ | | |/ ____ \| | _| || |__| | |\ | *
  15. * |_____/ \____/ \_____|\____/|_| |_|______|_| \_| |_/_/ \_\_| |_____\____/|_| \_| *
  16. * *
  17. * This is required for technical reasons - to place it after `#endinput` to not generate *
  18. * multiple copies of it in XML when compiling with `-r`. *
  19. * *
  20. *//*
  21. Legal:
  22. Version: MPL 1.1
  23. The contents of this file are subject to the Mozilla Public License Version
  24. 1.1 the "License"; you may not use this file except in compliance with
  25. the License. You may obtain a copy of the License at
  26. http://www.mozilla.org/MPL/
  27. Software distributed under the License is distributed on an "AS IS" basis,
  28. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  29. for the specific language governing rights and limitations under the
  30. License.
  31. The Original Code is the YSI framework.
  32. The Initial Developer of the Original Code is Alex "Y_Less" Cole.
  33. Portions created by the Initial Developer are Copyright C 2011
  34. the Initial Developer. All Rights Reserved.
  35. Contributors:
  36. Y_Less
  37. koolk
  38. JoeBullet/Google63
  39. g_aSlice/Slice
  40. Misiur
  41. samphunter
  42. tianmeta
  43. maddinat0r
  44. spacemud
  45. Crayder
  46. Dayvison
  47. Ahmad45123
  48. Zeex
  49. irinel1996
  50. Yiin-
  51. Chaprnks
  52. Konstantinos
  53. Masterchen09
  54. Southclaws
  55. PatchwerkQWER
  56. m0k1
  57. paulommu
  58. udan111
  59. Thanks:
  60. JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
  61. ZeeX - Very productive conversations.
  62. koolk - IsPlayerinAreaEx code.
  63. TheAlpha - Danish translation.
  64. breadfish - German translation.
  65. Fireburn - Dutch translation.
  66. yom - French translation.
  67. 50p - Polish translation.
  68. Zamaroht - Spanish translation.
  69. Los - Portuguese translation.
  70. Dracoblue, sintax, mabako, Xtreme, other coders - Producing other modes for
  71. me to strive to better.
  72. Pixels^ - Running XScripters where the idea was born.
  73. Matite - Pestering me to release it and using it.
  74. Very special thanks to:
  75. Thiadmer - PAWN, whose limits continue to amaze me!
  76. Kye/Kalcor - SA:MP.
  77. SA:MP Team past, present and future - SA:MP.
  78. Optional plugins:
  79. Gamer_Z - GPS.
  80. Incognito - Streamer.
  81. Me - sscanf2, fixes2, Whirlpool.
  82. */
  83. #if defined _inc_y_master
  84. #undef _inc_y_master
  85. #endif
  86. #if !defined _Y_MASTER_INCLUDED
  87. #tryinclude "y_master\y_master_entry"
  88. #endif
  89. #if !defined _Y_MASTER_INCLUDED
  90. #tryinclude "YSI_Core\y_master\y_master_entry"
  91. #endif
  92. #if !defined _Y_MASTER_INCLUDED
  93. #tryinclude "YSI\YSI_Core\y_master\y_master_entry"
  94. #endif
  95. #if !defined _Y_MASTER_INCLUDED
  96. #tryinclude <YSI_Core\y_master\y_master_entry>
  97. #endif
  98. #if !defined _Y_MASTER_INCLUDED
  99. #tryinclude <YSI\YSI_Core\y_master\y_master_entry>
  100. #endif
  101. #if defined _Y_MASTER_INCLUDED
  102. #undef _Y_MASTER_INCLUDED
  103. #else
  104. #error Did you use `YSI/y_master` instead of `YSI\y_master`?
  105. #endif
  106. /**
  107. * <library name="y_master">
  108. * <section>
  109. * Description
  110. * </section>
  111. * Handles distribution of control of code segments across all running scripts
  112. * with YSI to avoid conflicts of checkpoint streamers etc and allow features
  113. * like "/commands" displaying all commands on the server.
  114. *
  115. * Now fully autonomous - to use the master system simply define which one you
  116. * want and include the script:
  117. *
  118. * <c>
  119. * #define MASTER 14
  120. * #include "Master"
  121. * </c>
  122. *
  123. * That will make the current script attempt to make itself the main master -
  124. * you don't need ANY other code for initialisation anywhere (which took a
  125. * while to figure out)...
  126. *
  127. * This is now over 2000 lines of repetitive and complex macros!
  128. * <section>
  129. * Version
  130. * </section>
  131. * 0.2
  132. * <section>
  133. * Macros
  134. * </section><ul>
  135. * <symbol name="RF">Declare a function which may be remote.</symbol>
  136. * <symbol name="RV">Declare a void function which may be remote.</symbol>
  137. * <symbol name="RS">Declare an optional callback.</symbol>
  138. * <symbol name="RFN">Declare an optional callback with no parameters.</symbol>
  139. * <symbol name="RFC">Declare a slower but shorter function.</symbol>
  140. * <symbol name="RFP">Declare a function with tags and give recall hints.</symbol>
  141. * <symbol name="RFPC">Combination of P and C.</symbol>
  142. * <symbol name="RFCP">Combination of P and C.</symbol>
  143. * </ul><section>
  144. * Variables
  145. * </section>
  146. * <subsection>
  147. * Global
  148. * </subsection><ul>
  149. * <symbol name="@_">ID of this script.</symbol>
  150. * </ul><section>Compile options</section><ul>
  151. * <symbol name="YSI_NO_MASTER">Don't use the master system.</symbol>
  152. * <symbol name="YSI_IS_CLIENT">Script is a client only script.</symbol>
  153. * <symbol name="YSI_IS_SERVER">Script is a server only script.</symbol>
  154. * </ul>
  155. * </library>
  156. *//** */