Skip to main content

WebSocket Protocol

Areloria uses WebSocket for real-time bidirectional communication between clients and server.

Connection

Standard Connection

With Authentication

Connection Lifecycle

Message Types

Client → Server

Server → Client

Intent Protocol

The client sends wishes. The server assigns truth. Client time is diagnostic only. Server tickId, logicalIndex, receivedOrder, and deterministic hashes are authoritative.

Movement Intent

Attack Intent

Skill Intent

Interact Intent

Inventory Intent

Intent Truth Assignment

Snapshot Protocol

Full Snapshot

Snapshot metadata must be server-derived from tick/runtime state. Wall-clock timestamps are telemetry only and must not drive simulation.

Delta Snapshot

For efficiency, servers may send deltas:

Causal Catchup Summary

When a client rejoins after a disconnect or falls behind the live tick window, the server may emit a causal_catchup_summary message on the same WebSocket connection. The summary is a render-only side channel that describes significant events the client missed, so the UI can show a catchup banner without replaying every snapshot. The summary is advisory and never authoritative. Clients must not mutate gameplay state from it. Authoritative state still arrives through snapshot and event messages. The sideChannelOnly: true flag routes the payload to passive overlays or notifications.

Payload

Example

Clients can render this through a passive overlay, for example: “Causal catchup observed: 2 event(s), ticks 41200–41460.”

Event Protocol

Combat Events

Loot Events

Quest Events

Rate Limiting

Reconnection

Clients should implement reconnection:
Client reconnect timers are network-side behavior only. They do not create simulation ticks or authoritative time.

State Recovery

After reconnect:
  1. Client sends last known stateHash and tickId
  2. Server compares with runtime truth
  3. Server sends authoritative snapshot/delta and optional causal_catchup_summary
  4. Client resumes normal rendering from server truth

Next Steps

REST API

REST endpoint reference

API Overview

Complete API reference

Client Architecture

Client networking implementation

Server Architecture

Server WebSocket handling