]> git.localhorst.tv Git - blank.git/blobdiff - src/server/Server.hpp
some linting
[blank.git] / src / server / Server.hpp
index 3bffafc29d2ada80307be32b5cab2269c49a6a65..9b89ab1bbc94692a400c7a3a6eda0054ca98a161 100644 (file)
@@ -14,6 +14,7 @@
 namespace blank {
 
 class ChunkIndex;
+class CLIContext;
 class Model;
 class Player;
 class WorldSave;
@@ -29,6 +30,10 @@ public:
        Server(const Config::Network &, World &, const World::Config &, const WorldSave &);
        ~Server();
 
+       // wait for data to arrive for at most dt milliseconds
+       void Wait(int dt) noexcept;
+       // true if there's data waiting to be handled
+       bool Ready() noexcept;
        void Handle();
 
        void Update(int dt);
@@ -48,7 +53,7 @@ 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 &);
+       void DispatchMessage(CLIContext &, const std::string &);
 
        /// send message to all connected clients
        void DistributeMessage(std::uint8_t type, std::uint32_t ref, const std::string &msg);
@@ -63,6 +68,7 @@ private:
 private:
        UDPsocket serv_sock;
        UDPpacket serv_pack;
+       SDLNet_SocketSet serv_set;
        std::list<ClientConnection> clients;
 
        World &world;