How deepsarda/project-armada works
Project Armada is a terminal-based, turn-based multiplayer strategy game. A player uses the TUI to host a match or discover/join one over LAN or a direct IP; the client exchanges lobby, match, turn, and action events with the server, which manages players and authoritative game state. The README describes economic upgrades, repairs, attacks, turn-taking, and victory conditions. Sampled code supports the client event flow, server networking, and gameplay callbacks; some documented features, including LAN discovery and portions of the UI, are represented at their enclosing source paths because their implementations were not fully sampled.
Main entry points: launcher.cpp Host and Play TUI · server.c Lobby and Turn Handling · client.c Client Transport · events.h Game Event Protocol
Components 19
Terminal Interface
- Application Entry
src/main.cpp - Host and Play TUI
src/client/launcher.cpp - UI Notifications
src/client/ui_notifications.cpp
Client Session
- Client Session API
src/networking/client.c - Client Session State
include/client/client_api.h - Client UI Callbacks
src/client/launcher.cpp
Server and Game
- Server Lifecycle
src/networking/server.c - Lobby and Turn Handling
src/networking/server.c - Gameplay Rules
src/server/main.c - Authoritative Game State
include/server/server_api.h - Server Callbacks
src/server/main.c - Server Contracts
include/server/main.h
Networking and Protocol
- Game Event Protocol
include/common/events.h - Game State Types
include/common/game_types.h - Socket Operations
src/networking/network.c - Client Transport
src/networking/client.c - Platform Sockets and Threads
include/networking/net_platform.h
Other components
- Player
- Other Players
Connections 26
- Player → Application Entry: launches
- Application Entry → Host and Play TUI: starts
- Player → Host and Play TUI: uses
- Host and Play TUI → Client Session API: joins and acts
- Host and Play TUI → Server Lifecycle: hosts locally
- Host and Play TUI → Client Session State: reads session
- Client Session API → Client Session State: updates
- Client Session API → Client Transport: sends and pumps
- Client Transport → Socket Operations: uses sockets
- Socket Operations → Platform Sockets and Threads: uses
- Client Transport → Game Event Protocol: encodes events
- Game Event Protocol → Game State Types: carries state
- Client Transport → Client UI Callbacks: dispatches events
- Client UI Callbacks → Host and Play TUI: updates interface
- Host and Play TUI → UI Notifications: logs activity
- Server Lifecycle → Lobby and Turn Handling: dispatches clients
- Lobby and Turn Handling → Socket Operations: uses sockets
- Lobby and Turn Handling → Game Event Protocol: handles events
- Lobby and Turn Handling → Authoritative Game State: reads and updates
- Lobby and Turn Handling → Gameplay Rules: processes actions
- Gameplay Rules → Authoritative Game State: applies game rules
- Lobby and Turn Handling → Server Callbacks: reports lifecycle
- Server Callbacks → UI Notifications: logs activity
- Server Contracts → Lobby and Turn Handling: declares handlers
- Server Lifecycle → Other Players: accepts connections
- Host and Play TUI → Server Lifecycle: starts discovery scan