# krilliac/arcanecore architecture

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

- Interactive diagram: https://gitdiagram.com/krilliac/arcanecore
- Repository: https://github.com/krilliac/arcanecore

## Overview

ArcaneCore is a World of Warcraft 1.12.1 server emulator. The main user workflow is a client connecting to the realm service to authenticate and obtain realm access, then connecting to the world service to play; gameplay is backed by separate auth, character, and world databases. An optional gateway splits world workers and supports character handoff. The README documents the major product capabilities, while sampled source confirms selected session, opcode-registration, and game-system details; unsampled implementation links are omitted where not documented.

Main entry points: [`src/ArcaneCore.World/Handlers/OpcodeTable.cs`](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.World/Handlers/OpcodeTable.cs) (World service), [`src/ArcaneCore.Gateway/Program.cs`](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Gateway/Program.cs) (Gateway), [`src/ArcaneCore.Realm/Program.cs`](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Realm/Program.cs) (Realm service), [`src/ArcaneCore.Game/Entities/Player.cs`](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Game/Entities/Player.cs) (Player state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Server runtime"]
  node_realm["Realm service<br/>[Program.cs]"]
  node_world["World service<br/>[OpcodeTable.cs]"]
  node_session["World session<br/>[WorldSession.cs]"]
  node_opcode["Opcode dispatch<br/>[OpcodeTable.cs]"]
end

subgraph group_data["Persistence and content"]
  node_authdb[("Auth database<br/>[AuthDbContext.cs]")]
  node_characterdb[("Character database")]
  node_worlddb[("World database<br/>[WorldDbContext.cs]")]
  node_contentimport["Content importer<br/>[ContentScanner.cs]"]
end

subgraph group_cluster["Cluster runtime"]
  node_gateway["Gateway<br/>[Program.cs]"]
  node_gatewaylink["Gateway link"]
  node_clusterwire["Cluster protocol"]
  node_handoff["Character handoff"]
  node_transfers["Transfer service"]
end

subgraph group_gameplay["Gameplay systems"]
  node_player["Player state<br/>[Player.cs]"]
  node_unit["Unit state<br/>[Unit.cs]"]
  node_inventory["Inventory"]
  node_loot["Loot rolls<br/>[LootRollManager.cs]"]
  node_eventai["Creature EventAI<br/>[EventAiEngine.cs]"]
  node_atlas["Atlas visualizer<br/>[ServerEngine.cs]"]
end

subgraph group_bots["Playerbots"]
  node_bots["Playerbot behavior"]
  node_botpolicy["Bot policy"]
  node_botchat["Bot chat inference"]
end

node_client(("WoW client"))

node_client -->|"authenticates"| node_realm
node_realm -->|"uses"| node_authdb
node_realm -->|"offers realm list"| node_client
node_client -->|"plays through"| node_world
node_world -->|"shares auth data"| node_authdb
node_world -->|"persists characters"| node_characterdb
node_world -->|"loads game content"| node_worlddb
node_world -.->|"can split behind"| node_gateway
node_client -.->|"connects optionally"| node_gateway
node_gateway -->|"forwards sessions"| node_gatewaylink
node_gatewaylink -.->|"uses framing"| node_clusterwire
node_gateway -->|"coordinates handoff"| node_handoff
node_gateway -->|"supports transfers"| node_transfers
node_contentimport -.->|"imports content"| node_worlddb
node_world -->|"runs gameplay"| node_player
node_player -->|"is a unit"| node_unit
node_player -->|"owns inventory"| node_inventory
node_world -->|"provides loot"| node_loot
node_world -->|"provides creature AI"| node_eventai
node_world -->|"hosts bots"| node_bots
node_bots -.->|"uses policy"| node_botpolicy
node_bots -.->|"can use chat"| node_botchat
node_atlas -.->|"visualizes map runtime"| node_world

click node_realm "https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Realm/Program.cs"
click node_world "https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.World/Handlers/OpcodeTable.cs"
click node_session "https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.World/Net/WorldSession.cs"
click node_opcode "https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.World/Handlers/OpcodeTable.cs"
click node_gateway "https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Gateway/Program.cs"
click node_gatewaylink "https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.World/Cluster/Gateway/GatewaySessionLinkClient.cs"
click node_clusterwire "https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Cluster.Protocol/GatewayLinkFraming.cs"
click node_handoff "https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Gateway/Handoff/GatewayHandoffService.cs"
click node_transfers "https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Gateway/Transfers/GatewayTransferService.cs"
click node_authdb "https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Data/Auth/AuthDbContext.cs"
click node_characterdb "https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Data/Characters/CharacterDbContext.cs"
click node_worlddb "https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Data/Content/WorldDbContext.cs"
click node_contentimport "https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Data/Content/Import/Core/ContentScanner.cs"
click node_player "https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Game/Entities/Player.cs"
click node_unit "https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Game/Entities/Unit.cs"
click node_inventory "https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Game/Items/PlayerInventory.Storage.cs"
click node_loot "https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Game/Loot/LootRollManager.cs"
click node_eventai "https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Game/Creatures/AI/EventAi/EventAiEngine.cs"
click node_bots "https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Playerbots/Chaos/PlayerbotChaosEngine.cs"
click node_botpolicy "https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Playerbots/Policy/PlayerbotPolicyEngine.cs"
click node_botchat "https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Playerbots/Chat/Inference/InProcessChatEngine.cs"
click node_atlas "https://github.com/krilliac/arcanecore/blob/main/tools/ArcaneCore.Atlas/Server/ServerEngine.cs"

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_realm,node_world,node_session,node_opcode,node_client toneBlue
class node_authdb,node_characterdb,node_worlddb,node_contentimport toneAmber
class node_gateway,node_gatewaylink,node_clusterwire,node_handoff,node_transfers toneMint
class node_player,node_unit,node_inventory,node_loot,node_eventai,node_atlas toneRose
class node_bots,node_botpolicy,node_botchat toneIndigo
```

## Components

### Server runtime

- [Realm service](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Realm/Program.cs): `src/ArcaneCore.Realm/Program.cs`
- [World service](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.World/Handlers/OpcodeTable.cs): `src/ArcaneCore.World/Handlers/OpcodeTable.cs`
- [World session](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.World/Net/WorldSession.cs): `src/ArcaneCore.World/Net/WorldSession.cs`
- [Opcode dispatch](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.World/Handlers/OpcodeTable.cs): `src/ArcaneCore.World/Handlers/OpcodeTable.cs`

### Persistence and content

- [Auth database](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Data/Auth/AuthDbContext.cs): `src/ArcaneCore.Data/Auth/AuthDbContext.cs`
- [Character database](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Data/Characters/CharacterDbContext.cs): `src/ArcaneCore.Data/Characters/CharacterDbContext.cs`
- [World database](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Data/Content/WorldDbContext.cs): `src/ArcaneCore.Data/Content/WorldDbContext.cs`
- [Content importer](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Data/Content/Import/Core/ContentScanner.cs): `src/ArcaneCore.Data/Content/Import/Core/ContentScanner.cs`

### Cluster runtime

- [Gateway](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Gateway/Program.cs): `src/ArcaneCore.Gateway/Program.cs`
- [Gateway link](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.World/Cluster/Gateway/GatewaySessionLinkClient.cs): `src/ArcaneCore.World/Cluster/Gateway/GatewaySessionLinkClient.cs`
- [Cluster protocol](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Cluster.Protocol/GatewayLinkFraming.cs): `src/ArcaneCore.Cluster.Protocol/GatewayLinkFraming.cs`
- [Character handoff](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Gateway/Handoff/GatewayHandoffService.cs): `src/ArcaneCore.Gateway/Handoff/GatewayHandoffService.cs`
- [Transfer service](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Gateway/Transfers/GatewayTransferService.cs): `src/ArcaneCore.Gateway/Transfers/GatewayTransferService.cs`

### Gameplay systems

- [Player state](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Game/Entities/Player.cs): `src/ArcaneCore.Game/Entities/Player.cs`
- [Unit state](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Game/Entities/Unit.cs): `src/ArcaneCore.Game/Entities/Unit.cs`
- [Inventory](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Game/Items/PlayerInventory.Storage.cs): `src/ArcaneCore.Game/Items/PlayerInventory.Storage.cs`
- [Loot rolls](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Game/Loot/LootRollManager.cs): `src/ArcaneCore.Game/Loot/LootRollManager.cs`
- [Creature EventAI](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Game/Creatures/AI/EventAi/EventAiEngine.cs): `src/ArcaneCore.Game/Creatures/AI/EventAi/EventAiEngine.cs`
- [Atlas visualizer](https://github.com/krilliac/arcanecore/blob/main/tools/ArcaneCore.Atlas/Server/ServerEngine.cs): `tools/ArcaneCore.Atlas/Server/ServerEngine.cs`

### Playerbots

- [Playerbot behavior](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Playerbots/Chaos/PlayerbotChaosEngine.cs): `src/ArcaneCore.Playerbots/Chaos/PlayerbotChaosEngine.cs`
- [Bot policy](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Playerbots/Policy/PlayerbotPolicyEngine.cs): `src/ArcaneCore.Playerbots/Policy/PlayerbotPolicyEngine.cs`
- [Bot chat inference](https://github.com/krilliac/arcanecore/blob/main/src/ArcaneCore.Playerbots/Chat/Inference/InProcessChatEngine.cs): `src/ArcaneCore.Playerbots/Chat/Inference/InProcessChatEngine.cs`

### Other components

- **WoW client**

## Connections

- WoW client → Realm service: authenticates (evidence: `README.md`)
- Realm service → Auth database: uses (evidence: `README.md`)
- Realm service → WoW client: offers realm list (evidence: `README.md`)
- WoW client → World service: plays through (evidence: `README.md`)
- World service → Auth database: shares auth data (evidence: `README.md`)
- World service → Character database: persists characters (evidence: `README.md`)
- World service → World database: loads game content (evidence: `README.md`)
- World service → Gateway: can split behind (evidence: `README.md`)
- WoW client → Gateway: connects optionally (evidence: `README.md`)
- Gateway → Gateway link: forwards sessions (evidence: `README.md`)
- Gateway link → Cluster protocol: uses framing
- Gateway → Character handoff: coordinates handoff (evidence: `README.md`)
- Gateway → Transfer service: supports transfers (evidence: `README.md`)
- Content importer → World database: imports content (evidence: `README.md`)
- World service → Player state: runs gameplay (evidence: `README.md`)
- Player state → Unit state: is a unit (evidence: `src/ArcaneCore.Game/Entities/Unit.cs`)
- Player state → Inventory: owns inventory (evidence: `src/ArcaneCore.Game/Items/PlayerInventory.Storage.cs`)
- World service → Loot rolls: provides loot (evidence: `README.md`)
- World service → Creature EventAI: provides creature AI (evidence: `README.md`)
- World service → Playerbot behavior: hosts bots (evidence: `README.md`)
- Playerbot behavior → Bot policy: uses policy
- Playerbot behavior → Bot chat inference: can use chat
- Atlas visualizer → World service: visualizes map runtime (evidence: `README.md`)
