# efesw/scpsl-roleplay-plugin architecture

> Architecture diagram of the GitHub repository efesw/scpsl-roleplay-plugin, 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/efesw/scpsl-roleplay-plugin
- Repository: https://github.com/efesw/scpsl-roleplay-plugin

## Overview

RpPluginByEfes is an EXILED roleplay HUD plugin. Players use client commands to submit roleplay messages or roll dice; the manager keeps messages and runs a round-started HUD routine that displays server/player information and nearby messages. Configuration controls formatting and behavior. The README also documents spectator visibility and HintServiceMeow as a required dependency. The sampled source shows lifecycle, command, and HUD wiring; some HUD details come from the README because the manager excerpt is partial.

Main entry points: [`RpManager.cs`](https://github.com/efesw/scpsl-roleplay-plugin/blob/main/RpManager.cs) (RP manager), [`Plugin.cs`](https://github.com/efesw/scpsl-roleplay-plugin/blob/main/Plugin.cs) (Plugin lifecycle), [`Commands.cs`](https://github.com/efesw/scpsl-roleplay-plugin/blob/main/Commands.cs) (RP commands), [`Config.cs`](https://github.com/efesw/scpsl-roleplay-plugin/blob/main/Config.cs) (Plugin config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_plugin["Plugin lifecycle"]
  node_plugin["Plugin lifecycle<br/>[Plugin.cs]"]
  node_config["Plugin config<br/>[Config.cs]"]
end

subgraph group_commands["Player commands"]
  node_rpcommands["RP commands<br/>[Commands.cs]"]
  node_dice["Dice command<br/>[Commands.cs]"]
end

subgraph group_display["HUD and messages"]
  node_manager["RP manager<br/>[RpManager.cs]"]
  node_messages["Active messages<br/>[RpManager.cs]"]
  node_hud["HUD routine<br/>[RpManager.cs]"]
end

node_player(("Player"))
node_exiled{{"EXILED server"}}
node_hintservice{{"HintServiceMeow"}}

node_player -->|"invokes commands"| node_rpcommands
node_player -->|"invokes command"| node_dice
node_rpcommands -->|"checks settings"| node_config
node_dice -->|"reads settings"| node_config
node_rpcommands -->|"adds messages"| node_manager
node_dice -->|"adds roll"| node_manager
node_exiled -.->|"loads plugin"| node_plugin
node_plugin -->|"creates manager"| node_manager
node_plugin -->|"registers round events"| node_manager
node_manager -->|"reads settings"| node_config
node_manager -->|"stores messages"| node_messages
node_manager -->|"starts routine"| node_hud
node_hud -->|"reads messages"| node_messages
node_hud -->|"updates hints"| node_hintservice
node_hud -->|"shows HUD"| node_player

click node_plugin "https://github.com/efesw/scpsl-roleplay-plugin/blob/main/Plugin.cs"
click node_config "https://github.com/efesw/scpsl-roleplay-plugin/blob/main/Config.cs"
click node_rpcommands "https://github.com/efesw/scpsl-roleplay-plugin/blob/main/Commands.cs"
click node_dice "https://github.com/efesw/scpsl-roleplay-plugin/blob/main/Commands.cs"
click node_manager "https://github.com/efesw/scpsl-roleplay-plugin/blob/main/RpManager.cs"
click node_messages "https://github.com/efesw/scpsl-roleplay-plugin/blob/main/RpManager.cs"
click node_hud "https://github.com/efesw/scpsl-roleplay-plugin/blob/main/RpManager.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_plugin,node_config toneBlue
class node_rpcommands,node_dice toneAmber
class node_manager,node_messages,node_hud,node_exiled toneMint
class node_player,node_hintservice toneIndigo
```

## Components

### Plugin lifecycle

- [Plugin lifecycle](https://github.com/efesw/scpsl-roleplay-plugin/blob/main/Plugin.cs): `Plugin.cs`
- [Plugin config](https://github.com/efesw/scpsl-roleplay-plugin/blob/main/Config.cs): `Config.cs`

### Player commands

- [RP commands](https://github.com/efesw/scpsl-roleplay-plugin/blob/main/Commands.cs): `Commands.cs`
- [Dice command](https://github.com/efesw/scpsl-roleplay-plugin/blob/main/Commands.cs): `Commands.cs`

### HUD and messages

- [RP manager](https://github.com/efesw/scpsl-roleplay-plugin/blob/main/RpManager.cs): `RpManager.cs`
- [Active messages](https://github.com/efesw/scpsl-roleplay-plugin/blob/main/RpManager.cs): `RpManager.cs`
- [HUD routine](https://github.com/efesw/scpsl-roleplay-plugin/blob/main/RpManager.cs): `RpManager.cs`

### Other components

- **Player**
- **EXILED server**
- **HintServiceMeow**

## Connections

- Player → RP commands: invokes commands (evidence: `Commands.cs`)
- Player → Dice command: invokes command (evidence: `Commands.cs`)
- RP commands → Plugin config: checks settings (evidence: `Commands.cs`)
- Dice command → Plugin config: reads settings (evidence: `Commands.cs`)
- RP commands → RP manager: adds messages (evidence: `Commands.cs`)
- Dice command → RP manager: adds roll (evidence: `Commands.cs`)
- EXILED server → Plugin lifecycle: loads plugin
- Plugin lifecycle → RP manager: creates manager (evidence: `Plugin.cs`)
- Plugin lifecycle → RP manager: registers round events (evidence: `Plugin.cs`)
- RP manager → Plugin config: reads settings (evidence: `RpManager.cs`)
- RP manager → Active messages: stores messages (evidence: `RpManager.cs`)
- RP manager → HUD routine: starts routine (evidence: `RpManager.cs`)
- HUD routine → Active messages: reads messages (evidence: `RpManager.cs`)
- HUD routine → HintServiceMeow: updates hints (evidence: `RpManager.cs`)
- HUD routine → Player: shows HUD (evidence: `RpManager.cs`)
