X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fserver%2FServer.hpp;h=683d36254c76523a6ba5afddd84c2607ae204292;hb=dbd214ac278019c20c883cbb76456b0b0fddc063;hp=c12b86aa75ba0b4d9e17e726aab2c54c44474491;hpb=d91257ba2a51416683be3f54fe16cb2e96ae29f5;p=blank.git diff --git a/src/server/Server.hpp b/src/server/Server.hpp index c12b86a..683d362 100644 --- a/src/server/Server.hpp +++ b/src/server/Server.hpp @@ -5,6 +5,7 @@ #include "../world/World.hpp" #include "../world/WorldManipulator.hpp" +#include #include #include @@ -12,7 +13,7 @@ namespace blank { class ChunkIndex; -class CompositeModel; +class Model; class Player; class WorldSave; @@ -37,19 +38,24 @@ public: World &GetWorld() noexcept { return world; } const WorldSave &GetWorldSave() noexcept { return save; } - void SetPlayerModel(const CompositeModel &) noexcept; + void SetPlayerModel(const Model &) noexcept; bool HasPlayerModel() const noexcept; - const CompositeModel &GetPlayerModel() const noexcept; + const Model &GetPlayerModel() const noexcept; Player *JoinPlayer(const std::string &name); 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; @@ -58,7 +64,7 @@ private: World &world; ChunkIndex &spawn_index; const WorldSave &save; - const CompositeModel *player_model; + const Model *player_model; };