| Package | Description |
|---|---|
| com.github.steveice10.packetlib | |
| com.github.steveice10.packetlib.event.session | |
| com.github.steveice10.packetlib.packet | |
| com.github.steveice10.packetlib.tcp |
| Modifier and Type | Method and Description |
|---|---|
void |
Session.send(Packet packet)
Sends a packet.
|
| Modifier and Type | Method and Description |
|---|---|
<T extends Packet> |
PacketSendingEvent.getPacket()
Gets the packet involved in this event as the required type.
|
<T extends Packet> |
PacketReceivedEvent.getPacket()
Gets the packet involved in this event as the required type.
|
<T extends Packet> |
PacketSentEvent.getPacket()
Gets the packet involved in this event as the required type.
|
| Modifier and Type | Method and Description |
|---|---|
void |
PacketSendingEvent.setPacket(Packet packet)
Sets the packet that should be sent as a result of this event.
|
| Constructor and Description |
|---|
PacketReceivedEvent(Session session,
Packet packet)
Creates a new PacketReceivedEvent instance.
|
PacketSendingEvent(Session session,
Packet packet)
Creates a new PacketSendingEvent instance.
|
PacketSentEvent(Session session,
Packet packet)
Creates a new PacketSentEvent instance.
|
| Modifier and Type | Class and Description |
|---|---|
class |
PacketDefinition<T extends Packet>
Represents a definition of a packet with various
information about it, such as it's id, class and
factory for construction.
|
interface |
PacketFactory<T extends Packet>
Factory for constructing
Packets. |
| Modifier and Type | Class and Description |
|---|---|
class |
BufferedPacket |
| Modifier and Type | Method and Description |
|---|---|
<T extends Packet> |
PacketProtocol.register(int id,
Class<T> packet,
PacketFactory<T> factory)
Registers a packet to this protocol as both incoming and outgoing.
|
<T extends Packet> |
PacketProtocol.registerIncoming(int id,
Class<T> packet,
PacketFactory<T> factory)
Registers an incoming packet to this protocol.
|
<T extends Packet> |
PacketProtocol.registerOutgoing(int id,
Class<T> packet,
PacketFactory<T> factory)
Registers an outgoing packet to this protocol.
|
| Modifier and Type | Method and Description |
|---|---|
Packet |
PacketProtocol.createIncomingPacket(int id,
NetInput in)
Creates a new instance of an incoming packet with the given id and read the incoming input.
|
Packet |
PacketProtocol.createOutgoingPacket(int id,
NetInput in)
Creates a new instance of an outgoing packet with the given id and read the outgoing input.
|
| Modifier and Type | Method and Description |
|---|---|
Class<? extends Packet> |
PacketProtocol.getOutgoingClass(int id)
Gets the packet class for a packet id.
|
Class<? extends Packet> |
BufferedPacket.getPacketClass() |
| Modifier and Type | Method and Description |
|---|---|
int |
PacketProtocol.getOutgoingId(Packet packet)
Gets the registered id of an outgoing
Packet instance. |
| Modifier and Type | Method and Description |
|---|---|
int |
PacketProtocol.getOutgoingId(Class<? extends Packet> packetClass)
Gets the registered id of an outgoing packet class.
|
| Constructor and Description |
|---|
BufferedPacket(Class<? extends Packet> packetClass,
byte[] buf) |
| Modifier and Type | Method and Description |
|---|---|
void |
TcpPacketCodec.encode(io.netty.channel.ChannelHandlerContext ctx,
Packet packet,
io.netty.buffer.ByteBuf buf) |
void |
TcpSession.send(Packet packet) |
Copyright © 2021. All rights reserved.