31 #include <unordered_map>
33 #include "eng3d/network.hpp"
42 virtual const char*
what() const noexcept {
43 return buffer.c_str();
ServerException(const std::string &msg)
virtual const char * what() const noexcept
std::vector< ClientData > clients_data
void on_connect(int conn_fd, int id) override
void netloop(int id)
This is the handling thread-function for handling a connection to a single client Sending packets wil...
Server(GameState &gs, unsigned port=1825, unsigned max_conn=4)
std::unordered_map< ActionType, std::function< void(ClientData &client_data, const Eng3D::Networking::Packet &packet, Eng3D::Deser::Archive &ar)> > action_handlers
void on_disconnect() override
void handler(const Eng3D::Networking::Packet &packet, Eng3D::Deser::Archive &ar, int id) override
std::vector< Nation * > clients_extra_data
Base class that serves as archiver, stores (in memory) the data required for serialization/deserializ...
ClientData(GameState &_gs)