# flightgear/fgms architecture

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

- Interactive diagram: https://gitdiagram.com/flightgear/fgms
- Repository: https://github.com/flightgear/fgms

## Overview

FGMS is a standalone network server for FlightGear multiplayer: pilots use it to fly together over a network. The apparent runtime centers on server startup, configuration, multiplayer handling, and network communication, with tracking, administration, protocol support, and logging as supporting concerns. The README documents the user-facing workflow, but the server implementation files were not sampled; dashed, uncited links mark inferred runtime relationships rather than verified calls.

Main entry points: [`src/server/fg_server.cxx`](https://github.com/flightgear/fgms/blob/master/src/server/fg_server.cxx) (Multiplayer server), [`src/server/main.cxx`](https://github.com/flightgear/fgms/blob/master/src/server/main.cxx) (Server startup), [`src/flightgear/MultiPlayer/tiny_xdr.cxx`](https://github.com/flightgear/fgms/blob/master/src/flightgear/MultiPlayer/tiny_xdr.cxx) (MP protocol encoding), [`src/server/fg_cli.cxx`](https://github.com/flightgear/fgms/blob/master/src/server/fg_cli.cxx) (Server CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Server runtime"]
  node_entry["Server startup<br/>[main.cxx]"]
  node_config["Server configuration<br/>[fg_config.cxx]"]
  node_server["Multiplayer server<br/>[fg_server.cxx]"]
end

subgraph group_domain["Multiplayer services"]
  node_tracker["Pilot tracking<br/>[fg_tracker.cxx]"]
  node_geometry["Flight geometry<br/>[fg_geometry.cxx]"]
  node_lists["Server lists<br/>[fg_list.cxx]"]
  node_protocol["MP protocol encoding<br/>[tiny_xdr.cxx]"]
  node_messages["MP messages<br/>[mpmessages.hxx]"]
end

subgraph group_interfaces["Network and administration"]
  node_sockets["Socket wrapper<br/>[netSocket.cxx]"]
  node_admin["Server CLI<br/>[fg_cli.cxx]"]
  node_cli["CLI framework<br/>[libcli.cxx]"]
  node_daemon["Daemon control<br/>[daemon.cxx]"]
end

subgraph group_support["Shared support"]
  node_logging["Logging<br/>[logstream.cxx]"]
  node_wincrypt["Windows CLI crypt<br/>[crypt-win.c]"]
  node_portability["Compiler portability<br/>[compiler.h]"]
  node_debugtypes["Debug categories<br/>[debug_types.h]"]
end

node_pilots(("FlightGear pilots"))

node_pilots -->|"connect over network"| node_server
node_entry -.->|"loads configuration"| node_config
node_entry -.->|"starts server"| node_server
node_server -.->|"communicates over"| node_sockets
node_server -.->|"encodes multiplayer data"| node_protocol
node_protocol -.->|"encodes messages"| node_messages
node_server -.->|"updates tracking"| node_tracker
node_server -.->|"uses flight geometry"| node_geometry
node_server -.->|"uses server lists"| node_lists
node_admin -.->|"uses CLI framework"| node_cli
node_server -.->|"exposes administration"| node_admin
node_entry -.->|"controls daemon"| node_daemon
node_server -.->|"logs activity"| node_logging
node_cli -.->|"may use on Windows"| node_wincrypt
node_logging -.->|"uses debug categories"| node_debugtypes

click node_entry "https://github.com/flightgear/fgms/blob/master/src/server/main.cxx"
click node_config "https://github.com/flightgear/fgms/blob/master/src/server/fg_config.cxx"
click node_server "https://github.com/flightgear/fgms/blob/master/src/server/fg_server.cxx"
click node_tracker "https://github.com/flightgear/fgms/blob/master/src/server/fg_tracker.cxx"
click node_geometry "https://github.com/flightgear/fgms/blob/master/src/server/fg_geometry.cxx"
click node_lists "https://github.com/flightgear/fgms/blob/master/src/server/fg_list.cxx"
click node_protocol "https://github.com/flightgear/fgms/blob/master/src/flightgear/MultiPlayer/tiny_xdr.cxx"
click node_messages "https://github.com/flightgear/fgms/blob/master/src/flightgear/MultiPlayer/mpmessages.hxx"
click node_sockets "https://github.com/flightgear/fgms/blob/master/src/plib/netSocket.cxx"
click node_admin "https://github.com/flightgear/fgms/blob/master/src/server/fg_cli.cxx"
click node_cli "https://github.com/flightgear/fgms/blob/master/src/libcli/libcli.cxx"
click node_daemon "https://github.com/flightgear/fgms/blob/master/src/server/daemon.cxx"
click node_logging "https://github.com/flightgear/fgms/blob/master/src/simgear/debug/logstream.cxx"
click node_wincrypt "https://github.com/flightgear/fgms/blob/master/src/libcli/crypt-win.c"
click node_portability "https://github.com/flightgear/fgms/blob/master/src/simgear/compiler.h"
click node_debugtypes "https://github.com/flightgear/fgms/blob/master/src/simgear/debug/debug_types.h"

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_entry,node_config,node_server toneBlue
class node_tracker,node_geometry,node_lists,node_protocol,node_messages toneAmber
class node_sockets,node_admin,node_cli,node_daemon toneMint
class node_logging,node_wincrypt,node_portability,node_debugtypes toneRose
class node_pilots toneIndigo
```

## Components

### Server runtime

- [Server startup](https://github.com/flightgear/fgms/blob/master/src/server/main.cxx): `src/server/main.cxx`
- [Server configuration](https://github.com/flightgear/fgms/blob/master/src/server/fg_config.cxx): `src/server/fg_config.cxx`
- [Multiplayer server](https://github.com/flightgear/fgms/blob/master/src/server/fg_server.cxx): `src/server/fg_server.cxx`

### Multiplayer services

- [Pilot tracking](https://github.com/flightgear/fgms/blob/master/src/server/fg_tracker.cxx): `src/server/fg_tracker.cxx`
- [Flight geometry](https://github.com/flightgear/fgms/blob/master/src/server/fg_geometry.cxx): `src/server/fg_geometry.cxx`
- [Server lists](https://github.com/flightgear/fgms/blob/master/src/server/fg_list.cxx): `src/server/fg_list.cxx`
- [MP protocol encoding](https://github.com/flightgear/fgms/blob/master/src/flightgear/MultiPlayer/tiny_xdr.cxx): `src/flightgear/MultiPlayer/tiny_xdr.cxx`
- [MP messages](https://github.com/flightgear/fgms/blob/master/src/flightgear/MultiPlayer/mpmessages.hxx): `src/flightgear/MultiPlayer/mpmessages.hxx`

### Network and administration

- [Socket wrapper](https://github.com/flightgear/fgms/blob/master/src/plib/netSocket.cxx): `src/plib/netSocket.cxx`
- [Server CLI](https://github.com/flightgear/fgms/blob/master/src/server/fg_cli.cxx): `src/server/fg_cli.cxx`
- [CLI framework](https://github.com/flightgear/fgms/blob/master/src/libcli/libcli.cxx): `src/libcli/libcli.cxx`
- [Daemon control](https://github.com/flightgear/fgms/blob/master/src/server/daemon.cxx): `src/server/daemon.cxx`

### Shared support

- [Logging](https://github.com/flightgear/fgms/blob/master/src/simgear/debug/logstream.cxx): `src/simgear/debug/logstream.cxx`
- [Windows CLI crypt](https://github.com/flightgear/fgms/blob/master/src/libcli/crypt-win.c): `src/libcli/crypt-win.c`
- [Compiler portability](https://github.com/flightgear/fgms/blob/master/src/simgear/compiler.h): `src/simgear/compiler.h`
- [Debug categories](https://github.com/flightgear/fgms/blob/master/src/simgear/debug/debug_types.h): `src/simgear/debug/debug_types.h`

### Other components

- **FlightGear pilots**

## Connections

- FlightGear pilots → Multiplayer server: connect over network (evidence: `README.md`)
- Server startup → Server configuration: loads configuration
- Server startup → Multiplayer server: starts server
- Multiplayer server → Socket wrapper: communicates over
- Multiplayer server → MP protocol encoding: encodes multiplayer data
- MP protocol encoding → MP messages: encodes messages
- Multiplayer server → Pilot tracking: updates tracking
- Multiplayer server → Flight geometry: uses flight geometry
- Multiplayer server → Server lists: uses server lists
- Server CLI → CLI framework: uses CLI framework
- Multiplayer server → Server CLI: exposes administration
- Server startup → Daemon control: controls daemon
- Multiplayer server → Logging: logs activity
- CLI framework → Windows CLI crypt: may use on Windows
- Logging → Debug categories: uses debug categories
