X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fserver%2FServer.hpp;h=3bffafc29d2ada80307be32b5cab2269c49a6a65;hb=da06ac178d2c083249f8cb2b2c0bef799c079cfd;hp=cef98beaeba764844059a5663179513f5fcd5ce6;hpb=eba29c8ad489194cd1e3cd64b5f23424ad4384ef;p=blank.git diff --git a/src/server/Server.hpp b/src/server/Server.hpp index cef98be..3bffafc 100644 --- a/src/server/Server.hpp +++ b/src/server/Server.hpp @@ -2,9 +2,11 @@ #define BLANK_SERVER_SERVER_HPP #include "../app/Config.hpp" +#include "../shared/CLI.hpp" #include "../world/World.hpp" #include "../world/WorldManipulator.hpp" +#include #include #include @@ -45,11 +47,19 @@ public: void SetBlock(Chunk &, int, const Block &) override; + /// for use by client connections when they receive a line from the player + void DispatchMessage(Player &, const std::string &); + + /// send message to all connected clients + void DistributeMessage(std::uint8_t type, std::uint32_t ref, const std::string &msg); + private: void HandlePacket(const UDPpacket &); ClientConnection &GetClient(const IPaddress &); + void SendAll(); + private: UDPsocket serv_sock; UDPpacket serv_pack; @@ -60,6 +70,8 @@ private: const WorldSave &save; const Model *player_model; + CLI cli; + }; }