Messages.cs 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. using System.Collections.Generic;
  2. using System.Runtime.Serialization;
  3. namespace BossBase
  4. {
  5. public static class MessageOpcode
  6. {
  7. // realm message opcode
  8. public const ushort CMSG_REALM_LIST = 16;
  9. public const ushort CMSG_BOSS_GM = 17;
  10. public const ushort CMSG_AUTH_LOGON_PERMIT = 800;
  11. public const ushort CMSG_OTP_PASSWORD = 801;
  12. public const ushort CMSG_PPC_PASSWORD = 802;
  13. public const ushort CMSG_AUTH_LOGON_CHALLENGE = 803;
  14. public const ushort CMSG_AUTH_LOGON_PROOF = 805;
  15. public const ushort SMSG_AUTH_LOGON_CHALLENGE_RESPONSE = 900;
  16. public const ushort SMSG_REALM_LOGON_RESPONSE = 901;
  17. public const ushort SMSG_REALM_LIST = 902;
  18. public const ushort SMSG_LOCK_FOR_SAFE_TIME = 903;
  19. public const ushort SMSG_PASSWORD_PROTECT_TYPE = 904;
  20. public const ushort SMSG_AUTH_LOGON_PROOF_M2 = 905;
  21. // gate message opcode
  22. public const ushort CMSG_AUTH_SESSION = 2;
  23. public const ushort SMSG_AUTH_CHALLENGE = 502;
  24. public const ushort SMSG_AUTH_RESPONSE = 503;
  25. public const ushort SMSG_SERVERTIME = 510;
  26. public const ushort SMSG_BOSS_SERVERSINFO = 22000;
  27. public const ushort SMSG_BOSS_COMMAND_RESPONSE = 22001;
  28. }
  29. public static class ErrorCode
  30. {
  31. // realm error code
  32. public const int REALM_AUTH_SUCCESS = 0;
  33. // Unable to connect
  34. public const int REALM_AUTH_FAILURE = 1;
  35. // Unable to connect
  36. public const int REALM_AUTH_UNKNOWN1 = 2;
  37. // This game> account has been closed and is no longer available for use.
  38. // Please go to site>/banned.html for further information.
  39. public const int REALM_AUTH_ACCOUNT_BANNED = 3;
  40. // The information you have entered is not valid.
  41. // Please check the spelling of the account name and password.
  42. // If you need help in retrieving a lost or stolen password,
  43. // see site> for more information
  44. public const int REALM_AUTH_NO_MATCH = 4;
  45. // The information you have entered is not valid.
  46. // Please check the spelling of the account name and password.
  47. // If you need help in retrieving a lost or stolen password,
  48. // see site> for more information
  49. public const int REALM_AUTH_UNKNOWN2 = 5;
  50. // This account is already logged into game.
  51. // Please check the spelling and try again.
  52. public const int REALM_AUTH_ACCOUNT_IN_USE = 6;
  53. // You have used up your prepaid time for this account.
  54. // Please purchase more to continue playing
  55. public const int REALM_AUTH_PREPAID_TIME_LIMIT = 7;
  56. // Could not log in to game> at this time. Please try again later.
  57. public const int REALM_AUTH_SERVER_FULL = 8;
  58. // Unable to validate game version.
  59. // This may be caused by file corruption or interference of another program.
  60. // Please visit site for more information and possible solutions to this
  61. // issue.
  62. public const int REALM_AUTH_WRONG_BUILD_NUMBER = 9;
  63. // Downloading
  64. public const int REALM_AUTH_UPDATE_CLIENT = 10;
  65. // Unable to connect
  66. public const int REALM_AUTH_UNKNOWN3 = 11;
  67. // This game account has been temporarily suspended.
  68. // Please go to site further information.
  69. public const int REALM_AUTH_ACCOUNT_FREEZED = 12;
  70. // Unable to connect
  71. public const int REALM_AUTH_UNKNOWN4 = 13;
  72. // Connected.
  73. public const int REALM_AUTH_UNKNOWN5 = 14;
  74. // Access to this account has been blocked by parental controls.
  75. // Your settings may be changed in your account preferences at site.
  76. public const int REALM_AUTH_PARENTAL_CONTROL = 15;
  77. // 其它error code
  78. public const int RESPONSE_SUCCESS = 0;
  79. public const int AUTH_OK = 12;
  80. public const int BOSS_PLAYER_NOT_FOUND = 164000;
  81. }
  82. [DataContract]
  83. public class CMSG_Auth_Logon_Permit
  84. {
  85. [DataMember(Order = 1, IsRequired = true)]
  86. public byte[] Account { get; set; }
  87. [DataMember(Order = 2, IsRequired = true)]
  88. public byte[] PasswordMd5 { get; set; }
  89. }
  90. [DataContract]
  91. public class SMSG_Password_Protect_Type
  92. {
  93. [DataMember(Order = 1, IsRequired = true)]
  94. public uint Code { get; set; }
  95. [DataMember(Order = 2, IsRequired = true)]
  96. public uint SubCode { get; set; }
  97. [DataMember(Order = 3, IsRequired = true)]
  98. public uint PasswordProtectType { get; set; }
  99. [DataMember(Order = 4, IsRequired = true)]
  100. public byte[] PpcCoordinate { get; set; }
  101. }
  102. [DataContract]
  103. public class CMSG_Auth_Logon_Challenge
  104. {
  105. }
  106. [DataContract]
  107. public class SMSG_Auth_Logon_Challenge_Response
  108. {
  109. [DataMember(Order = 1, IsRequired = true)]
  110. public int ErrorCode { get; set; }
  111. [DataMember(Order = 2, IsRequired = true)]
  112. public byte[] B { get; set; }
  113. [DataMember(Order = 3, IsRequired = true)]
  114. public byte[] G { get; set; }
  115. [DataMember(Order = 4, IsRequired = true)]
  116. public byte[] N { get; set; }
  117. [DataMember(Order = 5, IsRequired = true)]
  118. public byte[] S { get; set; }
  119. }
  120. [DataContract]
  121. public class CMSG_Auth_Logon_Proof
  122. {
  123. [DataMember(Order = 1, IsRequired = true)]
  124. public byte[] A { get; set; }
  125. [DataMember(Order = 2, IsRequired = true)]
  126. public byte[] M { get; set; }
  127. }
  128. [DataContract]
  129. public class CMSG_Realm_List
  130. {
  131. }
  132. [DataContract]
  133. public class SMSG_Auth_Logon_Proof_M2
  134. {
  135. [DataMember(Order = 1, IsRequired = true)]
  136. public int ErrorCode { get; set; }
  137. [DataMember(Order = 2, IsRequired = true)]
  138. public byte[] M { get; set; }
  139. }
  140. [DataContract]
  141. public class Realm_List_Gate
  142. {
  143. [DataMember(Order = 1, IsRequired = true)]
  144. public byte[] Name { get; set; }
  145. [DataMember(Order = 2, IsRequired = true)]
  146. public byte[] Address { get; set; }
  147. [DataMember(Order = 3, IsRequired = true)]
  148. public float CityLoad { get; set; }
  149. }
  150. [DataContract]
  151. public class Realm_List_City
  152. {
  153. [DataMember(Order = 1, IsRequired = true)]
  154. public string Name { get; set; }
  155. [DataMember(Order = 2, IsRequired = true)]
  156. public float CityLoad { get; set; }
  157. [DataMember(Order = 3, IsRequired = true)]
  158. public bool IsEnable { get; set; }
  159. }
  160. [DataContract]
  161. public class SMSG_Realm_List
  162. {
  163. [DataMember(Order = 1, IsRequired = true)]
  164. public string GateIP { get; set; }
  165. [DataMember(Order = 2, IsRequired = true)]
  166. public int GatePort { get; set; }
  167. [DataMember(Order = 3, IsRequired = true)]
  168. public List<Realm_List_City> GateList { get; set; }
  169. }
  170. [DataContract]
  171. public class CMSG_Auth_Session
  172. {
  173. [DataMember(Order = 1, IsRequired = true)]
  174. public uint ClientBuild { get; set; }
  175. [DataMember(Order = 2, IsRequired = true)]
  176. public uint Unk2 { get; set; }
  177. [DataMember(Order = 3, IsRequired = true)]
  178. public byte[] Username { get; set; }
  179. [DataMember(Order = 4, IsRequired = true)]
  180. public uint Unk3 { get; set; }
  181. [DataMember(Order = 5, IsRequired = true)]
  182. public uint ClientSeed { get; set; }
  183. [DataMember(Order = 6, IsRequired = true)]
  184. public uint Unk4 { get; set; }
  185. [DataMember(Order = 7, IsRequired = true)]
  186. public byte[] Digest { get; set; }
  187. [DataMember(Order = 8, IsRequired = false)]
  188. public byte[] Mac { get; set; }
  189. [DataMember(Order = 9, IsRequired = false)]
  190. public byte[] Hd { get; set; }
  191. }
  192. // gate message
  193. [DataContract]
  194. public class SMSG_Auth_Challenge
  195. {
  196. [DataMember(Order = 1, IsRequired = true)]
  197. public uint Num { get; set; }
  198. [DataMember(Order = 2, IsRequired = true)]
  199. public uint Seed { get; set; }
  200. [DataMember(Order = 3)]
  201. public List<uint> Random { get; set; }
  202. }
  203. [DataContract]
  204. public class SMSG_Auth_Response
  205. {
  206. [DataMember(Order = 1, IsRequired = true)]
  207. public uint ErrorCode { get; set; }
  208. }
  209. [DataContract]
  210. public class CMSG_Boss_Gm
  211. {
  212. [DataMember(Order = 1, IsRequired = true)]
  213. public string Message { get; set; }
  214. }
  215. [DataContract]
  216. public class SMSG_Boss_ServersInfo
  217. {
  218. [DataMember(Order = 1, IsRequired = true)]
  219. public List<string> Name { get; set; }
  220. }
  221. [DataContract]
  222. public class SMSG_Boss_Command_Response
  223. {
  224. [DataMember(Order = 1, IsRequired = true)]
  225. public uint ErrorCode { get; set; }
  226. [DataMember(Order = 2, IsRequired = false)]
  227. public string Content { get; set; }
  228. }
  229. [DataContract]
  230. public class BossMailItem
  231. {
  232. [DataMember(Order = 1, IsRequired = false)]
  233. public uint item_id { get; set; }
  234. [DataMember(Order = 2, IsRequired = false)]
  235. public uint item_count { get; set; }
  236. }
  237. [DataContract]
  238. public class BossMail
  239. {
  240. [DataMember(Order = 1, IsRequired = true)]
  241. public string sender_name { get; set; }
  242. [DataMember(Order = 2, IsRequired = true)]
  243. public ulong receiver_guid { get; set; }
  244. [DataMember(Order = 3, IsRequired = true)]
  245. public string subject { get; set; }
  246. [DataMember(Order = 4, IsRequired = true)]
  247. public string content { get; set; }
  248. [DataMember(Order = 5, IsRequired = false)]
  249. public uint free_gold { get; set; }
  250. [DataMember(Order = 6, IsRequired = false)]
  251. public uint silver { get; set; }
  252. [DataMember(Order = 7, IsRequired = false)]
  253. public Dictionary<int, int> item_dict { get; set; }
  254. }
  255. }