Skip to content

Architecture

boyism80 edited this page Jul 3, 2026 · 1 revision

Architecture

Architecture

The server is organized around worlds: each world has its own data and services, while some services are shared across all worlds.

Legend (diagram): solid arrows are client TCP connections; double-headed arrows are backend communication (HTTP / RabbitMQ).

Client connection flow

  1. Client / Bot → Gateway (TCP): version check, encryption keys, world and login server list.
  2. Gateway → Login (TCP, per world): account authentication and character management.
  3. Login → Game (TCP transfer): after Internal resolves the target game host, Login hands off the session to the correct Game container. The client then plays on Game directly.

Backend services use HTTP + FlatBuffer; events and write-back use RabbitMQ; hot data is cached in Redis.

Shared services (world-independent)

  • Gateway: Single entry point for clients and bots. Routes players to the chosen world's Login servers.
  • Internal: Central HTTP service for accounts, characters, clans, parties, mail, bans, sessions, and cache. Publishes world-scoped notifications via RabbitMQ (Internal). Uses unified and per-world databases.
  • Marketplace: Shared in-game marketplace for all worlds. Uses unified MySQL.
  • Admin Tool: Blazor Server web UI for operators.

Unified infrastructure (shared, not shown as a separate box in the diagram): unified MySQL, unified Redis, and two RabbitMQ clusters — Internal (service events, write-back) and Log (structured logs).

Per-world structure

Each world (World 1 … World N) has three layers, as shown in the diagram:

Infrastructure (infra)

  • MySQL: Global, Data (sharded by id % shard_count), and Log databases.
  • Redis: Global and Data shard caches. Internal reads/writes cache; Write-back persists to MySQL.

Private

  • Write-back: Consumes write-back messages from RabbitMQ, reads Redis, and writes to that world's MySQL (Global/Data).
  • Log: Consumes log messages from RabbitMQ (Log) and writes to that world's MySQL (Log).

Public

  • Login: Account tasks (character creation, password changes). Communicates with Internal over HTTP; transfers clients to Game over TCP.
  • Game: Game logic and sessions. Multiple containers (0 … n) per world, each identified by a host ID. A container loads only maps assigned to its host.

Related pages

Clone this wiki locally