Guest User

Untitled

a guest
Jul 17th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.15 KB | None | 0 0
  1. [code]
  2. if ((0x80 & arg1) != 0) {//start chat mask
  3. int i
  4. = Class109_Sub1.aClass153_Sub8_Sub1_3922.method1677((byte) 48);
  5. int i_6_ = Class109_Sub1.aClass153_Sub8_Sub1_3922
  6. .readUnsignedByteC((byte) 113);
  7. int i_7_ = Class109_Sub1.aClass153_Sub8_Sub1_3922
  8. .readUnsignedByteS((byte) 119);
  9. int i_8_ = Class109_Sub1.aClass153_Sub8_Sub1_3922.position;
  10. boolean bool = (0x8000 & i ^ 0xffffffff) != -1;
  11. if (arg2.aString6427 != null && arg2.aClass152_6393 != null) {
  12. boolean bool_9_ = false;
  13. if (i_6_ <= 1) {
  14. if (!bool
  15. && (Class49.aBoolean763 && !Class153_Sub14.aBoolean4334
  16. || Class137_Sub1.aBoolean4129))
  17. bool_9_ = true;
  18. else if (Class189.method2605(arg2.aString6427, (byte) -97))
  19. bool_9_ = true;
  20. }
  21. if (!bool_9_
  22. && (RuntimeException_Sub1.anInt3096 ^ 0xffffffff) == -1) {
  23. Class196_Sub1.aClass153_Sub8_4738.position = 0;
  24. Class109_Sub1.aClass153_Sub8_Sub1_3922.method1630
  25. (Class196_Sub1.aClass153_Sub8_4738.buffer,
  26. i_7_, 0, -1);
  27. Class196_Sub1.aClass153_Sub8_4738.position = 0;
  28. int i_10_ = -1;
  29. String string;
  30. if (bool) {
  31. i &= 0x7fff;
  32. Class169 class169
  33. = (Class210_Sub2_Sub1.method2774
  34. (Class196_Sub1.aClass153_Sub8_4738, 4096));
  35. i_10_ = class169.anInt2241;
  36. string = (class169.aClass153_Sub14_Sub3_2239.method1728
  37. (Class196_Sub1.aClass153_Sub8_4738, 119));
  38. } else
  39. string
  40. = (Class208_Sub1.method2742
  41. ((Class17.method439
  42. (true,
  43. Class44.method596(-128,
  44. (Class196_Sub1
  45. .aClass153_Sub8_4738)))),
  46. 123));
  47. arg2.aString5184 = string.trim();
  48. arg2.anInt5232 = 0xff & i;
  49. arg2.anInt5220 = i >> 1908958408;
  50. arg2.anInt5218 = 150;
  51. int i_11_;
  52. if ((i_6_ ^ 0xffffffff) != -2 && i_6_ != 2)
  53. i_11_ = bool ? 17 : 2;
  54. else
  55. i_11_ = bool ? 17 : 1;
  56. if (i_6_ == 2)
  57. Class153_Sub36_Sub35.method2253
  58. (i_10_, "<img=1>" + arg2.method1348(-44, false),
  59. "<img=1>" + arg2.method1346(arg0 + -29336, true),
  60. 0, 100, string, i_11_, null);
  61. else if ((i_6_ ^ 0xffffffff) == -2)
  62. Class153_Sub36_Sub35.method2253
  63. (i_10_, "<img=0>" + arg2.method1348(-10, false),
  64. "<img=0>" + arg2.method1346(-13458, true), 0, 104,
  65. string, i_11_, null);
  66. else
  67. Class153_Sub36_Sub35.method2253(i_10_,
  68. arg2.method1348(-73,
  69. false),
  70. arg2.method1346(-13458,
  71. true),
  72. 0, 120, string, i_11_,
  73. null);
  74. }
  75. }
  76. Class109_Sub1.aClass153_Sub8_Sub1_3922.position = i_7_ + i_8_;
  77. }//end chat mask
  78. [/code]
  79.  
  80. my chat handler
  81.  
  82. [code]
  83. package com.rs2hd.packethandler;
  84.  
  85. import com.rs2hd.model.ChatMessage;
  86. import com.rs2hd.model.Player;
  87. import com.rs2hd.model.World;
  88. import com.rs2hd.GameEngine;
  89. import com.rs2hd.net.Packet;
  90. import com.rs2hd.util.Misc;
  91. import org.apache.mina.common.IoSession;
  92. /**
  93. * Chat packet handler.
  94. *
  95. * @author Graham
  96. */
  97. public class ChatPacketHandler implements PacketHandler {
  98. @Override
  99. public void handlePacket(Player player, IoSession session, Packet packet) {
  100. if (player == null) {
  101. return;
  102. }
  103. int effects = packet.readShort();
  104. int numChars = packet.readShort();
  105. String text = Misc.decryptPlayerChat(packet, numChars);
  106.  
  107. if (!World.getInstance().getBanManager().canTalk(player)) {
  108. player.getActionSender().sendMessage("You are currently muted.");
  109. return;
  110. }
  111. player.setLastChatMessage(new ChatMessage(effects, numChars, text));
  112. player.getUpdateFlags().setChatTextUpdateRequired(true);
  113. }
  114. }
  115. [/code]
  116. method1677
  117. [code]
  118. public int method1677(byte arg0) {
  119. try {
  120. position += 2;
  121. anInt4259++;
  122. if (arg0 != 48)
  123. writeString(null, true);
  124. return ((0xff & buffer[position - 1])
  125. + (0xff00
  126. & buffer[position + -2] << -1147743544));
  127. } catch (RuntimeException runtimeexception) {
  128. throw Class180.method2506(runtimeexception, "dg.J(" + arg0 + ')');
  129. }
  130. }
  131. [/code]
  132.  
  133. Could you please help me figure this out? you said i'm sending wrong data, and i have been looking at the code trying different things. i can't figure it out.
  134.  
  135. thank you.
Add Comment
Please, Sign In to add comment