Тема: [Point Blank] UDP3 Send-back packet
Показать сообщение отдельно
Непрочитано 28.06.2018, 17:20   #1
Пользователь

Автор темы (Топик Стартер) UDP3 Send-back packet

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
Код:
ae 4f b2 44 6f be 9e 50 0e 49 10 00 //This is PosRotation wrong      
0a e4 fb 24 46 fb e9 e5 00 e4 91 00 //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());

Последний раз редактировалось ManuelDev; 28.06.2018 в 22:24. Причина: No need anymore
ManuelDev вне форума Ответить с цитированием