# jonnyptn/zomboi architecture

> Architecture diagram of the GitHub repository jonnyptn/zomboi, 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/jonnyptn/zomboi
- Repository: https://github.com/jonnyptn/zomboi

## Overview

Zomboi is a Discord slash-command bot that manages a local Project Zomboid dedicated server and turns its log files into Discord notifications and player records. Users issue server, mod, and player commands; separately, file watchers parse server logs to update player and skill state or mirror chat. The graph includes the documented install/create/start/stop and reporting capabilities, plus log parsing and notification layers. Some command and server internals were not excerpted, so their documented links cite the README; unsampled implementation details are not inferred.

Main entry points: [`src/Server.cs`](https://github.com/jonnyptn/zomboi/blob/main/src/Server.cs) (Server control), [`src/Playerlistener.cs`](https://github.com/jonnyptn/zomboi/blob/main/src/Playerlistener.cs) (Player listener), [`src/PerkListener.cs`](https://github.com/jonnyptn/zomboi/blob/main/src/PerkListener.cs) (Skill listener), [`src/Zomboi.cs`](https://github.com/jonnyptn/zomboi/blob/main/src/Zomboi.cs) (Bot startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discord["Discord interface"]
  node_app["Bot startup<br/>[Zomboi.cs]"]
  node_interactions["Interaction handler"]
  node_server_commands["Server commands"]
  node_mod_commands["Mod commands"]
  node_player_commands["Player commands"]
  node_channel_lookup["Channel lookup<br/>[Channels.cs]"]
  node_discord_errors["Discord errors<br/>[DiscordError.cs]"]
  node_invite["Invite link<br/>[Invite.cs]"]
  node_logger["Logger<br/>[Logger.cs]"]
end

subgraph group_management["Server management"]
  node_server["Server control<br/>[Server.cs]"]
  node_server_config["Server config lists<br/>[ConfigList.cs]"]
end

subgraph group_ingestion["Log ingestion"]
  node_log_watcher["Log file watcher<br/>[LogFileListener.cs]"]
  node_log_line["Log line parser<br/>[LogLine.cs]"]
  node_log_fields["Log field parser<br/>[LogFields.cs]"]
  node_chat_listener["Chat listener<br/>[ChatListener.cs]"]
  node_player_listener["Player listener<br/>[Playerlistener.cs]"]
  node_perk_listener["Skill listener<br/>[PerkListener.cs]"]
end

subgraph group_records["Player records and notifications"]
  node_player_state["Player state<br/>[Player.cs]"]
  node_perk_state["Skill state<br/>[Perk.cs]"]
  node_map_link["Map links<br/>[Map.cs]"]
  node_survival_time["Survival time<br/>[Survival.cs]"]
end

node_admin(("Discord user"))
node_discord(("Discord"))
node_steamcmd["SteamCMD"]
node_game_server["Dedicated server"]

node_admin -->|"issues commands"| node_interactions
node_interactions -.->|"registers commands"| node_discord
node_app -->|"initializes"| node_interactions
node_app -->|"attaches or starts"| node_server
node_app -->|"sets channel"| node_chat_listener
node_app -->|"sets channel"| node_player_listener
node_app -->|"sets channel"| node_perk_listener
node_server_commands -->|"controls server"| node_server
node_server_commands -->|"installs with"| node_steamcmd
node_mod_commands -->|"edits mod lists"| node_server
node_player_commands -->|"reads player data"| node_server
node_server -->|"uses config lists"| node_server_config
node_server -->|"starts and stops"| node_game_server
node_log_watcher -->|"parses lines"| node_log_line
node_chat_listener -->|"watches chat log"| node_log_watcher
node_player_listener -->|"watches player log"| node_log_watcher
node_perk_listener -->|"watches perk log"| node_log_watcher
node_chat_listener -->|"checks news window"| node_server
node_chat_listener -->|"extracts chat fields"| node_log_fields
node_chat_listener -->|"mirrors via webhook"| node_discord
node_player_listener -->|"updates connections"| node_server
node_player_listener -->|"extracts player fields"| node_log_fields
node_player_listener -->|"formats locations"| node_map_link
node_player_listener -->|"describes survival"| node_survival_time
node_perk_listener -->|"updates player records"| node_server
node_perk_listener -->|"extracts skill fields"| node_log_fields
node_perk_listener -->|"updates player"| node_player_state
node_perk_listener -->|"updates skills"| node_perk_state
node_player_commands -->|"reports players"| node_player_state
node_player_commands -->|"provides map links"| node_map_link
node_player_commands -->|"reports survival"| node_survival_time
node_chat_listener -->|"resolves channel"| node_channel_lookup
node_player_listener -->|"resolves channel"| node_channel_lookup
node_perk_listener -->|"resolves channel"| node_channel_lookup
node_app -->|"offers invite link"| node_invite
node_discord_errors -->|"logs failures"| node_logger

click node_app "https://github.com/jonnyptn/zomboi/blob/main/src/Zomboi.cs"
click node_interactions "https://github.com/jonnyptn/zomboi/blob/main/src/InteractionHandler.cs"
click node_server_commands "https://github.com/jonnyptn/zomboi/blob/main/src/ServerCommandModule.cs"
click node_mod_commands "https://github.com/jonnyptn/zomboi/blob/main/src/ModCommandModule.cs"
click node_player_commands "https://github.com/jonnyptn/zomboi/blob/main/src/PlayerCommandModule.cs"
click node_channel_lookup "https://github.com/jonnyptn/zomboi/blob/main/src/Channels.cs"
click node_discord_errors "https://github.com/jonnyptn/zomboi/blob/main/src/DiscordError.cs"
click node_server "https://github.com/jonnyptn/zomboi/blob/main/src/Server.cs"
click node_server_config "https://github.com/jonnyptn/zomboi/blob/main/src/ConfigList.cs"
click node_log_watcher "https://github.com/jonnyptn/zomboi/blob/main/src/LogFileListener.cs"
click node_log_line "https://github.com/jonnyptn/zomboi/blob/main/src/LogLine.cs"
click node_log_fields "https://github.com/jonnyptn/zomboi/blob/main/src/LogFields.cs"
click node_chat_listener "https://github.com/jonnyptn/zomboi/blob/main/src/ChatListener.cs"
click node_player_listener "https://github.com/jonnyptn/zomboi/blob/main/src/Playerlistener.cs"
click node_perk_listener "https://github.com/jonnyptn/zomboi/blob/main/src/PerkListener.cs"
click node_player_state "https://github.com/jonnyptn/zomboi/blob/main/src/Player.cs"
click node_perk_state "https://github.com/jonnyptn/zomboi/blob/main/src/Perk.cs"
click node_map_link "https://github.com/jonnyptn/zomboi/blob/main/src/Map.cs"
click node_survival_time "https://github.com/jonnyptn/zomboi/blob/main/src/Survival.cs"
click node_invite "https://github.com/jonnyptn/zomboi/blob/main/src/Invite.cs"
click node_logger "https://github.com/jonnyptn/zomboi/blob/main/src/Logger.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_app,node_interactions,node_server_commands,node_mod_commands,node_player_commands,node_channel_lookup,node_discord_errors,node_invite,node_logger,node_admin toneBlue
class node_server,node_server_config toneAmber
class node_log_watcher,node_log_line,node_log_fields,node_chat_listener,node_player_listener,node_perk_listener,node_game_server toneMint
class node_player_state,node_perk_state,node_map_link,node_survival_time toneRose
class node_discord,node_steamcmd toneIndigo
```

## Components

### Discord interface

- [Bot startup](https://github.com/jonnyptn/zomboi/blob/main/src/Zomboi.cs): `src/Zomboi.cs`
- [Interaction handler](https://github.com/jonnyptn/zomboi/blob/main/src/InteractionHandler.cs): `src/InteractionHandler.cs`
- [Server commands](https://github.com/jonnyptn/zomboi/blob/main/src/ServerCommandModule.cs): `src/ServerCommandModule.cs`
- [Mod commands](https://github.com/jonnyptn/zomboi/blob/main/src/ModCommandModule.cs): `src/ModCommandModule.cs`
- [Player commands](https://github.com/jonnyptn/zomboi/blob/main/src/PlayerCommandModule.cs): `src/PlayerCommandModule.cs`
- [Channel lookup](https://github.com/jonnyptn/zomboi/blob/main/src/Channels.cs): `src/Channels.cs`
- [Discord errors](https://github.com/jonnyptn/zomboi/blob/main/src/DiscordError.cs): `src/DiscordError.cs`
- [Invite link](https://github.com/jonnyptn/zomboi/blob/main/src/Invite.cs): `src/Invite.cs`
- [Logger](https://github.com/jonnyptn/zomboi/blob/main/src/Logger.cs): `src/Logger.cs`

### Server management

- [Server control](https://github.com/jonnyptn/zomboi/blob/main/src/Server.cs): `src/Server.cs`
- [Server config lists](https://github.com/jonnyptn/zomboi/blob/main/src/ConfigList.cs): `src/ConfigList.cs`

### Log ingestion

- [Log file watcher](https://github.com/jonnyptn/zomboi/blob/main/src/LogFileListener.cs): `src/LogFileListener.cs`
- [Log line parser](https://github.com/jonnyptn/zomboi/blob/main/src/LogLine.cs): `src/LogLine.cs`
- [Log field parser](https://github.com/jonnyptn/zomboi/blob/main/src/LogFields.cs): `src/LogFields.cs`
- [Chat listener](https://github.com/jonnyptn/zomboi/blob/main/src/ChatListener.cs): `src/ChatListener.cs`
- [Player listener](https://github.com/jonnyptn/zomboi/blob/main/src/Playerlistener.cs): `src/Playerlistener.cs`
- [Skill listener](https://github.com/jonnyptn/zomboi/blob/main/src/PerkListener.cs): `src/PerkListener.cs`

### Player records and notifications

- [Player state](https://github.com/jonnyptn/zomboi/blob/main/src/Player.cs): `src/Player.cs`
- [Skill state](https://github.com/jonnyptn/zomboi/blob/main/src/Perk.cs): `src/Perk.cs`
- [Map links](https://github.com/jonnyptn/zomboi/blob/main/src/Map.cs): `src/Map.cs`
- [Survival time](https://github.com/jonnyptn/zomboi/blob/main/src/Survival.cs): `src/Survival.cs`

### Other components

- **Discord user**
- **Discord**
- **SteamCMD**
- **Dedicated server**

## Connections

- Discord user → Interaction handler: issues commands (evidence: `README.md`)
- Interaction handler → Discord: registers commands
- Bot startup → Interaction handler: initializes (evidence: `src/Zomboi.cs`)
- Bot startup → Server control: attaches or starts (evidence: `src/Zomboi.cs`)
- Bot startup → Chat listener: sets channel (evidence: `src/Zomboi.cs`)
- Bot startup → Player listener: sets channel (evidence: `src/Zomboi.cs`)
- Bot startup → Skill listener: sets channel (evidence: `src/Zomboi.cs`)
- Server commands → Server control: controls server (evidence: `README.md`)
- Server commands → SteamCMD: installs with (evidence: `README.md`)
- Mod commands → Server control: edits mod lists (evidence: `src/ModCommandModule.cs`)
- Player commands → Server control: reads player data (evidence: `src/PlayerCommandModule.cs`)
- Server control → Server config lists: uses config lists (evidence: `src/Server.cs`)
- Server control → Dedicated server: starts and stops (evidence: `README.md`)
- Log file watcher → Log line parser: parses lines (evidence: `src/LogFileListener.cs`)
- Chat listener → Log file watcher: watches chat log (evidence: `src/ChatListener.cs`)
- Player listener → Log file watcher: watches player log (evidence: `src/Playerlistener.cs`)
- Skill listener → Log file watcher: watches perk log (evidence: `src/PerkListener.cs`)
- Chat listener → Server control: checks news window (evidence: `src/ChatListener.cs`)
- Chat listener → Log field parser: extracts chat fields (evidence: `src/ChatListener.cs`)
- Chat listener → Discord: mirrors via webhook (evidence: `README.md`)
- Player listener → Server control: updates connections (evidence: `src/Playerlistener.cs`)
- Player listener → Log field parser: extracts player fields (evidence: `src/Playerlistener.cs`)
- Player listener → Map links: formats locations (evidence: `src/Playerlistener.cs`)
- Player listener → Survival time: describes survival (evidence: `src/Playerlistener.cs`)
- Skill listener → Server control: updates player records (evidence: `src/PerkListener.cs`)
- Skill listener → Log field parser: extracts skill fields (evidence: `src/PerkListener.cs`)
- Skill listener → Player state: updates player (evidence: `src/PerkListener.cs`)
- Skill listener → Skill state: updates skills (evidence: `src/PerkListener.cs`)
- Player commands → Player state: reports players (evidence: `README.md`)
- Player commands → Map links: provides map links (evidence: `src/PlayerCommandModule.cs`)
- Player commands → Survival time: reports survival (evidence: `src/PlayerCommandModule.cs`)
- Chat listener → Channel lookup: resolves channel (evidence: `src/ChatListener.cs`)
- Player listener → Channel lookup: resolves channel (evidence: `src/Playerlistener.cs`)
- Skill listener → Channel lookup: resolves channel (evidence: `src/PerkListener.cs`)
- Bot startup → Invite link: offers invite link (evidence: `src/Zomboi.cs`)
- Discord errors → Logger: logs failures (evidence: `src/DiscordError.cs`)
