I'm trying to finish 357 chat and I'm getting stuck at this error... I have no idea what's causing the packet offset and the block size to be different but I guess that's what it's telling me.
Anyways, here is my code:
Serverside:
Code:
public void appendChatUpdate(Rs2PacketBuilder packet) {
ChatMessage cm = player.getChatMessage();
byte[] bytes = cm.getData();
packet.putShortA(((cm.getColor() & 0xFF) << 8) | (cm.getEffects() & 0xFF));
packet.putByteC((byte) player.getRights());
packet.putByteA(bytes.length);
for(int ptr = bytes.length -1; ptr >= 0; ptr--) {
packet.put(bytes[ptr]);
}
}
Clientside:
Code:
if((k & 0x40) != 0)
{
int l = buffer.getShortA();
int j2 = buffer.getUnsignedByteC();
int j3 = buffer.getUnsignedByteA();
int l3 = buffer.currentOffset;
if(class39_sub3_sub2_sub5_sub1.aString1754 != null && class39_sub3_sub2_sub5_sub1.aBoolean1755)
{
long l4 = Class37.stringToLong(class39_sub3_sub2_sub5_sub1.aString1754);
boolean flag = false;
if(j2 <= 1)
{
for(int i4 = 0; i4 < anInt1168; i4++)
{
if(aLongArray879[i4] != l4)
continue;
flag = true;
break;
}
}
if(!flag && anInt897 == 0)
try
{
aClass39_Sub3_Sub3_898.currentOffset = 0;
buffer.getReverseBytes(aClass39_Sub3_Sub3_898.buffer, j3, 0);
aClass39_Sub3_Sub3_898.currentOffset = 0;
String s = Class50.method601(aClass39_Sub3_Sub3_898, j3, 0);
s = Class44.method556(s, true);
class39_sub3_sub2_sub5_sub1.aString1605 = s;
class39_sub3_sub2_sub5_sub1.anInt1607 = l >> 8;
class39_sub3_sub2_sub5_sub1.anInt1643 = l & 0xff;
class39_sub3_sub2_sub5_sub1.anInt1628 = 150;
if(j2 == 2 || j2 == 3)
sendMessage((byte)-83, s, 1, "@cr2@" + class39_sub3_sub2_sub5_sub1.aString1754);
else
if(j2 == 1)
sendMessage((byte)-83, s, 1, "@cr1@" + class39_sub3_sub2_sub5_sub1.aString1754);
else
sendMessage((byte)-83, s, 2, class39_sub3_sub2_sub5_sub1.aString1754);
}
catch(Exception exception)
{
Signlink.reporterror("cde2");
}
}
buffer.currentOffset = l3 + j3;
}
And it's giving me this error:
Code:
Error: Error packet size mismatch in getplayer pos:202 psize:9
Error: T2 - 166,208,166 - 9,3200,3200 - 0,-49,-2,-128,59,0,-127,-128,64,
java.lang.RuntimeException: eek
at Client.parseUpdatePlayers(Client.java:7426)
at Client.parseOpcode(Client.java:1476)
at Client.method113(Client.java:8598)
at Client.method7(Client.java:12105)
at GameApplet.run(GameApplet.java:111)
at Client.run(Client.java:7689)
at java.lang.Thread.run(Unknown Source)
I don't know if this should be in the client section or the server section, but I'm putting it here because I'm almost positive it's the server that's causing it.