You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

221 lines
6.5 KiB

  1. //! Defines for subsystems and overlays
  2. //!
  3. //! Lots of important stuff in here, make sure you have your brain switched on
  4. //! when editing this file
  5. //! ## DB defines
  6. /**
  7. * DB major schema version
  8. *
  9. * Update this whenever the db schema changes
  10. *
  11. * make sure you add an update to the schema_version stable in the db changelog
  12. */
  13. #define DB_MAJOR_VERSION 5
  14. /**
  15. * DB minor schema version
  16. *
  17. * Update this whenever the db schema changes
  18. *
  19. * make sure you add an update to the schema_version stable in the db changelog
  20. */
  21. #define DB_MINOR_VERSION 7
  22. //! ## Timing subsystem
  23. /**
  24. * Don't run if there is an identical unique timer active
  25. *
  26. * if the arguments to addtimer are the same as an existing timer, it doesn't create a new timer,
  27. * and returns the id of the existing timer
  28. */
  29. #define TIMER_UNIQUE (1<<0)
  30. ///For unique timers: Replace the old timer rather then not start this one
  31. #define TIMER_OVERRIDE (1<<1)
  32. /**
  33. * Timing should be based on how timing progresses on clients, not the server.
  34. *
  35. * Tracking this is more expensive,
  36. * should only be used in conjuction with things that have to progress client side, such as
  37. * animate() or sound()
  38. */
  39. #define TIMER_CLIENT_TIME (1<<2)
  40. ///Timer can be stopped using deltimer()
  41. #define TIMER_STOPPABLE (1<<3)
  42. ///prevents distinguishing identical timers with the wait variable
  43. ///
  44. ///To be used with TIMER_UNIQUE
  45. #define TIMER_NO_HASH_WAIT (1<<4)
  46. ///Loops the timer repeatedly until qdeleted
  47. ///
  48. ///In most cases you want a subsystem instead, so don't use this unless you have a good reason
  49. #define TIMER_LOOP (1<<5)
  50. ///Empty ID define
  51. #define TIMER_ID_NULL -1
  52. //! ## Initialization subsystem
  53. ///New should not call Initialize
  54. #define INITIALIZATION_INSSATOMS 0
  55. ///New should call Initialize(TRUE)
  56. #define INITIALIZATION_INNEW_MAPLOAD 2
  57. ///New should call Initialize(FALSE)
  58. #define INITIALIZATION_INNEW_REGULAR 1
  59. //! ### Initialization hints
  60. ///Nothing happens
  61. #define INITIALIZE_HINT_NORMAL 0
  62. /**
  63. * call LateInitialize at the end of all atom Initalization
  64. *
  65. * The item will be added to the late_loaders list, this is iterated over after
  66. * initalization of subsystems is complete and calls LateInitalize on the atom
  67. * see [this file for the LateIntialize proc](atom.html#proc/LateInitialize)
  68. */
  69. #define INITIALIZE_HINT_LATELOAD 1
  70. ///Call qdel on the atom after intialization
  71. #define INITIALIZE_HINT_QDEL 2
  72. ///type and all subtypes should always immediately call Initialize in New()
  73. #define INITIALIZE_IMMEDIATE(X) ##X/New(loc, ...){\
  74. ..();\
  75. if(!(flags_1 & INITIALIZED_1)) {\
  76. args[1] = TRUE;\
  77. SSatoms.InitAtom(src, args);\
  78. }\
  79. }
  80. // Subsystem init_order, from highest priority to lowest priority
  81. // Subsystems shutdown in the reverse of the order they initialize in
  82. // The numbers just define the ordering, they are meaningless otherwise.
  83. #define INIT_ORDER_PROFILER 101
  84. #define INIT_ORDER_TITLE 100
  85. #define INIT_ORDER_GARBAGE 99
  86. #define INIT_ORDER_DBCORE 95
  87. #define INIT_ORDER_BLACKBOX 94
  88. #define INIT_ORDER_SERVER_MAINT 93
  89. #define INIT_ORDER_INPUT 85
  90. #define INIT_ORDER_VIS 80
  91. #define INIT_ORDER_ACHIEVEMENTS 77
  92. #define INIT_ORDER_RESEARCH 75
  93. #define INIT_ORDER_EVENTS 70
  94. #define INIT_ORDER_JOBS 65
  95. #define INIT_ORDER_QUIRKS 60
  96. #define INIT_ORDER_TICKER 55
  97. #define INIT_ORDER_MAPPING 50
  98. #define INIT_ORDER_NETWORKS 45
  99. #define INIT_ORDER_ECONOMY 40
  100. #define INIT_ORDER_OUTPUTS 35
  101. #define INIT_ORDER_ATOMS 30
  102. #define INIT_ORDER_LANGUAGE 25
  103. #define INIT_ORDER_MACHINES 20
  104. #define INIT_ORDER_SKILLS 15
  105. #define INIT_ORDER_TIMER 1
  106. #define INIT_ORDER_DEFAULT 0
  107. #define INIT_ORDER_AIR -1
  108. #define INIT_ORDER_ASSETS -4
  109. #define INIT_ORDER_ICON_SMOOTHING -5
  110. #define INIT_ORDER_OVERLAY -6
  111. #define INIT_ORDER_XKEYSCORE -10
  112. #define INIT_ORDER_STICKY_BAN -10
  113. #define INIT_ORDER_LIGHTING -20
  114. #define INIT_ORDER_SHUTTLE -21
  115. #define INIT_ORDER_MINOR_MAPPING -40
  116. #define INIT_ORDER_PATH -50
  117. #define INIT_ORDER_DISCORD -60
  118. #define INIT_ORDER_PERSISTENCE -95
  119. #define INIT_ORDER_DEMO -99 // o avoid a bunch of changes related to initialization being written, do this last
  120. #define INIT_ORDER_CHAT -100 //Should be last to ensure chat remains smooth during init.
  121. // Subsystem fire priority, from lowest to highest priority
  122. // If the subsystem isn't listed here it's either DEFAULT or PROCESS (if it's a processing subsystem child)
  123. #define FIRE_PRIORITY_PING 10
  124. #define FIRE_PRIORITY_IDLE_NPC 10
  125. #define FIRE_PRIORITY_SERVER_MAINT 10
  126. #define FIRE_PRIORITY_RESEARCH 10
  127. #define FIRE_PRIORITY_VIS 10
  128. #define FIRE_PRIORITY_GARBAGE 15
  129. #define FIRE_PRIORITY_WET_FLOORS 20
  130. #define FIRE_PRIORITY_AIR 20
  131. #define FIRE_PRIORITY_NPC 20
  132. #define FIRE_PRIORITY_PROCESS 25
  133. #define FIRE_PRIORITY_THROWING 25
  134. #define FIRE_PRIORITY_SPACEDRIFT 30
  135. #define FIRE_PRIORITY_FIELDS 30
  136. #define FIRE_PRIOTITY_SMOOTHING 35
  137. #define FIRE_PRIORITY_NETWORKS 40
  138. #define FIRE_PRIORITY_OBJ 40
  139. #define FIRE_PRIORITY_ACID 40
  140. #define FIRE_PRIOTITY_BURNING 40
  141. #define FIRE_PRIORITY_DEFAULT 50
  142. #define FIRE_PRIORITY_PARALLAX 65
  143. #define FIRE_PRIORITY_MOBS 100
  144. #define FIRE_PRIORITY_TGUI 110
  145. #define FIRE_PRIORITY_TICKER 200
  146. #define FIRE_PRIORITY_ATMOS_ADJACENCY 300
  147. #define FIRE_PRIORITY_CHAT 400
  148. #define FIRE_PRIORITY_OVERLAYS 500
  149. #define FIRE_PRIORITY_INPUT 1000 // This must always always be the max highest priority. Player input must never be lost.
  150. // SS runlevels
  151. #define RUNLEVEL_INIT 0
  152. #define RUNLEVEL_LOBBY 1
  153. #define RUNLEVEL_SETUP 2
  154. #define RUNLEVEL_GAME 4
  155. #define RUNLEVEL_POSTGAME 8
  156. #define RUNLEVELS_DEFAULT (RUNLEVEL_SETUP | RUNLEVEL_GAME | RUNLEVEL_POSTGAME)
  157. //! ## Overlays subsystem
  158. ///Compile all the overlays for an atom from the cache lists
  159. #define COMPILE_OVERLAYS(A)\
  160. if (TRUE) {\
  161. var/list/ad = A.add_overlays;\
  162. var/list/rm = A.remove_overlays;\
  163. var/list/po = A.priority_overlays;\
  164. if(LAZYLEN(rm)){\
  165. A.overlays -= rm;\
  166. rm.Cut();\
  167. }\
  168. if(LAZYLEN(ad)){\
  169. A.overlays |= ad;\
  170. ad.Cut();\
  171. }\
  172. if(LAZYLEN(po)){\
  173. A.overlays |= po;\
  174. }\
  175. for(var/I in A.alternate_appearances){\
  176. var/datum/atom_hud/alternate_appearance/AA = A.alternate_appearances[I];\
  177. if(AA.transfer_overlays){\
  178. AA.copy_overlays(A, TRUE);\
  179. }\
  180. }\
  181. A.flags_1 &= ~OVERLAY_QUEUED_1;\
  182. if(isturf(A)){SSdemo.mark_turf(A);}\
  183. else if(isobj(A) || ismob(A)){SSdemo.mark_dirty(A);}\
  184. }
  185. // Air subsystem subtasks
  186. #define SSAIR_PIPENETS 1
  187. #define SSAIR_ATMOSMACHINERY 2
  188. #define SSAIR_ACTIVETURFS 3
  189. #define SSAIR_EXCITEDGROUPS 4
  190. #define SSAIR_HIGHPRESSURE 5
  191. #define SSAIR_HOTSPOTS 6
  192. #define SSAIR_SUPERCONDUCTIVITY 7