]> git.localhorst.tv Git - blank.git/blobdiff - src/server/Server.hpp
fix serverside player orientation
[blank.git] / src / server / Server.hpp
index c12b86aa75ba0b4d9e17e726aab2c54c44474491..3bffafc29d2ada80307be32b5cab2269c49a6a65 100644 (file)
@@ -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 <cstdint>
 #include <list>
 #include <SDL_net.h>
 
@@ -12,7 +14,7 @@
 namespace blank {
 
 class ChunkIndex;
-class CompositeModel;
+class Model;
 class Player;
 class WorldSave;
 
@@ -37,19 +39,27 @@ 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;
 
+       /// 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;
@@ -58,7 +68,9 @@ private:
        World &world;
        ChunkIndex &spawn_index;
        const WorldSave &save;
-       const CompositeModel *player_model;
+       const Model *player_model;
+
+       CLI cli;
 
 };