Zappy Server
C++ game server: world, rules, scheduler, network
Loading...
Searching...
No Matches
Server.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "core/Args.hpp"
4#include "core/Scheduler.hpp"
5#include "core/World.hpp"
9#include "logging/Logger.hpp"
11#include "network/Listener.hpp"
12
Owns every client socket and runs the poll() loop.
Sends each client line to the right handler.
The server's listening socket.
Definition Listener.hpp:31
Bridges the Observer hooks to the Logger.
Logging facade: formats [time] [LEVEL] [component] message, filters by level, and forwards to a singl...
Definition Logger.hpp:17
Priority queue of timed callbacks. Drives all game timing.
Definition Scheduler.hpp:23
Owns every subsystem and runs the main game loop.
Definition Server.hpp:20
bool _gameOverHandled
Definition Server.hpp:46
CommandDispatcher _dispatcher
Definition Server.hpp:45
void _logStartup() const
Definition Server.cpp:53
GuiNotifier _notifier
Definition Server.hpp:41
ClientManager _clients
Definition Server.hpp:39
static constexpr int RESPAWN_INTERVAL_MS
Resources respawn every 20 time units (subject spec).
Definition Server.hpp:35
Listener _listener
Definition Server.hpp:38
Logger _logger
Definition Server.hpp:42
ServerConfig _config
Definition Server.hpp:37
void _scheduleRespawn()
(Re)schedule the periodic world resource respawn.
Definition Server.cpp:45
void run()
Run the game loop until the process is stopped.
Definition Server.cpp:98
LogObserver _logObserver
Definition Server.hpp:43
World _world
Definition Server.hpp:40
Scheduler _scheduler
Definition Server.hpp:44
void _handleGameOver()
Freeze the world and log the winner banner. Runs once when a team wins.
Definition Server.cpp:63
Pure game state - no networking, no scheduling.
Definition World.hpp:47
Represents the configuration for the server application, described by:
Definition Args.hpp:17