Help me please UDP3 EVENT Opcode 3 and 4
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; }When i get this.x = originalbuffer.readShort(); this.y = originalbuffer.readShort(); this.z = originalbuffer.readShort(); this.camX = originalbuffer.readShort(); this.camZ = originalbuffer.readShort(); this.Area = originalbuffer.readShort();I have to do with Opcode4. Or i made the wrong structure |
Re: Help me please UDP3 EVENT Opcode 3 and 4
3 and 4 is a same. https://forum.zone-game.info/showpos...18&postcount=6
|
Re: Help me please UDP3 EVENT Opcode 3 and 4
Цитата:
I have no structure |
Re: Help me please UDP3 EVENT Opcode 3 and 4
Send to all clients for them to see the actual position of a player. kappa
P.S. Before this you need to check player's position data and speed of movement to switch off possibility of teleportation and speedhack and for lag compensation. |
Re: Help me please UDP3 EVENT Opcode 3 and 4
Цитата:
I need a structured way to send value to the client. |
Re: Help me please UDP3 EVENT Opcode 3 and 4
Цитата:
help me please |
Re: Help me please UDP3 EVENT Opcode 3 and 4
|
Re: Help me please UDP3 EVENT Opcode 3 and 4
Цитата:
Opcode 3 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(); } System.out.println("============================================================================================"); System.out.println("| Sub-Opcode: " + sub_opcode + " | Slot: " + slot + "| Length: " + sub_length + " | EventType: " + EventType + " |"); System.out.println("============================================================================================"); if ((EventType & 0x01) > 0) { System.out.println("===================================================="); System.out.println("Action State"); System.out.println(" Condition 1 " + originalbuffer.readShort()); System.out.println(" Condition 2 " + originalbuffer.readShort()); System.out.println("===================================================="); remainvalue += 0x01; } if ((EventType & 0x02) > 0) { System.out.println("===================================================="); System.out.println("Animation : " + originalbuffer.readShort()); System.out.println("===================================================="); remainvalue += 0x02; } 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); System.out.println("===================================================="); remainvalue += 0x04; } for (Player p : room.getPlayers().values()) { log.info("===================================================="); log.info("| Sub-Opcode: " + sub_opcode + " | Slot: " + slot + "| length: " + sub_length + " | EventType: " + EventType + " |"); log.info("===================================================="); 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()); ctx.writeAndFlush(new DatagramPacket(_buf.copy(), p.net)); } } break; }What do I do next? I need an example of how to send values to a client. Opcode 4 case 4: { if (room != null) { 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); System.out.println("===================================================="); remainvalue += 0x04; } 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()); ctx.writeAndFlush(new DatagramPacket(_buf, p.net)); } } break; } |
Текущее время: 01:21. Часовой пояс GMT +3. |
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd. Перевод: zCarot