# Commonwealth Online - Qt GUI Host Production-ready Qt6 GUI application for hosting Commonwealth Online servers on Windows. ## Features - **Start/Stop Server**: One-click server control with live status indicator - **Real-time Stats**: Monitor uptime, connected players, packet rates - **Client List**: Live table showing connected clients and their connection details - **Server Logs**: Real-time log viewer with timestamps - **Dark Theme**: Fallout 4-inspired dark UI with amber/green accents - **Auto-detection**: Automatically finds Python and server directory - **Subprocess Management**: Server runs in separate process; GUI crash doesn't kill server ## Requirements - Windows 10 or later - Qt 6.4+ - Visual Studio 2022 (MSVC) - CMake 3.20+ - Python 3.9+ (for running the relay server) ## Building ### From Visual Studio 1. Clone the repository 2. Open `CMakeLists.txt` in Visual Studio 3. Configure the project (Visual Studio should auto-detect Qt6) 4. Build → Build All 5. Run the executable ### From Command Line ```bash cd host-gui mkdir build cd build cmake .. -G "Visual Studio 17 2022" cmake --build . --config Release ``` ## First Run 1. Double-click `CommonwealthOnlineHost.exe` 2. Click "▶ Start Server" 3. Server will bind to 0.0.0.0:7777 (configurable in commonwealth-server.json) 4. View real-time logs and connected clients ## Configuration Edit `commonwealth-server.json` in the server folder to customize: - `host`: Bind address - `port`: Server port - `server_name`: Display name - `max_players`: Max player count - `log_verbosity`: debug/info/warning/error ## Layout ``` host-gui/ ├── CMakeLists.txt # Build configuration ├── README.md # This file ├── src/ │ ├── main.cpp # Application entry point │ ├── MainWindow.h/cpp # Main window UI and logic │ ├── ServerProcess.h/cpp # Subprocess manager for relay server │ └── resources/ │ ├── resources.qrc # Qt resource manifest │ └── icons/ │ └── app.ico # Application icon └── build/ # Build output directory └── bin/ └── CommonwealthOnlineHost.exe ``` ## Architecture The GUI spawns the Python relay server (`consumer_server_cli.py`) as a subprocess and: - Captures stdout/stderr for real-time logs - Parses log output to extract stats and client info - Provides UI for server control and monitoring - Maintains server state even if GUI crashes ## Future Enhancements - Admin commands (set time/weather directly from GUI) - Config file editor in GUI - Player kick/ban buttons - System tray icon with quick access - Settings panel for port customization - Server history and logs export