Skip to content

Network PRD: relay-hub multiplayer #1224

Description

@anton-makarevich

Destination

A Network PRD (docs/project/network-prd.md) that locks the decisions to move MakaMek from today's LAN-only peer-host to a cloud relay-hub model enabling internet + web multiplayer at minimal cost — ready to hand to /to-issues. Planning only; no code is written during this effort.

Notes

Domain. Command-based client-server: ServerGame owns authoritative state, ClientGame mirrors it; state changes travel only as serialized command DTOs. The wire is abstracted behind Sanet.Transport's ITransportPublisher (RX for local play, SignalR for LAN today). Clients only process server-originated commands; the server only processes client commands (GameOriginId filtering). See docs/architecture/Game-(Protocol)-High-Level-Architecture.md and docs/architecture/game-shutdown-lifecycle.md.

Chosen direction (settled while charting).

  • The cloud holds only a dumb relay hub — a WebSocket fan-out with no game logic. The authoritative ServerGame runs on a participant's machine; every party (server-logic host and clients alike) dials the hub outbound. This sidesteps NAT traversal and the browser's inability to accept inbound connections.
  • Symmetric hosting: any platform, including WASM/browser, may be the server-logic host.
  • Cost ceiling: a few $/month for the hub is acceptable.
  • Identity: anonymous; player IDs preserved only within a single game. Centralized identity comes later.

Skills to consult each session: grilling, domain-modeling, research, navigate-docs; sanet-mvvm for GameManager/DI wiring.

Decisions so far

Not yet specified

Out of scope

  • Persistent / centralized accounts & authentication — later effort.
  • Server-side game persistence / surviving authoritative-host loss beyond reconnect — later; workarounds acceptable.
  • Spectators.
  • In-game chat — integrate with Discord instead (permanently out).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions