Contents
Class GenericPacketHandler
java.lang.Object
com.hypixel.hytale.server.core.io.PacketHandler
com.hypixel.hytale.server.core.io.handlers.GenericPacketHandler
- All Implemented Interfaces:
ConnectionHandler, IPacketReceiver
- Direct Known Subclasses:
AssetEditorPacketHandler, GamePacketHandler
- Since:
- 2021/03/29
-
Nested Class Summary
Nested classes/interfaces inherited from class PacketHandler
PacketHandler.DisconnectReason, PacketHandler.PingInfo -
Field Summary
Fields inherited from class PacketHandler
DEFAULT_STREAM_PRIORITIES, MAX_PACKET_ID -
Constructor Summary
ConstructorsConstructorDescriptionGenericPacketHandler(ChannelConnection channel, ProtocolVersion protocolVersion) Default Constructor for aGenericPacketHandlerinstance -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaccept(ToServerPacket packet) Called to accept the given incoming packet<T extends SubPacketHandler>
TgetSubPacketHandler(Class<T> type) static Consumer<ToServerPacket>[]newHandlerArray(int size) voidregisterHandler(int packetId, Consumer<ToServerPacket> handler) Register a new packet handlervoidregisterNoOpHandlers(int... packetIds) voidregisterSubPacketHandler(SubPacketHandler subPacketHandler) Methods inherited from class PacketHandler
checkStreamOpenRateLimit, closed, compareAndSetChannel, disconnect, disconnect, getAccountProfile, getAuth, getAuxiliaryChannelCount, getChannel, getChannel, getChannel, getClientReadyForChunksFuture, getDisconnectReason, getIdentifier, getOperationTimeoutThreshold, getPacketStatsRecorder, getPingInfo, getProtocolVersion, getQueuedPacketsCount, getSniHostname, handle, handlePong, isLANConnection, isLocalConnection, logCloseMessage, logConnectionTimings, registered, sendPing, setChannel, setChannel, setClientReadyForChunksFuture, setQueuePackets, stillActive, tickPing, tryFlush, unregistered, write, write, write, writeNoCache, writePacket
-
Constructor Details
-
GenericPacketHandler
public GenericPacketHandler(@Nonnull ChannelConnection channel, @Nonnull ProtocolVersion protocolVersion) Default Constructor for aGenericPacketHandlerinstance- Parameters:
channel- The channel affiliated with this packet handlerprotocolVersion- The network protocol version
-
-
Method Details
-
newHandlerArray
-
registerSubPacketHandler
-
getSubPacketHandler
-
registerHandler
Register a new packet handler- Parameters:
packetId- the packetIdhandler- the handler
-
registerNoOpHandlers
public void registerNoOpHandlers(@Nonnull int... packetIds) -
accept
Description copied from class:PacketHandlerCalled to accept the given incoming packet- Specified by:
acceptin classPacketHandler- Parameters:
packet- The packet instance to accept
-