# mod-playerbots/azerothcore-wotlk architecture

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

- Interactive diagram: https://gitdiagram.com/mod-playerbots/azerothcore-wotlk
- Repository: https://github.com/mod-playerbots/azerothcore-wotlk

## Overview

AzerothCore is a modular MMORPG server framework that recreates World of Warcraft 3.3.5a gameplay. At a high level, clients connect through the server applications, interact with the world through sessions and game systems, and rely on database-backed account, world, and character state. The graph preserves major gameplay domains and modular extension points, while separating the supporting common and persistence layers. Source excerpts are partial; edges are limited to relationships shown by the README or SOURCE INDEX references.

Main entry points: [`src/server/apps/worldserver/Main.cpp`](https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/apps/worldserver/Main.cpp) (World Server), [`src/server/database/Database/DatabaseEnv.h`](https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/database/Database/DatabaseEnv.h) (Database Pools), [`src/server/game/Handlers/QueryHandler.cpp`](https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/game/Handlers/QueryHandler.cpp) (World Queries), [`src/server/game/Server/WorldSession.h`](https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/game/Server/WorldSession.h) (World Session)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_apps["Server Applications"]
  node_authserver["Auth Server<br/>[Main.cpp]"]
  node_worldserver["World Server<br/>[Main.cpp]"]
end

subgraph group_game["Gameplay Runtime"]
  node_session["World Session<br/>[WorldSession.h]"]
  node_protocol["Packet Protocol<br/>[Opcodes.h]"]
  node_player_entity["Player Entity<br/>[Player.h]"]
  node_combat["Combat and Threat<br/>[ThreatManager.cpp]"]
  node_maps["Maps and Grids<br/>[Map.h]"]
  node_queries["World Queries<br/>[QueryHandler.cpp]"]
  node_quests["Quest Definitions<br/>[QuestDef.h]"]
end

subgraph group_state["Persistence and Data"]
  node_object_mgr["Object Manager<br/>[ObjectMgr.h]"]
  node_loot_storage[("Stored Loot")]
  node_character_storage[("Character Storage<br/>[PlayerStorage.cpp]")]
  node_database[("Database Pools<br/>[DatabaseEnv.h]")]
end

subgraph group_common["Shared Infrastructure"]
  node_common["Common Services<br/>[Common.h]"]
  node_logging["Logging<br/>[Log.h]"]
  node_scheduler["Task Scheduler<br/>[TaskScheduler.cpp]"]
end

subgraph group_extension["Extensions and Tools"]
  node_scripts["Script Manager<br/>[ScriptMgr.h]"]
  node_modules["Modules"]
  node_dbimport["Database Import<br/>[Main.cpp]"]
end

node_player(("Player"))

node_player -.->|"connects"| node_authserver
node_player -.->|"plays through"| node_worldserver
node_worldserver -->|"uses"| node_maps
node_worldserver -->|"loads"| node_database
node_worldserver -->|"initializes"| node_modules
node_worldserver -->|"configures"| node_logging
node_session -.->|"dispatches"| node_protocol
node_queries -->|"queries"| node_object_mgr
node_queries -->|"sends packets"| node_session
node_character_storage -->|"reads and writes"| node_database
node_loot_storage -->|"reads and writes"| node_database
node_worldserver -.->|"uses updates from"| node_dbimport
node_worldserver -.->|"uses"| node_scheduler
node_combat -->|"uses"| node_player_entity
node_player_entity -->|"uses"| node_object_mgr

