Multiplayer
Keep the same client.
Do not leave, close, or create a new room because the tab hid or the network dropped.
Keep the same LokiClient and room instance while the page is hidden, blurred, offline, or briefly dead.
Do not add your own handlers that call leave(), close(), disconnect, reload, or create a new room on visibilitychange, pagehide, pageshow, blur, focus, online, or offline.
The SDK marks the page suspended, replaces the socket when visible and online, retries with backoff (max 15 s), requests a snapshot, and replays unresolved synchronized actions with the same IDs.
After reconnect, do not assume you are still host. A runtime process restart is fail-closed: in-memory rooms die. Clients must create a new room. room_closed is terminal.