DisconnectReason
Why a client's connection to the gateway ended, or why an attempt to connect failed.
Nebula · Packages/com.1by3.nebula/Runtime/Client/DisconnectInfo.cspublic enum DisconnectReason : byteWhy a client's connection to the gateway ended, or why an attempt to connect failed. Carried by DisconnectInfo in NebulaClient.Disconnected and NebulaClient.LastDisconnect. Branch on it to choose what to show: a network problem on the player's side, a server that is down, or a decision the server made.
Members
| Name | Value | Description |
|---|---|---|
Unknown | 0 | The transport did not say why the link closed. A custom ITransport that reports no reason produces this. |
Timeout | 1 | The connection was up and the gateway stopped answering for longer than the transport's disconnect timeout: the gateway, or the network between, went away. |
NetworkUnreachable | 2 | The player's own network is down: the client's machine has no route to the gateway. |
HostUnreachable | 3 | The gateway could not be reached: nothing answered at its address, it refused the connection, or its name did not resolve. |
ClosedByServer | 4 | The gateway closed the connection without saying why, or restarted and no longer knows this client. |
Kicked | 5 | The server removed this player (NebulaWorker.Kick or NebulaGateway.Kick). DisconnectInfo.Message is the server's reason and DisconnectInfo.Code the game's own code. The session is over, the session token is cleared, and the client does not reconnect by itself. |
SessionReplaced | 6 | This player connected again somewhere else and the newer connection took the session (NebulaClient.SessionReplaced). The client does not reconnect by itself. |
JoinRefused | 7 | The gateway refused the join (NebulaClient.JoinRefused); NebulaClient.JoinRejectReason holds the typed reason. The client retries only when the gateway asked it to. |
ServerShutdown | 8 | The gateway is shutting down and no other gateway was serving: the server is going away, or restarting. The client reconnects on its normal schedule with its session token, so a server back within NebulaConfig.SessionReclaimSeconds can give the pawn back. |
ClientRequested | 9 | The game called NebulaClient.Disconnect or NebulaClient.Leave, directly or through NebulaClient.ConnectTo. |
GatewayDraining | 10 | The gateway is being taken out of service and asked the client to reconnect (NebulaClient.GatewayDraining). The client reconnects at once with its session token. |
EncryptionFailed | 11 | The encrypted connection was refused: the key exchange failed or the gateway's certificate did not match the pinned fingerprint. |
DisconnectInfo
How a client's connection ended: the typed Reason, a Message for logs and the player, and whether the client will try again by itself (WillRetry).
FarEntity
An entity of the far relevance tier as a client sees it (NEB-388, docs/interest-management.md §16): a large or important entity beyond its normal relevance radius, with no replica, no variables and no RPCs, only enough to draw a marker o...