API reference / @jsprismarine/prismarine / player/context/SessionHandler
player/context/SessionHandler
Interfaces
ConnectionLaneHandler
Defined in: packages/prismarine/src/player/context/SessionHandler.ts:14
A connection-lane handler: it touches only its own session, and runs when its packet arrives.
Extends
LaneHandler<P,SessionContext,"connection",SessionPhase>
Type Parameters
P
P
Properties
lane
readonlylane:"connection"
Defined in: packages/protocol/src/handler/PacketHandler.ts:41
When the handler runs relative to the world tick.
Inherited from
LaneHandler.lane
phases
readonlyphases: readonlySessionPhase[]
Defined in: packages/protocol/src/handler/PacketHandler.ts:23
The session phases in which the packet is accepted. The side drops it in any other.
Inherited from
LaneHandler.phases
Methods
handle()
handle(
packet,context):void|Promise<void>
Defined in: packages/protocol/src/handler/PacketHandler.ts:31
Handles one packet.
Parameters
packet
P
The decoded packet.
context
What the side hands the handler.
Returns
void | Promise<void>
Inherited from
LaneHandler.handle
InputLaneHandler
Defined in: packages/prismarine/src/player/context/SessionHandler.ts:23
An input-lane handler: applied synchronously in the input step of its sender's world, inside one unit of that world's change log, so a throw undoes what it wrote.
Extends
InputHandler<P,InputContext,SessionPhase>
Type Parameters
P
P
Properties
lane
readonlylane:"input"
Defined in: packages/protocol/src/handler/PacketHandler.ts:41
When the handler runs relative to the world tick.
Inherited from
InputHandler.lane
phases
readonlyphases: readonlySessionPhase[]
Defined in: packages/protocol/src/handler/PacketHandler.ts:23
The session phases in which the packet is accepted. The side drops it in any other.
Inherited from
InputHandler.phases
Methods
handle()
handle(
packet,context):undefined
Defined in: packages/protocol/src/handler/PacketHandler.ts:60
Applies one input.
Parameters
packet
P
The decoded packet.
context
What the side hands an input-lane handler.
Returns
undefined
Inherited from
InputHandler.handle
ReadLaneHandler
Defined in: packages/prismarine/src/player/context/SessionHandler.ts:17
A read-lane handler: it reads the world, writes nothing, and answers only its sender.
Extends
LaneHandler<P,SessionContext,"read",SessionPhase>
Type Parameters
P
P
Properties
lane
readonlylane:"read"
Defined in: packages/protocol/src/handler/PacketHandler.ts:41
When the handler runs relative to the world tick.
Inherited from
LaneHandler.lane
phases
readonlyphases: readonlySessionPhase[]
Defined in: packages/protocol/src/handler/PacketHandler.ts:23
The session phases in which the packet is accepted. The side drops it in any other.
Inherited from
LaneHandler.phases
Methods
handle()
handle(
packet,context):void|Promise<void>
Defined in: packages/protocol/src/handler/PacketHandler.ts:31
Handles one packet.
Parameters
packet
P
The decoded packet.
context
What the side hands the handler.
Returns
void | Promise<void>
Inherited from
LaneHandler.handle
Type Aliases
SessionHandler
SessionHandler<
P> =ConnectionLaneHandler<P> |ReadLaneHandler<P> |InputLaneHandler<P>
Defined in: packages/prismarine/src/player/context/SessionHandler.ts:26
Any handler of a player session in the shared shape, its context chosen by its lane.
Type Parameters
P
P