Messages.cs 6.6 KB

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