/trunk/Demo.Mmose.GameServer/R.O.S.E.Server/R.O.S.E.Server/CharServer/Network/CharPackets.cs

# · C# · 1052 lines · 591 code · 157 blank · 304 comment · 15 complexity · cd7cc3005cac6b6ba9af3011b7f4f73d MD5 · raw file

  1. #region zh-CHS °ćȨËůÓĐ (C) 2006 - 2006 DemoSoft Corporation. ąŁÁôËůÓĐȨŔű | en Copyright (C) 2006 - 2006 DemoSoft Corporation. All Rights Reserved.
  2. // COPYRIGHT NOTES
  3. // ---------------
  4. // Program.cs : interface for the Program class.
  5. //
  6. // This file is a part of the Demo Toolkit for .NET.
  7. // 2006-2006 Demo Software, All Rights Reserved.
  8. //
  9. // This source code can only be used under the terms and conditions
  10. // outlined in the accompanying license agreement.
  11. //
  12. // mailto:caihuanqing@hotmail.com
  13. #region zh-CHS °üşŹĂű×ÖżŐźä | en Include namespace
  14. using System.IO;
  15. using System.Net;
  16. using System.Collections.Generic;
  17. using Demo_G.O.S.E.ServerEngine.Network;
  18. using Demo_R.O.S.E.CharServer.Common;
  19. #endregion
  20. namespace Demo_R.O.S.E.CharServer.Network
  21. {
  22. #region zh-CHS WorldAction Ack Ŕŕ | en WSCharSelect Ack Class
  23. /// <summary>
  24. ///
  25. /// </summary>
  26. internal sealed class WorldActionAck : Packet
  27. {
  28. /// <summary>
  29. ///
  30. /// </summary>
  31. public WorldActionAck()
  32. : base( 0x71C, 7/*6 + 1*/ )
  33. {
  34. WriterStream.Write( (ushort)7 /*6 + 1*/ ); // ×֜δóĐĄ
  35. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  36. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  37. WriterStream.Write( (byte)0x00 );
  38. }
  39. }
  40. #endregion
  41. #region zh-CHS DoIdentify Ack Ŕŕ | en DoIdentify Ack Class
  42. /// <summary>
  43. ///
  44. /// </summary>
  45. internal sealed class DoIdentifyAck : Packet
  46. {
  47. /// <summary>
  48. ///
  49. /// </summary>
  50. internal DoIdentifyAck() : base( 0x070C, 15 /*6 + 9*/ )
  51. {
  52. WriterStream.Write( (ushort)15 /*6 + 9*/ ); // ×֜δóĐĄ
  53. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  54. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  55. //////////////////////////////////////////////////////////////////////////
  56. WriterStream.Write( (sbyte)0x0 );
  57. WriterStream.Write( (uint)0x87654321 );
  58. WriterStream.Write( (uint)0x0 );
  59. }
  60. }
  61. #endregion
  62. #region zh-CHS GetCharacters Ack Ŕŕ | en GetCharacters Ack Class
  63. #region zh-CHS PacketCharacterŔŕ | en PacketCharacter Class
  64. /// <summary>
  65. ///
  66. /// </summary>
  67. internal class PacketCharacter
  68. {
  69. #region zh-CHS PacketItemŔŕ | en PacketItem Class
  70. /// <summary>
  71. ///
  72. /// </summary>
  73. internal class PacketItem
  74. {
  75. /// <summary>
  76. ///
  77. /// </summary>
  78. internal uint m_CharacterGuid;
  79. /// <summary>
  80. ///
  81. /// </summary>
  82. internal uint m_ItemID;
  83. /// <summary>
  84. ///
  85. /// </summary>
  86. internal uint m_ItemType;
  87. /// <summary>
  88. ///
  89. /// </summary>
  90. internal uint m_Refine;
  91. /// <summary>
  92. ///
  93. /// </summary>
  94. internal uint m_Durability;
  95. /// <summary>
  96. ///
  97. /// </summary>
  98. internal uint m_Lifespan;
  99. }
  100. #endregion
  101. /// <summary>
  102. ///
  103. /// </summary>
  104. internal string m_CharacterName;
  105. /// <summary>
  106. ///
  107. /// </summary>
  108. internal uint m_CharacterGuid;
  109. /// <summary>
  110. ///
  111. /// </summary>
  112. internal uint m_Level;
  113. /// <summary>
  114. ///
  115. /// </summary>
  116. internal uint m_Face;
  117. /// <summary>
  118. ///
  119. /// </summary>
  120. internal uint m_HairStyle;
  121. /// <summary>
  122. ///
  123. /// </summary>
  124. internal uint m_ClassID;
  125. /// <summary>
  126. ///
  127. /// </summary>
  128. internal int m_Sex;
  129. /// <summary>
  130. ///
  131. /// </summary>
  132. internal uint m_DeleteTime;
  133. /// <summary>
  134. ///
  135. /// </summary>
  136. internal PacketItem[] m_Item = new PacketItem[0];
  137. }
  138. #endregion
  139. /// <summary>
  140. ///
  141. /// </summary>
  142. internal sealed class GetCharactersAck : Packet
  143. {
  144. /// <summary>
  145. ///
  146. /// </summary>
  147. internal GetCharactersAck( PacketCharacter[] characterArray ) : base( 0x0712, 0 /*6 + ?*/ )
  148. {
  149. WriterStream.Write( (ushort)0 /*6 + ?*/ ); // ×֜δóĐĄ(Öť°üŔ¨ČËÎďľÄĘýÁżŁŹĎęϸĘýžÝ˛ťËľĂ÷)
  150. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  151. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  152. //////////////////////////////////////////////////////////////////////////
  153. WriterStream.Write( (sbyte)characterArray.Length );
  154. for ( int iIndex = 0; iIndex < characterArray.Length; iIndex++ )
  155. {
  156. WriterStream.WriteAsciiNull( characterArray[iIndex].m_CharacterName ); // Character Name
  157. WriterStream.Write( (sbyte)characterArray[iIndex].m_Sex ); // SEX
  158. WriterStream.Write( (ushort)characterArray[iIndex].m_Level ); // LEVEL
  159. WriterStream.Write( (ushort)characterArray[iIndex].m_ClassID ); // CLASS ID
  160. WriterStream.Write( (uint)characterArray[iIndex].m_DeleteTime ); // DELETE TIME
  161. WriterStream.Write( (sbyte)0x00 ); // IS PLATINUM? 00-NO;01-YES;02-YES BUT USER IS NOT
  162. WriterStream.Write( (uint)characterArray[iIndex].m_Face ); // FACE
  163. WriterStream.Write( (uint)characterArray[iIndex].m_HairStyle ); // HAIR
  164. WriterStream.Write( (ushort)characterArray[iIndex].m_Item[2].m_ItemID );// CAP
  165. WriterStream.Write( (ushort)characterArray[iIndex].m_Item[2].m_Refine );// CAP REFINE
  166. WriterStream.Write( (ushort)characterArray[iIndex].m_Item[3].m_ItemID );// BODY
  167. WriterStream.Write( (ushort)characterArray[iIndex].m_Item[3].m_Refine );// BODY REFINE
  168. WriterStream.Write( (ushort)characterArray[iIndex].m_Item[5].m_ItemID );// GLOVES
  169. WriterStream.Write( (ushort)characterArray[iIndex].m_Item[5].m_Refine );// GLOVES REFINE
  170. WriterStream.Write( (ushort)characterArray[iIndex].m_Item[6].m_ItemID );// BOOTS
  171. WriterStream.Write( (ushort)characterArray[iIndex].m_Item[6].m_Refine );// BOOTS REFINE
  172. WriterStream.Write( (ushort)characterArray[iIndex].m_Item[1].m_ItemID );// FACE
  173. WriterStream.Write( (ushort)characterArray[iIndex].m_Item[1].m_Refine );// FACE REFINE
  174. WriterStream.Write( (ushort)characterArray[iIndex].m_Item[4].m_ItemID );// BACK
  175. WriterStream.Write( (ushort)characterArray[iIndex].m_Item[4].m_Refine );// BACK REFINE
  176. WriterStream.Write( (ushort)characterArray[iIndex].m_Item[7].m_ItemID );// WEAPON
  177. WriterStream.Write( (ushort)characterArray[iIndex].m_Item[7].m_Refine );// WEAPON REFINE
  178. WriterStream.Write( (ushort)characterArray[iIndex].m_Item[8].m_ItemID );// SUBWEAPON
  179. WriterStream.Write( (ushort)characterArray[iIndex].m_Item[8].m_Refine );// SUBWEAPON REFINE
  180. }
  181. //////////////////////////////////////////////////////////////////////////
  182. WriterStream.Seek( 0, SeekOrigin.Begin );
  183. WriterStream.Write( (ushort)WriterStream.Length );
  184. }
  185. }
  186. #endregion
  187. #region zh-CHS RequestWorld Ack Ŕŕ | en RequestWorld Ack Class
  188. /// <summary>
  189. ///
  190. /// </summary>
  191. internal sealed class RequestWorldAck : Packet
  192. {
  193. /// <summary>
  194. ///
  195. /// </summary>
  196. internal RequestWorldAck( IPEndPoint ipEndPoint, long iAccountsGuid )
  197. : base( 0x711, 0 /*6 + ?*/ )
  198. {
  199. WriterStream.Write( (ushort)0 /*6 + ?*/ ); // ×֜δóĐĄ
  200. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  201. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  202. //////////////////////////////////////////////////////////////////////////
  203. WriterStream.Write( (ushort)ipEndPoint.Port );
  204. WriterStream.Write( (uint)iAccountsGuid );
  205. WriterStream.Write( (uint)0x87654321 );
  206. WriterStream.WriteAsciiNull( ipEndPoint.Address.ToString() );
  207. //////////////////////////////////////////////////////////////////////////
  208. WriterStream.Seek( 0, SeekOrigin.Begin );
  209. WriterStream.Write( (ushort)WriterStream.Length );
  210. }
  211. }
  212. #endregion
  213. #region zh-CHS CreateCharacter Ack Ŕŕ | en CreateCharacter Ack Class
  214. /// <summary>
  215. ///
  216. /// </summary>
  217. internal sealed class CreateCharacterAck : Packet
  218. {
  219. /// <summary>
  220. ///
  221. /// </summary>
  222. internal CreateCharacterAck()
  223. : base( 0x0713, 8 /*6 + 2*/ )
  224. {
  225. WriterStream.Write( (ushort)8 /*6 + 2*/ );
  226. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  227. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  228. //////////////////////////////////////////////////////////////////////////
  229. WriterStream.Write( (ushort)0x00 );
  230. }
  231. }
  232. /// <summary>
  233. ///
  234. /// </summary>
  235. public enum CCLReason
  236. {
  237. /// <summary>
  238. ///
  239. /// </summary>
  240. BadCharacterName = 0x01,
  241. /// <summary>
  242. ///
  243. /// </summary>
  244. BadAccountName = 0x02,
  245. }
  246. /// <summary>
  247. ///
  248. /// </summary>
  249. public sealed class CreateCharacterRej : Packet
  250. {
  251. /// <summary>
  252. ///
  253. /// </summary>
  254. public CreateCharacterRej( CCLReason cclReason )
  255. : base( 0x0713, 8 /*6 + 2*/ )
  256. {
  257. WriterStream.Write( (ushort)8 /*6 + 2*/ );
  258. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  259. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  260. //////////////////////////////////////////////////////////////////////////
  261. if ( cclReason == CCLReason.BadAccountName )
  262. WriterStream.Write( (ushort)4 ); // ĎŕÍŹľÄŐĘşĹĂűŇŃž­´ćÔÚ
  263. else if ( cclReason == CCLReason.BadCharacterName )
  264. WriterStream.Write( (ushort)2 ); // ÓÎϡĂű×ÖŇŃž­´ćÔÚťňŇŃšýÂËľÄÎÄźţĂű
  265. else
  266. WriterStream.Write( (ushort)0 );
  267. }
  268. }
  269. #endregion
  270. #region zh-CHS DeleteCharacter Ack Ŕŕ | en DeleteCharacter Ack Class
  271. /// <summary>
  272. ///
  273. /// </summary>
  274. internal sealed class DeleteCharacterAck : Packet
  275. {
  276. /// <summary>
  277. ///
  278. /// </summary>
  279. internal DeleteCharacterAck( string strCharacterName, uint iDeleteTime )
  280. : base( 0x0714, 0 /*6 + ?*/ )
  281. {
  282. WriterStream.Write( (ushort)0 /*6 + ?*/ );
  283. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  284. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  285. //////////////////////////////////////////////////////////////////////////
  286. WriterStream.Write( (uint)iDeleteTime );
  287. WriterStream.WriteAsciiNull( strCharacterName );
  288. //////////////////////////////////////////////////////////////////////////
  289. WriterStream.Seek( 0, SeekOrigin.Begin );
  290. WriterStream.Write( (ushort)WriterStream.Length );
  291. }
  292. }
  293. #endregion
  294. #region zh-CHS ClanChat Ack Ŕŕ | en ClanManager Ack Class
  295. /// <summary>
  296. ///
  297. /// </summary>
  298. internal sealed class ClanChatAck : Packet
  299. {
  300. /// <summary>
  301. ///
  302. /// </summary>
  303. internal ClanChatAck( string strName, string strText )
  304. : base( 0x787, 0/*6 + ?*/ )
  305. {
  306. WriterStream.Write( (ushort)0 /*6 + ?*/ ); // ×֜δóĐĄ
  307. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  308. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  309. //////////////////////////////////////////////////////////////////////////
  310. WriterStream.WriteAsciiNull( strName );
  311. WriterStream.WriteAsciiNull( strText ); //
  312. //////////////////////////////////////////////////////////////////////////
  313. WriterStream.Seek( 0, SeekOrigin.Begin );
  314. WriterStream.Write( (ushort)WriterStream.Length );
  315. }
  316. }
  317. #endregion
  318. #region zh-CHS MessengerChat Ack Ŕŕ | en ClanManager Ack Class
  319. /// <summary>
  320. ///
  321. /// </summary>
  322. internal sealed class MessengerChatAck : Packet
  323. {
  324. /// <summary>
  325. ///
  326. /// </summary>
  327. internal MessengerChatAck( long charid, string strName, string strMessage )
  328. : base( 0x7E2, 0/*6 + ?*/ )
  329. {
  330. WriterStream.Write( (ushort)0 /*6 + ?*/ ); // ×֜δóĐĄ
  331. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  332. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  333. //////////////////////////////////////////////////////////////////////////
  334. WriterStream.Write( (ushort)charid );
  335. WriterStream.Write( (ushort)0x0000 );
  336. long beginPosition = WriterStream.Position;
  337. WriterStream.WriteAsciiNull( strName );
  338. long endPosition = WriterStream.Position;
  339. long nameSize = endPosition - beginPosition;
  340. for ( int iIndex = 0; iIndex < 31 - nameSize; iIndex++ )
  341. WriterStream.Write( (byte)0x00 );
  342. WriterStream.WriteAsciiNull( strMessage ); //
  343. //////////////////////////////////////////////////////////////////////////
  344. WriterStream.Seek( 0, SeekOrigin.Begin );
  345. WriterStream.Write( (ushort)WriterStream.Length );
  346. }
  347. }
  348. #endregion
  349. #region zh-CHS Clan0x7E0 Ack Ŕŕ | en ClanManagerAck Class
  350. /// <summary>
  351. ///
  352. /// </summary>
  353. internal sealed class Clan0x7E0_Action0x33_Ack : Packet
  354. {
  355. /// <summary>
  356. ///
  357. /// </summary>
  358. internal Clan0x7E0_Action0x33_Ack( Clan clan, long iClanRank )
  359. : base( 0x7E0, 0/*6 + ?*/ )
  360. {
  361. WriterStream.Write( (ushort)0 /*6 + ?*/ ); // ×֜δóĐĄ
  362. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  363. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  364. //////////////////////////////////////////////////////////////////////////
  365. WriterStream.Write( (byte)0x33 ); // 0x33 you have invited to clan
  366. WriterStream.Write( (ushort)0x09CF );
  367. WriterStream.Write( (byte)0x00 );
  368. WriterStream.Write( (byte)0x00 );
  369. WriterStream.Write( (ushort)clan.Back ); // Clan Background
  370. WriterStream.Write( (ushort)clan.Logo ); // Clan logo
  371. WriterStream.Write( (byte)clan.Grade ); // Clan grade
  372. WriterStream.Write( (byte)iClanRank ); // Clan rank (0 = red rokie / 6 = master)
  373. WriterStream.Write( (byte)clan.CP ); // Clan Points
  374. WriterStream.Write( (uint)0x00000000 );
  375. WriterStream.Write( (uint)0x00000000 ); // Clan found
  376. WriterStream.Write( (byte)0x00 );
  377. WriterStream.Write( (uint)0x00000000 );
  378. WriterStream.Write( (ushort)0x0000 );
  379. for ( int iIndex = 34; iIndex < 156; iIndex++ )
  380. WriterStream.Write( (byte)0x00 );
  381. WriterStream.Write( (ushort)0x0000 );
  382. WriterStream.Write( (byte)0x00 );
  383. WriterStream.WriteAsciiNull( clan.ClanName );
  384. WriterStream.WriteAsciiNull( clan.Slogan );
  385. WriterStream.WriteAsciiNull( clan.News );
  386. //////////////////////////////////////////////////////////////////////////
  387. WriterStream.Seek( 0, SeekOrigin.Begin );
  388. WriterStream.Write( (ushort)WriterStream.Length );
  389. }
  390. }
  391. /// <summary>
  392. ///
  393. /// </summary>
  394. internal sealed class Clan0x7E0_Action0x0B_Ack : Packet
  395. {
  396. /// <summary>
  397. ///
  398. /// </summary>
  399. internal Clan0x7E0_Action0x0B_Ack( string strCharName )
  400. : base( 0x7E0, 0/*6 + ?*/ )
  401. {
  402. WriterStream.Write( (ushort)0 /*6 + ?*/ ); // ×֜δóĐĄ
  403. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  404. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  405. //////////////////////////////////////////////////////////////////////////
  406. WriterStream.Write( (byte)0x0B ); // invite action
  407. WriterStream.WriteAsciiNull( strCharName );
  408. //////////////////////////////////////////////////////////////////////////
  409. WriterStream.Seek( 0, SeekOrigin.Begin );
  410. WriterStream.Write( (ushort)WriterStream.Length );
  411. }
  412. }
  413. /// <summary>
  414. ///
  415. /// </summary>
  416. internal sealed class Clan0x7E0_Action0x81_Ack : Packet
  417. {
  418. /// <summary>
  419. ///
  420. /// </summary>
  421. internal Clan0x7E0_Action0x81_Ack( string strKickName, string strCharName )
  422. : base( 0x7E0, 0/*6 + ?*/ )
  423. {
  424. WriterStream.Write( (ushort)0 /*6 + ?*/ ); // ×֜δóĐĄ
  425. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  426. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  427. //////////////////////////////////////////////////////////////////////////
  428. WriterStream.Write( (byte)0x81 ); // xxx have kicket to yyyy
  429. WriterStream.WriteAsciiNull( strKickName );
  430. WriterStream.WriteAsciiNull( strCharName );
  431. //////////////////////////////////////////////////////////////////////////
  432. WriterStream.Seek( 0, SeekOrigin.Begin );
  433. WriterStream.Write( (ushort)WriterStream.Length );
  434. }
  435. }
  436. /// <summary>
  437. ///
  438. /// </summary>
  439. internal sealed class Clan0x7E0_Action0x83_Ack : Packet
  440. {
  441. /// <summary>
  442. ///
  443. /// </summary>
  444. internal Clan0x7E0_Action0x83_Ack( string strCharName, long iRank )
  445. : base( 0x7E0, 0/*6 + ?*/ )
  446. {
  447. WriterStream.Write( (ushort)0 /*6 + ?*/ ); // ×֜δóĐĄ
  448. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  449. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  450. //////////////////////////////////////////////////////////////////////////
  451. WriterStream.Write( (byte)0x83 ); // up/down rank
  452. WriterStream.WriteAsciiNull( strCharName );
  453. WriterStream.Write( (uint)iRank );
  454. //////////////////////////////////////////////////////////////////////////
  455. WriterStream.Seek( 0, SeekOrigin.Begin );
  456. WriterStream.Write( (ushort)WriterStream.Length );
  457. }
  458. }
  459. /// <summary>
  460. ///
  461. /// </summary>
  462. internal sealed class Clan0x7E0_Action0x75_Ack : Packet
  463. {
  464. /// <summary>
  465. ///
  466. /// </summary>
  467. internal Clan0x7E0_Action0x75_Ack( long iRank, long iServerGuid, long iLevel, long iJob, string strCharName )
  468. : base( 0x7E0, 0/*6 + ?*/ )
  469. {
  470. WriterStream.Write( (ushort)0 /*6 + ?*/ ); // ×֜δóĐĄ
  471. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  472. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  473. //////////////////////////////////////////////////////////////////////////
  474. WriterStream.Write( (byte)0x75 ); // up rank
  475. WriterStream.Write( (byte)iRank ); //
  476. WriterStream.Write( (byte)iServerGuid ); // channel
  477. WriterStream.Write( (short)0x0000 ); //
  478. WriterStream.Write( (short)0x0000 ); //
  479. WriterStream.Write( (short)iLevel ); //
  480. WriterStream.Write( (short)iJob ); //
  481. WriterStream.WriteAsciiNull( strCharName );
  482. //////////////////////////////////////////////////////////////////////////
  483. WriterStream.Seek( 0, SeekOrigin.Begin );
  484. WriterStream.Write( (ushort)WriterStream.Length );
  485. }
  486. }
  487. /// <summary>
  488. ///
  489. /// </summary>
  490. internal sealed class Clan0x7E0_Action0x34_Ack : Packet
  491. {
  492. /// <summary>
  493. ///
  494. /// </summary>
  495. internal Clan0x7E0_Action0x34_Ack( string strNews )
  496. : base( 0x7E0, 0/*6 + ?*/ )
  497. {
  498. WriterStream.Write( (ushort)0 /*6 + ?*/ ); // ×֜δóĐĄ
  499. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  500. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  501. //////////////////////////////////////////////////////////////////////////
  502. WriterStream.Write( (byte)0x34 );// Change news
  503. WriterStream.WriteAsciiNull( strNews );
  504. //////////////////////////////////////////////////////////////////////////
  505. WriterStream.Seek( 0, SeekOrigin.Begin );
  506. WriterStream.Write( (ushort)WriterStream.Length );
  507. }
  508. }
  509. /// <summary>
  510. ///
  511. /// </summary>
  512. internal sealed class Clan0x7E0_Action0x82_Ack : Packet
  513. {
  514. /// <summary>
  515. ///
  516. /// </summary>
  517. internal Clan0x7E0_Action0x82_Ack( string strName )
  518. : base( 0x7E0, 0/*6 + ?*/ )
  519. {
  520. WriterStream.Write( (ushort)0 /*6 + ?*/ ); // ×֜δóĐĄ
  521. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  522. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  523. //////////////////////////////////////////////////////////////////////////
  524. WriterStream.Write( (byte)0x82 ); // Leave Clan
  525. WriterStream.WriteAsciiNull( strName );
  526. //////////////////////////////////////////////////////////////////////////
  527. WriterStream.Seek( 0, SeekOrigin.Begin );
  528. WriterStream.Write( (ushort)WriterStream.Length );
  529. }
  530. }
  531. /// <summary>
  532. ///
  533. /// </summary>
  534. internal sealed class Clan0x7E0_Action0x72_Ack : Packet
  535. {
  536. /// <summary>
  537. ///
  538. /// </summary>
  539. internal Clan0x7E0_Action0x72_Ack( ClanMember[] clanMembers )
  540. : base( 0x7E0, 0/*6 + ?*/ )
  541. {
  542. WriterStream.Write( (ushort)0 /*6 + ?*/ ); // ×֜δóĐĄ
  543. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  544. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  545. //////////////////////////////////////////////////////////////////////////
  546. if ( clanMembers == null && clanMembers.Length == 0 )
  547. {
  548. WriterStream.Write( (byte)0x0F );
  549. WriterStream.Write( (uint)0x00000001 );
  550. }
  551. else
  552. {
  553. WriterStream.Write( (byte)0x72 ); // Send clan members
  554. foreach ( ClanMember clanMember in clanMembers )
  555. {
  556. WriterStream.Write( (byte)clanMember.ClanRank ); //clan rank
  557. WriterStream.Write( (byte)clanMember.ServerGuid ); //channel (0xff = offline) //channel (0x01 = channel 1)
  558. WriterStream.Write( (ushort)0x0000 );
  559. WriterStream.Write( (ushort)0x0000 );
  560. WriterStream.Write( (ushort)clanMember.Level );
  561. WriterStream.Write( (ushort)clanMember.ClassId );
  562. WriterStream.WriteAsciiNull( clanMember.CharacterName );
  563. }
  564. }
  565. //////////////////////////////////////////////////////////////////////////
  566. WriterStream.Seek( 0, SeekOrigin.Begin );
  567. WriterStream.Write( (ushort)WriterStream.Length );
  568. }
  569. }
  570. /// <summary>
  571. ///
  572. /// </summary>
  573. internal sealed class Clan0x7E0_Action0x51_Ack : Packet
  574. {
  575. /// <summary>
  576. ///
  577. /// </summary>
  578. internal Clan0x7E0_Action0x51_Ack()
  579. : base( 0x7E0, 8/*6 + 2*/ )
  580. {
  581. WriterStream.Write( (ushort)8 /*6 + 2*/ ); // ×֜δóĐĄ
  582. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  583. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  584. //////////////////////////////////////////////////////////////////////////
  585. WriterStream.Write( (byte)0x51 ); //
  586. WriterStream.Write( (byte)0x00 ); //
  587. }
  588. }
  589. /// <summary>
  590. ///
  591. /// </summary>
  592. internal sealed class Clan0x7E0_Action0x61_Ack : Packet
  593. {
  594. /// <summary>
  595. ///
  596. /// </summary>
  597. internal Clan0x7E0_Action0x61_Ack( string strName, string strNameAccepted )
  598. : base( 0x7E0, 0/*6 + ?*/ )
  599. {
  600. WriterStream.Write( (ushort)0 /*6 + ?*/ ); // ×֜δóĐĄ
  601. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  602. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  603. //////////////////////////////////////////////////////////////////////////
  604. WriterStream.Write( (byte)0x61 ); //
  605. WriterStream.WriteAsciiNull( strName );
  606. WriterStream.WriteAsciiNull( strNameAccepted );
  607. //////////////////////////////////////////////////////////////////////////
  608. WriterStream.Seek( 0, SeekOrigin.Begin );
  609. WriterStream.Write( (ushort)WriterStream.Length );
  610. }
  611. }
  612. /// <summary>
  613. ///
  614. /// </summary>
  615. internal sealed class Clan0x7E0_Action0x84_Ack : Packet
  616. {
  617. /// <summary>
  618. ///
  619. /// </summary>
  620. internal Clan0x7E0_Action0x84_Ack( long iLevel, long iClassId, string strName )
  621. : base( 0x7E0, 0/*6 + ?*/ )
  622. {
  623. WriterStream.Write( (ushort)0 /*6 + ?*/ ); // ×֜δóĐĄ
  624. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  625. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  626. //////////////////////////////////////////////////////////////////////////
  627. WriterStream.Write( (byte)0x84 ); //
  628. WriterStream.Write( (ushort)iLevel );
  629. WriterStream.Write( (ushort)iClassId );
  630. WriterStream.WriteAsciiNull( strName );
  631. //////////////////////////////////////////////////////////////////////////
  632. WriterStream.Seek( 0, SeekOrigin.Begin );
  633. WriterStream.Write( (ushort)WriterStream.Length );
  634. }
  635. }
  636. /// <summary>
  637. ///
  638. /// </summary>
  639. internal sealed class Clan0x7E0_Action0x0D_Ack : Packet
  640. {
  641. /// <summary>
  642. ///
  643. /// </summary>
  644. internal Clan0x7E0_Action0x0D_Ack( string strName )
  645. : base( 0x7E0, 0/*6 + ?*/ )
  646. {
  647. WriterStream.Write( (ushort)0 /*6 + ?*/ ); // ×֜δóĐĄ
  648. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  649. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  650. //////////////////////////////////////////////////////////////////////////
  651. WriterStream.Write( (byte)0x0D ); //
  652. WriterStream.WriteAsciiNull( strName );
  653. //////////////////////////////////////////////////////////////////////////
  654. WriterStream.Seek( 0, SeekOrigin.Begin );
  655. WriterStream.Write( (ushort)WriterStream.Length );
  656. }
  657. }
  658. /// <summary>
  659. ///
  660. /// </summary>
  661. internal sealed class Clan0x7E0_Action0x30_Ack : Packet
  662. {
  663. /// <summary>
  664. ///
  665. /// </summary>
  666. internal Clan0x7E0_Action0x30_Ack( long iClientId, long iClanRank, Clan clan )
  667. : base( 0x7E0, 0/*6 + ?*/ )
  668. {
  669. WriterStream.Write( (ushort)0 /*6 + ?*/ ); // ×֜δóĐĄ
  670. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  671. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  672. //////////////////////////////////////////////////////////////////////////
  673. WriterStream.Write( (byte)0x30 ); //
  674. WriterStream.Write( (ushort)iClientId ); //
  675. WriterStream.Write( (ushort)0x0100 ); //
  676. WriterStream.Write( (ushort)clan.Back ); // clan background
  677. WriterStream.Write( (ushort)clan.Logo ); // clanlogo
  678. WriterStream.Write( (byte)0x01 ); //clan grade
  679. WriterStream.Write( (byte)iClanRank ); // clan rank
  680. for ( int iIndex = 0; iIndex < 146; iIndex++ )
  681. WriterStream.Write( (byte)0x00 ); // clan skills
  682. WriterStream.WriteAsciiNull( clan.ClanName );
  683. WriterStream.Write( (byte)0x00 ); //
  684. WriterStream.Write( (ushort)0x0000 ); //
  685. WriterStream.Write( (ushort)0x0000 ); //
  686. WriterStream.Write( (ushort)0x0000 ); //
  687. WriterStream.Write( (ushort)0x0000 ); //
  688. WriterStream.WriteAsciiNull( clan.Slogan ); // clan slogan
  689. //////////////////////////////////////////////////////////////////////////
  690. WriterStream.Seek( 0, SeekOrigin.Begin );
  691. WriterStream.Write( (ushort)WriterStream.Length );
  692. }
  693. }
  694. #endregion
  695. #region zh-CHS Friend0x7E1 Ack Ŕŕ | en ClanManagerAck Class
  696. /// <summary>
  697. ///
  698. /// </summary>
  699. internal sealed class Friend0x7E1_Action0x01_Ack : Packet
  700. {
  701. /// <summary>
  702. ///
  703. /// </summary>
  704. internal Friend0x7E1_Action0x01_Ack( string strName )
  705. : base( 0x7E1, 0/*6 + ?*/ )
  706. {
  707. WriterStream.Write( (ushort)0 /*6 + ?*/ ); // ×֜δóĐĄ
  708. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  709. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  710. //////////////////////////////////////////////////////////////////////////
  711. WriterStream.Write( (byte)0x01 );
  712. WriterStream.Write( (ushort)0x0000 );
  713. WriterStream.WriteAsciiNull( strName );
  714. //////////////////////////////////////////////////////////////////////////
  715. WriterStream.Seek( 0, SeekOrigin.Begin );
  716. WriterStream.Write( (ushort)WriterStream.Length );
  717. }
  718. }
  719. /// <summary>
  720. ///
  721. /// </summary>
  722. internal sealed class Friend0x7E1_Action0x02_Ack : Packet
  723. {
  724. /// <summary>
  725. ///
  726. /// </summary>
  727. internal Friend0x7E1_Action0x02_Ack( long iCharGuid, string strName )
  728. : base( 0x7E1, 0/*6 + ?*/ )
  729. {
  730. WriterStream.Write( (ushort)0 /*6 + ?*/ ); // ×֜δóĐĄ
  731. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  732. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  733. //////////////////////////////////////////////////////////////////////////
  734. WriterStream.Write( (byte)0x02 );
  735. WriterStream.Write( (ushort)iCharGuid );
  736. WriterStream.Write( (byte)0x00 );
  737. WriterStream.Write( (ushort)0x0000 );
  738. WriterStream.WriteAsciiNull( strName );
  739. //////////////////////////////////////////////////////////////////////////
  740. WriterStream.Seek( 0, SeekOrigin.Begin );
  741. WriterStream.Write( (ushort)WriterStream.Length );
  742. }
  743. }
  744. /// <summary>
  745. ///
  746. /// </summary>
  747. internal sealed class Friend0x7E1_Action0x03_Ack : Packet
  748. {
  749. /// <summary>
  750. ///
  751. /// </summary>
  752. internal Friend0x7E1_Action0x03_Ack( string strName )
  753. : base( 0x7E1, 0/*6 + ?*/ )
  754. {
  755. WriterStream.Write( (ushort)0 /*6 + ?*/ ); // ×֜δóĐĄ
  756. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  757. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  758. //////////////////////////////////////////////////////////////////////////
  759. WriterStream.Write( (byte)0x03 );
  760. WriterStream.WriteAsciiNull( strName );
  761. //////////////////////////////////////////////////////////////////////////
  762. WriterStream.Seek( 0, SeekOrigin.Begin );
  763. WriterStream.Write( (ushort)WriterStream.Length );
  764. }
  765. }
  766. /// <summary>
  767. ///
  768. /// </summary>
  769. internal sealed class Friend0x7E1_Action0x04_Ack : Packet
  770. {
  771. /// <summary>
  772. ///
  773. /// </summary>
  774. internal Friend0x7E1_Action0x04_Ack( string strName )
  775. : base( 0x7E1, 0/*6 + ?*/ )
  776. {
  777. WriterStream.Write( (ushort)0 /*6 + ?*/ ); // ×֜δóĐĄ
  778. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  779. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  780. //////////////////////////////////////////////////////////////////////////
  781. WriterStream.Write( (byte)0x04 );
  782. WriterStream.WriteAsciiNull( strName );
  783. //////////////////////////////////////////////////////////////////////////
  784. WriterStream.Seek( 0, SeekOrigin.Begin );
  785. WriterStream.Write( (ushort)WriterStream.Length );
  786. }
  787. }
  788. /// <summary>
  789. ///
  790. /// </summary>
  791. internal sealed class Friend0x7E1_Action0x06_Ack : Packet
  792. {
  793. /// <summary>
  794. ///
  795. /// </summary>
  796. internal Friend0x7E1_Action0x06_Ack( Friend[] friendListArray )
  797. : base( 0x7E1, 0/*6 + ?*/ )
  798. {
  799. WriterStream.Write( (ushort)0 /*6 + ?*/ ); // ×֜δóĐĄ
  800. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  801. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  802. //////////////////////////////////////////////////////////////////////////
  803. WriterStream.Write( (byte)0x06 );
  804. WriterStream.Write( (byte)friendListArray.Length );
  805. foreach ( Friend friendList in friendListArray )
  806. {
  807. WriterStream.Write( (ushort)friendList.FriendGuid );
  808. WriterStream.Write( (ushort)0x0000 );
  809. if ( friendList.IsOnline == true ) // is Online ??
  810. WriterStream.Write( (byte)0x07 ); // Online
  811. else
  812. WriterStream.Write( (byte)0x08 ); // Offline
  813. WriterStream.WriteAsciiNull( friendList.FriendName );
  814. }
  815. //////////////////////////////////////////////////////////////////////////
  816. WriterStream.Seek( 0, SeekOrigin.Begin );
  817. WriterStream.Write( (ushort)WriterStream.Length );
  818. }
  819. }
  820. /// <summary>
  821. ///
  822. /// </summary>
  823. internal sealed class Friend0x7E1_Action0x08_Ack : Packet
  824. {
  825. /// <summary>
  826. ///
  827. /// </summary>
  828. internal Friend0x7E1_Action0x08_Ack( long iCharGuid, long iStatus )
  829. : base( 0x7E1, 12/*6 + 6*/ )
  830. {
  831. WriterStream.Write( (ushort)12 /*6 + 6*/ ); // ×֜δóĐĄ
  832. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  833. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  834. //////////////////////////////////////////////////////////////////////////
  835. WriterStream.Write( (byte)0x08 );
  836. WriterStream.Write( (ushort)iCharGuid );
  837. WriterStream.Write( (ushort)0x0000 );
  838. WriterStream.Write( (byte)iStatus );
  839. }
  840. }
  841. #endregion
  842. #region zh-CHS Unknown0x07E5 Ack Ŕŕ | en ClanManagerAck Class
  843. /// <summary>
  844. ///
  845. /// </summary>
  846. internal sealed class Unknown0x07E5_Action0x01Ack : Packet
  847. {
  848. /// <summary>
  849. ///
  850. /// </summary>
  851. internal Unknown0x07E5_Action0x01Ack()
  852. : base( 0x7E5, 9/*6 + 3*/ )
  853. {
  854. WriterStream.Write( (ushort)9 /*6 + 3*/ ); // ×֜δóĐĄ
  855. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  856. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  857. //////////////////////////////////////////////////////////////////////////
  858. WriterStream.Write( (byte)0x01 );
  859. WriterStream.Write( (ushort)0x0000 );
  860. //////////////////////////////////////////////////////////////////////////
  861. WriterStream.Seek( 0, SeekOrigin.Begin );
  862. WriterStream.Write( (ushort)WriterStream.Length );
  863. }
  864. }
  865. /// <summary>
  866. ///
  867. /// </summary>
  868. internal sealed class Clan0x7E0_Action0x73_Ack : Packet
  869. {
  870. /// <summary>
  871. ///
  872. /// </summary>
  873. internal Clan0x7E0_Action0x73_Ack( long iServerGuid, long iLevel, long iClassId, string strCharName )
  874. : base( 0x7E0, 0/*6 + ?*/ )
  875. {
  876. WriterStream.Write( (ushort)0 /*6 + ?*/ ); // ×֜δóĐĄ
  877. WriterStream.Write( (ushort)base.PacketID ); // ×֜ιŕşĹ
  878. WriterStream.Write( (ushort)0x00 ); // ×֜ιŁÁô
  879. //////////////////////////////////////////////////////////////////////////
  880. WriterStream.Write( (byte)0x73 );
  881. WriterStream.Write( (byte)0x00 );
  882. WriterStream.Write( (byte)iServerGuid );
  883. WriterStream.Write( (ushort)0x0000 );
  884. WriterStream.Write( (ushort)0x0000 );
  885. WriterStream.Write( (ushort)iLevel );
  886. WriterStream.Write( (ushort)iClassId );
  887. WriterStream.WriteAsciiNull( strCharName );
  888. //////////////////////////////////////////////////////////////////////////
  889. WriterStream.Seek( 0, SeekOrigin.Begin );
  890. WriterStream.Write( (ushort)WriterStream.Length );
  891. }
  892. }
  893. #endregion
  894. }
  895. #endregion