R-Type  2
Doom but in better
Loading...
Searching...
No Matches
Server Class Reference

The main UDP server that accepts client messages and updates the game logic. More...

#include <server.hpp>

Inheritance diagram for Server:
Inheritance graph
Collaboration diagram for Server:
Collaboration graph

Public Member Functions

 Server (asio::io_context &io, unsigned short port)
 Constructs the Server, binding a UDP socket to the specified port.
 
GameManagergetGameManager ()
 Accessor for the GameManager that manages multiple games.
 
void sendToClient (uint32_t clientId, const Message &msg)
 Sends a Message to a specific client by ID (uses clientManager to find endpoint).
 

Detailed Description

The main UDP server that accepts client messages and updates the game logic.

Definition at line 18 of file server.hpp.

Constructor & Destructor Documentation

◆ Server()

Server::Server ( asio::io_context & io,
unsigned short port )

Constructs the Server, binding a UDP socket to the specified port.

Parameters
ioThe Asio io_context for async operations.
portThe UDP port for listening (e.g. 9000).

Definition at line 4 of file server.cpp.

Member Function Documentation

◆ getGameManager()

GameManager & Server::getGameManager ( )
inline

Accessor for the GameManager that manages multiple games.

Returns
Reference to the GameManager instance.

Definition at line 31 of file server.hpp.

◆ sendToClient()

void Server::sendToClient ( uint32_t clientId,
const Message & msg )

Sends a Message to a specific client by ID (uses clientManager to find endpoint).

Parameters
clientIdThe unique ID of the client.
msgThe message to send.

Definition at line 80 of file server.cpp.


The documentation for this class was generated from the following files: