Guest User

Untitled

a guest
Oct 19th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.26 KB | None | 0 0
  1. meta:
  2. id: scfareplay
  3. file-extension: scfareplay
  4. encoding: utf-8
  5. endian: le
  6.  
  7. seq:
  8. - id: header
  9. type: header
  10. - id: op_stream
  11. type: op_stream
  12.  
  13. types:
  14. replay_map:
  15. seq:
  16. - id: replay
  17. type: strz
  18.  
  19. formation_data:
  20. seq:
  21. - id: w
  22. type: f4
  23. - id: x
  24. type: f4
  25. - id: y
  26. type: f4
  27. - id: z
  28. type: f4
  29. - id: scale
  30. type: f4
  31.  
  32. formation:
  33. seq:
  34. - id: id
  35. type: s4
  36. - id: data
  37. type: formation_data
  38. if: id != -1
  39.  
  40. position:
  41. seq:
  42. - id: x
  43. type: f4
  44. - id: y
  45. type: f4
  46. - id: z
  47. type: f4
  48.  
  49. target:
  50. seq:
  51. - id: target_type
  52. type: u1
  53. - id: entity
  54. type: u4
  55. if: target_type == 1
  56. - id: position
  57. type: position
  58. if: target_type == 2
  59.  
  60. # general types
  61.  
  62. luakv:
  63. seq:
  64. - id: key
  65. type: lua
  66. - id: value
  67. type: lua
  68. if: key.type != luatype::end
  69.  
  70. luatable:
  71. seq:
  72. - id: data
  73. type: luakv
  74. repeat: until
  75. repeat-until: _.key.type == luatype::end
  76.  
  77. lua:
  78. seq:
  79. - id: type
  80. type: u1
  81. enum: luatype
  82.  
  83. - id: data
  84. if: type != luatype::end
  85. type:
  86. switch-on: type
  87. cases:
  88. 'luatype::float': f4
  89. 'luatype::string': strz
  90. 'luatype::nil': u1
  91. 'luatype::bool': u1
  92. 'luatype::table': luatable
  93. timeout:
  94. seq:
  95. - id: player
  96. type: strz
  97. - id: timeouts_left
  98. type: u4
  99.  
  100. playerdata:
  101. seq:
  102. - id: size
  103. type: u4
  104. - id: data
  105. type: lua
  106. - id: source
  107. type: u1
  108. - id: unknown
  109. type: u1
  110. if: source != 255
  111.  
  112. header:
  113. seq:
  114. - id: name
  115. type: strz
  116. encoding: utf8
  117. - id: unknown
  118. type: strz
  119. encoding: utf8
  120. - id: replay_version
  121. type: str
  122. terminator: 10
  123. - id: map_file
  124. type: strz
  125. - id: unknown2
  126. type: u4
  127. - id: num_mods
  128. type: u4
  129. - id: mods
  130. type: lua
  131. - id: scenario_size
  132. type: u4
  133. - id: scenario
  134. type: lua
  135. - id: num_sources
  136. type: u1
  137. - id: timeouts
  138. type: timeout
  139. repeat: expr
  140. repeat-expr: num_sources
  141. - id: cheats
  142. type: u1
  143. - id: num_armies
  144. type: u1
  145. - id: player_data
  146. type: playerdata
  147. repeat: expr
  148. repeat-expr: num_armies
  149. - id: random_seed
  150. type: u4
  151.  
  152. op:
  153. seq:
  154. - id: type
  155. type: u1
  156. enum: optype
  157. - id: len
  158. type: u2
  159. - id: data
  160. size: len - 3
  161. type:
  162. switch-on: type
  163. cases:
  164. 'optype::advance': op_advance
  165. 'optype::set_command_source': op_set_command_source
  166. 'optype::verify_checksum': op_verify_checksum
  167. 'optype::request_pause': op_request_pause
  168. 'optype::resume': op_request_resume
  169. 'optype::issue_command': op_issue_command
  170. 'optype::issue_factory_command': op_issue_command
  171. 'optype::lua_sim_callback': op_lua_sim_callback
  172.  
  173. op_advance:
  174. seq:
  175. - id: num_ticks
  176. type: u4
  177.  
  178. op_set_command_source:
  179. seq:
  180. - id: source
  181. type: u1
  182.  
  183. op_command_source_terminated:
  184. seq:
  185. - id: source
  186. type: u1
  187.  
  188. op_verify_checksum:
  189. seq:
  190. - id: checksum
  191. size: 20
  192.  
  193. op_request_pause:
  194. seq:
  195. - id: source
  196. type: u1
  197.  
  198. op_request_resume:
  199. seq:
  200. - id: source
  201. type: u1
  202.  
  203. op_issue_command:
  204. seq:
  205. - id: num_units
  206. type: u4
  207. - id: unit_ids
  208. type: u4
  209. repeat: expr
  210. repeat-expr: num_units
  211. - id: cmd_id
  212. type: u4
  213. - id: unknown
  214. type: u4
  215. - id: cmd_type
  216. type: u1
  217. - id: unknown2
  218. type: u4
  219. - id: target
  220. type: target
  221. - id: unknown3
  222. type: u1
  223. - id: formation
  224. type: formation
  225. - id: bp
  226. type: strz
  227. - id: unknown4
  228. size: 12
  229. - id: lua
  230. type: lua
  231. - id: unknown5
  232. type: u1
  233. if: lua.type != luatype::nil
  234.  
  235. op_lua_sim_callback:
  236. seq:
  237. - id: name
  238. type: strz
  239. - id: lua
  240. type: lua
  241. - id: unknown
  242. type: u4
  243. if: lua.type != luatype::nil
  244. - id: skip_if_lua
  245. type: u4
  246. repeat: expr
  247. repeat-expr: unknown
  248. if: lua.type != luatype::nil
  249. - id: skip_if_not_lua
  250. size: 7
  251. if: lua.type == luatype::nil
  252.  
  253. op_stream:
  254. seq:
  255. - id: ops
  256. type: op
  257. repeat: eos
  258.  
  259. enums:
  260. luatype:
  261. 0: float
  262. 1: string
  263. 2: nil
  264. 3: bool
  265. 4: table
  266. 5: end
  267.  
  268. optype:
  269. 0: advance
  270. 1: set_command_source
  271. 2: command_source_terminated
  272. 3: verify_checksum
  273. 4: request_pause
  274. 5: resume
  275. 6: single_step
  276. 7: create_unit
  277. 8: create_prop
  278. 9: destroy_entity
  279. 10: warp_entity
  280. 11: process_info_pair
  281. 12: issue_command
  282. 13: issue_factory_command
  283. 14: increase_command_count
  284. 15: decrease_command_count
  285. 16: set_command_target
  286. 17: set_command_type
  287. 18: set_command_cells
  288. 19: remove_command_from_queue
  289. 20: debug_command
  290. 21: execute_lua_in_sim
  291. 22: lua_sim_callback
  292. 23: end_game
Add Comment
Please, Sign In to add comment