Skip to content

Search

Volver
· 2 min de lectura

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.

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.

The Gamend dock on a local server: its url, the target, the hook plugin and a health reply of 200

Generated

  • clients/sdkgen in 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.bs or socket.bs, which log it for the Gamend dock with its round trip in ms.

Signing in

  • client::login_device, login_email and confirm_registration open a session, and authentication::register makes an account.
  • client::login_google, login_apple and login_steam open 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::connect opens Phoenix Channels over websocket, 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, then reopened once every topic it had is joined again.

Replay

  • A recording holds each http and websocket arrival. 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 --verify on a recorded session printed "31 ticks replayed, every digest matched".

¿Seguro?