]> git.localhorst.tv Git - blank.git/blobdiff - src/server/Server.hpp
server: distribute received messages to clients
[blank.git] / src / server / Server.hpp
index cef98beaeba764844059a5663179513f5fcd5ce6..683d36254c76523a6ba5afddd84c2607ae204292 100644 (file)
@@ -5,6 +5,7 @@
 #include "../world/World.hpp"
 #include "../world/WorldManipulator.hpp"
 
+#include <cstdint>
 #include <list>
 #include <SDL_net.h>
 
@@ -45,11 +46,16 @@ public:
 
        void SetBlock(Chunk &, int, const Block &) override;
 
+       /// 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;