y_masterresolve.inc 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. /*----------------------------------------------------------------------------*\
  2. =================================
  3. y_masterresolve - Settings.
  4. =================================
  5. Description:
  6. Determine how the master system has been included; client, server, etc.
  7. Legal:
  8. Version: MPL 1.1
  9. The contents of this file are subject to the Mozilla Public License Version
  10. 1.1 (the "License"); you may not use this file except in compliance with
  11. the License. You may obtain a copy of the License at
  12. http://www.mozilla.org/MPL/
  13. Software distributed under the License is distributed on an "AS IS" basis,
  14. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  15. for the specific language governing rights and limitations under the
  16. License.
  17. The Original Code is the YSI utils include.
  18. The Initial Developer of the Original Code is Alex "Y_Less" Cole.
  19. Portions created by the Initial Developer are Copyright (C) 2011
  20. the Initial Developer. All Rights Reserved.
  21. Contributors:
  22. ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
  23. Thanks:
  24. JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
  25. ZeeX - Very productive conversations.
  26. koolk - IsPlayerinAreaEx code.
  27. TheAlpha - Danish translation.
  28. breadfish - German translation.
  29. Fireburn - Dutch translation.
  30. yom - French translation.
  31. 50p - Polish translation.
  32. Zamaroht - Spanish translation.
  33. Dracoblue, sintax, mabako, Xtreme, other coders - Producing other modes
  34. for me to strive to better.
  35. Pixels^ - Running XScripters where the idea was born.
  36. Matite - Pestering me to release it and using it.
  37. Very special thanks to:
  38. Thiadmer - PAWN, whose limits continue to amaze me!
  39. Kye/Kalcor - SA:MP.
  40. SA:MP Team past, present and future - SA:MP.
  41. Version:
  42. 0.1
  43. Changelog:
  44. 25/02/12:
  45. First version.
  46. Functions:
  47. Stock:
  48. -
  49. Inline:
  50. -
  51. Variables:
  52. Global:
  53. -
  54. \*----------------------------------------------------------------------------*/
  55. #undef _inc_y_masterresolve
  56. #if (!defined YSI_NO_MASTER || defined YSIM_T_ENABLE) && !defined YSIM_T_DISABLE
  57. #define YSIM_HAS_MASTER 1
  58. #else
  59. #define YSIM_HAS_MASTER 0
  60. #endif
  61. #if (defined YSI_IS_CLIENT || defined YSIM_C_ENABLE) && !defined YSIM_C_DISABLE
  62. #define _YSIM_IS_CLIENT 1
  63. #else
  64. #define _YSIM_IS_CLIENT 0
  65. #endif
  66. #if (defined YSI_IS_SERVER || defined YSIM_S_ENABLE) && !defined YSIM_S_DISABLE
  67. #define _YSIM_IS_SERVER 1
  68. #else
  69. #define _YSIM_IS_SERVER 0
  70. #endif
  71. #if (defined YSI_IS_STUB || defined YSIM_U_ENABLE) && !defined YSIM_U_DISABLE
  72. #define _YSIM_IS_STUB 1
  73. #else
  74. #define _YSIM_IS_STUB 0
  75. #endif
  76. // Can't be "stub", "client", or "server" if there's no master.
  77. #if !YSIM_HAS_MASTER && _YSIM_IS_CLIENT
  78. #undef _YSIM_IS_CLIENT
  79. #define _YSIM_IS_CLIENT 0
  80. #endif
  81. #if !YSIM_HAS_MASTER && _YSIM_IS_SERVER
  82. #undef _YSIM_IS_SERVER
  83. #define _YSIM_IS_SERVER 0
  84. #endif
  85. #if !YSIM_HAS_MASTER && _YSIM_IS_STUB
  86. #undef _YSIM_IS_STUB
  87. #define _YSIM_IS_STUB 0
  88. #endif
  89. // Are there any conflicts, determine which is better.
  90. #if _YSIM_IS_CLIENT && _YSIM_IS_SERVER
  91. #if defined YSIM_C_ENABLE
  92. #if defined YSIM_S_ENABLE
  93. // Both on temporary enable.
  94. #error YSIM_C_ENABLE and YSIM_S_ENABLE both defined.
  95. #else
  96. // Client override.
  97. #undef _YSIM_IS_SERVER
  98. #define _YSIM_IS_SERVER 0
  99. #endif
  100. #else
  101. #if defined YSIM_S_ENABLE
  102. // Server override.
  103. #undef _YSIM_IS_CLIENT
  104. #define _YSIM_IS_CLIENT 0
  105. #else
  106. // Neither defined locally.
  107. #if YSI_IS_SERVER > YSI_IS_CLIENT
  108. // Client override.
  109. #undef _YSIM_IS_SERVER
  110. #define _YSIM_IS_SERVER 0
  111. #else
  112. // Server override.
  113. #undef _YSIM_IS_CLIENT
  114. #define _YSIM_IS_CLIENT 0
  115. #endif
  116. #endif
  117. #endif
  118. #endif
  119. // Are there any conflicts, determine which is better.
  120. #if _YSIM_IS_STUB && _YSIM_IS_SERVER
  121. #if defined YSIM_U_ENABLE
  122. #if defined YSIM_S_ENABLE
  123. // Both on temporary enable.
  124. #error YSIM_U_ENABLE and YSIM_S_ENABLE both defined.
  125. #else
  126. // Stub override.
  127. #undef _YSIM_IS_SERVER
  128. #define _YSIM_IS_SERVER 0
  129. #endif
  130. #else
  131. #if defined YSIM_S_ENABLE
  132. // Server override.
  133. #undef _YSIM_IS_STUB
  134. #define _YSIM_IS_STUB 0
  135. #else
  136. // Neither defined locally.
  137. #if YSI_IS_SERVER > YSI_IS_STUB
  138. // Stub override.
  139. #undef _YSIM_IS_SERVER
  140. #define _YSIM_IS_SERVER 0
  141. #else
  142. // Server override.
  143. #undef _YSIM_IS_STUB
  144. #define _YSIM_IS_STUB 0
  145. #endif
  146. #endif
  147. #endif
  148. #endif
  149. // Are there any conflicts, determine which is better.
  150. #if _YSIM_IS_STUB && _YSIM_IS_CLIENT
  151. #if defined YSIM_U_ENABLE
  152. #if defined YSIM_C_ENABLE
  153. // Both on temporary enable.
  154. #error YSIM_U_ENABLE and YSIM_C_ENABLE both defined.
  155. #else
  156. // Stub override.
  157. #undef _YSIM_IS_CLIENT
  158. #define _YSIM_IS_CLIENT 0
  159. #endif
  160. #else
  161. #if defined YSIM_C_ENABLE
  162. // Client override.
  163. #undef _YSIM_IS_STUB
  164. #define _YSIM_IS_STUB 0
  165. #else
  166. // Neither defined locally.
  167. #if YSI_IS_CLIENT > YSI_IS_STUB
  168. // Stub override.
  169. #undef _YSIM_IS_CLIENT
  170. #define _YSIM_IS_CLIENT 0
  171. #else
  172. // Client override.
  173. #undef _YSIM_IS_STUB
  174. #define _YSIM_IS_STUB 0
  175. #endif
  176. #endif
  177. #endif
  178. #endif
  179. // Default to cloud.
  180. #if YSIM_HAS_MASTER && !_YSIM_IS_CLIENT && !_YSIM_IS_SERVER && !_YSIM_IS_STUB
  181. #define _YSIM_IS_CLOUD 1
  182. #else
  183. #define _YSIM_IS_CLOUD 0
  184. #endif