Messages.cs 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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 SMSG_Realm_List
  152. {
  153. [DataMember(Order = 1, IsRequired = true)]
  154. public List<Realm_List_Gate> GateList { get; set; }
  155. }
  156. [DataContract]
  157. public class CMSG_Auth_Session
  158. {
  159. [DataMember(Order = 1, IsRequired = true)]
  160. public uint ClientBuild { get; set; }
  161. [DataMember(Order = 2, IsRequired = true)]
  162. public uint Unk2 { get; set; }
  163. [DataMember(Order = 3, IsRequired = true)]
  164. public byte[] Username { get; set; }
  165. [DataMember(Order = 4, IsRequired = true)]
  166. public uint Unk3 { get; set; }
  167. [DataMember(Order = 5, IsRequired = true)]
  168. public uint ClientSeed { get; set; }
  169. [DataMember(Order = 6, IsRequired = true)]
  170. public uint Unk4 { get; set; }
  171. [DataMember(Order = 7, IsRequired = true)]
  172. public byte[] Digest { get; set; }
  173. [DataMember(Order = 8, IsRequired = false)]
  174. public byte[] Mac { get; set; }
  175. [DataMember(Order = 9, IsRequired = false)]
  176. public byte[] Hd { get; set; }
  177. }
  178. // gate message
  179. [DataContract]
  180. public class SMSG_Auth_Challenge
  181. {
  182. [DataMember(Order = 1, IsRequired = true)]
  183. public uint Num { get; set; }
  184. [DataMember(Order = 2, IsRequired = true)]
  185. public uint Seed { get; set; }
  186. [DataMember(Order = 3)]
  187. public List<uint> Random { get; set; }
  188. }
  189. [DataContract]
  190. public class SMSG_Auth_Response
  191. {
  192. [DataMember(Order = 1, IsRequired = true)]
  193. public uint ErrorCode { get; set; }
  194. }
  195. [DataContract]
  196. public class CMSG_Boss_Gm
  197. {
  198. [DataMember(Order = 1, IsRequired = true)]
  199. public string Message { get; set; }
  200. }
  201. [DataContract]
  202. public class SMSG_Boss_ServersInfo
  203. {
  204. [DataMember(Order = 1, IsRequired = true)]
  205. public List<string> Name { get; set; }
  206. }
  207. [DataContract]
  208. public class SMSG_Boss_Command_Response
  209. {
  210. [DataMember(Order = 1, IsRequired = true)]
  211. public uint ErrorCode { get; set; }
  212. [DataMember(Order = 2, IsRequired = false)]
  213. public string Content { get; set; }
  214. }
  215. }