SpawnPlayerMsg
Gateway -> worker: a client wants a pawn.
Nebula · Packages/com.1by3.nebula/Runtime/Protocol/Messages.cspublic struct SpawnPlayerMsgGateway -> worker: a client wants a pawn. Doubles as the claim of a session by a gateway: a worker that already holds a pawn for ClientId re-announces it to the sender and, when Generation is newer than the one it knew, routes the session through the sender from now on (PlayerSessions).
Fields
ClientId
public ulong ClientId;The mesh-wide session id (WelcomeMsg.ClientId).
Container
public ContainerRef Container;The container the gateway picked for the pawn (baked or runtime).
Name
public string Name;IsBot
public bool IsBot;Identity
public string Identity;The player's PlayerIdentity, as the gateway established it from the client's token.
Generation
public ulong Generation;The session's connection generation: increases every time a client (re)claims the session. A worker ignores a claim or a despawn carrying an older generation than the one it holds, which fences a gateway that lost the client from undoing what the gateway that gained it did.
Claims
public IReadOnlyDictionary<string, string> Claims;The claims of the player's verified sign-in token that the mesh forwards (NebulaConfig.ForwardedClaims), or null for none (an anonymous player, or nothing configured). Taken from the token presented on this connection, so a reconnection carries the claims as they are now. Protocol 22, trailing.
Methods
Write
public void Write(NetworkWriter w);Read
public static SpawnPlayerMsg Read(NetworkReader r);SessionReplacedMsg
Gateway -> client: the player this client signed in as connected again elsewhere, and that newer connection now holds the session and the pawn (NebulaConfig.SingleSessionPerPlayer).
SyncAudienceMsg
Worker to gateway (MsgId.SyncAudience, protocol 20): the member sets of an entity's SyncAudience.Custom behaviors changed.