click node_authserver "https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/apps/authserver/Main.cpp"
click node_worldserver "https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/apps/worldserver/Main.cpp"
click node_session "https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/game/Server/WorldSession.h"
click node_protocol "https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/game/Server/Protocol/Opcodes.h"
click node_player_entity "https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/game/Entities/Player/Player.h"
click node_combat "https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/game/Combat/ThreatManager.cpp"
click node_maps "https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/game/Maps/Map.h"
click node_queries "https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/game/Handlers/QueryHandler.cpp"
click node_quests "https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/game/Quests/QuestDef.h"
click node_scripts "https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/game/Scripting/ScriptMgr.h"
click node_modules "https://github.com/mod-playerbots/azerothcore-wotlk/tree/Playerbot/modules"
click node_object_mgr "https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/game/Globals/ObjectMgr.h"
click node_loot_storage "https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/game/Loot/LootItemStorage.cpp"
click node_character_storage "https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/game/Entities/Player/PlayerStorage.cpp"
click node_database "https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/database/Database/DatabaseEnv.h"
click node_common "https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/common/Common.h"
click node_logging "https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/common/Logging/Log.h"
click node_scheduler "https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/common/Utilities/TaskScheduler.cpp"
click node_dbimport "https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/tools/dbimport/Main.cpp"

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_authserver,node_worldserver toneBlue
class node_session,node_protocol,node_player_entity,node_combat,node_maps,node_queries,node_quests toneAmber
class node_object_mgr,node_loot_storage,node_character_storage,node_database toneMint
class node_common,node_logging,node_scheduler toneRose
class node_scripts,node_modules,node_dbimport,node_player toneIndigo
```

## Components

### Server Applications

- [Auth Server](https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/apps/authserver/Main.cpp): `src/server/apps/authserver/Main.cpp`
- [World Server](https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/apps/worldserver/Main.cpp): `src/server/apps/worldserver/Main.cpp`

### Gameplay Runtime

- [World Session](https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/game/Server/WorldSession.h): `src/server/game/Server/WorldSession.h`
- [Packet Protocol](https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/game/Server/Protocol/Opcodes.h): `src/server/game/Server/Protocol/Opcodes.h`
- [Player Entity](https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/game/Entities/Player/Player.h): `src/server/game/Entities/Player/Player.h`
- [Combat and Threat](https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/game/Combat/ThreatManager.cpp): `src/server/game/Combat/ThreatManager.cpp`
- [Maps and Grids](https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/game/Maps/Map.h): `src/server/game/Maps/Map.h`
- [World Queries](https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/game/Handlers/QueryHandler.cpp): `src/server/game/Handlers/QueryHandler.cpp`
- [Quest Definitions](https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/game/Quests/QuestDef.h): `src/server/game/Quests/QuestDef.h`

### Persistence and Data

- [Object Manager](https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/game/Globals/ObjectMgr.h): `src/server/game/Globals/ObjectMgr.h`
- [Stored Loot](https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/game/Loot/LootItemStorage.cpp): `src/server/game/Loot/LootItemStorage.cpp`
- [Character Storage](https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/game/Entities/Player/PlayerStorage.cpp): `src/server/game/Entities/Player/PlayerStorage.cpp`
- [Database Pools](https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/database/Database/DatabaseEnv.h): `src/server/database/Database/DatabaseEnv.h`

### Shared Infrastructure

- [Common Services](https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/common/Common.h): `src/common/Common.h`
- [Logging](https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/common/Logging/Log.h): `src/common/Logging/Log.h`
- [Task Scheduler](https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/common/Utilities/TaskScheduler.cpp): `src/common/Utilities/TaskScheduler.cpp`

### Extensions and Tools

- [Script Manager](https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/server/game/Scripting/ScriptMgr.h): `src/server/game/Scripting/ScriptMgr.h`
- [Modules](https://github.com/mod-playerbots/azerothcore-wotlk/tree/Playerbot/modules): `modules`
- [Database Import](https://github.com/mod-playerbots/azerothcore-wotlk/blob/Playerbot/src/tools/dbimport/Main.cpp): `src/tools/dbimport/Main.cpp`

### Other components

- **Player**

## Connections

- Player → Auth Server: connects
- Player → World Server: plays through
- World Server → Maps and Grids: uses (evidence: `src/server/apps/worldserver/Main.cpp`)
- World Server → Database Pools: loads (evidence: `src/server/apps/worldserver/Main.cpp`)
- World Server → Modules: initializes (evidence: `src/server/apps/worldserver/Main.cpp`)
- World Server → Logging: configures (evidence: `src/server/apps/worldserver/Main.cpp`)
- World Session → Packet Protocol: dispatches
- World Queries → Object Manager: queries (evidence: `src/server/game/Handlers/QueryHandler.cpp`)
- World Queries → World Session: sends packets (evidence: `src/server/game/Handlers/QueryHandler.cpp`)
- Character Storage → Database Pools: reads and writes (evidence: `src/server/game/Entities/Player/PlayerStorage.cpp`)
- Stored Loot → Database Pools: reads and writes (evidence: `src/server/game/Loot/LootItemStorage.cpp`)
- World Server → Database Import: uses updates from
- World Server → Task Scheduler: uses
- Combat and Threat → Player Entity: uses (evidence: `src/server/game/Combat/ThreatManager.cpp`)
- Player Entity → Object Manager: uses (evidence: `src/server/game/Entities/Player/Player.h`)
