public abstract class OutPacket extends Object implements Packet
Constructor and Description |
---|
OutPacket() |
Modifier and Type | Method and Description |
---|---|
Packet |
decode(ByteBuf buf)
Sets the fields of the packet from the data serialized into the buffer
|
PacketDirection |
direction()
Returns the packet direction
|
void |
handleReceived(ClientConnection connection)
Handles the packet after receiving it from a connection, is invoked by the ClientConnection that received it
|
OutPacket |
set(String name,
Object value)
Sets the field name with said value
|
public OutPacket()
public PacketDirection direction()
Packet
direction
in interface Packet
PacketDirection.IN
or
PacketDirection.OUT
depending on directionpublic OutPacket set(String name, Object value)
name
- Name of field you wish to setvalue
- Value you wish to set the field topublic Packet decode(ByteBuf buf)
Cannot be decoded
public void handleReceived(ClientConnection connection)
Used to allow the packet to notify the ClientConnection
of packets the server receives, and make changes specific to this packet
Cannot be received
handleReceived
in interface Packet
connection
- The connection that sent the packetCopyright © 2016. All rights reserved.