Protocol
MsgId
Wire message ids.
generated from the sources
Enum in namespace
Nebula · Packages/com.1by3.nebula/Runtime/Protocol/Messages.cspublic enum MsgId : byteWire 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
| Name | Value | Description |
|---|---|---|
Hello | 1 | |
Welcome | 2 | |
Ping | 3 | |
Pong | 4 | |
JoinStatus | 5 | Gateway -> 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. |
JoinRejected | 6 | Gateway -> 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. |
GatewayDraining | 7 | Gateway -> 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. |
SessionReplaced | 8 | Gateway -> client: a newer connection for this player took the session over (SessionReplacedMsg). The gateway disconnects right after sending it. |
Kicked | 9 | Gateway -> 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. |
EntitySpawn | 10 | |
EntityDespawn | 11 | |
EntityVars | 12 | |
EntityRpc | 13 | |
WorldState | 14 | |
OwnerState | 15 | |
ContainerOwnership | 16 | |
EntityState | 17 | Per-behavior sync chunks (NetworkTransform/NetworkAnimator) for one entity and tick. |
Batch | 18 | Gateway -> 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. |
InstancePrepare | 19 | |
ClientInput | 20 | |
ServerRpc | 21 | |
InstanceReady | 22 | |
ClientFocusHint | 23 | Client -> 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). |
Goodbye | 24 | Client -> 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. |
DriveInput | 25 | Client -> 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. |
FarEntities | 26 | Worker -> 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. |
Portals | 27 | Worker -> 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. |
PortalLinks | 28 | Worker -> 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. |
PortalWarm | 29 | Client -> 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. |
SpawnPlayer | 30 | |
DespawnPlayer | 31 | |
EndSession | 32 | The session moved to another gateway, so this one must let its client go (EndSessionMsg). |
InterestSubscribe | 33 | Gateway -> worker: the set of regions this gateway wants entities from (InterestSubscribeMsg). |
InterestResync | 34 | Worker -> gateway: the last subscription could not be applied; send a Full snapshot (InterestResyncMsg). |
EntityRedirect | 35 | Worker -> gateway: an explicitly subscribed entity now lives on another worker (EntityRedirectMsg). |
EntityForget | 36 | Worker -> gateway: an entity left every region this gateway subscribes here (EntityForgetMsg). |
SyncAudience | 37 | Worker -> gateway: the client member sets of an entity's Nebula.SyncAudience.Custom behaviors changed (SyncAudienceMsg, protocol 20). Never forwarded to a client. |
EntityMaps | 38 | Worker -> 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. |
KickPlayer | 39 | Worker -> 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. |
GhostSpawn | 40 | |
GhostState | 41 | |
GhostVars | 42 | |
GhostDespawn | 43 | |
AuthorityTransfer | 44 | |
ForwardInput | 45 | |
AuthorityRpc | 46 | Worker -> 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. |
GhostSyncState | 47 | |
WorkerMessage | 48 | Game-defined message between two workers: [kind:ushort][payload]. Registered per kind with NebulaWorker.RegisterMessageHandler; sent with NebulaWorker.SendToWorker. |
AuthorityRpcReply | 49 | Worker -> worker: the outcome of an AuthorityRpc that asked for one (AuthorityCallReplyMsg), sent to the worker that minted the call id. |
GhostMaps | 50 | Worker -> worker: EntityMaps for a ghost (EntityMapsMsg). |
PortalAdjacency | 51 | Worker -> 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. |
PortalHandoff | 52 | Worker -> 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. |
KickedMsg
Gateway -> client: the server removed this player (MsgId.Kicked, protocol 23).
NetworkMapCache
The contents of an entity's maps kept as opaque bytes, by a party that relays them without knowing their types: the gateway, so a late joiner is sent the current contents (docs/replicated-collections.md D6).