Skip to content

Feature/cli dashboard - #23

Merged
mattvb91 merged 25 commits into
devfrom
feature/cli-dashboard
Oct 27, 2026
Merged

mattvb91 merged 25 commits into
devfrom
feature/cli-dashboard

Conversation

@mattvb91

Copy link
Copy Markdown
Member

No description provided.

…point

- add ServerMetrics collector with typed snapshot and TickTracker
- keep rolling history in BandwidthTracker and CpuTracker
- move express setup into Http/HttpServer with GET /api/game/metrics
  (token or localhost only, off in production without a token)
- make socket/http ports and metrics configurable via ServerOptions
- fix crash when a delayed command's player disconnected
- fix onCommand delta never resetting lastTime
- live terminal dashboard for the game server metrics endpoint, built on hqtui
- MetricsClient polls /api/game/metrics with backoff and keeps last values on failure
- tolerant snapshot normalisation so cli and server versions can drift
- CPU, network, tick budget, world/memory and players panels with a narrow layout
- transparent background and readable muted text across themes
- --sim mode with deterministic simulated data
Text over a light wallpaper was unreadable with a fully transparent
background. Fill with the theme colour by default and make the
see-through look opt-in.
- core: LogBuffer winston transport keeps recent log entries in memory
- core: GET /api/game/logs?after=<id>, same access rules as metrics
- core: metrics.logBufferSize option (default 500, 0 disables)
- cli: logs panel that tails new lines, scrolls back, handles server
  restarts and older servers without the endpoint
- cli: simulated log output for --sim
The server treats metrics fetched within the last 15s as a dashboard
being open, skips the periodic summary and logs once when a dashboard
connects or disconnects.
npm ci runs before the build, so the mavonengine bin isn't linked and
npx fell back to the registry (404).
…e server

- cli: `mavonengine dev` finds the MavonEngine project upwards from the
  current directory and runs its dev script with the lockfile's package
  manager. SIGTERM / SIGHUP stop the whole process tree, since npm does
  not pass them on.
- core: `ServerOptions.client` serves the client from the HTTP server,
  through Vite in middleware mode when `dev` is set and from the built
  `dist` otherwise, mounted after all other routes. The game socket is
  then attached to the HTTP server, and the separate socket port (8081)
  is only opened when the client is not served or `socketPort` asks for it.
- template: the server serves the client (Vite only when
  MAVONENGINE_DEV_CLIENT=1, set by `npm run dev`), the client connects
  through /socket on the page's origin, and concurrently is gone.
… on quit

- `mavonengine dev` runs the dev script with its output captured and shows
  the dashboard. Quitting stops the whole process tree (SIGTERM, then
  SIGKILL after 3s); the dev script exiting on its own closes the
  dashboard and prints its output. `--no-dashboard`, or no interactive
  terminal, keeps the old behaviour. `--port`, `--theme` and
  `--transparent` are passed on to the dashboard.
- Until the game server first answers, a startup screen shows the
  engine's boot banner, a spinner and the latest dev script output, and
  the metrics client polls every 250ms without backoff.
- core: the banner BaseGame logs moves to `Utils/BootBanner`, which
  imports nothing so it can be used without loading the engine.
- cli: the `mavonengine dev` startup screen uses it instead of a copy.
- core: `RequestLog` records requests on the Node HTTP server itself, so
  static files, Vite, `onHttp` routes, geckos.io signaling and WebSocket
  upgrades all show up, with status, duration, size and client address.
  Query strings are left out since they can hold tokens, and the
  dashboard's own polling is skipped. Served on GET /api/game/requests,
  protected like metrics; `metrics.requestLogSize` (default 500, 0 off).
- cli: an HTTP tab lists the requests newest first, coloured by status.
  A scrolled table stays on the same request as new ones arrive. Logs and
  requests are followed by the same `Feed` in the metrics client, and
  `--sim` generates requests too.
…creen

Downloads the multiplayer template, extracts it and installs its
dependencies like @mavonengine/create-bootstrap, with each step and its
output shown under the logo boot screen. Then it starts the dev script
and the dashboard takes over once the game server answers.
create-bootstrap is now a thin wrapper that prints a deprecation notice
and runs `mavonengine create` from @mavonengine/cli on the same terminal,
so it still goes from setup straight into the dev dashboard. The docs
point at `npx @mavonengine/cli create` instead.
`mavonengine dev` and `mavonengine create` open the page the game server
serves in the default browser as soon as the server first answers, unless
--no-open is passed, the terminal is an SSH session, or the server doesn't
answer / with a page. `o` in the dashboard opens it again any time.
@mattvb91
mattvb91 merged commit 7620a38 into dev Oct 27, 2026
2 checks passed
@mattvb91
mattvb91 deleted the feature/cli-dashboard branch October 27, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant