_resolve.inc 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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. </remarks>
  55. \**--------------------------------------------------------------------------**/
  56. #undef _inc__resolve
  57. #if (!defined YSI_NO_MASTER || defined YSIM_T_ENABLE) && !defined YSIM_T_DISABLE
  58. #define YSIM_HAS_MASTER 1
  59. #else
  60. #define YSIM_HAS_MASTER 0
  61. #endif
  62. #if (defined YSI_IS_CLIENT || defined YSIM_C_ENABLE) && !defined YSIM_C_DISABLE
  63. #define _YSIM_IS_CLIENT 1
  64. #else
  65. #define _YSIM_IS_CLIENT 0
  66. #endif
  67. #if (defined YSI_IS_SERVER || defined YSIM_S_ENABLE) && !defined YSIM_S_DISABLE
  68. #define _YSIM_IS_SERVER 1
  69. #else
  70. #define _YSIM_IS_SERVER 0
  71. #endif
  72. #if (defined YSI_IS_STUB || defined YSIM_U_ENABLE) && !defined YSIM_U_DISABLE
  73. #define _YSIM_IS_STUB 1
  74. #else
  75. #define _YSIM_IS_STUB 0
  76. #endif
  77. // Can't be "stub", "client", or "server" if there's no master.
  78. #if !YSIM_HAS_MASTER && _YSIM_IS_CLIENT
  79. #undef _YSIM_IS_CLIENT
  80. #define _YSIM_IS_CLIENT 0
  81. #endif
  82. #if !YSIM_HAS_MASTER && _YSIM_IS_SERVER
  83. #undef _YSIM_IS_SERVER
  84. #define _YSIM_IS_SERVER 0
  85. #endif
  86. #if !YSIM_HAS_MASTER && _YSIM_IS_STUB
  87. #undef _YSIM_IS_STUB
  88. #define _YSIM_IS_STUB 0
  89. #endif
  90. // Are there any conflicts, determine which is better.
  91. #if _YSIM_IS_CLIENT && _YSIM_IS_SERVER
  92. #if defined YSIM_C_ENABLE
  93. #if defined YSIM_S_ENABLE
  94. // Both on temporary enable.
  95. #error YSIM_C_ENABLE and YSIM_S_ENABLE both defined.
  96. #else
  97. // Client override.
  98. #undef _YSIM_IS_SERVER
  99. #define _YSIM_IS_SERVER 0
  100. #endif
  101. #else
  102. #if defined YSIM_S_ENABLE
  103. // Server override.
  104. #undef _YSIM_IS_CLIENT
  105. #define _YSIM_IS_CLIENT 0
  106. #else
  107. // Neither defined locally.
  108. #if YSI_IS_SERVER > YSI_IS_CLIENT
  109. // Client override.
  110. #undef _YSIM_IS_SERVER
  111. #define _YSIM_IS_SERVER 0
  112. #else
  113. // Server override.
  114. #undef _YSIM_IS_CLIENT
  115. #define _YSIM_IS_CLIENT 0
  116. #endif
  117. #endif
  118. #endif
  119. #endif
  120. // Are there any conflicts, determine which is better.
  121. #if _YSIM_IS_STUB && _YSIM_IS_SERVER
  122. #if defined YSIM_U_ENABLE
  123. #if defined YSIM_S_ENABLE
  124. // Both on temporary enable.
  125. #error YSIM_U_ENABLE and YSIM_S_ENABLE both defined.
  126. #else
  127. // Stub override.
  128. #undef _YSIM_IS_SERVER
  129. #define _YSIM_IS_SERVER 0
  130. #endif
  131. #else
  132. #if defined YSIM_S_ENABLE
  133. // Server override.
  134. #undef _YSIM_IS_STUB
  135. #define _YSIM_IS_STUB 0
  136. #else
  137. // Neither defined locally.
  138. #if YSI_IS_SERVER > YSI_IS_STUB
  139. // Stub override.
  140. #undef _YSIM_IS_SERVER
  141. #define _YSIM_IS_SERVER 0
  142. #else
  143. // Server override.
  144. #undef _YSIM_IS_STUB
  145. #define _YSIM_IS_STUB 0
  146. #endif
  147. #endif
  148. #endif
  149. #endif
  150. // Are there any conflicts, determine which is better.
  151. #if _YSIM_IS_STUB && _YSIM_IS_CLIENT
  152. #if defined YSIM_U_ENABLE
  153. #if defined YSIM_C_ENABLE
  154. // Both on temporary enable.
  155. #error YSIM_U_ENABLE and YSIM_C_ENABLE both defined.
  156. #else
  157. // Stub override.
  158. #undef _YSIM_IS_CLIENT
  159. #define _YSIM_IS_CLIENT 0
  160. #endif
  161. #else
  162. #if defined YSIM_C_ENABLE
  163. // Client override.
  164. #undef _YSIM_IS_STUB
  165. #define _YSIM_IS_STUB 0
  166. #else
  167. // Neither defined locally.
  168. #if YSI_IS_CLIENT > YSI_IS_STUB
  169. // Stub override.
  170. #undef _YSIM_IS_CLIENT
  171. #define _YSIM_IS_CLIENT 0
  172. #else
  173. // Client override.
  174. #undef _YSIM_IS_STUB
  175. #define _YSIM_IS_STUB 0
  176. #endif
  177. #endif
  178. #endif
  179. #endif
  180. // Default to cloud.
  181. #if YSIM_HAS_MASTER && !_YSIM_IS_CLIENT && !_YSIM_IS_SERVER && !_YSIM_IS_STUB
  182. #define _YSIM_IS_CLOUD 1
  183. #else
  184. #define _YSIM_IS_CLOUD 0
  185. #endif