Hi,
i'm working on packet 4 (answer to packet 3).
I've make it working just "copying" all the content between the Header and the Footer of the packet (And this work in a part, I see player move and so on)
Then, I've start to write the content between the Header and the Footer of the packet with the PosRotation event but that's not working. I've get the sending data, and i've see a problem
This is the no-working code
This is the working code
i'm working on packet 4 (answer to packet 3).
I've make it working just "copying" all the content between the Header and the Footer of the packet (And this work in a part, I see player move and so on)
Then, I've start to write the content between the Header and the Footer of the packet with the PosRotation event but that's not working. I've get the sending data, and i've see a problem
Код:
[color=Red]ae [/color]4f [color=red]b2 [/color]44 [color=red]6f [/color]be [color=red]9e [/color]50 [color=red]0e [/color]49 [color=red]10 [/color]00 //This is PosRotation wrong
0[color=red]a e[/color]4 f[color=red]b 2[/color]4 4[color=red]6 f[/color]b e[color=red]9 e[/color]5 0[color=red]0 e[/color]4 9[color=red]1 0[/color]0 //This is PosRotation correct
If you check them, you can the that the wrong one is all moved of one, I've colored 2 by 2 for make it more clearly
This is the no-working code
Код:
byte subHead = read.readByte();
int subHead_Slot = read.readShort();
int subHead_Length = read.readShort();
int subHead_Flag = read.readInt();
if ((subHead_Flag & 0x01) > 0) //..
if ((subHead_Flag & 0x02) > 0) //..
if ((subHead_Flag & 0x04) > 0)
{
posX = read.readUnsignedShort();
posY = read.readUnsignedShort();
posZ = read.readUnsignedShort();
camX = read.readUnsignedShort();
camY = read.readUnsignedShort();
area = read.readUnsignedShort();
event.event += 0x04;
pSize += 12;
}
event.data.buffer.writeHeader();
event.data.buffer.writeByte(subHead);
event.data.buffer.writeByte(subHead_Slot);
event.data.buffer.writeByte(pSize);
if((event.event & 0x04) > 0){
//This part is the HEX buffer showed up
event.data.buffer.writeShort(posX);
event.data.buffer.writeShort(posY);
event.data.buffer.writeShort(posZ);
event.data.buffer.writeShort(camX);
event.data.buffer.writeShort(camY);
event.data.buffer.writeShort(area);
}
This is the working code
Код:
//.. header
Data = new byte[Length - 13];
Receive.readBytes(Data);
Reader = Unpooled.copiedBuffer(Data).order(ByteOrder.LITTLE_ENDIAN);
BitShift.onlyDecrypt(Reader, Length);
send.buffer.writeBytes(Packet.Data.clone());