# nwnxee/unified architecture

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

- Interactive diagram: https://gitdiagram.com/nwnxee/unified
- Repository: https://github.com/nwnxee/unified

## Overview

NWNX:EE is a Linux-oriented extension framework for Neverwinter Nights: Enhanced Edition. A module creator imports the distributed NWScript functions and calls them in a module running on the supported game server; the server loads NWNX through LD_PRELOAD, and plugins expose script commands or alter game behavior. The core and shared library provide plugin-facing runtime and game API access. README documents the overall flow and capabilities, but sampled source does not establish most plugin-to-core registrations or invocation paths, so those links are marked unverified.

Main entry points: [`NWNXLib/nwnx.hpp`](https://github.com/nwnxee/unified/blob/master/NWNXLib/nwnx.hpp) (Shared Runtime), [`Plugins/Area/Area.cpp`](https://github.com/nwnxee/unified/blob/master/Plugins/Area/Area.cpp) (Area Extensions), [`Plugins/Creature/Creature.cpp`](https://github.com/nwnxee/unified/blob/master/Plugins/Creature/Creature.cpp) (Creature Extensions), [`Plugins/Player/Player.cpp`](https://github.com/nwnxee/unified/blob/master/Plugins/Player/Player.cpp) (Player Extensions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime Framework"]
  node_nwscript["NWScript Functions<br/>[Functions.cs]"]
  node_core["NWNX Core<br/>[NWNXCore.cpp]"]
  node_shared_runtime["Shared Runtime<br/>[nwnx.hpp]"]
end

subgraph group_game["Game API"]
  node_server_app["Server Application<br/>[CServerExoApp.hpp]"]
  node_server_internal["Server Internals"]
  node_module_state["Module State<br/>[CNWSModule.hpp]"]
  node_area_state["Area State<br/>[CNWSArea.hpp]"]
  node_creature_state["Creature State<br/>[CNWSCreature.hpp]"]
  node_creature_stats["Creature Stats"]
  node_player_state["Player State<br/>[CNWSPlayer.hpp]"]
  node_item_state["Item State<br/>[CNWSItem.hpp]"]
end

subgraph group_gameplay["Gameplay Extensions"]
  node_area_plugin["Area Extensions<br/>[Area.cpp]"]
  node_creature_plugin["Creature Extensions<br/>[Creature.cpp]"]
  node_player_plugin["Player Extensions<br/>[Player.cpp]"]
  node_events_plugin["Event Hooks<br/>[ClientEvents.cpp]"]
  node_elc_plugin["Character Validation<br/>[ELC.cpp]"]
end

subgraph group_integration["External Integrations"]
  node_http_plugin["HTTP Client<br/>[HTTPClient.cpp]"]
  node_webhook_plugin["Webhooks<br/>[WebHook.cpp]"]
  node_metrics_plugin["InfluxDB Metrics<br/>[InfluxDBClient.cpp]"]
  node_redis_client["Redis Client<br/>[redis_client.cpp]"]
end

node_module_author(("Module Creator"))
node_game_server(("NWN Server"))

node_module_author -->|"imports"| node_nwscript
node_nwscript -->|"calls in module"| node_game_server
node_game_server -->|"preloads"| node_core
node_core -.->|"uses runtime"| node_shared_runtime
node_shared_runtime -.->|"plugin API"| node_area_plugin
node_shared_runtime -.->|"plugin API"| node_creature_plugin
node_shared_runtime -.->|"plugin API"| node_player_plugin
node_shared_runtime -.->|"plugin API"| node_events_plugin
node_shared_runtime -.->|"plugin API"| node_elc_plugin
node_shared_runtime -.->|"plugin API"| node_http_plugin
node_shared_runtime -.->|"plugin API"| node_webhook_plugin
node_shared_runtime -.->|"plugin API"| node_metrics_plugin
node_area_plugin -->|"accesses"| node_area_state
node_area_plugin -->|"accesses"| node_server_app
node_creature_plugin -->|"accesses"| node_creature_state
node_creature_plugin -->|"accesses"| node_creature_stats
node_player_plugin -->|"accesses"| node_player_state
node_player_plugin -->|"accesses"| node_server_app
node_events_plugin -->|"hooks"| node_server_internal
node_events_plugin -->|"accesses"| node_player_state
node_elc_plugin -->|"accesses"| node_creature_state
node_webhook_plugin -->|"accesses"| node_module_state
node_http_plugin -.->|"connects"| node_redis_client

click node_nwscript "https://github.com/nwnxee/unified/blob/master/Plugins/DotNET/NWN/NWScript/Functions.cs"
click node_core "https://github.com/nwnxee/unified/blob/master/Core/NWNXCore.cpp"
click node_shared_runtime "https://github.com/nwnxee/unified/blob/master/NWNXLib/nwnx.hpp"
click node_server_app "https://github.com/nwnxee/unified/blob/master/NWNXLib/API/API/CServerExoApp.hpp"
click node_server_internal "https://github.com/nwnxee/unified/blob/master/NWNXLib/API/API/CServerExoAppInternal.hpp"
click node_module_state "https://github.com/nwnxee/unified/blob/master/NWNXLib/API/API/CNWSModule.hpp"
click node_area_state "https://github.com/nwnxee/unified/blob/master/NWNXLib/API/API/CNWSArea.hpp"
click node_creature_state "https://github.com/nwnxee/unified/blob/master/NWNXLib/API/API/CNWSCreature.hpp"
click node_creature_stats "https://github.com/nwnxee/unified/blob/master/NWNXLib/API/API/CNWSCreatureStats.hpp"
click node_player_state "https://github.com/nwnxee/unified/blob/master/NWNXLib/API/API/CNWSPlayer.hpp"
click node_item_state "https://github.com/nwnxee/unified/blob/master/NWNXLib/API/API/CNWSItem.hpp"
click node_area_plugin "https://github.com/nwnxee/unified/blob/master/Plugins/Area/Area.cpp"
click node_creature_plugin "https://github.com/nwnxee/unified/blob/master/Plugins/Creature/Creature.cpp"
click node_player_plugin "https://github.com/nwnxee/unified/blob/master/Plugins/Player/Player.cpp"
click node_events_plugin "https://github.com/nwnxee/unified/blob/master/Plugins/Events/Events/ClientEvents.cpp"
click node_elc_plugin "https://github.com/nwnxee/unified/blob/master/Plugins/ELC/ELC.cpp"
click node_http_plugin "https://github.com/nwnxee/unified/blob/master/Plugins/HTTPClient/HTTPClient.cpp"
click node_webhook_plugin "https://github.com/nwnxee/unified/blob/master/Plugins/WebHook/WebHook.cpp"
click node_metrics_plugin "https://github.com/nwnxee/unified/blob/master/Plugins/Metrics_InfluxDB/InfluxDBClient.cpp"
click node_redis_client "https://github.com/nwnxee/unified/blob/master/Plugins/Redis/cpp_redis/sources/redis_client.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_nwscript,node_core,node_shared_runtime toneBlue
class node_server_app,node_server_internal,node_module_state,node_area_state,node_creature_state,node_creature_stats,node_player_state,node_item_state toneAmber
class node_area_plugin,node_creature_plugin,node_player_plugin,node_events_plugin,node_elc_plugin,node_game_server toneMint
class node_http_plugin,node_webhook_plugin,node_metrics_plugin,node_redis_client toneRose
class node_module_author toneIndigo
```

## Components

### Runtime Framework

- [NWScript Functions](https://github.com/nwnxee/unified/blob/master/Plugins/DotNET/NWN/NWScript/Functions.cs): `Plugins/DotNET/NWN/NWScript/Functions.cs`
- [NWNX Core](https://github.com/nwnxee/unified/blob/master/Core/NWNXCore.cpp): `Core/NWNXCore.cpp`
- [Shared Runtime](https://github.com/nwnxee/unified/blob/master/NWNXLib/nwnx.hpp): `NWNXLib/nwnx.hpp`

### Game API

- [Server Application](https://github.com/nwnxee/unified/blob/master/NWNXLib/API/API/CServerExoApp.hpp): `NWNXLib/API/API/CServerExoApp.hpp`
- [Server Internals](https://github.com/nwnxee/unified/blob/master/NWNXLib/API/API/CServerExoAppInternal.hpp): `NWNXLib/API/API/CServerExoAppInternal.hpp`
- [Module State](https://github.com/nwnxee/unified/blob/master/NWNXLib/API/API/CNWSModule.hpp): `NWNXLib/API/API/CNWSModule.hpp`
- [Area State](https://github.com/nwnxee/unified/blob/master/NWNXLib/API/API/CNWSArea.hpp): `NWNXLib/API/API/CNWSArea.hpp`
- [Creature State](https://github.com/nwnxee/unified/blob/master/NWNXLib/API/API/CNWSCreature.hpp): `NWNXLib/API/API/CNWSCreature.hpp`
- [Creature Stats](https://github.com/nwnxee/unified/blob/master/NWNXLib/API/API/CNWSCreatureStats.hpp): `NWNXLib/API/API/CNWSCreatureStats.hpp`
- [Player State](https://github.com/nwnxee/unified/blob/master/NWNXLib/API/API/CNWSPlayer.hpp): `NWNXLib/API/API/CNWSPlayer.hpp`
- [Item State](https://github.com/nwnxee/unified/blob/master/NWNXLib/API/API/CNWSItem.hpp): `NWNXLib/API/API/CNWSItem.hpp`

### Gameplay Extensions

- [Area Extensions](https://github.com/nwnxee/unified/blob/master/Plugins/Area/Area.cpp): `Plugins/Area/Area.cpp`
- [Creature Extensions](https://github.com/nwnxee/unified/blob/master/Plugins/Creature/Creature.cpp): `Plugins/Creature/Creature.cpp`
- [Player Extensions](https://github.com/nwnxee/unified/blob/master/Plugins/Player/Player.cpp): `Plugins/Player/Player.cpp`
- [Event Hooks](https://github.com/nwnxee/unified/blob/master/Plugins/Events/Events/ClientEvents.cpp): `Plugins/Events/Events/ClientEvents.cpp`
- [Character Validation](https://github.com/nwnxee/unified/blob/master/Plugins/ELC/ELC.cpp): `Plugins/ELC/ELC.cpp`

### External Integrations

- [HTTP Client](https://github.com/nwnxee/unified/blob/master/Plugins/HTTPClient/HTTPClient.cpp): `Plugins/HTTPClient/HTTPClient.cpp`
- [Webhooks](https://github.com/nwnxee/unified/blob/master/Plugins/WebHook/WebHook.cpp): `Plugins/WebHook/WebHook.cpp`
- [InfluxDB Metrics](https://github.com/nwnxee/unified/blob/master/Plugins/Metrics_InfluxDB/InfluxDBClient.cpp): `Plugins/Metrics_InfluxDB/InfluxDBClient.cpp`
- [Redis Client](https://github.com/nwnxee/unified/blob/master/Plugins/Redis/cpp_redis/sources/redis_client.cpp): `Plugins/Redis/cpp_redis/sources/redis_client.cpp`

### Other components

- **Module Creator**
- **NWN Server**

## Connections

- Module Creator → NWScript Functions: imports (evidence: `README.md`)
- NWScript Functions → NWN Server: calls in module (evidence: `README.md`)
- NWN Server → NWNX Core: preloads (evidence: `README.md`)
- NWNX Core → Shared Runtime: uses runtime
- Shared Runtime → Area Extensions: plugin API (evidence: `Plugins/Area/Area.cpp`)
- Shared Runtime → Creature Extensions: plugin API (evidence: `Plugins/Creature/Creature.cpp`)
- Shared Runtime → Player Extensions: plugin API (evidence: `Plugins/Player/Player.cpp`)
- Shared Runtime → Event Hooks: plugin API
- Shared Runtime → Character Validation: plugin API (evidence: `Plugins/ELC/ELC.cpp`)
- Shared Runtime → HTTP Client: plugin API (evidence: `Plugins/HTTPClient/HTTPClient.cpp`)
- Shared Runtime → Webhooks: plugin API (evidence: `Plugins/WebHook/WebHook.cpp`)
- Shared Runtime → InfluxDB Metrics: plugin API
- Area Extensions → Area State: accesses (evidence: `Plugins/Area/Area.cpp`)
- Area Extensions → Server Application: accesses (evidence: `Plugins/Area/Area.cpp`)
- Creature Extensions → Creature State: accesses (evidence: `Plugins/Creature/Creature.cpp`)
- Creature Extensions → Creature Stats: accesses (evidence: `Plugins/Creature/Creature.cpp`)
- Player Extensions → Player State: accesses (evidence: `Plugins/Player/Player.cpp`)
- Player Extensions → Server Application: accesses (evidence: `Plugins/Player/Player.cpp`)
- Event Hooks → Server Internals: hooks (evidence: `Plugins/Events/Events/ClientEvents.cpp`)
- Event Hooks → Player State: accesses (evidence: `Plugins/Events/Events/ClientEvents.cpp`)
- Character Validation → Creature State: accesses (evidence: `Plugins/ELC/ELC.cpp`)
- Webhooks → Module State: accesses (evidence: `Plugins/WebHook/WebHook.cpp`)
- HTTP Client → Redis Client: connects
