Skip to content

Game Servers

A multiplayer jEngine game has two halves. The game connects with the jengine-online package (Lua: Online.*). The server is a small Rust program built on jengine-server, the engine’s server framework. The server decides; the game shows what it is told and sends what the player does.

PieceWhat it is
jengine-serverThe framework: rooms (sync Rust, ticked on a timer), players whose state outlives a room, accounts, a store (SQLite), an admin dashboard at /admin, and optional live ops. A game’s server is its own small binary crate depending on it.
jengine-onlineThe client package: connects, signs in, joins rooms, mirrors server state into entities, predicts the player’s own movement.
jengine-relayThe smallest server: rooms and an ordered log, for turn-based games. jengine-server speaks the same protocol.
jengine-fleetThe deploy tool: an agent on each machine runs and restarts servers; a command line and a web page on yours deploy builds to them.
jengine-fleet hostAn agent that is also a host: one port for players in front of every server it runs, and a web console to manage them.

Every game in the repo’s projects/common-room is a worked example of a room and its client. Kotodama, Rust Bowl and Undermere each have a server/ folder of their own.

  1. On your machine, while you work. cargo run -p <your-server>, or the editor’s Servers panel (build, run, watch its rooms and log, send a notice). Players connect to ws://127.0.0.1:<port>.
  2. On machines you own, deployed with the fleet tool. An agent on each machine; jengine-fleet deploy from yours. See Hosting & Deploying.
  3. On one machine on your LAN that hosts everything - a Raspberry Pi is enough for several games. See Raspberry Pi Host.
  • Each server’s own dashboard (/admin, behind its admin token): rooms, players, kick, notices, drain, accounts, the game’s HTTP routes, history charts, and live ops if it runs them.
  • The console a host serves at /manage: every server on the host, the machine’s resources, recent errors, deploys - and each server’s dashboard inside it. See Console & Live Ops.
  • The editor’s Servers panel stays the light, developer side: build, run and deploy this project, and a Console button for a host.