Messages.cs 6.3 KB

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