constants.py 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229
  1. #! /usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. # SPDX-FileCopyrightText: Copyright (C) 2021-2023 MH3SP Server Project
  4. # SPDX-License-Identifier: AGPL-3.0-or-later
  5. """Monster Hunter constants."""
  6. import struct
  7. from other.utils import pad
  8. from mh.time_utils import current_server_time, TICKS_PER_CYCLE, \
  9. get_jhen_event_times, is_jhen_active, current_event_time_slot
  10. from mh.quest_utils import make_binary_event_quest
  11. from res.trading_post import CURRENT_TRADES
  12. def make_binary_type_time_events(binary_loader=None):
  13. return struct.pack(">III", *get_jhen_event_times())
  14. def make_event_slot(event):
  15. return (make_binary_event_quest(event), event)
  16. def get_event_slot(slot_num, temporal_slot):
  17. return lambda quest_loader, slot_num=slot_num, temporal_slot=temporal_slot: \
  18. quest_loader[temporal_slot][slot_num] \
  19. if slot_num < len(quest_loader[temporal_slot]) else b'\0' * 0x4B4
  20. def make_binary_server_type_list(is_jap=False):
  21. data = bytearray()
  22. PROPERTIES = [
  23. (b"Open", b"Hunters of all Ranks\ncan gather here.", 0, 999),
  24. (b"Rookie", b"Only hunters HR 30\nor lower may enter.", 0, 30),
  25. (b"Expert", b"Only hunters HR 31\nor higher may enter.", 31, 999),
  26. (b"Recruiting",
  27. b"Hunters in search of\nhunting companions\ncan gather here.", 0,
  28. 999),
  29. ]
  30. # Handle server type properties
  31. for name, desc, hr_min, hr_max in PROPERTIES:
  32. data += pad(name, 16 if is_jap else 24)
  33. if is_jap:
  34. desc = bytearray(desc)
  35. LINE_LENGTH = 24
  36. while b'\n' in desc:
  37. i = desc.index(b'\n')
  38. padding = (LINE_LENGTH - i % LINE_LENGTH) % LINE_LENGTH
  39. desc[i:i+1] = b' ' * padding
  40. data += pad(desc, 112 if is_jap else 168)
  41. data += struct.pack(">I", 0) # unk
  42. data += struct.pack(
  43. ">I", current_server_time()
  44. ) # Current time at server bootup
  45. data += struct.pack(
  46. ">I", TICKS_PER_CYCLE
  47. ) # Max tick per cycle, if 0 game defaults to 3000
  48. # Handle city seekings (x32)
  49. SEEKINGS = [
  50. # References:
  51. # - https://youtu.be/lPFQW3B1Kt0?t=31
  52. # - https://youtu.be/Ie_9lRIZF20?t=411
  53. b"Everyone welcome!", b"Casual play",
  54. # TODO: "Beginners welcome!" doesn't appear in Expert type servers
  55. b"Huntin' and chattin'", b"Beginners welcome!",
  56. # TODO: "Skilled players only" doesn't appear in Rookie type servers?
  57. b"Skilled players only", b"Let's Quest together",
  58. b"Event Quest ho!", b"Arena battles!",
  59. b"Earning money", b"HR grinding",
  60. b"Gathering materials", b"Rare material search",
  61. b"Just a Quest or two", b"In for the long haul",
  62. # TODO: The following seekings don't appear in Recruiting type servers
  63. b"Playing with friends", b"Solo play",
  64. # Extra seekings not from the original server
  65. b"Stream Lobby", b"Turns",
  66. b"Seeking18", b"Seeking19",
  67. b"Seeking20", b"Seeking21",
  68. b"Seeking22", b"Seeking23",
  69. b"Seeking24", b"Seeking25",
  70. b"Seeking26", b"Seeking27",
  71. b"Seeking28", b"Seeking29",
  72. b"Seeking30", b"Seeking31",
  73. ]
  74. for i, seeking in enumerate(SEEKINGS):
  75. data += pad(seeking, 32 if is_jap else 48)
  76. data += b"\0\1\xff\0" # TODO: Figure out the 0xff flag values
  77. # Handle city HR limits (x8)
  78. HR_LIMITS = [
  79. # (Name, HR min, HR max)
  80. (b"None", 0, 999),
  81. (b"Low", 0, 30),
  82. (b"High", 31, 999),
  83. (b"Limit3", 0, 999),
  84. (b"Limit4", 0, 999),
  85. (b"Limit5", 0, 999),
  86. (b"Limit6", 0, 999),
  87. (b"Limit7", 0, 999),
  88. ]
  89. for name, hr_min, hr_max in HR_LIMITS:
  90. data += pad(name, 20 if is_jap else 30)
  91. data += b"\1" # Enable bit
  92. data += b"\0" # Unused / Defaults to HR limit restriction
  93. data += struct.pack(">H", hr_min)
  94. data += struct.pack(">H", hr_max)
  95. # Handle city goals (x64)
  96. GOALS = [
  97. b"None", b"HR1~", b"HR9~", b"HR18~",
  98. b"HR31~", b"HR40~", b"HR51~",
  99. b"1* Urgent Quest", b"2* Urgent Quest", b"3* Urgent Quest",
  100. b"4* Urgent Quest", b"5* Urgent Quest",
  101. b"Great Jaggi", b"Qurupecco", b"Royal Ludroth", b"Barroth",
  102. b"Gobul", b"Rathian", b"Great Baggi", b"Gigginox",
  103. b"Lagiacrus", b"Barioth", b"Rathalos", b"Diablos",
  104. b"Uragaan", b"Agnaktor", b"Jhen Mohran", b"Deviljho",
  105. b"Alatreon", b"Mining Ore", b"Catching Bugs", b"Fishing",
  106. b"Small Monsters", b"Gathering", b"Transporting", b"The Arena",
  107. b"Goal36", b"Goal37", b"Goal38", b"Goal39",
  108. b"Goal40", b"Goal41", b"Goal42", b"Goal43",
  109. b"Goal44", b"Goal45", b"Goal46", b"Goal47",
  110. b"Goal48", b"Goal49", b"Goal50", b"Goal51",
  111. b"Goal52", b"Goal53", b"Goal54", b"Goal55",
  112. b"Goal56", b"Goal57", b"Goal58", b"Goal59",
  113. b"Goal60", b"Goal61", b"Goal62", b"Goal63",
  114. ]
  115. for name in GOALS:
  116. data += pad(name, 20 if is_jap else 30)
  117. # There are 3 restriction modes:
  118. # - 0x00: None
  119. # - 0x01: HR limit
  120. # - 0x02: An unknown one (TODO: Figure it out)
  121. data += b"\1" # Enable bit
  122. data += b"\0" # Restriction bit
  123. data += struct.pack(">H", 0)
  124. data += struct.pack(">H", 0)
  125. # Handle server type HR limits
  126. for i, (name, desc, hr_min, hr_max) in enumerate(PROPERTIES):
  127. data += struct.pack(">H", hr_min)
  128. data += struct.pack(">H", hr_max)
  129. # Timeout values (x8)
  130. timeout_in_sec = 30
  131. for _ in range(8):
  132. data += struct.pack(">H", 30 * timeout_in_sec)
  133. # TODO: Figure out the missing data at the end
  134. return data
  135. def make_binary_npc_greeters(binary_loader, is_jap=False, temporal_slot=None):
  136. """Binary with NPC City Greeter.
  137. Data offset:
  138. - 0x000: Tool Shop
  139. - 0x180: material shop
  140. - 0x300: Trading Post
  141. - 0x480: Quest Receptionist
  142. - 0x600: Arena Clerk
  143. - 0x780: Guildmaster
  144. Japanese offset:
  145. - 0x000: Tool Shop
  146. - 0x100: material shop
  147. - 0x200: Trading Post
  148. - 0x300: Quest Receptionist
  149. - 0x400: Arena Clerk
  150. - 0x500: Guildmaster
  151. """
  152. US_OFFSET = 0x180
  153. JP_OFFSET = 0x100
  154. offset = JP_OFFSET if is_jap else US_OFFSET
  155. if temporal_slot is None:
  156. temporal_slot = current_event_time_slot()
  157. if is_jhen_active():
  158. tool_shop = b"Half-off sale!"
  159. material_shop = b"Half-off sale!"
  160. event_quests = b"The Festival of Fear\n"
  161. else:
  162. tool_shop = b"Prices are normal."
  163. material_shop = b"Prices are normal."
  164. event_quests = b""
  165. quest_list, arena_list = binary_loader.get_separated_quest_dicts(temporal_slot)
  166. event_quests += b"\n".join([
  167. quest['quest_info']['name'].encode("ascii")
  168. for quest in quest_list
  169. ])
  170. arena_quests = b"\n".join([
  171. quest['quest_info']['name'].encode("ascii")
  172. for quest in arena_list
  173. ])
  174. guildmaster_str = (
  175. b'To all hunters:\n'
  176. b'Loc Lac is in "beta,"\n'
  177. b'whatever that means. Also,\n'
  178. b'the Arena is back in\n'
  179. b'operation! And now, a:\n'
  180. b'haiku: "Patient warriors /\n'
  181. b'returning home at long last /\n'
  182. b'now join hands to hunt!"'
  183. )
  184. data = b""
  185. data += pad(tool_shop, offset)
  186. data += pad(material_shop, offset)
  187. data += pad(b"The Trading Post is open!", offset)
  188. data += pad(event_quests, offset)
  189. data += pad(arena_quests, offset)
  190. data += pad(guildmaster_str, offset)
  191. return data
  192. def make_binary_trading_post():
  193. return CURRENT_TRADES
  194. LAYER_CHAT_COLORS = (0xbb3385ff, 0xffffffff, 0xffffffff)
  195. TERMS_VERSION = 1
  196. TERMS = {
  197. 1: b"""MH3 Server Project - Terms.""",
  198. 2: (b"-DEBUG- -DEBUG- -DEBUG- -DEBUG-\n" * 0x200)+b"- ZHIEND"
  199. }
  200. SUBTERMS = {
  201. 1: b"""MH3 Server Project - SubTerms.""",
  202. 2: b"-DEBUG- Subterms"
  203. }
  204. ANNOUNCE = b"<BR><BODY>".join([
  205. b"<BR><CENTER><BODY><SIZE=6>Monster Hunter 3 (Tri) Server Project",
  206. b"<BR><LEFT><SIZE=4>Welcome to the MH3SP Server!",
  207. b"Now we can play temporal, standard and arena quest.",
  208. b"Enjoy, have fun and report bugs :D",
  209. b"<BR><CENTER><C=2>Welcome back to Loc Lac!<END>"
  210. ])
  211. CHARGE = b"""<BODY><CENTER>MH3 Server Project - No charge.<END>"""
  212. # VULGARITY_INFO = b"""MH3 Server Project - Vulgarity info (low)."""
  213. VULGARITY_INFO = b""
  214. FMP_VERSION = 1
  215. TIME_STATE = 0
  216. IS_JAP = False
  217. def get_binary_loader_assisted_version(binary_loader):
  218. return current_event_time_slot() + 1 + binary_loader.version
  219. def get_binary_quest_content_from_quest_slot(quest_slot):
  220. return lambda temporal_slot, quest_slot=quest_slot: get_event_slot(quest_slot, temporal_slot)
  221. # Dummy PAT_BINARY
  222. PAT_BINARIES = {
  223. 0x01: {
  224. "version": 1,
  225. "content": make_binary_server_type_list(is_jap=IS_JAP)
  226. },
  227. 0x02: {
  228. "version": 1,
  229. "content": make_binary_type_time_events
  230. },
  231. 0x03: {
  232. "version": lambda binary_loader: current_event_time_slot() + 1,
  233. "content": lambda temporal_slot: lambda binary_loader: make_binary_npc_greeters(binary_loader, is_jap=IS_JAP, temporal_slot=temporal_slot)
  234. },
  235. 0x04: {
  236. "version": 1,
  237. "content": make_binary_trading_post()
  238. },
  239. 0x05: { # English
  240. "version": 1,
  241. "content": b"5" * 0x10 # b"titi\ttoto\ttutu\nbibi\tbobo\bubu\nouba\t"
  242. # "version": 1,
  243. # "content": b"TEST_BINARY"
  244. },
  245. 0x06: { # English
  246. "version": get_binary_loader_assisted_version,
  247. "content": get_binary_quest_content_from_quest_slot(0)
  248. },
  249. 0x07: { # English
  250. "version": get_binary_loader_assisted_version,
  251. "content": get_binary_quest_content_from_quest_slot(1)
  252. },
  253. 0x08: { # English
  254. "version": get_binary_loader_assisted_version,
  255. "content": get_binary_quest_content_from_quest_slot(2)
  256. },
  257. 0x09: { # English
  258. "version": get_binary_loader_assisted_version,
  259. "content": get_binary_quest_content_from_quest_slot(3)
  260. },
  261. 0x0a: { # Japanese(?)English
  262. "version": get_binary_loader_assisted_version,
  263. "content": get_binary_quest_content_from_quest_slot(4)
  264. },
  265. 0x0b: { # Japanese(?)English
  266. "version": get_binary_loader_assisted_version,
  267. "content": get_binary_quest_content_from_quest_slot(5)
  268. },
  269. 0x0c: { # Japanese(?)English
  270. "version": get_binary_loader_assisted_version,
  271. "content": get_binary_quest_content_from_quest_slot(6)
  272. },
  273. 0x0d: { # Japanese(?)English
  274. "version": get_binary_loader_assisted_version,
  275. "content": get_binary_quest_content_from_quest_slot(7)
  276. },
  277. 0x0e: { # Japanese(?)English
  278. "version": get_binary_loader_assisted_version,
  279. "content": get_binary_quest_content_from_quest_slot(8)
  280. },
  281. 0x0f: { # Japanese(?)English
  282. "version": get_binary_loader_assisted_version,
  283. "content": get_binary_quest_content_from_quest_slot(9)
  284. },
  285. 0x10: { # French
  286. "version": 1,
  287. "content": make_binary_server_type_list()
  288. },
  289. 0x11: { # French
  290. "version": 1,
  291. "content": make_binary_type_time_events
  292. },
  293. 0x12: { # French
  294. "version": lambda binary_loader: current_event_time_slot() + 1,
  295. "content": lambda temporal_slot: lambda binary_loader: make_binary_npc_greeters(binary_loader, temporal_slot=temporal_slot)
  296. },
  297. 0x13: { # French
  298. "version": 1,
  299. "content": make_binary_trading_post()
  300. },
  301. 0x14: { # French
  302. "version": 1,
  303. "content": b"dummy_14\0"
  304. },
  305. 0x15: { # French
  306. "version": get_binary_loader_assisted_version,
  307. "content": get_binary_quest_content_from_quest_slot(0)
  308. },
  309. 0x16: { # French
  310. "version": get_binary_loader_assisted_version,
  311. "content": get_binary_quest_content_from_quest_slot(1)
  312. },
  313. 0x17: { # French
  314. "version": get_binary_loader_assisted_version,
  315. "content": get_binary_quest_content_from_quest_slot(2)
  316. },
  317. 0x18: { # French
  318. "version": get_binary_loader_assisted_version,
  319. "content": get_binary_quest_content_from_quest_slot(3)
  320. },
  321. 0x19: { # French
  322. "version": get_binary_loader_assisted_version,
  323. "content": get_binary_quest_content_from_quest_slot(4)
  324. },
  325. 0x1a: { # French
  326. "version": get_binary_loader_assisted_version,
  327. "content": get_binary_quest_content_from_quest_slot(5)
  328. },
  329. 0x1b: { # French
  330. "version": get_binary_loader_assisted_version,
  331. "content": get_binary_quest_content_from_quest_slot(6)
  332. },
  333. 0x1c: { # French
  334. "version": get_binary_loader_assisted_version,
  335. "content": get_binary_quest_content_from_quest_slot(7)
  336. },
  337. 0x1d: { # French
  338. "version": get_binary_loader_assisted_version,
  339. "content": get_binary_quest_content_from_quest_slot(8)
  340. },
  341. 0x1e: { # French
  342. "version": get_binary_loader_assisted_version,
  343. "content": get_binary_quest_content_from_quest_slot(9)
  344. },
  345. 0x1f: { # German
  346. "version": 1,
  347. "content": make_binary_server_type_list()
  348. },
  349. 0x20: { # German
  350. "version": 1,
  351. "content": make_binary_type_time_events
  352. },
  353. 0x21: { # German
  354. "version": lambda binary_loader: current_event_time_slot() + 1,
  355. "content": lambda temporal_slot: lambda binary_loader: make_binary_npc_greeters(binary_loader, temporal_slot=temporal_slot)
  356. },
  357. 0x22: { # German
  358. "version": 1,
  359. "content": make_binary_trading_post()
  360. },
  361. 0x23: { # German
  362. "version": 1,
  363. "content": b"dummy_23\0"
  364. },
  365. 0x24: { # German
  366. "version": get_binary_loader_assisted_version,
  367. "content": get_binary_quest_content_from_quest_slot(0)
  368. },
  369. 0x25: { # German
  370. "version": get_binary_loader_assisted_version,
  371. "content": get_binary_quest_content_from_quest_slot(1)
  372. },
  373. 0x26: { # German
  374. "version": get_binary_loader_assisted_version,
  375. "content": get_binary_quest_content_from_quest_slot(2)
  376. },
  377. 0x27: { # German
  378. "version": get_binary_loader_assisted_version,
  379. "content": get_binary_quest_content_from_quest_slot(3)
  380. },
  381. 0x28: { # German
  382. "version": get_binary_loader_assisted_version,
  383. "content": get_binary_quest_content_from_quest_slot(4)
  384. },
  385. 0x29: { # German
  386. "version": get_binary_loader_assisted_version,
  387. "content": get_binary_quest_content_from_quest_slot(5)
  388. },
  389. 0x2a: { # German
  390. "version": get_binary_loader_assisted_version,
  391. "content": get_binary_quest_content_from_quest_slot(6)
  392. },
  393. 0x2b: { # German
  394. "version": get_binary_loader_assisted_version,
  395. "content": get_binary_quest_content_from_quest_slot(7)
  396. },
  397. 0x2c: { # German
  398. "version": get_binary_loader_assisted_version,
  399. "content": get_binary_quest_content_from_quest_slot(8)
  400. },
  401. 0x2d: { # German
  402. "version": get_binary_loader_assisted_version,
  403. "content": get_binary_quest_content_from_quest_slot(9)
  404. },
  405. 0x2e: { # Italian
  406. "version": 1,
  407. "content": make_binary_server_type_list()
  408. },
  409. 0x2f: { # Italian
  410. "version": 1,
  411. "content": make_binary_type_time_events
  412. },
  413. 0x30: { # Italian
  414. "version": lambda binary_loader: current_event_time_slot() + 1,
  415. "content": lambda temporal_slot: lambda binary_loader: make_binary_npc_greeters(binary_loader, temporal_slot=temporal_slot)
  416. },
  417. 0x31: { # Italian
  418. "version": 1,
  419. "content": make_binary_trading_post()
  420. },
  421. 0x32: { # Italian
  422. "version": 1,
  423. "content": b"dummy_32\0"
  424. },
  425. 0x33: { # Italian
  426. "version": get_binary_loader_assisted_version,
  427. "content": get_binary_quest_content_from_quest_slot(0)
  428. },
  429. 0x34: { # Italian
  430. "version": get_binary_loader_assisted_version,
  431. "content": get_binary_quest_content_from_quest_slot(1)
  432. },
  433. 0x35: { # Italian
  434. "version": get_binary_loader_assisted_version,
  435. "content": get_binary_quest_content_from_quest_slot(2)
  436. },
  437. 0x36: { # Italian
  438. "version": get_binary_loader_assisted_version,
  439. "content": get_binary_quest_content_from_quest_slot(3)
  440. },
  441. 0x37: { # Italian
  442. "version": get_binary_loader_assisted_version,
  443. "content": get_binary_quest_content_from_quest_slot(4)
  444. },
  445. 0x38: { # Italian
  446. "version": get_binary_loader_assisted_version,
  447. "content": get_binary_quest_content_from_quest_slot(5)
  448. },
  449. 0x39: { # Italian
  450. "version": get_binary_loader_assisted_version,
  451. "content": get_binary_quest_content_from_quest_slot(6)
  452. },
  453. 0x3a: { # Italian
  454. "version": get_binary_loader_assisted_version,
  455. "content": get_binary_quest_content_from_quest_slot(7)
  456. },
  457. 0x3b: { # Italian
  458. "version": get_binary_loader_assisted_version,
  459. "content": get_binary_quest_content_from_quest_slot(8)
  460. },
  461. 0x3c: { # Italian
  462. "version": get_binary_loader_assisted_version,
  463. "content": get_binary_quest_content_from_quest_slot(9)
  464. },
  465. 0x3d: { # Spanish
  466. "version": 1,
  467. "content": make_binary_server_type_list()
  468. },
  469. 0x3e: { # Spanish
  470. "version": 1,
  471. "content": make_binary_type_time_events
  472. },
  473. 0x3f: { # Spanish
  474. "version": lambda binary_loader: current_event_time_slot() + 1,
  475. "content": lambda temporal_slot: lambda binary_loader: make_binary_npc_greeters(binary_loader, temporal_slot=temporal_slot)
  476. },
  477. 0x40: { # Spanish
  478. "version": 1,
  479. "content": make_binary_trading_post()
  480. },
  481. 0x41: { # Spanish
  482. "version": 1,
  483. "content": b"dummy_41\0"
  484. },
  485. 0x42: { # Spanish
  486. "version": get_binary_loader_assisted_version,
  487. "content": get_binary_quest_content_from_quest_slot(0)
  488. },
  489. 0x43: { # Spanish
  490. "version": get_binary_loader_assisted_version,
  491. "content": get_binary_quest_content_from_quest_slot(1)
  492. },
  493. 0x44: { # Spanish
  494. "version": get_binary_loader_assisted_version,
  495. "content": get_binary_quest_content_from_quest_slot(2)
  496. },
  497. 0x45: { # Spanish
  498. "version": get_binary_loader_assisted_version,
  499. "content": get_binary_quest_content_from_quest_slot(3)
  500. },
  501. 0x46: { # Spanish
  502. "version": get_binary_loader_assisted_version,
  503. "content": get_binary_quest_content_from_quest_slot(4)
  504. },
  505. 0x47: { # Spanish
  506. "version": get_binary_loader_assisted_version,
  507. "content": get_binary_quest_content_from_quest_slot(5)
  508. },
  509. 0x48: { # Spanish
  510. "version": get_binary_loader_assisted_version,
  511. "content": get_binary_quest_content_from_quest_slot(6)
  512. },
  513. 0x49: { # Spanish
  514. "version": get_binary_loader_assisted_version,
  515. "content": get_binary_quest_content_from_quest_slot(7)
  516. },
  517. 0x4a: { # Spanish
  518. "version": get_binary_loader_assisted_version,
  519. "content": get_binary_quest_content_from_quest_slot(8)
  520. },
  521. 0x4b: { # Spanish
  522. "version": get_binary_loader_assisted_version,
  523. "content": get_binary_quest_content_from_quest_slot(9)
  524. },
  525. }
  526. def get_pat_binary_from_version(binary_type, version):
  527. static_binaries = (0x01, 0x02, 0x04, 0x05, 0x10, 0x11,
  528. 0x13, 0x14, 0x1f, 0x20, 0x22, 0x23, 0x2e, 0x2f,
  529. 0x31, 0x32, 0x3d, 0x3e, 0x40, 0x41)
  530. if binary_type in static_binaries:
  531. return PAT_BINARIES[binary_type]["content"]
  532. return PAT_BINARIES[binary_type]["content"](version)
  533. PAT_CATEGORIES = {
  534. 0x60: "Opn",
  535. 0x61: "Rfp",
  536. 0x62: "Lmp",
  537. 0x63: "Fmp",
  538. 0x64: "Layer",
  539. 0x65: "Circle",
  540. 0x66: "User",
  541. 0x69: "Agreement"
  542. }
  543. PAT_TYPES = {
  544. 0x01: "Req",
  545. 0x02: "Ans",
  546. 0x10: "Ntc"
  547. }
  548. PAT_FLAGS = {
  549. 0x00: "None",
  550. 0x01: "Alert",
  551. 0xff: "Ng"
  552. }
  553. PAT_NAMES = {
  554. # Category Opn
  555. 0x60010100: 'ReqLineCheck',
  556. 0x60010200: 'AnsLineCheck',
  557. 0x60020100: 'ReqServerTime',
  558. 0x60020200: 'AnsServerTime',
  559. 0x60100100: 'ReqShut',
  560. 0x60100200: 'AnsShut',
  561. 0x60101000: 'NtcShut',
  562. 0x60111000: 'NtcRecconect',
  563. 0x60200100: 'ReqConnection',
  564. 0x60200200: 'AnsConnection',
  565. 0x60211000: 'NtcLogin',
  566. 0x60300100: 'ReqTicket',
  567. 0x60300200: 'AnsTicket',
  568. 0x60310100: 'ReqTicket',
  569. 0x60310200: 'AnsTicket',
  570. 0x60400100: 'ReqWarning',
  571. 0x60400200: 'AnsWarning',
  572. 0x60501000: 'NtcCollectionLog',
  573. 0x60700100: 'ReqCommonKey',
  574. 0x60700200: 'AnsCommonKey',
  575. 0x60801000: 'NtcCheatCheck',
  576. 0x60810100: 'ReqMemoryCheck',
  577. 0x60810200: 'AnsMemoryCheck',
  578. # Category Rfp
  579. 0x61010100: 'ReqLoginInfo',
  580. 0x61010200: 'AnsLoginInfo',
  581. 0x61020100: 'ReqChargeInfo',
  582. 0x61020200: 'AnsChargeInfo',
  583. 0x61100100: 'ReqUserListHead',
  584. 0x61100200: 'AnsUserListHead',
  585. 0x61110100: 'ReqUserListData',
  586. 0x61110200: 'AnsUserListData',
  587. 0x61120100: 'ReqUserListFoot',
  588. 0x61120200: 'AnsUserListFoot',
  589. 0x61200100: 'ReqUserObject',
  590. 0x61200200: 'AnsUserObject',
  591. 0x61300100: 'ReqFmpListVersion',
  592. 0x61300200: 'AnsFmpListVersion',
  593. 0x61310100: 'ReqFmpListHead',
  594. 0x61310200: 'AnsFmpListHead',
  595. 0x61320100: 'ReqFmpListData',
  596. 0x61320200: 'AnsFmpListData',
  597. 0x61330100: 'ReqFmpListFoot',
  598. 0x61330200: 'AnsFmpListFoot',
  599. 0x61340100: 'ReqFmpInfo',
  600. 0x61340200: 'AnsFmpInfo',
  601. 0x61400100: 'ReqRfpConnect',
  602. 0x61400200: 'AnsRfpConnect',
  603. # Category Lmp
  604. 0x62010100: 'ReqLmpConnect',
  605. 0x62010200: 'AnsLmpConnect',
  606. 0x62100100: 'ReqTermsVersion',
  607. 0x62100200: 'AnsTermsVersion',
  608. 0x62110100: 'ReqTerms',
  609. 0x62110200: 'AnsTerms',
  610. 0x62130100: 'ReqSubTermsInfo',
  611. 0x62130200: 'AnsSubTermsInfo',
  612. 0x62140100: 'ReqSubTerms',
  613. 0x62140200: 'AnsSubTerms',
  614. 0x62200100: 'ReqMaintenance',
  615. 0x62200200: 'AnsMaintenance',
  616. 0x62300100: 'ReqAnnounce',
  617. 0x62300200: 'AnsAnnounce',
  618. 0x62310100: 'ReqNoCharge',
  619. 0x62310200: 'AnsNoCharge',
  620. 0x62410100: 'ReqMediaVersionInfo',
  621. 0x62410200: 'AnsMediaVersionInfo',
  622. 0x62500100: 'ReqVulgarityInfoHighJAP',
  623. 0x62500200: 'AnsVulgarityInfoHighJAP',
  624. 0x62510100: 'ReqVulgarityHighJAP',
  625. 0x62510200: 'AnsVulgarityHighJAP',
  626. 0x62520100: 'ReqVulgarityInfoLowJAP',
  627. 0x62520200: 'AnsVulgarityInfoLowJAP',
  628. 0x62530100: 'ReqVulgarityLowJAP',
  629. 0x62530200: 'AnsVulgarityLowJAP',
  630. 0x62540100: 'ReqVulgarityInfoHigh',
  631. 0x62540200: 'AnsVulgarityInfoHigh',
  632. 0x62550100: 'ReqVulgarityHigh',
  633. 0x62550200: 'AnsVulgarityHigh',
  634. 0x62560100: 'ReqVulgarityInfoLow',
  635. 0x62560200: 'AnsVulgarityInfoLow',
  636. 0x62570100: 'ReqVulgarityLow',
  637. 0x62570200: 'AnsVulgarityLow',
  638. 0x62600100: 'ReqAuthenticationToken',
  639. 0x62600200: 'AnsAuthenticationToken',
  640. # Category Fmp
  641. 0x63010100: 'ReqBinaryVersion',
  642. 0x63010200: 'AnsBinaryVersion',
  643. 0x63020100: 'ReqBinaryHead',
  644. 0x63020200: 'AnsBinaryHead',
  645. 0x63030100: 'ReqBinaryData',
  646. 0x63030200: 'AnsBinaryData',
  647. 0x63040100: 'ReqBinaryFoot',
  648. 0x63040200: 'AnsBinaryFoot',
  649. 0x63100100: 'ReqFmpListVersion',
  650. 0x63100200: 'AnsFmpListVersion',
  651. 0x63110100: 'ReqFmpListHead',
  652. 0x63110200: 'AnsFmpListHead',
  653. 0x63120100: 'ReqFmpListData',
  654. 0x63120200: 'AnsFmpListData',
  655. 0x63130100: 'ReqFmpListFoot',
  656. 0x63130200: 'AnsFmpListFoot',
  657. 0x63140100: 'ReqFmpInfo',
  658. 0x63140200: 'AnsFmpInfo',
  659. # Category Layer
  660. 0x64010100: 'ReqLayerStart',
  661. 0x64010200: 'AnsLayerStart',
  662. 0x64020100: 'ReqLayerEnd',
  663. 0x64020200: 'AnsLayerEnd',
  664. 0x64031000: 'NtcLayerUserNum',
  665. 0x64100100: 'ReqLayerJump',
  666. 0x64100200: 'AnsLayerJump',
  667. 0x64110100: 'ReqLayerCreateHead',
  668. 0x64110200: 'AnsLayerCreateHead',
  669. 0x64120100: 'ReqLayerCreateSet',
  670. 0x64120200: 'AnsLayerCreateSet',
  671. 0x64130100: 'ReqLayerCreateFoot',
  672. 0x64130200: 'AnsLayerCreateFoot',
  673. 0x64140100: 'ReqLayerDown',
  674. 0x64140200: 'AnsLayerDown',
  675. 0x64141000: 'NtcLayerIn',
  676. 0x64150100: 'ReqLayerUp',
  677. 0x64150200: 'AnsLayerUp',
  678. 0x64151000: 'NtcLayerOut',
  679. 0x64160100: 'ReqLayerJumpReady',
  680. 0x64160200: 'NtcLayerJumpReady',
  681. 0x64170100: 'ReqLayerJumpGo',
  682. 0x64170200: 'NtcLayerJumpGo',
  683. 0x64200100: 'ReqLayerInfoSet',
  684. 0x64200200: 'AnsLayerInfoSet',
  685. 0x64201000: 'NtcLayerInfoSet',
  686. 0x64210100: 'ReqLayerInfo',
  687. 0x64210200: 'AnsLayerInfo',
  688. 0x64220100: 'ReqLayerParentInfo',
  689. 0x64220200: 'AnsLayerParentInfo',
  690. 0x64230100: 'ReqLayerChildInfo',
  691. 0x64230200: 'AnsLayerChildInfo',
  692. 0x64240100: 'ReqLayerChildListHead',
  693. 0x64240200: 'AnsLayerChildListHead',
  694. 0x64250100: 'ReqLayerChildListData',
  695. 0x64250200: 'AnsLayerChildListData',
  696. 0x64260100: 'ReqLayerChildListFoot',
  697. 0x64260200: 'AnsLayerChildListFoot',
  698. 0x64270100: 'ReqLayerSiblingListHead',
  699. 0x64270200: 'AnsLayerSiblingListHead',
  700. 0x64280100: 'ReqLayerSiblingListData',
  701. 0x64280200: 'AnsLayerSiblingListData',
  702. 0x64290100: 'ReqLayerSiblingListFoot',
  703. 0x64290200: 'AnsLayerSiblingListFoot',
  704. 0x64410100: 'ReqLayerHost',
  705. 0x64410200: 'AnsLayerHost',
  706. 0x64411000: 'NtcLayerHost',
  707. 0x64600100: 'ReqLayerUserInfoSet',
  708. 0x64600200: 'AnsLayerUserInfoSet',
  709. 0x64601000: 'NtcLayerUserInfoSet',
  710. 0x64630100: 'ReqLayerUserList',
  711. 0x64630200: 'AnsLayerUserList',
  712. 0x64640100: 'ReqLayerUserListHead',
  713. 0x64640200: 'AnsLayerUserListHead',
  714. 0x64650100: 'ReqLayerUserListData',
  715. 0x64650200: 'AnsLayerUserListData',
  716. 0x64660100: 'ReqLayerUserListFoot',
  717. 0x64660200: 'AnsLayerUserListFoot',
  718. 0x64670100: 'ReqLayerUserSearchHead',
  719. 0x64670200: 'AnsLayerUserSearchHead',
  720. 0x64680100: 'ReqLayerUserSearchData',
  721. 0x64680200: 'AnsLayerUserSearchData',
  722. 0x64690100: 'ReqLayerUserSearchFoot',
  723. 0x64690200: 'AnsLayerUserSearchFoot',
  724. 0x64701000: 'NtcLayerBinary',
  725. 0x64711000: 'NtcLayerUserPosition',
  726. 0x64721000: 'NtcLayerChat',
  727. 0x64730100: 'ReqLayerTell',
  728. 0x64730200: 'AnsLayerTell',
  729. 0x64731000: 'NtcLayerTell',
  730. 0x64741000: 'Ntc0x6474',
  731. 0x64751000: 'NtcLayerBinary2', # (partner specified)
  732. 0x64800100: 'ReqLayerMediationLock',
  733. 0x64800200: 'AnsLayerMediationLock',
  734. 0x64801000: 'NtcLayerMediationLock',
  735. 0x64810100: 'ReqLayerMediationUnlock',
  736. 0x64810200: 'AnsLayerMediationUnlock',
  737. 0x64811000: 'NtcLayerMediationUnlock',
  738. 0x64820100: 'ReqLayerMediationList',
  739. 0x64820200: 'AnsLayerMediationList',
  740. 0x64900100: 'ReqLayerDetailSearchHead',
  741. 0x64900200: 'AnsLayerDetailSearchHead',
  742. 0x64910100: 'ReqLayerDetailSearchData',
  743. 0x64910200: 'AnsLayerDetailSearchData',
  744. 0x64920100: 'ReqLayerDetailSearchFoot',
  745. 0x64920200: 'AnsLayerDetailSearchFoot',
  746. # Category Circle
  747. 0x65010100: 'ReqCircleCreate',
  748. 0x65010200: 'AnsCircleCreate',
  749. 0x65020100: 'ReqCircleInfo',
  750. 0x65020200: 'AnsCircleInfo',
  751. 0x65030100: 'ReqCircleJoin',
  752. 0x65030200: 'AnsCircleJoin',
  753. 0x65031000: 'NtcCircleJoin',
  754. 0x65040100: 'ReqCircleLeave',
  755. 0x65040200: 'AnsCircleLeave',
  756. 0x65041000: 'NtcCircleLeave',
  757. 0x65050100: 'ReqCircleBreak',
  758. 0x65050200: 'AnsCircleBreak',
  759. 0x65051000: 'NtcCircleBreak',
  760. 0x65100100: 'ReqCircleMatchOptionSet',
  761. 0x65100200: 'AnsCircleMatchOptionSet',
  762. 0x65101000: 'NtcCircleMatchOptionSet',
  763. 0x65110100: 'ReqCircleMatchOptionGet',
  764. 0x65110200: 'AnsCircleMatchOptionGet',
  765. 0x65120100: 'ReqCircleMatchStart',
  766. 0x65120200: 'AnsCircleMatchStart',
  767. 0x65121000: 'NtcCircleMatchStart',
  768. 0x65130100: 'ReqCircleMatchEnd',
  769. 0x65130200: 'AnsCircleMatchEnd',
  770. 0x65200100: 'ReqCircleInfoSet',
  771. 0x65200200: 'AnsCircleInfoSet',
  772. 0x65201000: 'NtcCircleInfoSet',
  773. 0x65270100: 'ReqCircleListLayer',
  774. 0x65270200: 'AnsCircleListLayer',
  775. 0x65280100: 'ReqCircleSearchHead',
  776. 0x65280200: 'AnsCircleSearchHead',
  777. 0x65290100: 'ReqCircleSearchData',
  778. 0x65290200: 'AnsCircleSearchData',
  779. 0x652a0100: 'ReqCircleSearchFoot',
  780. 0x652a0200: 'AnsCircleSearchFoot',
  781. 0x65350100: 'ReqCircleKick',
  782. 0x65350200: 'AnsCircleKick',
  783. 0x65351000: 'NtcCircleKick',
  784. 0x65360100: 'ReqCircleDeleteKickList',
  785. 0x65360200: 'AnsCircleDeleteKickList',
  786. 0x65400100: 'ReqCircleHostHandover',
  787. 0x65400200: 'AnsCircleHostHandover',
  788. 0x65401000: 'NtcCircleHostHandover',
  789. 0x65410100: 'ReqCircleHost',
  790. 0x65410200: 'AnsCircleHost',
  791. 0x65411000: 'NtcCircleHost',
  792. 0x65600100: 'ReqCircleUserList',
  793. 0x65600200: 'AnsCircleUserList',
  794. 0x65701000: 'NtcCircleBinary',
  795. 0x65711000: 'NtcCircleBinary2',
  796. 0x65721000: 'NtcCircleChat',
  797. 0x65730100: 'ReqCircleTell',
  798. 0x65730200: 'AnsCircleTell',
  799. 0x65731000: 'NtcCircleTell',
  800. 0x65800100: 'ReqCircleInfoNoticeSet',
  801. 0x65800200: 'AnsCircleInfoNoticeSet',
  802. 0x65811000: 'NtcCircleListLayerCreate',
  803. 0x65821000: 'NtcCircleListLayerChange',
  804. 0x65831000: 'NtcCircleListLayerDelete',
  805. 0x65900100: 'ReqMcsCreate',
  806. 0x65900200: 'AnsMcsCreate',
  807. 0x65901000: 'NtcMcsCreate',
  808. 0x65911000: 'NtcMcsStart',
  809. # Category User
  810. 0x66110100: 'ReqTell',
  811. 0x66110200: 'AnsTell',
  812. 0x66111000: 'NtcTell',
  813. 0x66120100: 'ReqBinaryUser',
  814. 0x66120200: 'AnsBinaryUser',
  815. 0x66121000: 'NtcBinaryUser',
  816. 0x66131000: 'NtcBinaryServer',
  817. 0x66300100: 'ReqUserSearchSet',
  818. 0x66300200: 'AnsUserSearchSet',
  819. 0x66310100: 'ReqUserBinarySet',
  820. 0x66310200: 'AnsUserBinarySet',
  821. 0x66320100: 'ReqUserBinaryNotice',
  822. 0x66320200: 'AnsUserBinaryNotice',
  823. 0x66321000: 'NtcUserBinaryNotice',
  824. 0x66330100: 'ReqUserSearchHead',
  825. 0x66330200: 'AnsUserSearchHead',
  826. 0x66340100: 'ReqUserSearchData',
  827. 0x66340200: 'AnsUserSearchData',
  828. 0x66350100: 'ReqUserSearchFoot',
  829. 0x66350200: 'AnsUserSearchFoot',
  830. 0x66360100: 'ReqUserSearchInfo',
  831. 0x66360200: 'AnsUserSearchInfo',
  832. 0x66370100: 'ReqUserSearchInfoMine',
  833. 0x66370200: 'AnsUserSearchInfoMine',
  834. 0x66400100: 'ReqUserStatusSet',
  835. 0x66400200: 'AnsUserStatusSet',
  836. 0x66410100: 'ReqUserStatus',
  837. 0x66410200: 'AnsUserStatus',
  838. 0x66500100: 'ReqFriendAdd',
  839. 0x66500200: 'AnsFriendAdd',
  840. 0x66501000: 'NtcFriendAdd',
  841. 0x66510100: 'ReqFriendAccept',
  842. 0x66510200: 'AnsFriendAccept',
  843. 0x66511000: 'NtcFriendAccept',
  844. 0x66530100: 'ReqFriendDelete',
  845. 0x66530200: 'AnsFriendDelete',
  846. 0x66540100: 'ReqFriendList',
  847. 0x66540200: 'AnsFriendList',
  848. 0x66600100: 'ReqBlackAdd',
  849. 0x66600200: 'AnsBlackAdd',
  850. 0x66610100: 'ReqBlackDelete',
  851. 0x66610200: 'AnsBlackDelete',
  852. 0x66620100: 'ReqBlackList',
  853. 0x66620200: 'AnsBlackList',
  854. # Category Agreement
  855. 0x69010100: 'ReqAgreementPageNum',
  856. 0x69010200: 'AnsAgreementPageNum',
  857. 0x69020100: 'ReqAgreementPageInfo',
  858. 0x69020200: 'AnsAgreementPageInfo',
  859. 0x69030100: 'ReqAgreementPage',
  860. 0x69030200: 'AnsAgreementPage',
  861. 0x69100100: 'ReqAgreement',
  862. 0x69100200: 'AnsAgreement'
  863. }
  864. class PatID4:
  865. # Category Opn
  866. ReqLineCheck = 0x60010100
  867. AnsLineCheck = 0x60010200
  868. ReqServerTime = 0x60020100
  869. AnsServerTime = 0x60020200
  870. ReqShut = 0x60100100
  871. AnsShut = 0x60100200
  872. NtcShut = 0x60101000
  873. NtcRecconect = 0x60111000
  874. ReqConnection = 0x60200100
  875. AnsConnection = 0x60200200
  876. NtcLogin = 0x60211000
  877. ReqTicket = 0x60300100
  878. AnsTicket = 0x60300200
  879. ReqTicket2 = 0x60310100
  880. AnsTicket2 = 0x60310200
  881. ReqWarning = 0x60400100
  882. AnsWarning = 0x60400200
  883. NtcCollectionLog = 0x60501000
  884. ReqCommonKey = 0x60700100
  885. AnsCommonKey = 0x60700200
  886. NtcCheatCheck = 0x60801000
  887. ReqMemoryCheck = 0x60810100
  888. AnsMemoryCheck = 0x60810200
  889. # Category Rfp
  890. ReqLoginInfo = 0x61010100
  891. AnsLoginInfo = 0x61010200
  892. ReqChargeInfo = 0x61020100
  893. AnsChargeInfo = 0x61020200
  894. ReqUserListHead = 0x61100100
  895. AnsUserListHead = 0x61100200
  896. ReqUserListData = 0x61110100
  897. AnsUserListData = 0x61110200
  898. ReqUserListFoot = 0x61120100
  899. AnsUserListFoot = 0x61120200
  900. ReqUserObject = 0x61200100
  901. AnsUserObject = 0x61200200
  902. ReqFmpListVersion = 0x61300100
  903. AnsFmpListVersion = 0x61300200
  904. ReqFmpListHead = 0x61310100
  905. AnsFmpListHead = 0x61310200
  906. ReqFmpListData = 0x61320100
  907. AnsFmpListData = 0x61320200
  908. ReqFmpListFoot = 0x61330100
  909. AnsFmpListFoot = 0x61330200
  910. ReqFmpInfo = 0x61340100
  911. AnsFmpInfo = 0x61340200
  912. ReqRfpConnect = 0x61400100
  913. AnsRfpConnect = 0x61400200
  914. # Category Lmp
  915. ReqLmpConnect = 0x62010100
  916. AnsLmpConnect = 0x62010200
  917. ReqTermsVersion = 0x62100100
  918. AnsTermsVersion = 0x62100200
  919. ReqTerms = 0x62110100
  920. AnsTerms = 0x62110200
  921. ReqSubTermsInfo = 0x62130100
  922. AnsSubTermsInfo = 0x62130200
  923. ReqSubTerms = 0x62140100
  924. AnsSubTerms = 0x62140200
  925. ReqMaintenance = 0x62200100
  926. AnsMaintenance = 0x62200200
  927. ReqAnnounce = 0x62300100
  928. AnsAnnounce = 0x62300200
  929. ReqNoCharge = 0x62310100
  930. AnsNoCharge = 0x62310200
  931. ReqMediaVersionInfo = 0x62410100
  932. AnsMediaVersionInfo = 0x62410200
  933. ReqVulgarityInfoHighJAP = 0x62500100
  934. AnsVulgarityInfoHighJAP = 0x62500200
  935. ReqVulgarityHighJAP = 0x62510100
  936. AnsVulgarityHighJAP = 0x62510200
  937. ReqVulgarityInfoLowJAP = 0x62520100
  938. AnsVulgarityInfoLowJAP = 0x62520200
  939. ReqVulgarityLowJAP = 0x62530100
  940. AnsVulgarityLowJAP = 0x62530200
  941. ReqVulgarityInfoHigh = 0x62540100
  942. AnsVulgarityInfoHigh = 0x62540200
  943. ReqVulgarityHigh = 0x62550100
  944. AnsVulgarityHigh = 0x62550200
  945. ReqVulgarityInfoLow = 0x62560100
  946. AnsVulgarityInfoLow = 0x62560200
  947. ReqVulgarityLow = 0x62570100
  948. AnsVulgarityLow = 0x62570200
  949. ReqAuthenticationToken = 0x62600100
  950. AnsAuthenticationToken = 0x62600200
  951. # Category Fmp
  952. ReqBinaryVersion = 0x63010100
  953. AnsBinaryVersion = 0x63010200
  954. ReqBinaryHead = 0x63020100
  955. AnsBinaryHead = 0x63020200
  956. ReqBinaryData = 0x63030100
  957. AnsBinaryData = 0x63030200
  958. ReqBinaryFoot = 0x63040100
  959. AnsBinaryFoot = 0x63040200
  960. ReqFmpListVersion2 = 0x63100100
  961. AnsFmpListVersion2 = 0x63100200
  962. ReqFmpListHead2 = 0x63110100
  963. AnsFmpListHead2 = 0x63110200
  964. ReqFmpListData2 = 0x63120100
  965. AnsFmpListData2 = 0x63120200
  966. ReqFmpListFoot2 = 0x63130100
  967. AnsFmpListFoot2 = 0x63130200
  968. ReqFmpInfo2 = 0x63140100
  969. AnsFmpInfo2 = 0x63140200
  970. # Category Layer
  971. ReqLayerStart = 0x64010100
  972. AnsLayerStart = 0x64010200
  973. ReqLayerEnd = 0x64020100
  974. AnsLayerEnd = 0x64020200
  975. NtcLayerUserNum = 0x64031000
  976. ReqLayerJump = 0x64100100
  977. AnsLayerJump = 0x64100200
  978. ReqLayerCreateHead = 0x64110100
  979. AnsLayerCreateHead = 0x64110200
  980. ReqLayerCreateSet = 0x64120100
  981. AnsLayerCreateSet = 0x64120200
  982. ReqLayerCreateFoot = 0x64130100
  983. AnsLayerCreateFoot = 0x64130200
  984. ReqLayerDown = 0x64140100
  985. AnsLayerDown = 0x64140200
  986. NtcLayerIn = 0x64141000
  987. ReqLayerUp = 0x64150100
  988. AnsLayerUp = 0x64150200
  989. NtcLayerOut = 0x64151000
  990. ReqLayerJumpReady = 0x64160100
  991. NtcLayerJumpReady = 0x64160200
  992. ReqLayerJumpGo = 0x64170100
  993. NtcLayerJumpGo = 0x64170200
  994. ReqLayerInfoSet = 0x64200100
  995. AnsLayerInfoSet = 0x64200200
  996. NtcLayerInfoSet = 0x64201000
  997. ReqLayerInfo = 0x64210100
  998. AnsLayerInfo = 0x64210200
  999. ReqLayerParentInfo = 0x64220100
  1000. AnsLayerParentInfo = 0x64220200
  1001. ReqLayerChildInfo = 0x64230100
  1002. AnsLayerChildInfo = 0x64230200
  1003. ReqLayerChildListHead = 0x64240100
  1004. AnsLayerChildListHead = 0x64240200
  1005. ReqLayerChildListData = 0x64250100
  1006. AnsLayerChildListData = 0x64250200
  1007. ReqLayerChildListFoot = 0x64260100
  1008. AnsLayerChildListFoot = 0x64260200
  1009. ReqLayerSiblingListHead = 0x64270100
  1010. AnsLayerSiblingListHead = 0x64270200
  1011. ReqLayerSiblingListData = 0x64280100
  1012. AnsLayerSiblingListData = 0x64280200
  1013. ReqLayerSiblingListFoot = 0x64290100
  1014. AnsLayerSiblingListFoot = 0x64290200
  1015. ReqLayerHost = 0x64410100
  1016. AnsLayerHost = 0x64410200
  1017. NtcLayerHost = 0x64411000
  1018. ReqLayerUserInfoSet = 0x64600100
  1019. AnsLayerUserInfoSet = 0x64600200
  1020. NtcLayerUserInfoSet = 0x64601000
  1021. ReqLayerUserList = 0x64630100
  1022. AnsLayerUserList = 0x64630200
  1023. ReqLayerUserListHead = 0x64640100
  1024. AnsLayerUserListHead = 0x64640200
  1025. ReqLayerUserListData = 0x64650100
  1026. AnsLayerUserListData = 0x64650200
  1027. ReqLayerUserListFoot = 0x64660100
  1028. AnsLayerUserListFoot = 0x64660200
  1029. ReqLayerUserSearchHead = 0x64670100
  1030. AnsLayerUserSearchHead = 0x64670200
  1031. ReqLayerUserSearchData = 0x64680100
  1032. AnsLayerUserSearchData = 0x64680200
  1033. ReqLayerUserSearchFoot = 0x64690100
  1034. AnsLayerUserSearchFoot = 0x64690200
  1035. NtcLayerBinary = 0x64701000
  1036. NtcLayerUserPosition = 0x64711000
  1037. NtcLayerChat = 0x64721000
  1038. ReqLayerTell = 0x64730100
  1039. AnsLayerTell = 0x64730200
  1040. NtcLayerTell = 0x64731000
  1041. Ntc0x6474 = 0x64741000
  1042. NtcLayerBinary2 = 0x64751000 # (partner specified)
  1043. ReqLayerMediationLock = 0x64800100
  1044. AnsLayerMediationLock = 0x64800200
  1045. NtcLayerMediationLock = 0x64801000
  1046. ReqLayerMediationUnlock = 0x64810100
  1047. AnsLayerMediationUnlock = 0x64810200
  1048. NtcLayerMediationUnlock = 0x64811000
  1049. ReqLayerMediationList = 0x64820100
  1050. AnsLayerMediationList = 0x64820200
  1051. ReqLayerDetailSearchHead = 0x64900100
  1052. AnsLayerDetailSearchHead = 0x64900200
  1053. ReqLayerDetailSearchData = 0x64910100
  1054. AnsLayerDetailSearchData = 0x64910200
  1055. ReqLayerDetailSearchFoot = 0x64920100
  1056. AnsLayerDetailSearchFoot = 0x64920200
  1057. # Category Circle
  1058. ReqCircleCreate = 0x65010100
  1059. AnsCircleCreate = 0x65010200
  1060. ReqCircleInfo = 0x65020100
  1061. AnsCircleInfo = 0x65020200
  1062. ReqCircleJoin = 0x65030100
  1063. AnsCircleJoin = 0x65030200
  1064. NtcCircleJoin = 0x65031000
  1065. ReqCircleLeave = 0x65040100
  1066. AnsCircleLeave = 0x65040200
  1067. NtcCircleLeave = 0x65041000
  1068. ReqCircleBreak = 0x65050100
  1069. AnsCircleBreak = 0x65050200
  1070. NtcCircleBreak = 0x65051000
  1071. ReqCircleMatchOptionSet = 0x65100100
  1072. AnsCircleMatchOptionSet = 0x65100200
  1073. NtcCircleMatchOptionSet = 0x65101000
  1074. ReqCircleMatchOptionGet = 0x65110100
  1075. AnsCircleMatchOptionGet = 0x65110200
  1076. ReqCircleMatchStart = 0x65120100
  1077. AnsCircleMatchStart = 0x65120200
  1078. NtcCircleMatchStart = 0x65121000
  1079. ReqCircleMatchEnd = 0x65130100
  1080. AnsCircleMatchEnd = 0x65130200
  1081. ReqCircleInfoSet = 0x65200100
  1082. AnsCircleInfoSet = 0x65200200
  1083. NtcCircleInfoSet = 0x65201000
  1084. ReqCircleListLayer = 0x65270100
  1085. AnsCircleListLayer = 0x65270200
  1086. ReqCircleSearchHead = 0x65280100
  1087. AnsCircleSearchHead = 0x65280200
  1088. ReqCircleSearchData = 0x65290100
  1089. AnsCircleSearchData = 0x65290200
  1090. ReqCircleSearchFoot = 0x652a0100
  1091. AnsCircleSearchFoot = 0x652a0200
  1092. ReqCircleKick = 0x65350100
  1093. AnsCircleKick = 0x65350200
  1094. NtcCircleKick = 0x65351000
  1095. ReqCircleDeleteKickList = 0x65360100
  1096. AnsCircleDeleteKickList = 0x65360200
  1097. ReqCircleHostHandover = 0x65400100
  1098. AnsCircleHostHandover = 0x65400200
  1099. NtcCircleHostHandover = 0x65401000
  1100. ReqCircleHost = 0x65410100
  1101. AnsCircleHost = 0x65410200
  1102. NtcCircleHost = 0x65411000
  1103. ReqCircleUserList = 0x65600100
  1104. AnsCircleUserList = 0x65600200
  1105. NtcCircleBinary = 0x65701000
  1106. NtcCircleBinary2 = 0x65711000
  1107. NtcCircleChat = 0x65721000
  1108. ReqCircleTell = 0x65730100
  1109. AnsCircleTell = 0x65730200
  1110. NtcCircleTell = 0x65731000
  1111. ReqCircleInfoNoticeSet = 0x65800100
  1112. AnsCircleInfoNoticeSet = 0x65800200
  1113. NtcCircleListLayerCreate = 0x65811000
  1114. NtcCircleListLayerChange = 0x65821000
  1115. NtcCircleListLayerDelete = 0x65831000
  1116. ReqMcsCreate = 0x65900100
  1117. AnsMcsCreate = 0x65900200
  1118. NtcMcsCreate = 0x65901000
  1119. NtcMcsStart = 0x65911000
  1120. # Category User
  1121. ReqTell = 0x66110100
  1122. AnsTell = 0x66110200
  1123. NtcTell = 0x66111000
  1124. ReqBinaryUser = 0x66120100
  1125. AnsBinaryUser = 0x66120200
  1126. NtcBinaryUser = 0x66121000
  1127. NtcBinaryServer = 0x66131000
  1128. ReqUserSearchSet = 0x66300100
  1129. AnsUserSearchSet = 0x66300200
  1130. ReqUserBinarySet = 0x66310100
  1131. AnsUserBinarySet = 0x66310200
  1132. ReqUserBinaryNotice = 0x66320100
  1133. AnsUserBinaryNotice = 0x66320200
  1134. NtcUserBinaryNotice = 0x66321000
  1135. ReqUserSearchHead = 0x66330100
  1136. AnsUserSearchHead = 0x66330200
  1137. ReqUserSearchData = 0x66340100
  1138. AnsUserSearchData = 0x66340200
  1139. ReqUserSearchFoot = 0x66350100
  1140. AnsUserSearchFoot = 0x66350200
  1141. ReqUserSearchInfo = 0x66360100
  1142. AnsUserSearchInfo = 0x66360200
  1143. ReqUserSearchInfoMine = 0x66370100
  1144. AnsUserSearchInfoMine = 0x66370200
  1145. ReqUserStatusSet = 0x66400100
  1146. AnsUserStatusSet = 0x66400200
  1147. ReqUserStatus = 0x66410100
  1148. AnsUserStatus = 0x66410200
  1149. ReqFriendAdd = 0x66500100
  1150. AnsFriendAdd = 0x66500200
  1151. NtcFriendAdd = 0x66501000
  1152. ReqFriendAccept = 0x66510100
  1153. AnsFriendAccept = 0x66510200
  1154. NtcFriendAccept = 0x66511000
  1155. ReqFriendDelete = 0x66530100
  1156. AnsFriendDelete = 0x66530200
  1157. ReqFriendList = 0x66540100
  1158. AnsFriendList = 0x66540200
  1159. ReqBlackAdd = 0x66600100
  1160. AnsBlackAdd = 0x66600200
  1161. ReqBlackDelete = 0x66610100
  1162. AnsBlackDelete = 0x66610200
  1163. ReqBlackList = 0x66620100
  1164. AnsBlackList = 0x66620200
  1165. # Category Agreement
  1166. ReqAgreementPageNum = 0x69010100
  1167. AnsAgreementPageNum = 0x69010200
  1168. ReqAgreementPageInfo = 0x69020100
  1169. AnsAgreementPageInfo = 0x69020200
  1170. ReqAgreementPage = 0x69030100
  1171. AnsAgreementPage = 0x69030200
  1172. ReqAgreement = 0x69100100
  1173. AnsAgreement = 0x69100200
  1174. class PatServerType:
  1175. LMP = 0
  1176. FMP = 1
  1177. OPN = 2
  1178. RFP = 3