Nebula
Protocol

MsgId

Wire message ids.

generated from the sources
public enum MsgId : byte

Wire message ids. One byte header on every packet. The same entity message shapes are used on all three links (client-gateway, gateway-worker, worker-worker); only the id tells the receiver which role sent it.

Members

NameValueDescription
Hello1
Welcome2
Ping3
Pong4
JoinStatus5Gateway -> client: how the join is going (JoinStatusMsg). Sent once the client is welcomed and again whenever the answer changes, so a mesh that has scaled to zero can hold the client in a "world starting" state instead of leaving it welcomed with no pawn and no explanation.
JoinRejected6Gateway -> client: the join was refused (JoinRejectedMsg: the token in Hello did not verify, or the mesh requires one). The gateway disconnects right after sending it.
GatewayDraining7Gateway -> client: this gateway is being taken out of service (GatewayDrainingMsg). The client should reconnect, presenting its session token, so another gateway takes over its session without the worker noticing more than a pause in input.
SessionReplaced8Gateway -> client: a newer connection for this player took the session over (SessionReplacedMsg). The gateway disconnects right after sending it.
Kicked9Gateway -> client: the server removed this player (KickedMsg: a code and a reason). The session is over and the gateway closes the link right after sending it; the client does not reconnect by itself.
EntitySpawn10
EntityDespawn11
EntityVars12
EntityRpc13
WorldState14
OwnerState15
ContainerOwnership16
EntityState17Per-behavior sync chunks (NetworkTransform/NetworkAnimator) for one entity and tick.
Batch18Gateway -> client: several reliable messages in one packet: [count:ushort]{[len:ushort][message]}. A big mesh produces hundreds of small reliable messages a second (an RPC per shot, a vars update per hit); one packet each was most of a client's packet rate.
InstancePrepare19
ClientInput20
ServerRpc21
InstanceReady22
ClientFocusHint23Client -> gateway: where the player is looking (ClientFocusHintMsg). A hint, never authority: the gateway drops a non-finite one, rate-limits it and clamps it to the pawn before a policy ever sees it (FocusHintFilter).
Goodbye24Client -> gateway: the player is leaving for good (GoodbyeMsg, protocol 23). The gateway ends the session at once: the worker removes the pawn without waiting out NebulaConfig.SessionReclaimSeconds, and the gateway closes the link.
DriveInput25Client -> gateway -> worker, and worker -> worker after a handover: the driver's recent inputs for an entity it drives (DriveInputMsg, protocol 25, docs/driven-vehicles.md). The gateway forwards it only from the client the entity's spawn names as its driver, stamping the client id, to the worker that owns the entity; a worker that handed the entity on forwards it to the new owner.
FarEntities26Worker -> gateway -> client: the far relevance tier (FarEntitiesMsg, protocol 26, NEB-388): poses of large or important entities beyond the normal interest radius, absolute in their scope, in double. The gateway sends it only to clients that negotiated 26 or later.
Portals27Worker -> gateway -> client: portals appearing and going (PortalsMsg, protocol 28, docs/portals.md D45). The gateway sends a client a portal's record behind the container row of either of its faces and withdraws it with the row.
PortalLinks28Worker -> gateway -> client: the state of each party's link through a portal (PortalLinksMsg, protocol 28). To the gateway it carries the members and the observers; to a client only whether it is one.
PortalWarm29Client -> gateway -> worker: this client holds the far window of a link and its content is ready (PortalWarmMsg, protocol 28). The gateway forwards it only from a member of the link, stamping the client id, to the worker that owns the portal.
SpawnPlayer30
DespawnPlayer31
EndSession32The session moved to another gateway, so this one must let its client go (EndSessionMsg).
InterestSubscribe33Gateway -> worker: the set of regions this gateway wants entities from (InterestSubscribeMsg).
InterestResync34Worker -> gateway: the last subscription could not be applied; send a Full snapshot (InterestResyncMsg).
EntityRedirect35Worker -> gateway: an explicitly subscribed entity now lives on another worker (EntityRedirectMsg).
EntityForget36Worker -> gateway: an entity left every region this gateway subscribes here (EntityForgetMsg).
SyncAudience37Worker -> gateway: the client member sets of an entity's Nebula.SyncAudience.Custom behaviors changed (SyncAudienceMsg, protocol 20). Never forwarded to a client.
EntityMaps38Worker -> gateway -> client: the entries of an entity's NetworkMap<TKey, TValue>s that changed (EntityMapsMsg, protocol 21, docs/replicated-collections.md D4). The gateway applies it to its copy before relaying it, and sends it only to clients that negotiated 21 or later.
KickPlayer39Worker -> gateway: remove this player (KickPlayerMsg, protocol 23). The gateway tells the client why (Kicked), closes the link and ends the session. Never forwarded to a client.
GhostSpawn40
GhostState41
GhostVars42
GhostDespawn43
AuthorityTransfer44
ForwardInput45
AuthorityRpc46Worker -> worker: an AuthorityRpc for an entity the sender holds only a ghost of (AuthorityCallMsg). Carries a call id, a hop count and the epoch the sender observed, so the receiver can apply it once, forward it after a handover, or reject it with a reason.
GhostSyncState47
WorkerMessage48Game-defined message between two workers: [kind:ushort][payload]. Registered per kind with NebulaWorker.RegisterMessageHandler; sent with NebulaWorker.SendToWorker.
AuthorityRpcReply49Worker -> worker: the outcome of an AuthorityRpc that asked for one (AuthorityCallReplyMsg), sent to the worker that minted the call id.
GhostMaps50Worker -> worker: EntityMaps for a ghost (EntityMapsMsg).
PortalAdjacency51Worker -> worker: a portal link the sender drives and the containers of the far scope its band touches, sent to the workers that own them (PortalAdjacencyMsg, docs/portals.md D30, D45). It is how a worker learns that a body in the band of a face it does not own is to be ghosted across, and how the far worker builds its side of the aperture before the link opens.
PortalHandoff52Worker -> worker: the links of a portal whose near container the sender is releasing to the receiver on a planned reassignment (PortalHandoffMsg, docs/portals.md D44, D45). On a crash nothing is sent and the links read closed.

On this page