X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fserver%2FClientConnection.hpp;h=3ab0453e87a1d46e5c18262ad974bd3e01287f84;hb=d507e4b06e32aff46caacf961b310ba1050b232f;hp=57a34e49339a965655a170758a82603558bc6155;hpb=fa73e3600dee78063ab95e1903172ab339dcd4bd;p=blank.git diff --git a/src/server/ClientConnection.hpp b/src/server/ClientConnection.hpp index 57a34e4..3ab0453 100644 --- a/src/server/ClientConnection.hpp +++ b/src/server/ClientConnection.hpp @@ -2,6 +2,7 @@ #define BLANK_SERVER_CLIENTCONNECTION_HPP_ #include "ChunkTransmitter.hpp" +#include "NetworkCLIFeedback.hpp" #include "Server.hpp" #include "../app/IntervalTimer.hpp" #include "../ui/DirectInput.hpp" @@ -10,6 +11,7 @@ #include "../world/EntityState.hpp" #include "../world/Player.hpp" +#include #include #include #include @@ -39,6 +41,8 @@ public: Connection &GetConnection() noexcept { return conn; } bool Disconnected() const noexcept { return conn.Closed(); } + Server &GetServer() noexcept { return server; } + /// prepare a packet of given type template Type Prepare() const noexcept { @@ -63,6 +67,8 @@ public: bool ChunkInRange(const glm::ivec3 &) const noexcept; + std::uint16_t SendMessage(std::uint8_t type, std::uint32_t from, const std::string &msg); + private: struct SpawnStatus { // the entity in question @@ -105,6 +111,7 @@ private: Server &server; Connection conn; std::unique_ptr input; + std::unique_ptr cli_ctx; const Model *player_model; std::list spawns; unsigned int confirm_wait;