# alterrsps/alter architecture

> Architecture diagram of the GitHub repository alterrsps/alter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alterrsps/alter
- Repository: https://github.com/alterrsps/alter

## Overview

Alter is a modular OSRS-compatible game server: a client connects to the server, which initializes the cache and world, accepts logins, and runs game cycles; plugins provide much of the game content. The tree also shows player interfaces, combat, skills, administrative commands, and auxiliary HTTP/world-list services. Relationships are limited to those visible in excerpts or documented in the README; several plugin subsystems are represented by their enclosing directories because their implementations were not sampled.

Main entry points: [`game-server/src/main/kotlin/org/alter/game/plugin/PluginRepository.kt`](https://github.com/alterrsps/alter/blob/main/game-server/src/main/kotlin/org/alter/game/plugin/PluginRepository.kt) (Plugin loading), [`game-server/src/main/kotlin/org/alter/game/model/World.kt`](https://github.com/alterrsps/alter/blob/main/game-server/src/main/kotlin/org/alter/game/model/World.kt) (Game world), [`game-server/src/main/kotlin/org/alter/game/Server.kt`](https://github.com/alterrsps/alter/blob/main/game-server/src/main/kotlin/org/alter/game/Server.kt) (Server bootstrap), [`plugins/filestore/src/main/kotlin/dev/openrune/cache/CacheManager.kt`](https://github.com/alterrsps/alter/blob/main/plugins/filestore/src/main/kotlin/dev/openrune/cache/CacheManager.kt) (Cache definitions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Server runtime"]
  node_server["Server bootstrap<br/>[Server.kt]"]
  node_network["Game networking<br/>[Server.kt]"]
  node_login["Login service<br/>[LoginService.kt]"]
  node_cycles["Game cycles<br/>[GameService.kt]"]
  node_services["Service lifecycle<br/>[Service.kt]"]
end

subgraph group_worlddata["World and data"]
  node_world["Game world<br/>[World.kt]"]
  node_cache[("Cache definitions<br/>[CacheManager.kt]")]
  node_metadata["Item metadata"]
  node_xtea["Region keys<br/>[XteaKeyService.kt]"]
  node_rscm[("Entity identifiers<br/>[RSCM.kt]")]
end

subgraph group_gameplay["Game plugins"]
  node_api["Game API"]
  node_plugins["Plugin loading"]
  node_combat["Combat system"]
  node_skills["Skills and areas"]
  node_items["Item behaviors"]
end

subgraph group_interfaces["Interfaces and services"]
  node_interfaces["Player interfaces"]
  node_commands["Commands"]
  node_rest["REST API"]
  node_worldlist["World list"]
  node_httpclient["HTTP API client<br/>[App.vue]"]
end

node_client(("OSRS client"))

node_server -->|"initializes"| node_cache
node_server -->|"creates"| node_world
node_server -->|"starts"| node_network
node_client -.->|"connects"| node_network
node_login -->|"verifies against"| node_world
node_cycles -->|"runs tasks on"| node_world
node_world -->|"runs world init"| node_plugins
node_metadata -->|"loads definitions"| node_cache
node_xtea -->|"reads map data"| node_cache
node_xtea -->|"sets key service"| node_world
node_server -.->|"initializes services"| node_services
node_plugins -.->|"uses extensions"| node_api
node_plugins -.->|"loads content"| node_combat
node_plugins -.->|"loads content"| node_skills
node_plugins -.->|"loads content"| node_items
node_plugins -.->|"loads content"| node_interfaces
node_plugins -.->|"loads content"| node_commands
node_rest -.->|"serves data to"| node_httpclient
node_rscm -.->|"names entities from"| node_cache
node_worldlist -->|"tracks players"| node_world

click node_server "https://github.com/alterrsps/alter/blob/main/game-server/src/main/kotlin/org/alter/game/Server.kt"
click node_network "https://github.com/alterrsps/alter/blob/main/game-server/src/main/kotlin/org/alter/game/Server.kt"
click node_login "https://github.com/alterrsps/alter/blob/main/game-server/src/main/kotlin/org/alter/game/service/login/LoginService.kt"
click node_world "https://github.com/alterrsps/alter/blob/main/game-server/src/main/kotlin/org/alter/game/model/World.kt"
click node_cycles "https://github.com/alterrsps/alter/blob/main/game-server/src/main/kotlin/org/alter/game/service/GameService.kt"
click node_services "https://github.com/alterrsps/alter/blob/main/game-server/src/main/kotlin/org/alter/game/service/Service.kt"
click node_cache "https://github.com/alterrsps/alter/blob/main/plugins/filestore/src/main/kotlin/dev/openrune/cache/CacheManager.kt"
click node_metadata "https://github.com/alterrsps/alter/blob/main/game-server/src/main/kotlin/org/alter/game/service/game/ItemMetadataService.kt"
click node_xtea "https://github.com/alterrsps/alter/blob/main/game-server/src/main/kotlin/org/alter/game/service/xtea/XteaKeyService.kt"
click node_api "https://github.com/alterrsps/alter/tree/main/game-api/src/main/kotlin/org/alter/api"
click node_plugins "https://github.com/alterrsps/alter/blob/main/game-server/src/main/kotlin/org/alter/game/plugin/PluginRepository.kt"
click node_combat "https://github.com/alterrsps/alter/tree/main/game-plugins/src/main/kotlin/org/alter/plugins/content/combat"
click node_skills "https://github.com/alterrsps/alter/tree/main/game-plugins/src/main/kotlin/org/alter/plugins/content/skills"
click node_items "https://github.com/alterrsps/alter/tree/main/game-plugins/src/main/kotlin/org/alter/plugins/content/items"
click node_interfaces "https://github.com/alterrsps/alter/tree/main/game-plugins/src/main/kotlin/org/alter/plugins/content/interfaces"
click node_commands "https://github.com/alterrsps/alter/tree/main/game-plugins/src/main/kotlin/org/alter/plugins/content/commands"
click node_rest "https://github.com/alterrsps/alter/tree/main/game-plugins/src/main/kotlin/org/alter/plugins/service/restapi"
click node_worldlist "https://github.com/alterrsps/alter/blob/main/game-plugins/src/main/kotlin/org/alter/plugins/service/worldlist/WorldListService.kt"
click node_httpclient "https://github.com/alterrsps/alter/blob/main/http-api/src/App.vue"
click node_rscm "https://github.com/alterrsps/alter/blob/main/plugins/rscm/src/main/kotlin/org/alter/rscm/RSCM.kt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_server,node_network,node_login,node_cycles,node_services,node_client toneBlue
class node_world,node_cache,node_metadata,node_xtea,node_rscm toneAmber
class node_api,node_plugins,node_combat,node_skills,node_items toneMint
class node_interfaces,node_commands,node_rest,node_worldlist,node_httpclient toneRose
```

## Components

### Server runtime

- [Server bootstrap](https://github.com/alterrsps/alter/blob/main/game-server/src/main/kotlin/org/alter/game/Server.kt): `game-server/src/main/kotlin/org/alter/game/Server.kt`
- [Game networking](https://github.com/alterrsps/alter/blob/main/game-server/src/main/kotlin/org/alter/game/Server.kt): `game-server/src/main/kotlin/org/alter/game/Server.kt`
- [Login service](https://github.com/alterrsps/alter/blob/main/game-server/src/main/kotlin/org/alter/game/service/login/LoginService.kt): `game-server/src/main/kotlin/org/alter/game/service/login/LoginService.kt`
- [Game cycles](https://github.com/alterrsps/alter/blob/main/game-server/src/main/kotlin/org/alter/game/service/GameService.kt): `game-server/src/main/kotlin/org/alter/game/service/GameService.kt`
- [Service lifecycle](https://github.com/alterrsps/alter/blob/main/game-server/src/main/kotlin/org/alter/game/service/Service.kt): `game-server/src/main/kotlin/org/alter/game/service/Service.kt`

### World and data

- [Game world](https://github.com/alterrsps/alter/blob/main/game-server/src/main/kotlin/org/alter/game/model/World.kt): `game-server/src/main/kotlin/org/alter/game/model/World.kt`
- [Cache definitions](https://github.com/alterrsps/alter/blob/main/plugins/filestore/src/main/kotlin/dev/openrune/cache/CacheManager.kt): `plugins/filestore/src/main/kotlin/dev/openrune/cache/CacheManager.kt`
- [Item metadata](https://github.com/alterrsps/alter/blob/main/game-server/src/main/kotlin/org/alter/game/service/game/ItemMetadataService.kt): `game-server/src/main/kotlin/org/alter/game/service/game/ItemMetadataService.kt`
- [Region keys](https://github.com/alterrsps/alter/blob/main/game-server/src/main/kotlin/org/alter/game/service/xtea/XteaKeyService.kt): `game-server/src/main/kotlin/org/alter/game/service/xtea/XteaKeyService.kt`
- [Entity identifiers](https://github.com/alterrsps/alter/blob/main/plugins/rscm/src/main/kotlin/org/alter/rscm/RSCM.kt): `plugins/rscm/src/main/kotlin/org/alter/rscm/RSCM.kt`

### Game plugins

- [Game API](https://github.com/alterrsps/alter/tree/main/game-api/src/main/kotlin/org/alter/api): `game-api/src/main/kotlin/org/alter/api`
- [Plugin loading](https://github.com/alterrsps/alter/blob/main/game-server/src/main/kotlin/org/alter/game/plugin/PluginRepository.kt): `game-server/src/main/kotlin/org/alter/game/plugin/PluginRepository.kt`
- [Combat system](https://github.com/alterrsps/alter/tree/main/game-plugins/src/main/kotlin/org/alter/plugins/content/combat): `game-plugins/src/main/kotlin/org/alter/plugins/content/combat`
- [Skills and areas](https://github.com/alterrsps/alter/tree/main/game-plugins/src/main/kotlin/org/alter/plugins/content/skills): `game-plugins/src/main/kotlin/org/alter/plugins/content/skills`
- [Item behaviors](https://github.com/alterrsps/alter/tree/main/game-plugins/src/main/kotlin/org/alter/plugins/content/items): `game-plugins/src/main/kotlin/org/alter/plugins/content/items`

### Interfaces and services

- [Player interfaces](https://github.com/alterrsps/alter/tree/main/game-plugins/src/main/kotlin/org/alter/plugins/content/interfaces): `game-plugins/src/main/kotlin/org/alter/plugins/content/interfaces`
- [Commands](https://github.com/alterrsps/alter/tree/main/game-plugins/src/main/kotlin/org/alter/plugins/content/commands): `game-plugins/src/main/kotlin/org/alter/plugins/content/commands`
- [REST API](https://github.com/alterrsps/alter/tree/main/game-plugins/src/main/kotlin/org/alter/plugins/service/restapi): `game-plugins/src/main/kotlin/org/alter/plugins/service/restapi`
- [World list](https://github.com/alterrsps/alter/blob/main/game-plugins/src/main/kotlin/org/alter/plugins/service/worldlist/WorldListService.kt): `game-plugins/src/main/kotlin/org/alter/plugins/service/worldlist/WorldListService.kt`
- [HTTP API client](https://github.com/alterrsps/alter/blob/main/http-api/src/App.vue): `http-api/src/App.vue`

### Other components

- **OSRS client**

## Connections

- Server bootstrap → Cache definitions: initializes (evidence: `game-server/src/main/kotlin/org/alter/game/Server.kt`)
- Server bootstrap → Game world: creates (evidence: `game-server/src/main/kotlin/org/alter/game/Server.kt`)
- Server bootstrap → Game networking: starts (evidence: `game-server/src/main/kotlin/org/alter/game/Server.kt`)
- OSRS client → Game networking: connects
- Login service → Game world: verifies against (evidence: `game-server/src/main/kotlin/org/alter/game/service/login/LoginService.kt`)
- Game cycles → Game world: runs tasks on (evidence: `game-server/src/main/kotlin/org/alter/game/service/GameService.kt`)
- Game world → Plugin loading: runs world init (evidence: `game-server/src/main/kotlin/org/alter/game/model/World.kt`)
- Item metadata → Cache definitions: loads definitions (evidence: `game-server/src/main/kotlin/org/alter/game/service/game/ItemMetadataService.kt`)
- Region keys → Cache definitions: reads map data (evidence: `game-server/src/main/kotlin/org/alter/game/service/xtea/XteaKeyService.kt`)
- Region keys → Game world: sets key service (evidence: `game-server/src/main/kotlin/org/alter/game/service/xtea/XteaKeyService.kt`)
- Server bootstrap → Service lifecycle: initializes services (evidence: `game-server/src/main/kotlin/org/alter/game/service/Service.kt`)
- Plugin loading → Game API: uses extensions
- Plugin loading → Combat system: loads content
- Plugin loading → Skills and areas: loads content
- Plugin loading → Item behaviors: loads content
- Plugin loading → Player interfaces: loads content
- Plugin loading → Commands: loads content
- REST API → HTTP API client: serves data to
- Entity identifiers → Cache definitions: names entities from
- World list → Game world: tracks players (evidence: `game-plugins/src/main/kotlin/org/alter/plugins/service/worldlist/WorldListService.kt`)
