02-21-2018, 03:03 PM
(Сообщение последний раз редактировалось: 02-21-2018, 03:06 PM bmzproject.)
Help me UDP3 i'm get value Opcode3 X,Y,Z,camX,camZ,Area
[SRC="java"]case 3:
{
log.info("Packet Replication Opcode 3 Slot :" + slotID);
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();
}
log.info("============================================================================================");
log.info("| Sub-Opcode: " + sub_opcode + " | Slot: " + slot + "| Length: " + sub_length + " | EventType: " + EventType + " |");
log.info("============================================================================================");
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();
log.info("====================================================");
log.info("X : " + x);
log.info("Y : " + y);
log.info("Z : " + z);
log.info("camX : " + camX);
log.info("camZ : " + camZ);
log.info("Area : " + Area);
log.info("====================================================");
remainvalue += 0x04;
}
log.info("| Sub-Opcode: " + sub_opcode + " | Slot: " + slot + "| length: " + sub_length + " | EventType: " + EventType + " |");
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(InternalPacket.copy());
for (Player p : this.room.getPlayers().values())
{
log.info(NetworkUtil.printData("Buffer OutPut 3", _buf));
ctx.writeAndFlush(new DatagramPacket(_buf.copy(), p.net));
log.warn("Opcode3 Relay Packet send to > " + p.slotID);
log.info("====================================================");
log.info("Opcode 3 >>>");
log.info("Room.GetPlayer : " + room.getPlayers().values().toString());
log.info("PlayerID : " + p.playerID);
log.info("PlayerSession : " + p.session);
log.info("PlayerSlotID : " + p.slotID);
log.info("PlayerNet : " + p.net);
log.info("PlayerIP : " + p.playerIP);
log.info("PlayerRoom : " + p.room);
log.info("====================================================");
}
}
break;
}[/SRC]
Received value
[SRC="xml"][12:58:30|INFO |nioEventLoopGroup-2-1 |ru.pb.battle.network.client.BattleClientConnection] X : 19908
[12:58:30|INFO |nioEventLoopGroup-2-1 |ru.pb.battle.network.client.BattleClientConnection] Y : 18071
[12:58:30|INFO |nioEventLoopGroup-2-1 |ru.pb.battle.network.client.BattleClientConnection] Z : -14562
[12:58:30|INFO |nioEventLoopGroup-2-1 |ru.pb.battle.network.client.BattleClientConnection] camX : 22820
[12:58:30|INFO |nioEventLoopGroup-2-1 |ru.pb.battle.network.client.BattleClientConnection] camZ : -17989
[12:58:30|INFO |nioEventLoopGroup-2-1 |ru.pb.battle.network.client.BattleClientConnection] Area : 9[/SRC]
I want to know what to (X, Y, Z, camX, camZ, Area) How to send to the client?
Now UDP3 I can not work. Can not see the movement.
Добавлено через 2 минуты
I would like to know how to send (X, Y, Z, camX, camZ, Area) received from Opcode3 to client, please help me.
[SRC="java"]case 3:
{
log.info("Packet Replication Opcode 3 Slot :" + slotID);
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();
}
log.info("============================================================================================");
log.info("| Sub-Opcode: " + sub_opcode + " | Slot: " + slot + "| Length: " + sub_length + " | EventType: " + EventType + " |");
log.info("============================================================================================");
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();
log.info("====================================================");
log.info("X : " + x);
log.info("Y : " + y);
log.info("Z : " + z);
log.info("camX : " + camX);
log.info("camZ : " + camZ);
log.info("Area : " + Area);
log.info("====================================================");
remainvalue += 0x04;
}
log.info("| Sub-Opcode: " + sub_opcode + " | Slot: " + slot + "| length: " + sub_length + " | EventType: " + EventType + " |");
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(InternalPacket.copy());
for (Player p : this.room.getPlayers().values())
{
log.info(NetworkUtil.printData("Buffer OutPut 3", _buf));
ctx.writeAndFlush(new DatagramPacket(_buf.copy(), p.net));
log.warn("Opcode3 Relay Packet send to > " + p.slotID);
log.info("====================================================");
log.info("Opcode 3 >>>");
log.info("Room.GetPlayer : " + room.getPlayers().values().toString());
log.info("PlayerID : " + p.playerID);
log.info("PlayerSession : " + p.session);
log.info("PlayerSlotID : " + p.slotID);
log.info("PlayerNet : " + p.net);
log.info("PlayerIP : " + p.playerIP);
log.info("PlayerRoom : " + p.room);
log.info("====================================================");
}
}
break;
}[/SRC]
Received value
[SRC="xml"][12:58:30|INFO |nioEventLoopGroup-2-1 |ru.pb.battle.network.client.BattleClientConnection] X : 19908
[12:58:30|INFO |nioEventLoopGroup-2-1 |ru.pb.battle.network.client.BattleClientConnection] Y : 18071
[12:58:30|INFO |nioEventLoopGroup-2-1 |ru.pb.battle.network.client.BattleClientConnection] Z : -14562
[12:58:30|INFO |nioEventLoopGroup-2-1 |ru.pb.battle.network.client.BattleClientConnection] camX : 22820
[12:58:30|INFO |nioEventLoopGroup-2-1 |ru.pb.battle.network.client.BattleClientConnection] camZ : -17989
[12:58:30|INFO |nioEventLoopGroup-2-1 |ru.pb.battle.network.client.BattleClientConnection] Area : 9[/SRC]
I want to know what to (X, Y, Z, camX, camZ, Area) How to send to the client?
Now UDP3 I can not work. Can not see the movement.
Добавлено через 2 минуты
I would like to know how to send (X, Y, Z, camX, camZ, Area) received from Opcode3 to client, please help me.