Interface SessionListener
- All Known Implementing Classes:
ClientListener, ServerListener, SessionAdapter
public interface SessionListener
A listener for listening to session events.
-
Method Summary
Modifier and TypeMethodDescriptionvoidCalled when a session connects.voiddisconnected(Session session, net.kyori.adventure.text.Component reason, Throwable cause) Called when a session is disconnected.voiddisconnecting(Session session, net.kyori.adventure.text.Component reason, Throwable cause) Called when a session is about to disconnect.booleanpacketError(Session session, Throwable throwable) Called when a session encounters an error while reading or writing packet data.voidpacketReceived(Session session, Packet packet) Called when a session receives a packet.packetSending(Session session, Packet packet) Called when a session is sending a packet.voidpacketSent(Session session, Packet packet) Called when a session sends a packet.
-
Method Details
-
packetReceived
-
packetSending
-
packetSent
-
packetError
-
connected
Called when a session connects.- Parameters:
session- Session that connected.
-
disconnecting
Called when a session is about to disconnect.- Parameters:
session- Session being disconnected.reason- Reason for the session to disconnect.cause- Throwable that caused the disconnect, or null if not caused by a throwable.
-
disconnected
Called when a session is disconnected.- Parameters:
session- Session that disconnected.reason- Reason for the session to disconnect.cause- Throwable that caused the disconnect, or null if not caused by a throwable.
-