# tacman1981/connect-log-parser architecture

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

- Interactive diagram: https://gitdiagram.com/tacman1981/connect-log-parser
- Repository: https://github.com/tacman1981/connect-log-parser

## Overview

Peak Online is a WPF viewer for daily player peaks computed from connection logs produced by the ConnectLogger plugin. A user selects a log file or reopens one from recent history; the window passes its path to the parser, which reads and sorts events, calculates daily and overall peaks, and returns daily values for bar-chart rendering. The window also persists file history and background color in isolated storage. The plugin’s log output and the viewer’s input are shown as a shared file, though the app does not automatically locate it. The documented workflow and sampled code support these links; the XAML layout was not sampled.

Main entry points: [`Peak Online/MainWindow.xaml.cs`](https://github.com/tacman1981/connect-log-parser/blob/main/Peak%20Online/MainWindow.xaml.cs) (Window workflow), [`Peak Online/TextFileParser.cs`](https://github.com/tacman1981/connect-log-parser/blob/main/Peak%20Online/TextFileParser.cs) (Log parsing), [`ConnectLogger.cs`](https://github.com/tacman1981/connect-log-parser/blob/main/ConnectLogger.cs) (Connect logger)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_logging["Log production"]
  node_logger["Connect logger<br/>[ConnectLogger.cs]"]
  node_log_file["Connection log"]
end

subgraph group_viewer["Peak viewer"]
  node_window["Window workflow<br/>[MainWindow.xaml.cs]"]
  node_parser["Log parsing<br/>[TextFileParser.cs]"]
  node_daily_peaks["Daily peak calculation<br/>[TextFileParser.cs]"]
  node_chart["Peak chart<br/>[MainWindow.xaml.cs]"]
end

subgraph group_state["User preferences"]
  node_settings[("Isolated settings<br/>[MainWindow.xaml.cs]")]
end

node_player_events(("Player events"))
node_user(("Viewer user"))

node_player_events -->|"triggers hooks"| node_logger
node_logger -->|"writes events"| node_log_file
node_user -->|"selects log"| node_window
node_window -->|"passes path"| node_parser
node_log_file -->|"reads lines"| node_parser
node_parser -->|"calculates peaks"| node_daily_peaks
node_window -->|"renders bars"| node_chart
node_daily_peaks -->|"supplies values"| node_chart
node_window -->|"reads and writes"| node_settings

click node_logger "https://github.com/tacman1981/connect-log-parser/blob/main/ConnectLogger.cs"
click node_window "https://github.com/tacman1981/connect-log-parser/blob/main/Peak%20Online/MainWindow.xaml.cs"
click node_parser "https://github.com/tacman1981/connect-log-parser/blob/main/Peak%20Online/TextFileParser.cs"
click node_daily_peaks "https://github.com/tacman1981/connect-log-parser/blob/main/Peak%20Online/TextFileParser.cs"
click node_chart "https://github.com/tacman1981/connect-log-parser/blob/main/Peak%20Online/MainWindow.xaml.cs"
click node_settings "https://github.com/tacman1981/connect-log-parser/blob/main/Peak%20Online/MainWindow.xaml.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_logger,node_log_file,node_user toneBlue
class node_window,node_parser,node_daily_peaks,node_chart toneAmber
class node_settings toneMint
class node_player_events toneIndigo
```

## Components

### Log production

- [Connect logger](https://github.com/tacman1981/connect-log-parser/blob/main/ConnectLogger.cs): `ConnectLogger.cs`
- **Connection log**

### Peak viewer

- [Window workflow](https://github.com/tacman1981/connect-log-parser/blob/main/Peak%20Online/MainWindow.xaml.cs): `Peak Online/MainWindow.xaml.cs`
- [Log parsing](https://github.com/tacman1981/connect-log-parser/blob/main/Peak%20Online/TextFileParser.cs): `Peak Online/TextFileParser.cs`
- [Daily peak calculation](https://github.com/tacman1981/connect-log-parser/blob/main/Peak%20Online/TextFileParser.cs): `Peak Online/TextFileParser.cs`
- [Peak chart](https://github.com/tacman1981/connect-log-parser/blob/main/Peak%20Online/MainWindow.xaml.cs): `Peak Online/MainWindow.xaml.cs`

### User preferences

- [Isolated settings](https://github.com/tacman1981/connect-log-parser/blob/main/Peak%20Online/MainWindow.xaml.cs): `Peak Online/MainWindow.xaml.cs`

### Other components

- **Player events**
- **Viewer user**

## Connections

- Player events → Connect logger: triggers hooks (evidence: `ConnectLogger.cs`)
- Connect logger → Connection log: writes events (evidence: `ConnectLogger.cs`)
- Viewer user → Window workflow: selects log (evidence: `Peak Online/MainWindow.xaml.cs`)
- Window workflow → Log parsing: passes path (evidence: `Peak Online/MainWindow.xaml.cs`)
- Connection log → Log parsing: reads lines (evidence: `Peak Online/TextFileParser.cs`)
- Log parsing → Daily peak calculation: calculates peaks (evidence: `Peak Online/TextFileParser.cs`)
- Window workflow → Peak chart: renders bars (evidence: `Peak Online/MainWindow.xaml.cs`)
- Daily peak calculation → Peak chart: supplies values (evidence: `Peak Online/MainWindow.xaml.cs`)
- Window workflow → Isolated settings: reads and writes (evidence: `Peak Online/MainWindow.xaml.cs`)
