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.
The pieces
Section titled “The pieces”| Piece | What it is |
|---|---|
jengine-server | The 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-online | The client package: connects, signs in, joins rooms, mirrors server state into entities, predicts the player’s own movement. |
jengine-relay | The smallest server: rooms and an ordered log, for turn-based games. jengine-server speaks the same protocol. |
jengine-fleet | The 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 host | An 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.
Three ways to run a server
Section titled “Three ways to run a server”- 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 tows://127.0.0.1:<port>. - On machines you own, deployed with the fleet tool. An agent on each
machine;
jengine-fleet deployfrom yours. See Hosting & Deploying. - On one machine on your LAN that hosts everything - a Raspberry Pi is enough for several games. See Raspberry Pi Host.
Managing what runs
Section titled “Managing what runs”- 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.