02-13-2018, 12:10 PM
[SRC="java"]case 3:
{
if (room != null)
{
onlyDecrypt(originalbuffer, this.length);
sub_opcode = originalbuffer.readByte();
slot = originalbuffer.readShort();
sub_length = originalbuffer.readShort();
EventType = 0;
if (sub_opcode != 2)
{
EventType = originalbuffer.readInt();
}
if ((EventType & 0x04) > 0)
{
this.x = originalbuffer.readShort();
this.y = originalbuffer.readShort();
this.z = originalbuffer.readShort();
this.camX = originalbuffer.readShort();
this.camZ = originalbuffer.readShort();
this.Area = originalbuffer.readShort(); System.out.println("====================================================");
System.out.println("X : " + x);
System.out.println("Y : " + y);
System.out.println("Z : " + z);
System.out.println("camX : " + camX);
System.out.println("camZ : " + camZ);
System.out.println("Area : " + Area);
}
ByteBuf _buf = Unpooled.buffer(0, this.length).order(ByteOrder.LITTLE_ENDIAN);
_buf.writeByte(4); // OPCODE 4
_buf.writeByte(-1); // SLOT -1
_buf.writeFloat(this.time); // TIME
_buf.writeByte(1); // SESSION
_buf.writeShort(this.length); // LENGTH this.length
_buf.writeShort(0); // EVENT 1
_buf.writeShort(0); // EVENT 2
_buf.writeBytes(this.InternalPacket.copy());
System.out.println(NetworkUtil.printData("Buffer OutPut 3", _buf));
ctx.writeAndFlush(new DatagramPacket(_buf.copy(), p.net));
}
}
break;
}
case 4:
{
if (room != null)
{
for (Player p : room.getPlayers().values())
{
ByteBuf _buf = Unpooled.buffer(0, this.length).order(ByteOrder.LITTLE_ENDIAN);
_buf.writeByte(4); // OPCODE
_buf.writeByte(-1); // SLOT
_buf.writeFloat(this.time); // TIME
_buf.writeByte(1); // SESSION
_buf.writeShort(this.length); // LENGTH
_buf.writeShort(0); // EVENT 1
_buf.writeShort(0); // EVENT 2
_buf.writeBytes(this.InternalPacket.copy());
System.out.println(NetworkUtil.printData("Buffer OutPut 4", _buf));
ctx.writeAndFlush(new DatagramPacket(_buf, p.net));
}
}
break;
}[/SRC]
When i get
[SRC="java"]this.x = originalbuffer.readShort();
this.y = originalbuffer.readShort();
this.z = originalbuffer.readShort();
this.camX = originalbuffer.readShort();
this.camZ = originalbuffer.readShort();
this.Area = originalbuffer.readShort(); [/SRC]
I have to do with Opcode4.
Or i made the wrong structure
{
if (room != null)
{
onlyDecrypt(originalbuffer, this.length);
sub_opcode = originalbuffer.readByte();
slot = originalbuffer.readShort();
sub_length = originalbuffer.readShort();
EventType = 0;
if (sub_opcode != 2)
{
EventType = originalbuffer.readInt();
}
if ((EventType & 0x04) > 0)
{
this.x = originalbuffer.readShort();
this.y = originalbuffer.readShort();
this.z = originalbuffer.readShort();
this.camX = originalbuffer.readShort();
this.camZ = originalbuffer.readShort();
this.Area = originalbuffer.readShort(); System.out.println("====================================================");
System.out.println("X : " + x);
System.out.println("Y : " + y);
System.out.println("Z : " + z);
System.out.println("camX : " + camX);
System.out.println("camZ : " + camZ);
System.out.println("Area : " + Area);
}
ByteBuf _buf = Unpooled.buffer(0, this.length).order(ByteOrder.LITTLE_ENDIAN);
_buf.writeByte(4); // OPCODE 4
_buf.writeByte(-1); // SLOT -1
_buf.writeFloat(this.time); // TIME
_buf.writeByte(1); // SESSION
_buf.writeShort(this.length); // LENGTH this.length
_buf.writeShort(0); // EVENT 1
_buf.writeShort(0); // EVENT 2
_buf.writeBytes(this.InternalPacket.copy());
System.out.println(NetworkUtil.printData("Buffer OutPut 3", _buf));
ctx.writeAndFlush(new DatagramPacket(_buf.copy(), p.net));
}
}
break;
}
case 4:
{
if (room != null)
{
for (Player p : room.getPlayers().values())
{
ByteBuf _buf = Unpooled.buffer(0, this.length).order(ByteOrder.LITTLE_ENDIAN);
_buf.writeByte(4); // OPCODE
_buf.writeByte(-1); // SLOT
_buf.writeFloat(this.time); // TIME
_buf.writeByte(1); // SESSION
_buf.writeShort(this.length); // LENGTH
_buf.writeShort(0); // EVENT 1
_buf.writeShort(0); // EVENT 2
_buf.writeBytes(this.InternalPacket.copy());
System.out.println(NetworkUtil.printData("Buffer OutPut 4", _buf));
ctx.writeAndFlush(new DatagramPacket(_buf, p.net));
}
}
break;
}[/SRC]
When i get
[SRC="java"]this.x = originalbuffer.readShort();
this.y = originalbuffer.readShort();
this.z = originalbuffer.readShort();
this.camX = originalbuffer.readShort();
this.camZ = originalbuffer.readShort();
this.Area = originalbuffer.readShort(); [/SRC]
I have to do with Opcode4.
Or i made the wrong structure