Tilbake
· 2 min lesetid
The Gamend client as a script
The Gamend client is Balaur Script in the library's gamend addon, over the engine's http and websocket, so a recorded run replays with no server.
- Dragos Balaur
The Gamend client is Balaur Script, in the library's addons/gamend. It talks to the server over the engine's http and websocket, so a recorded run replays with no server.

Generated
clients/sdkgenin the Gamend repository writes the addon from the server's OpenAPI document and realtime table: 278 operations in 44 modules, 100 events and 15 socket commands.- The session, the socket and the activity log come from the generator's template, written by hand. The engine holds no Gamend code of its own.
- Every call goes through
core.bsorsocket.bs, which log it for the Gamend dock with its round trip inms.
Signing in
client::login_device,login_emailandconfirm_registrationopen a session, andauthentication::registermakes an account.client::login_google,login_appleandlogin_steamopen one from what the platform hands the game: a Credential Manager ID token, a native Sign in with Apple code, a Steam ticket.- A call answered 401 trades the refresh token once and goes again.
The socket
client::connectopens Phoenix Channels overwebsocket, with a heartbeat every 30 seconds.- A dropped socket waits 1, 2, 4, 8, 16, then 30 seconds between tries, and gives up after 8.
- Its node hears
reconnecting, thenreopenedonce every topic it had is joined again.
Replay
- A recording holds each
httpandwebsocketarrival. A test replays a run that signs in, opens a lobby, joins its channel and calls a hook, against a port where nothing listens. balaur replay --verifyon a recorded session printed "31 ticks replayed, every digest matched".