Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [code]
- if ((0x80 & arg1) != 0) {//start chat mask
- int i
- = Class109_Sub1.aClass153_Sub8_Sub1_3922.method1677((byte) 48);
- int i_6_ = Class109_Sub1.aClass153_Sub8_Sub1_3922
- .readUnsignedByteC((byte) 113);
- int i_7_ = Class109_Sub1.aClass153_Sub8_Sub1_3922
- .readUnsignedByteS((byte) 119);
- int i_8_ = Class109_Sub1.aClass153_Sub8_Sub1_3922.position;
- boolean bool = (0x8000 & i ^ 0xffffffff) != -1;
- if (arg2.aString6427 != null && arg2.aClass152_6393 != null) {
- boolean bool_9_ = false;
- if (i_6_ <= 1) {
- if (!bool
- && (Class49.aBoolean763 && !Class153_Sub14.aBoolean4334
- || Class137_Sub1.aBoolean4129))
- bool_9_ = true;
- else if (Class189.method2605(arg2.aString6427, (byte) -97))
- bool_9_ = true;
- }
- if (!bool_9_
- && (RuntimeException_Sub1.anInt3096 ^ 0xffffffff) == -1) {
- Class196_Sub1.aClass153_Sub8_4738.position = 0;
- Class109_Sub1.aClass153_Sub8_Sub1_3922.method1630
- (Class196_Sub1.aClass153_Sub8_4738.buffer,
- i_7_, 0, -1);
- Class196_Sub1.aClass153_Sub8_4738.position = 0;
- int i_10_ = -1;
- String string;
- if (bool) {
- i &= 0x7fff;
- Class169 class169
- = (Class210_Sub2_Sub1.method2774
- (Class196_Sub1.aClass153_Sub8_4738, 4096));
- i_10_ = class169.anInt2241;
- string = (class169.aClass153_Sub14_Sub3_2239.method1728
- (Class196_Sub1.aClass153_Sub8_4738, 119));
- } else
- string
- = (Class208_Sub1.method2742
- ((Class17.method439
- (true,
- Class44.method596(-128,
- (Class196_Sub1
- .aClass153_Sub8_4738)))),
- 123));
- arg2.aString5184 = string.trim();
- arg2.anInt5232 = 0xff & i;
- arg2.anInt5220 = i >> 1908958408;
- arg2.anInt5218 = 150;
- int i_11_;
- if ((i_6_ ^ 0xffffffff) != -2 && i_6_ != 2)
- i_11_ = bool ? 17 : 2;
- else
- i_11_ = bool ? 17 : 1;
- if (i_6_ == 2)
- Class153_Sub36_Sub35.method2253
- (i_10_, "<img=1>" + arg2.method1348(-44, false),
- "<img=1>" + arg2.method1346(arg0 + -29336, true),
- 0, 100, string, i_11_, null);
- else if ((i_6_ ^ 0xffffffff) == -2)
- Class153_Sub36_Sub35.method2253
- (i_10_, "<img=0>" + arg2.method1348(-10, false),
- "<img=0>" + arg2.method1346(-13458, true), 0, 104,
- string, i_11_, null);
- else
- Class153_Sub36_Sub35.method2253(i_10_,
- arg2.method1348(-73,
- false),
- arg2.method1346(-13458,
- true),
- 0, 120, string, i_11_,
- null);
- }
- }
- Class109_Sub1.aClass153_Sub8_Sub1_3922.position = i_7_ + i_8_;
- }//end chat mask
- [/code]
- my chat handler
- [code]
- package com.rs2hd.packethandler;
- import com.rs2hd.model.ChatMessage;
- import com.rs2hd.model.Player;
- import com.rs2hd.model.World;
- import com.rs2hd.GameEngine;
- import com.rs2hd.net.Packet;
- import com.rs2hd.util.Misc;
- import org.apache.mina.common.IoSession;
- /**
- * Chat packet handler.
- *
- * @author Graham
- */
- public class ChatPacketHandler implements PacketHandler {
- @Override
- public void handlePacket(Player player, IoSession session, Packet packet) {
- if (player == null) {
- return;
- }
- int effects = packet.readShort();
- int numChars = packet.readShort();
- String text = Misc.decryptPlayerChat(packet, numChars);
- if (!World.getInstance().getBanManager().canTalk(player)) {
- player.getActionSender().sendMessage("You are currently muted.");
- return;
- }
- player.setLastChatMessage(new ChatMessage(effects, numChars, text));
- player.getUpdateFlags().setChatTextUpdateRequired(true);
- }
- }
- [/code]
- method1677
- [code]
- public int method1677(byte arg0) {
- try {
- position += 2;
- anInt4259++;
- if (arg0 != 48)
- writeString(null, true);
- return ((0xff & buffer[position - 1])
- + (0xff00
- & buffer[position + -2] << -1147743544));
- } catch (RuntimeException runtimeexception) {
- throw Class180.method2506(runtimeexception, "dg.J(" + arg0 + ')');
- }
- }
- [/code]
- 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.
- thank you.
Add Comment
Please, Sign In to add comment