Table of Contents

Delegate GamePacketCallback<TPacket>

Namespace
Shard.Gameplay.Universe.Networking.GamePackets
Assembly
Shard.Gameplay.Universe.dll

Handles one typed gameplay packet for the Player supplied by its connection.

public delegate ValueTask GamePacketCallback<in TPacket>(Player player, TPacket packet) where TPacket : class, IToServerPacket

Parameters

player Player

The durable Player bound to the connection that received the packet. It is an identity, not proof that its connection or world binding is still current.

packet TPacket

The decoded packet.

Returns

ValueTask

An operation that completes when the callback has accepted or rejected the packet.

Type Parameters

TPacket

The generated inbound packet type.

Remarks

Calls from different connections may overlap. If a callback yields, a later packet from the same connection may also enter before it completes. A callback that requires ordering must preserve it at its domain boundary. Callback owners must not retain Player, World, or connection state after a call completes. World mutation must acquire fresh validated access through the Player or its domain owner. A module that accepts asynchronous callback work must stop admission and await that work from its quiescence hook.