Advertisement
Guest User

Untitled

a guest
Oct 29th, 2016
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.49 KB | None | 0 0
  1. namespace PBServer.network.serverpackets
  2. {
  3. using PBServer;
  4. using PBServer.data.model;
  5. using PBServer.data.xml.holders;
  6. using PBServer.managers;
  7. using PBServer.model.clans;
  8. using PBServer.src.managers;
  9. using PBServer.src.model.accounts;
  10. using System;
  11.  
  12. internal class SM_BASE_GET_MYINFO : SendBaseLoginPacket
  13. {
  14. private LoginClient _lc;
  15.  
  16. public SM_BASE_GET_MYINFO(LoginClient lc)
  17. {
  18. this._lc = lc;
  19. base.makeme();
  20. }
  21.  
  22. protected internal override void write()
  23. {
  24. int num;
  25. Account account = AccountManager.getInstance().get(this._lc.getLogin());
  26. Clan clan = ClanManager.getInstance().get(account.getClanId());
  27. if ((account.getPlayerName() == null) || (account.getPlayerName() == ""))
  28. {
  29. PlayerTemplate playerTemplate = PlayerTemplateHolder.getPlayerTemplate(Config.PlayerTemplateId);
  30. account.setRank(playerTemplate._rank);
  31. account.setExp(playerTemplate._exp);
  32. account.setGP(playerTemplate._gp);
  33. account.setMoney(playerTemplate._money);
  34. }
  35. base.writeH(0xa06);
  36. base.writeD(0);
  37. base.writeC(0xdd);
  38. base.writeS(account.getPlayerName(), 0x21);
  39. int num2 = account.getExp() + RankExpInfoHolder.getRankExpInfo(account.getRank())._onAllExp;
  40. base.writeD(num2);
  41. base.writeD(account.getRank());
  42. base.writeD(account.getRank());
  43. base.writeD(account.getGP());
  44. base.writeD(account.getMoney());
  45. base.writeD(((account == null) || (clan == null)) ? 0 : clan.getClanId());
  46. base.writeD(((account == null) || (clan == null)) ? 0 : clan.getLogoColor());
  47. base.writeD(0);
  48. base.writeD(0);
  49. base.writeH((short)account.getPcCafe());
  50. base.writeC((byte)account.getNameColor());
  51. base.writeS(Convert.ToString(((account == null) || (clan == null)) ? "" : clan.getClanName()), 0x10);
  52. base.writeC(0);
  53. base.writeH(((account == null) || (clan == null)) ? ((short)0) : ((short)clan.getClanRank()));
  54. base.writeC(Convert.ToByte(((account == null) || (clan == null)) ? 0xff : clan.getLogo1()));
  55. base.writeC(Convert.ToByte(((account == null) || (clan == null)) ? 0xff : clan.getLogo2()));
  56. base.writeC(Convert.ToByte(((account == null) || (clan == null)) ? 0xff : clan.getLogo3()));
  57. base.writeC(Convert.ToByte(((account == null) || (clan == null)) ? 0xff : clan.getLogo4()));
  58. base.writeH(((account == null) || (clan == null)) ? ((short)0) : ((short)clan.getLogoColor()));
  59. base.writeD(0);
  60. base.writeD(0);
  61. base.writeD(0);
  62. base.writeD(account._statistic.getFights_s());
  63. base.writeD(account._statistic.getWinFights_s());
  64. base.writeD(account._statistic.getLostFights_s());
  65. base.writeD(0);
  66. base.writeD(account._statistic.getKills_s());
  67. base.writeD(account._statistic.getHeadShotKills());
  68. base.writeD(account._statistic.getDeaths_s());
  69. base.writeD(0);
  70. base.writeD(account._statistic.getKills_s());
  71. base.writeD(account._statistic.getEscapes_s());
  72. base.writeD(account._statistic.getFights_s());
  73. base.writeD(account._statistic.getWinFights_s());
  74. base.writeD(account._statistic.getLostFights_s());
  75. base.writeD(0);
  76. base.writeD(account._statistic.getKills_s());
  77. base.writeD(account._statistic.getHeadShotKills());
  78. base.writeD(account._statistic.getDeaths_s());
  79. base.writeD(0);
  80. base.writeD(account._statistic.getKills_s());
  81. base.writeD(account._statistic.getEscapes_s());
  82. account.setStatus(1);
  83. AccountManager.getInstance().UpdateStatus(account.getPlayerId(), 1);
  84. if ((account.getPlayerName() == null) || (account.getPlayerName() == ""))
  85. {
  86. account.setCharRed(0x3baa102d);
  87. account.setCharBlue(0x3baa1416);
  88. account.setCharHelmet(0x41af3b39);
  89. account.setCharDino(0x3bf66361);
  90. account.setCharBeret(0);
  91. account.setPrimaryWeapon(0xbebd1a6);
  92. account.setSecondaryWeapon(0x23d29013);
  93. account.setMeleeWeapon(0x29d7af69);
  94. account.setThrownNormalWeapon(0x2fdcea19);
  95. account.setThrownSpecialWeapon(0x35e20d5a);
  96. account.setTitleSlotCount(1);
  97. }
  98. account.CheckCorrectInventory();
  99. base.writeD(account.getCharRed());
  100. base.writeD(account.getCharBlue());
  101. base.writeD(account.getCharHelmet());
  102. base.writeD(account.getCharBeret());
  103. base.writeD(account.getCharDino());
  104. base.writeD(account.getPrimaryWeapon());
  105. base.writeD(account.getSecondaryWeapon());
  106. base.writeD(account.getMeleeWeapon());
  107. base.writeD(account.getThrownNormalWeapon());
  108. base.writeD(account.getThrownSpecialWeapon());
  109. base.writeB(new byte[0x29]);
  110. if ((account.getPlayerName() == null) || (account.getPlayerName() == ""))
  111. {
  112. base.writeC(1);
  113. }
  114. else
  115. {
  116. base.writeC(1);
  117. }
  118. if ((account.getPlayerName() == null) || (account.getPlayerName() == ""))
  119. {
  120. base.writeD(account.getInvetoryOnlyEquip(2).Count);
  121. base.writeD(account.getInvetoryOnlyEquip(1).Count);
  122. base.writeD(account.getInvetoryOnlyEquip(3).Count);
  123. base.writeD(0);
  124. }
  125. else
  126. {
  127. base.writeD(account.getInvetoryOnly(2).Count);
  128. base.writeD(account.getInvetoryOnly(1).Count);
  129. base.writeD(account.getInvetoryOnly(3).Count);
  130. base.writeD(0);
  131. }
  132. if ((account.getPlayerName() == null) || (account.getPlayerName() == ""))
  133. {
  134. for (num = 0; num < account.getInvetoryOnlyEquip(2).Count; num++)
  135. {
  136. base.writeD(account.getInvetoryOnlyEquip(2)[num].id);
  137. base.writeD(account.getInvetoryOnlyEquip(2)[num].id);
  138. base.writeD(account.getInvetoryOnlyEquip(2)[num].id);
  139. base.writeC((byte)account.getInvetoryOnlyEquip(2)[num].equip_type);
  140. base.writeD(account.getInvetoryOnlyEquip(2)[num].count);
  141. }
  142. for (num = 0; num < account.getInvetoryOnlyEquip(1).Count; num++)
  143. {
  144. base.writeD(account.getInvetoryOnlyEquip(1)[num].id);
  145. base.writeD(account.getInvetoryOnlyEquip(1)[num].id);
  146. base.writeD(account.getInvetoryOnlyEquip(1)[num].id);
  147. base.writeC((byte)account.getInvetoryOnlyEquip(1)[num].equip_type);
  148. base.writeD(account.getInvetoryOnlyEquip(1)[num].count);
  149. }
  150. for (num = 0; num < account.getInvetoryOnlyEquip(3).Count; num++)
  151. {
  152. base.writeD(account.getInvetoryOnlyEquip(3)[num].id);
  153. base.writeD(account.getInvetoryOnlyEquip(3)[num].id);
  154. base.writeD(account.getInvetoryOnlyEquip(3)[num].id);
  155. base.writeC((byte)account.getInvetoryOnlyEquip(3)[num].equip_type);
  156. base.writeD(account.getInvetoryOnlyEquip(3)[num].count);
  157. }
  158. }
  159. else
  160. {
  161. num = 0;
  162. while (num < account.getInvetoryOnly(2).Count)
  163. {
  164. base.writeD(account.getInvetoryOnly(2)[num].object_id);
  165. base.writeD(account.getInvetoryOnly(2)[num].id);
  166. base.writeD(account.getInvetoryOnly(2)[num].id);
  167. base.writeC((byte)account.getInvetoryOnly(2)[num].equip_type);
  168. base.writeD(account.getInvetoryOnly(2)[num].count);
  169. num++;
  170. }
  171. for (num = 0; num < account.getInvetoryOnly(1).Count; num++)
  172. {
  173. base.writeD(account.getInvetoryOnly(1)[num].object_id);
  174. base.writeD(account.getInvetoryOnly(1)[num].id);
  175. base.writeD(account.getInvetoryOnly(1)[num].id);
  176. base.writeC((byte)account.getInvetoryOnly(1)[num].equip_type);
  177. base.writeD(account.getInvetoryOnly(1)[num].count);
  178. }
  179. for (num = 0; num < account.getInvetoryOnly(3).Count; num++)
  180. {
  181. base.writeD(account.getInvetoryOnly(3)[num].object_id);
  182. base.writeD(account.getInvetoryOnly(3)[num].id);
  183. base.writeD(account.getInvetoryOnly(3)[num].id);
  184. base.writeC((byte)account.getInvetoryOnly(3)[num].equip_type);
  185. base.writeD(account.getInvetoryOnly(3)[num].count);
  186. }
  187. }
  188. base.writeC((byte)Config.OutpostEnable);
  189. base.writeD(account.getBrooch());
  190. base.writeD(account.getInsignia());
  191. base.writeD(account.getMedal());
  192. base.writeD(account.getBlueOrder());
  193. base.writeC(0);
  194. base.writeC(0);
  195. base.writeC((byte)account.getCardId());
  196. byte[] buffer = new byte[] {
  197. 2, 4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  198. 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  199. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  200. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  201. 0, 0x10, 6, 7, 8, 9, 5, 0, 0, 0, 4, 3, 2, 0, 0, 0,
  202. 0, 0, 0, 0, 0, 0
  203. };
  204. buffer[0x53] = (byte)account.getMissionId();
  205. base.writeB(buffer);
  206. base.writeB(new byte[] {
  207. 3, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2,
  208. 2, 1, 1, 1, 1, 2, 1, 3, 1, 0, 1, 1, 0, 0, 0, 0,
  209. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  210. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  211. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  212. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  213. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  214. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  215. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  216. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 5, 4, 3, 2, 1
  217. });
  218. base.writeB(new byte[8]);
  219. base.writeB(new byte[3]);
  220. base.writeD(1);
  221. base.writeB(new byte[] {
  222. 0, 0, 0, 0, 0x39, 0, 0, 0, 0x19, 0, 0, 0, 0x23, 0, 0, 0,
  223. 1, 0, 0, 0, 0x27, 0, 0, 0, 1, 0, 0, 0, 40, 0, 0, 0,
  224. 1, 0, 0, 0, 1, 0, 0, 0, 0x2c, 0, 0, 0, 0, 0, 0, 0,
  225. 0, 0, 0, 0
  226. });
  227. base.writeC(60);
  228. base.writeC(2);
  229. base.writeB(new byte[] { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 7, 0xfe});
  230. base.writeB(new byte[] {
  231. 0, 0, 0x8d, 1, 0x88, 0, 0x89, 0, 0x8d, 0, 0x8d, 0, 0x8d, 0, 0x8d, 1,
  232. 9, 0, 1, 0, 0, 0, 0x8d, 0, 0x80, 0, 0, 0, 0, 0, 0, 0,
  233. 0, 0, 0, 0, 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0,
  234. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  235. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  236. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0,
  237. 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  238. 0, 0, 0, 0, 0, 0, 0, 0
  239. });
  240. base.writeB(new byte[] {
  241. 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
  242. 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
  243. 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
  244. 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0
  245. });
  246. base.writeB(new byte[] {
  247. 1, 0xee, 0xdf, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 5, 0,
  248. 110, 0x6f, 110, 0x65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  249. });
  250. }
  251. }
  252. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement