Форум администраторов игровых серверов

Форум администраторов игровых серверов (https://forum.zone-game.info/TT.php)
-   Point Blank (Piercing Blow) (https://forum.zone-game.info/forumdisplay.php?f=204)
-   -   [Point Blank] Help me please UDP3 EVENT Opcode 3 and 4 (https://forum.zone-game.info/showthread.php?t=42952)

bmzproject 13.02.2018 12:10

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;
            }
Code: Java
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();        
Code: Java
I have to do with Opcode4.
Or i made the wrong structure

PROGRAMMATOR 13.02.2018 14:43

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

bmzproject 13.02.2018 19:25

Re: Help me please UDP3 EVENT Opcode 3 and 4
 
Цитата:

Сообщение от PROGRAMMATOR (Сообщение 430173)

When I get posX, posY, posZ, what do I need to do next?
I have no structure

PROGRAMMATOR 13.02.2018 21:52

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.

bmzproject 14.02.2018 00:49

Re: Help me please UDP3 EVENT Opcode 3 and 4
 
Цитата:

Сообщение от PROGRAMMATOR (Сообщение 430182)
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.

I do not know how to send.

I need a structured way to send value to the client.

bmzproject 15.02.2018 03:05

Re: Help me please UDP3 EVENT Opcode 3 and 4
 
Цитата:

Сообщение от PROGRAMMATOR (Сообщение 430182)
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.

@PROGRAMMATOR Send to all clients where Opcode ?
help me please

Awiion 15.02.2018 10:05

Re: Help me please UDP3 EVENT Opcode 3 and 4
 
bmzproject,

Link

bmzproject 15.02.2018 11:30

Re: Help me please UDP3 EVENT Opcode 3 and 4
 
Цитата:

Сообщение от Awiion (Сообщение 430218)
bmzproject,

Link

When I get x, y, z, camX, camZ, Area
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;
        }
Code: Java
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;
            }
Code: Java


Текущее время: 01:21. Часовой пояс GMT +3.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd. Перевод: zCarot