Skip to content

API Variable Connection

github-actions[bot] edited this page Nov 24, 2026 · 1 revision

Variable: Connection

const Connection: DataComponentDef<{
  id: ScalarType<"i32">;
  lastAckedTick: ScalarType<"i32">;
  rtt: ScalarType<"f32">;
  state: ScalarType<"u8">;
}>;

Defined in: src/engine/net/connection.ts:29

The net.Connection data component. Fields:

  • id: the connection's id, assigned by the server when it accepts the handshake (1, 2, …; unique per server World). The client's node has the same id as the server's node for it, so ids can name owners across Worlds (Replicated.ownerId). 0 on a client until accepted.
  • state: a ConnectionState value.
  • rtt: smoothed round-trip time in milliseconds. On a server, the client's measurement, as it last reported it.
  • lastAckedTick: the newest tick the other end has acknowledged (set by replication, T11; 0 until then).

Clone this wiki locally