Interface IConnectionHandler
Handles the lifecycle and inbound packets of a single IChannelConnection.
Mirrors the Java ConnectionHandler: the server installs an initial handler on a new
connection and handlers swap themselves as the connection advances (handshake → auth → play).
public interface IConnectionHandler
Methods
Closed(string?)
Called when the connection has closed; reason is best-effort.
void Closed(string? reason)
Parameters
reasonstring
Handle(int, IToServerPacket)
Called for each decoded inbound client-to-server packet and its validated wire ID.
void Handle(int packetId, IToServerPacket packet)
Parameters
packetIdintpacketIToServerPacket
Registered(IChannelConnection)
Called once when this handler is attached to a connection.
void Registered(IChannelConnection connection)
Parameters
connectionIChannelConnection
Unregistered()
Called when this handler is detached (replaced or connection gone).
void Unregistered()