schema_server_config.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  3. <xs:element name="game_config" type="server_config_type" />
  4. <xs:simpleType name="nonEmptyString">
  5. <xs:restriction base="xs:string">
  6. <xs:minLength value="1" />
  7. </xs:restriction>
  8. </xs:simpleType>
  9. <!-- If game has different query port than the game port
  10. with this you can specify the difference to the game port. -->
  11. <xs:simpleType name="query_port_type_type">
  12. <xs:restriction base="xs:string">
  13. <xs:enumeration value="add" />
  14. <xs:minLength value="1" />
  15. </xs:restriction>
  16. </xs:simpleType>
  17. <xs:complexType name="query_port_type">
  18. <xs:simpleContent>
  19. <xs:extension base="xs:string">
  20. <xs:attribute name="type" type="query_port_type_type" />
  21. </xs:extension>
  22. </xs:simpleContent>
  23. </xs:complexType>
  24. <xs:simpleType name="cli_param_id_type">
  25. <xs:restriction base="xs:string">
  26. <xs:enumeration value="GAME_TYPE" />
  27. <xs:enumeration value="HOSTNAME" />
  28. <xs:enumeration value="IP" />
  29. <xs:enumeration value="MAP" />
  30. <xs:enumeration value="PID_FILE" />
  31. <xs:enumeration value="PLAYERS" />
  32. <xs:enumeration value="PORT" />
  33. <xs:enumeration value="QUERY_PORT" />
  34. <xs:enumeration value="BASE_PATH" />
  35. <xs:enumeration value="HOME_PATH" />
  36. <xs:enumeration value="SAVE_PATH" />
  37. <xs:enumeration value="OUTPUT_PATH" />
  38. <xs:enumeration value="USER_PATH" />
  39. <xs:enumeration value="CONTROL_PASSWORD" />
  40. </xs:restriction>
  41. </xs:simpleType>
  42. <xs:complexType name="cli_param_type">
  43. <xs:simpleContent>
  44. <xs:extension base="xs:string">
  45. <xs:attribute name="id" type="cli_param_id_type" />
  46. <xs:attribute name="cli_string" type="xs:string" />
  47. <xs:attribute name="options" type="nonEmptyString" />
  48. </xs:extension>
  49. </xs:simpleContent>
  50. </xs:complexType>
  51. <xs:complexType name="cli_params_type">
  52. <xs:sequence>
  53. <xs:element name="cli_param" type="cli_param_type" maxOccurs="unbounded" />
  54. </xs:sequence>
  55. </xs:complexType>
  56. <!-- Type for server control protocol -->
  57. <xs:simpleType name="control_protocol_type">
  58. <xs:restriction base="xs:string">
  59. <xs:enumeration value="rcon" /><!-- HL, Q1/2/3 -->
  60. <xs:enumeration value="rcon2" /><!-- HL2(source) -->
  61. <xs:enumeration value="lcon" /><!-- legacy console -->
  62. <xs:minLength value="1" />
  63. </xs:restriction>
  64. </xs:simpleType>
  65. <xs:simpleType name="control_protocol_type_type">
  66. <xs:restriction base="xs:string">
  67. <xs:enumeration value="new" /><!-- Half-Life version 1.1.0.6 or newer -->
  68. <xs:enumeration value="old" /><!-- Quake 1/2/3 or old Half-Life -->
  69. <xs:minLength value="1" />
  70. </xs:restriction>
  71. </xs:simpleType>
  72. <!-- Type for mods, each server must have at least one mod called, e.g., Default. -->
  73. <xs:complexType name="mod_type">
  74. <xs:sequence>
  75. <xs:element name="name" type="xs:string" />
  76. <!-- Installer name overrides the key attribute if present. -->
  77. <xs:element name="installer_name" type="xs:string" minOccurs="0" />
  78. <xs:element name="installer_login" type="xs:string" minOccurs="0" />
  79. <xs:element name="betaname" type="xs:string" minOccurs="0" />
  80. <xs:element name="betapwd" type="xs:string" minOccurs="0" />
  81. </xs:sequence>
  82. <xs:attribute name="key" type="xs:string" />
  83. </xs:complexType>
  84. <xs:complexType name="mods_type">
  85. <xs:sequence>
  86. <xs:element name="mod" type="mod_type" maxOccurs="unbounded" />
  87. </xs:sequence>
  88. </xs:complexType>
  89. <xs:complexType name="simple_key_type">
  90. <xs:simpleContent>
  91. <xs:extension base="xs:string">
  92. <xs:attribute name="key" type="xs:string" />
  93. </xs:extension>
  94. </xs:simpleContent>
  95. </xs:complexType>
  96. <xs:complexType name="option_type">
  97. <xs:simpleContent>
  98. <xs:extension base="xs:string">
  99. <xs:attribute name="value" type="xs:string" />
  100. </xs:extension>
  101. </xs:simpleContent>
  102. </xs:complexType>
  103. <!-- Type for server cfg params replace -->
  104. <xs:complexType name="replace_text_type">
  105. <xs:choice minOccurs="0" maxOccurs="unbounded">
  106. <xs:element name="default" type="xs:string" minOccurs="0" />
  107. <xs:element name="var" type="xs:string" />
  108. <xs:element name="filepath" type="xs:string" />
  109. <xs:element name="options" type="xs:string" />
  110. <xs:element name="occurrence" type="xs:string" minOccurs="0" />
  111. </xs:choice>
  112. <xs:attribute name="key" type="xs:string" />
  113. </xs:complexType>
  114. <xs:complexType name="alltext_type">
  115. <xs:sequence>
  116. <xs:element name="text" type="replace_text_type" maxOccurs="unbounded" />
  117. </xs:sequence>
  118. <xs:attribute name="key" type="xs:string" />
  119. </xs:complexType>
  120. <xs:complexType name="replace_texts_type">
  121. <xs:choice minOccurs="0" maxOccurs="unbounded" >
  122. <xs:element name="alltext" type="alltext_type" />
  123. <xs:element name="text" type="replace_text_type" />
  124. </xs:choice>
  125. </xs:complexType>
  126. <!-- Type for server cli params -->
  127. <xs:complexType name="server_param_type">
  128. <xs:choice minOccurs="0" maxOccurs="unbounded">
  129. <xs:element name="option" type="option_type" />
  130. <xs:element name="attribute" type="simple_key_type" />
  131. <xs:element name="default" type="simple_key_type" maxOccurs="1" />
  132. <xs:element name="caption" type="xs:string" maxOccurs="1" />
  133. <xs:element name="desc" type="xs:string" maxOccurs="1" />
  134. <xs:element name="options" type="xs:string" />
  135. <xs:element name="access" type="xs:string" minOccurs="0" maxOccurs="1" />
  136. </xs:choice>
  137. <xs:attribute name="id" type="xs:string" />
  138. <xs:attribute name="key" type="xs:string" />
  139. <xs:attribute name="type" type="xs:string" default="text" />
  140. </xs:complexType>
  141. <xs:complexType name="group_type">
  142. <xs:sequence>
  143. <xs:element name="param" type="server_param_type" maxOccurs="unbounded" />
  144. </xs:sequence>
  145. <xs:attribute name="key" type="xs:string" />
  146. <xs:attribute name="name" type="xs:string" />
  147. </xs:complexType>
  148. <xs:complexType name="server_params_type">
  149. <xs:choice minOccurs="0" maxOccurs="unbounded" >
  150. <xs:element name="group" type="group_type" />
  151. <xs:element name="param" type="server_param_type" />
  152. </xs:choice>
  153. </xs:complexType>
  154. <!-- Type for reserve ports -->
  155. <xs:simpleType name="port_type_type">
  156. <xs:restriction base="xs:string">
  157. <xs:enumeration value="add" />
  158. <xs:enumeration value="subtract" />
  159. <xs:minLength value="1" />
  160. </xs:restriction>
  161. </xs:simpleType>
  162. <xs:complexType name="port_type">
  163. <xs:simpleContent>
  164. <xs:extension base="xs:string">
  165. <xs:attribute name="type" type="port_type_type" />
  166. <xs:attribute name="id" type="xs:string" />
  167. <xs:attribute name="cli_string" type="xs:string" />
  168. <xs:attribute name="options" type="nonEmptyString" />
  169. </xs:extension>
  170. </xs:simpleContent>
  171. </xs:complexType>
  172. <xs:complexType name="reserve_ports_type">
  173. <xs:sequence>
  174. <xs:element name="port" type="port_type" maxOccurs="unbounded" />
  175. </xs:sequence>
  176. </xs:complexType>
  177. <!-- Type for server cfg custom fields -->
  178. <xs:complexType name="custom_field_type">
  179. <xs:choice minOccurs="0" maxOccurs="unbounded">
  180. <xs:element name="option" type="option_type" />
  181. <xs:element name="default" type="xs:string" minOccurs="0" />
  182. <xs:element name="default_value" type="xs:string" minOccurs="0" />
  183. <xs:element name="var" type="xs:string" />
  184. <xs:element name="filepath" type="xs:string" />
  185. <xs:element name="options" type="xs:string" />
  186. <xs:element name="occurrence" type="xs:string" minOccurs="0" />
  187. <xs:element name="access" type="xs:string" minOccurs="0" maxOccurs="1" />
  188. <xs:element name="desc" type="xs:string" maxOccurs="1" />
  189. </xs:choice>
  190. <xs:attribute name="id" type="xs:string" />
  191. <xs:attribute name="key" type="xs:string" />
  192. <xs:attribute name="type" type="xs:string" default="text" />
  193. </xs:complexType>
  194. <xs:complexType name="custom_fields_type">
  195. <xs:choice minOccurs="0" maxOccurs="unbounded" >
  196. <xs:element name="field" type="custom_field_type" />
  197. </xs:choice>
  198. </xs:complexType>
  199. <!-- Type for player_info -->
  200. <xs:complexType name="index_type">
  201. <xs:simpleContent>
  202. <xs:extension base="xs:string">
  203. <xs:attribute name="key" type="xs:string" />
  204. </xs:extension>
  205. </xs:simpleContent>
  206. </xs:complexType>
  207. <xs:complexType name="player_info_type">
  208. <xs:choice minOccurs="0" maxOccurs="unbounded" >
  209. <xs:element name="index" type="index_type" />
  210. </xs:choice>
  211. </xs:complexType>
  212. <!-- Type for server player_commands -->
  213. <xs:complexType name="command_type">
  214. <xs:choice minOccurs="0" maxOccurs="unbounded">
  215. <xs:element name="option" type="option_type" />
  216. <xs:element name="default" type="xs:string" maxOccurs="1" />
  217. <xs:element name="string" type="xs:string" />
  218. </xs:choice>
  219. <xs:attribute name="key" type="xs:string" />
  220. <xs:attribute name="type" type="xs:string" default="text" />
  221. </xs:complexType>
  222. <xs:complexType name="player_commands_type">
  223. <xs:choice minOccurs="0" maxOccurs="unbounded" >
  224. <xs:element name="command" type="command_type" />
  225. </xs:choice>
  226. </xs:complexType>
  227. <!-- Type for config files module -->
  228. <xs:complexType name="files_type">
  229. <xs:simpleContent>
  230. <xs:extension base="xs:string">
  231. <xs:attribute name="description" type="xs:string" />
  232. <xs:attribute name="options" type="nonEmptyString" />
  233. </xs:extension>
  234. </xs:simpleContent>
  235. </xs:complexType>
  236. <xs:complexType name="configuration_files_type">
  237. <xs:sequence>
  238. <xs:element name="file" type="files_type" maxOccurs="unbounded" />
  239. </xs:sequence>
  240. </xs:complexType>
  241. <!-- The main of the template -->
  242. <xs:complexType name="server_config_type">
  243. <xs:sequence>
  244. <xs:element name="game_key" type="nonEmptyString" />
  245. <xs:element name="protocol" type="nonEmptyString" minOccurs="0"/>
  246. <xs:element name="lgsl_query_name" type="nonEmptyString" minOccurs="0" />
  247. <xs:element name="gameq_query_name" type="nonEmptyString" minOccurs="0" />
  248. <xs:element name="installer" type="nonEmptyString" minOccurs="0" />
  249. <xs:element name="game_name" type="nonEmptyString" />
  250. <xs:element name="server_exec_name" type="nonEmptyString" />
  251. <xs:element name="query_port" type="query_port_type" minOccurs="0" />
  252. <xs:element name="cli_template" type="nonEmptyString" minOccurs="0" />
  253. <xs:element name="cli_params" type="cli_params_type" minOccurs="0" />
  254. <xs:element name="reserve_ports" type="reserve_ports_type" minOccurs="0" />
  255. <xs:element name="cli_allow_chars" type="nonEmptyString" minOccurs="0" />
  256. <xs:element name="maps_location" type="nonEmptyString" minOccurs="0" />
  257. <xs:element name="map_list" type="nonEmptyString" minOccurs="0" />
  258. <xs:element name="console_log" type="nonEmptyString" minOccurs="0" />
  259. <xs:element name="exe_location" type="nonEmptyString" minOccurs="0" />
  260. <xs:element name="max_user_amount" type="xs:positiveInteger" minOccurs="0" />
  261. <xs:element name="control_protocol" type="control_protocol_type" minOccurs="0" />
  262. <xs:element name="control_protocol_type" type="control_protocol_type_type" minOccurs="0" />
  263. <xs:element name="mods" type="mods_type" />
  264. <xs:element name="replace_texts" type="replace_texts_type" minOccurs="0" />
  265. <xs:element name="server_params" type="server_params_type" minOccurs="0" />
  266. <xs:element name="custom_fields" type="custom_fields_type" minOccurs="0" />
  267. <xs:element name="list_players_command" type="nonEmptyString" minOccurs="0" />
  268. <xs:element name="player_info_regex" type="nonEmptyString" minOccurs="0" />
  269. <xs:element name="player_info" type="player_info_type" minOccurs="0" />
  270. <xs:element name="player_commands" type="player_commands_type" minOccurs="0" />
  271. <xs:element name="pre_install" type="nonEmptyString" minOccurs="0" />
  272. <xs:element name="post_install" type="nonEmptyString" minOccurs="0" />
  273. <xs:element name="pre_start" type="nonEmptyString" minOccurs="0" />
  274. <xs:element name="environment_variables" type="nonEmptyString" minOccurs="0" />
  275. <xs:element name="lock_files" type="nonEmptyString" minOccurs="0" />
  276. <xs:element name="configuration_files" type="configuration_files_type" minOccurs="0" />
  277. </xs:sequence>
  278. </xs:complexType>
  279. </xs:schema>