Messages.cs 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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. 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 AUTH_OK = 12;
  79. }
  80. [DataContract]
  81. public class CMSG_Auth_Logon_Permit
  82. {
  83. [DataMember(Order = 1, IsRequired = true)]
  84. public byte[] Account { get; set; }
  85. [DataMember(Order = 2, IsRequired = true)]
  86. public byte[] PasswordMd5 { get; set; }
  87. }
  88. [DataContract]
  89. public class SMSG_Password_Protect_Type
  90. {
  91. [DataMember(Order = 1, IsRequired = true)]
  92. public uint Code { get; set; }
  93. [DataMember(Order = 2, IsRequired = true)]
  94. public uint SubCode { get; set; }
  95. [DataMember(Order = 3, IsRequired = true)]
  96. public uint PasswordProtectType { get; set; }
  97. [DataMember(Order = 4, IsRequired = true)]
  98. public byte[] PpcCoordinate { get; set; }
  99. }
  100. [DataContract]
  101. public class CMSG_Auth_Logon_Challenge
  102. {
  103. }
  104. [DataContract]
  105. public class SMSG_Auth_Logon_Challenge_Response
  106. {
  107. [DataMember(Order = 1, IsRequired = true)]
  108. public int ErrorCode { get; set; }
  109. [DataMember(Order = 2, IsRequired = true)]
  110. public byte[] B { get; set; }
  111. [DataMember(Order = 3, IsRequired = true)]
  112. public byte[] G { get; set; }
  113. [DataMember(Order = 4, IsRequired = true)]
  114. public byte[] N { get; set; }
  115. [DataMember(Order = 5, IsRequired = true)]
  116. public byte[] S { get; set; }
  117. }
  118. [DataContract]
  119. public class CMSG_Auth_Logon_Proof
  120. {
  121. [DataMember(Order = 1, IsRequired = true)]
  122. public byte[] A { get; set; }
  123. [DataMember(Order = 2, IsRequired = true)]
  124. public byte[] M { get; set; }
  125. }
  126. [DataContract]
  127. public class CMSG_Realm_List
  128. {
  129. }
  130. [DataContract]
  131. public class SMSG_Auth_Logon_Proof_M2
  132. {
  133. [DataMember(Order = 1, IsRequired = true)]
  134. public int ErrorCode { get; set; }
  135. [DataMember(Order = 2, IsRequired = true)]
  136. public byte[] M { get; set; }
  137. }
  138. [DataContract]
  139. public class Realm_List_Gate
  140. {
  141. [DataMember(Order = 1, IsRequired = true)]
  142. public byte[] Name { get; set; }
  143. [DataMember(Order = 2, IsRequired = true)]
  144. public byte[] Address { get; set; }
  145. [DataMember(Order = 3, IsRequired = true)]
  146. public float CityLoad { get; set; }
  147. }
  148. [DataContract]
  149. public class SMSG_Realm_List
  150. {
  151. [DataMember(Order = 1, IsRequired = true)]
  152. public List<Realm_List_Gate> GateList { get; set; }
  153. }
  154. [DataContract]
  155. public class CMSG_Auth_Session
  156. {
  157. [DataMember(Order = 1, IsRequired = true)]
  158. public uint ClientBuild { get; set; }
  159. [DataMember(Order = 2, IsRequired = true)]
  160. public uint Unk2 { get; set; }
  161. [DataMember(Order = 3, IsRequired = true)]
  162. public byte[] Username { get; set; }
  163. [DataMember(Order = 4, IsRequired = true)]
  164. public uint Unk3 { get; set; }
  165. [DataMember(Order = 5, IsRequired = true)]
  166. public uint ClientSeed { get; set; }
  167. [DataMember(Order = 6, IsRequired = true)]
  168. public uint Unk4 { get; set; }
  169. [DataMember(Order = 7, IsRequired = true)]
  170. public byte[] Digest { get; set; }
  171. [DataMember(Order = 8, IsRequired = false)]
  172. public byte[] Mac { get; set; }
  173. [DataMember(Order = 9, IsRequired = false)]
  174. public byte[] Hd { get; set; }
  175. }
  176. // gate message
  177. [DataContract]
  178. public class SMSG_Auth_Challenge
  179. {
  180. [DataMember(Order = 1, IsRequired = true)]
  181. public uint Num { get; set; }
  182. [DataMember(Order = 2, IsRequired = true)]
  183. public uint Seed { get; set; }
  184. [DataMember(Order = 3)]
  185. public List<uint> Random { get; set; }
  186. }
  187. [DataContract]
  188. public class SMSG_Auth_Response
  189. {
  190. [DataMember(Order = 1, IsRequired = true)]
  191. public uint ErrorCode { get; set; }
  192. }
  193. [DataContract]
  194. public class CMSG_Boss_Gm
  195. {
  196. [DataMember(Order = 1, IsRequired = true)]
  197. public string Message { get; set; }
  198. }
  199. [DataContract]
  200. public class SMSG_Boss_ServersInfo
  201. {
  202. [DataMember(Order = 1, IsRequired = true)]
  203. public List<string> Name { get; set; }
  204. }
  205. [DataContract]
  206. public class SMSG_Boss_Command_Response
  207. {
  208. [DataMember(Order = 1, IsRequired = true)]
  209. public uint ErrorCode { get; set; }
  210. }
  211. }