# tanboy4u/gaydar architecture

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

- Interactive diagram: https://gitdiagram.com/tanboy4u/gaydar
- Repository: https://github.com/tanboy4u/gaydar

## Overview

Gaydar is a PUBG network radar: it captures live traffic or replays a PCAP, decodes replicated game state, and presents the resulting map and overlays. The graph preserves the packet, channel, actor, and game-specific decoding stages alongside the map UI and settings. Edges are limited to calls or data access shown in excerpts or the source index; some domain-decoder dispatch details were not sampled and are left unconnected.

Main entry points: [`src/main/kotlin/gaydar/ui/GLMap.kt`](https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/ui/GLMap.kt) (Radar map UI), [`src/main/kotlin/gaydar/deserializer/channel/ActorChannel.kt`](https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/deserializer/channel/ActorChannel.kt) (Actor channel), [`src/main/kotlin/gaydar/deserializer/PacketParser.kt`](https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/deserializer/PacketParser.kt) (Packet parser), [`src/main/kotlin/gaydar/Game.kt`](https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/Game.kt) (Application entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture and decoding"]
  node_game["Application entry<br/>[Game.kt]"]
  node_sniffer["Traffic capture<br/>[Sniffer.kt]"]
  node_parser["Packet parser<br/>[PacketParser.kt]"]
  node_buffer["Bit buffer<br/>[Buffer.kt]"]
  node_channel["Channel sequencing<br/>[Channel.kt]"]
  node_control["Control channel<br/>[ControlChannel.kt]"]
end

subgraph group_state["Replicated game state"]
  node_bunch["Replicated bunch<br/>[Bunch.kt]"]
  node_actorchannel["Actor channel<br/>[ActorChannel.kt]"]
  node_actor["Actor model<br/>[Actor.kt]"]
  node_guid["Network GUID<br/>[NetworkGUID.kt]"]
  node_guidcache["GUID cache<br/>[NetGuidCache.kt]"]
  node_commands["Game decoders"]
  node_items["Item data<br/>[Item.kt]"]
end

subgraph group_presentation["Map and presentation"]
  node_map["Radar map UI<br/>[GLMap.kt]"]
  node_settings["User settings<br/>[Settings.kt]"]
end

node_user(("Operator"))
node_gametraffic(("Game traffic"))
node_pcap["PCAP input"]

node_user -->|"launches"| node_game
node_game -->|"starts capture"| node_sniffer
node_game -->|"loads settings"| node_settings
node_game -->|"opens UI"| node_map
node_gametraffic -->|"supplies packets"| node_sniffer
node_pcap -->|"provides replay"| node_sniffer
node_sniffer -->|"queues and parses"| node_parser
node_parser -->|"reads packet bits"| node_buffer
node_parser -->|"dispatches channels"| node_channel
node_parser -->|"dispatches control"| node_control
node_parser -->|"constructs bunches"| node_bunch
node_channel -->|"orders bunches"| node_bunch
node_actorchannel -->|"extends channel"| node_channel
node_actorchannel -->|"processes bunches"| node_bunch
node_bunch -->|"inherits reads"| node_buffer
node_buffer -->|"resolves object IDs"| node_guidcache
node_actorchannel -->|"creates and updates"| node_actor
node_actorchannel -->|"indexes replicated actors"| node_guid
node_actorchannel -->|"decodes properties"| node_commands
node_commands -->|"updates actor state"| node_actor
node_map -->|"reads live state"| node_actorchannel
node_map -->|"renders actors"| node_actor
node_map -->|"uses game state"| node_commands
node_map -->|"renders item data"| node_items
node_map -->|"reads display options"| node_settings

click node_game "https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/Game.kt"
click node_sniffer "https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/Sniffer.kt"
click node_parser "https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/deserializer/PacketParser.kt"
click node_buffer "https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/deserializer/Buffer.kt"
click node_channel "https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/deserializer/channel/Channel.kt"
click node_control "https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/deserializer/channel/ControlChannel.kt"
click node_bunch "https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/struct/Bunch.kt"
click node_actorchannel "https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/deserializer/channel/ActorChannel.kt"
click node_actor "https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/struct/Actor.kt"
click node_guid "https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/struct/NetworkGUID.kt"
click node_guidcache "https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/struct/NetGuidCache.kt"
click node_commands "https://github.com/tanboy4u/gaydar/tree/master/src/main/kotlin/gaydar/struct/CMD"
click node_items "https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/struct/Item.kt"
click node_map "https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/ui/GLMap.kt"
click node_settings "https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/util/Settings.kt"

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_game,node_sniffer,node_parser,node_buffer,node_channel,node_control toneBlue
class node_bunch,node_actorchannel,node_actor,node_guid,node_guidcache,node_commands,node_items toneAmber
class node_map,node_settings toneMint
class node_user,node_gametraffic,node_pcap toneIndigo
```

## Components

### Capture and decoding

- [Application entry](https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/Game.kt): `src/main/kotlin/gaydar/Game.kt`
- [Traffic capture](https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/Sniffer.kt): `src/main/kotlin/gaydar/Sniffer.kt`
- [Packet parser](https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/deserializer/PacketParser.kt): `src/main/kotlin/gaydar/deserializer/PacketParser.kt`
- [Bit buffer](https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/deserializer/Buffer.kt): `src/main/kotlin/gaydar/deserializer/Buffer.kt`
- [Channel sequencing](https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/deserializer/channel/Channel.kt): `src/main/kotlin/gaydar/deserializer/channel/Channel.kt`
- [Control channel](https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/deserializer/channel/ControlChannel.kt): `src/main/kotlin/gaydar/deserializer/channel/ControlChannel.kt`

### Replicated game state

- [Replicated bunch](https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/struct/Bunch.kt): `src/main/kotlin/gaydar/struct/Bunch.kt`
- [Actor channel](https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/deserializer/channel/ActorChannel.kt): `src/main/kotlin/gaydar/deserializer/channel/ActorChannel.kt`
- [Actor model](https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/struct/Actor.kt): `src/main/kotlin/gaydar/struct/Actor.kt`
- [Network GUID](https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/struct/NetworkGUID.kt): `src/main/kotlin/gaydar/struct/NetworkGUID.kt`
- [GUID cache](https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/struct/NetGuidCache.kt): `src/main/kotlin/gaydar/struct/NetGuidCache.kt`
- [Game decoders](https://github.com/tanboy4u/gaydar/tree/master/src/main/kotlin/gaydar/struct/CMD): `src/main/kotlin/gaydar/struct/CMD`
- [Item data](https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/struct/Item.kt): `src/main/kotlin/gaydar/struct/Item.kt`

### Map and presentation

- [Radar map UI](https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/ui/GLMap.kt): `src/main/kotlin/gaydar/ui/GLMap.kt`
- [User settings](https://github.com/tanboy4u/gaydar/blob/master/src/main/kotlin/gaydar/util/Settings.kt): `src/main/kotlin/gaydar/util/Settings.kt`

### Other components

- **Operator**
- **Game traffic**
- **PCAP input**

## Connections

- Operator → Application entry: launches (evidence: `src/main/kotlin/gaydar/Game.kt`)
- Application entry → Traffic capture: starts capture (evidence: `src/main/kotlin/gaydar/Game.kt`)
- Application entry → User settings: loads settings (evidence: `src/main/kotlin/gaydar/Game.kt`)
- Application entry → Radar map UI: opens UI (evidence: `src/main/kotlin/gaydar/Game.kt`)
- Game traffic → Traffic capture: supplies packets (evidence: `src/main/kotlin/gaydar/Sniffer.kt`)
- PCAP input → Traffic capture: provides replay
- Traffic capture → Packet parser: queues and parses (evidence: `src/main/kotlin/gaydar/Sniffer.kt`)
- Packet parser → Bit buffer: reads packet bits (evidence: `src/main/kotlin/gaydar/deserializer/PacketParser.kt`)
- Packet parser → Channel sequencing: dispatches channels (evidence: `src/main/kotlin/gaydar/deserializer/PacketParser.kt`)
- Packet parser → Control channel: dispatches control (evidence: `src/main/kotlin/gaydar/deserializer/PacketParser.kt`)
- Packet parser → Replicated bunch: constructs bunches (evidence: `src/main/kotlin/gaydar/deserializer/PacketParser.kt`)
- Channel sequencing → Replicated bunch: orders bunches (evidence: `src/main/kotlin/gaydar/deserializer/channel/Channel.kt`)
- Actor channel → Channel sequencing: extends channel (evidence: `src/main/kotlin/gaydar/deserializer/channel/ActorChannel.kt`)
- Actor channel → Replicated bunch: processes bunches (evidence: `src/main/kotlin/gaydar/deserializer/channel/ActorChannel.kt`)
- Replicated bunch → Bit buffer: inherits reads (evidence: `src/main/kotlin/gaydar/struct/Bunch.kt`)
- Bit buffer → GUID cache: resolves object IDs (evidence: `src/main/kotlin/gaydar/deserializer/Buffer.kt`)
- Actor channel → Actor model: creates and updates (evidence: `src/main/kotlin/gaydar/deserializer/channel/ActorChannel.kt`)
- Actor channel → Network GUID: indexes replicated actors (evidence: `src/main/kotlin/gaydar/deserializer/channel/ActorChannel.kt`)
- Actor channel → Game decoders: decodes properties (evidence: `src/main/kotlin/gaydar/deserializer/channel/ActorChannel.kt`)
- Game decoders → Actor model: updates actor state (evidence: `src/main/kotlin/gaydar/struct/CMD/ActorCMD.kt`)
- Radar map UI → Actor channel: reads live state (evidence: `src/main/kotlin/gaydar/ui/GLMap.kt`)
- Radar map UI → Actor model: renders actors (evidence: `src/main/kotlin/gaydar/ui/GLMap.kt`)
- Radar map UI → Game decoders: uses game state (evidence: `src/main/kotlin/gaydar/ui/GLMap.kt`)
- Radar map UI → Item data: renders item data (evidence: `src/main/kotlin/gaydar/ui/GLMap.kt`)
- Radar map UI → User settings: reads display options (evidence: `src/main/kotlin/gaydar/ui/GLMap.kt`)
