Messages.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. using System.Collections.Generic;
  2. using System.Runtime.Serialization;
  3. namespace BossClient
  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. }
  28. public static class ErrorCode
  29. {
  30. // realm error code
  31. public const int REALM_AUTH_SUCCESS = 0;
  32. // Unable to connect
  33. public const int REALM_AUTH_FAILURE = 1;
  34. // Unable to connect
  35. public const int REALM_AUTH_UNKNOWN1 = 2;
  36. // This game> account has been closed and is no longer available for use.
  37. // Please go to site>/banned.html for further information.
  38. public const int REALM_AUTH_ACCOUNT_BANNED = 3;
  39. // The information you have entered is not valid.
  40. // Please check the spelling of the account name and password.
  41. // If you need help in retrieving a lost or stolen password,
  42. // see site> for more information
  43. public const int REALM_AUTH_NO_MATCH = 4;
  44. // The information you have entered is not valid.
  45. // Please check the spelling of the account name and password.
  46. // If you need help in retrieving a lost or stolen password,
  47. // see site> for more information
  48. public const int REALM_AUTH_UNKNOWN2 = 5;
  49. // This account is already logged into game.
  50. // Please check the spelling and try again.
  51. public const int REALM_AUTH_ACCOUNT_IN_USE = 6;
  52. // You have used up your prepaid time for this account.
  53. // Please purchase more to continue playing
  54. public const int REALM_AUTH_PREPAID_TIME_LIMIT = 7;
  55. // Could not log in to game> at this time. Please try again later.
  56. public const int REALM_AUTH_SERVER_FULL = 8;
  57. // Unable to validate game version.
  58. // This may be caused by file corruption or interference of another program.
  59. // Please visit site for more information and possible solutions to this
  60. // issue.
  61. public const int REALM_AUTH_WRONG_BUILD_NUMBER = 9;
  62. // Downloading
  63. public const int REALM_AUTH_UPDATE_CLIENT = 10;
  64. // Unable to connect
  65. public const int REALM_AUTH_UNKNOWN3 = 11;
  66. // This game account has been temporarily suspended.
  67. // Please go to site further information.
  68. public const int REALM_AUTH_ACCOUNT_FREEZED = 12;
  69. // Unable to connect
  70. public const int REALM_AUTH_UNKNOWN4 = 13;
  71. // Connected.
  72. public const int REALM_AUTH_UNKNOWN5 = 14;
  73. // Access to this account has been blocked by parental controls.
  74. // Your settings may be changed in your account preferences at site.
  75. public const int REALM_AUTH_PARENTAL_CONTROL = 15;
  76. // 其它error code
  77. public const int AUTH_OK = 12;
  78. }
  79. [DataContract]
  80. public class CMSG_Auth_Logon_Permit
  81. {
  82. [DataMember(Order = 1, IsRequired = true)]
  83. public byte[] Account { get; set; }
  84. [DataMember(Order = 2, IsRequired = true)]
  85. public byte[] PasswordMd5 { get; set; }
  86. }
  87. [DataContract]
  88. public class SMSG_Password_Protect_Type
  89. {
  90. [DataMember(Order = 1, IsRequired = true)]
  91. public uint Code { get; set; }
  92. [DataMember(Order = 2, IsRequired = true)]
  93. public uint SubCode { get; set; }
  94. [DataMember(Order = 3, IsRequired = true)]
  95. public uint PasswordProtectType { get; set; }
  96. [DataMember(Order = 4, IsRequired = true)]
  97. public byte[] PpcCoordinate { get; set; }
  98. }
  99. [DataContract]
  100. public class CMSG_Auth_Logon_Challenge
  101. {
  102. }
  103. [DataContract]
  104. public class SMSG_Auth_Logon_Challenge_Response
  105. {
  106. [DataMember(Order = 1, IsRequired = true)]
  107. public int ErrorCode { get; set; }
  108. [DataMember(Order = 2, IsRequired = true)]
  109. public byte[] B { get; set; }
  110. [DataMember(Order = 3, IsRequired = true)]
  111. public byte[] G { get; set; }
  112. [DataMember(Order = 4, IsRequired = true)]
  113. public byte[] N { get; set; }
  114. [DataMember(Order = 5, IsRequired = true)]
  115. public byte[] S { get; set; }
  116. }
  117. [DataContract]
  118. public class CMSG_Auth_Logon_Proof
  119. {
  120. [DataMember(Order = 1, IsRequired = true)]
  121. public byte[] A { get; set; }
  122. [DataMember(Order = 2, IsRequired = true)]
  123. public byte[] M { get; set; }
  124. }
  125. [DataContract]
  126. public class CMSG_Realm_List
  127. {
  128. }
  129. [DataContract]
  130. public class SMSG_Auth_Logon_Proof_M2
  131. {
  132. [DataMember(Order = 1, IsRequired = true)]
  133. public int ErrorCode { get; set; }
  134. [DataMember(Order = 2, IsRequired = true)]
  135. public byte[] M { get; set; }
  136. }
  137. [DataContract]
  138. public class Realm_List_Gate
  139. {
  140. [DataMember(Order = 1, IsRequired = true)]
  141. public byte[] Name { get; set; }
  142. [DataMember(Order = 2, IsRequired = true)]
  143. public byte[] Address { get; set; }
  144. [DataMember(Order = 3, IsRequired = true)]
  145. public float CityLoad { get; set; }
  146. }
  147. [DataContract]
  148. public class SMSG_Realm_List
  149. {
  150. [DataMember(Order = 1, IsRequired = true)]
  151. public List<Realm_List_Gate> GateList { get; set; }
  152. }
  153. [DataContract]
  154. public class CMSG_Auth_Session
  155. {
  156. [DataMember(Order = 1, IsRequired = true)]
  157. public uint ClientBuild { get; set; }
  158. [DataMember(Order = 2, IsRequired = true)]
  159. public uint Unk2 { get; set; }
  160. [DataMember(Order = 3, IsRequired = true)]
  161. public byte[] Username { get; set; }
  162. [DataMember(Order = 4, IsRequired = true)]
  163. public uint Unk3 { get; set; }
  164. [DataMember(Order = 5, IsRequired = true)]
  165. public uint ClientSeed { get; set; }
  166. [DataMember(Order = 6, IsRequired = true)]
  167. public uint Unk4 { get; set; }
  168. [DataMember(Order = 7, IsRequired = true)]
  169. public byte[] Digest { get; set; }
  170. [DataMember(Order = 8, IsRequired = false)]
  171. public byte[] Mac { get; set; }
  172. [DataMember(Order = 9, IsRequired = false)]
  173. public byte[] Hd { get; set; }
  174. }
  175. // gate message
  176. [DataContract]
  177. public class SMSG_Auth_Challenge
  178. {
  179. [DataMember(Order = 1, IsRequired = true)]
  180. public uint Num { get; set; }
  181. [DataMember(Order = 2, IsRequired = true)]
  182. public uint Seed { get; set; }
  183. [DataMember(Order = 3)]
  184. public List<uint> Random { get; set; }
  185. }
  186. [DataContract]
  187. public class SMSG_Auth_Response
  188. {
  189. [DataMember(Order = 1, IsRequired = true)]
  190. public uint ErrorCode { get; set; }
  191. }
  192. [DataContract]
  193. public class CMSG_Boss_Gm
  194. {
  195. [DataMember(Order = 1, IsRequired = true)]
  196. public string Message { get; set; }
  197. }
  198. [DataContract]
  199. public class SMSG_Boss_ServersInfo
  200. {
  201. [DataMember(Order = 1, IsRequired = true)]
  202. public List<string> Name { get; set; }
  203. }
  204. }