Class PacketProtocol
java.lang.Object
org.geysermc.mcprotocollib.network.packet.PacketProtocol
- Direct Known Subclasses:
MinecraftProtocol
A protocol for packet sending and receiving.
All implementations must have a constructor that takes in a
ByteBuf.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract PacketRegistryGets the inbound packet registry for this protocol.abstract PacketRegistryGets the outbound packet registry for this protocol.abstract PacketHeaderGets the packet header of this protocol.abstract StringGets the prefix used when locating SRV records for this protocol.abstract voidnewClientSession(Session session) Called when a client session is created with this protocol.abstract voidnewServerSession(Server server, Session session) Called when a server session is created with this protocol.
-
Constructor Details
-
PacketProtocol
public PacketProtocol()
-
-
Method Details
-
getSRVRecordPrefix
Gets the prefix used when locating SRV records for this protocol.- Returns:
- The protocol's SRV record prefix.
-
getPacketHeader
Gets the packet header of this protocol.- Returns:
- The protocol's packet header.
-
newClientSession
Called when a client session is created with this protocol.- Parameters:
session- The created session.
-
newServerSession
Called when a server session is created with this protocol.- Parameters:
server- The server that the session belongs to.session- The created session.
-
getInboundPacketRegistry
Gets the inbound packet registry for this protocol.- Returns:
- The protocol's inbound packet registry.
-
getOutboundPacketRegistry
Gets the outbound packet registry for this protocol.- Returns:
- The protocol's outbound packet registry.
-