6#include "../audio/IAudioManager.hpp"
19 App(
int argc,
char** argv);
The main application class that manages the game state, network communication, and rendering....
bool _connectWithRetry(TcpSocket &socket, const std::string &host, int port)
Attempts to connect with exponential backoff. Returns true on success.
std::unique_ptr< IAudioManager > _audioManager
std::chrono::steady_clock::time_point _lastStuSent
void _trySendStu(TcpSocket &socket)
Sends stu once per real second and silences it after 3 consecutive non-responses.
bool shouldRun() const
Checks if the application should run based on the parsed arguments.
int exitCode() const
Gets the exit code to return if the application should not run.
void _resetStuState()
Resets stu polling state, called on reconnect.
void pollAndEnqueue(TcpSocket &socket, EventQueue &queue)
Polls the socket for new data and enqueues any received events.
void run()
Runs the application.
Thread-safe queue for storing events received from the server. Allows for potential multi-threaded be...
Represents the current state of the game. Knows the world state, some metadata, and how to apply even...
Simple TCP socket wrapper.