X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fnet%2FClient.hpp;h=5c0a9c2b378344f8e4c7db1700de664093bd0b69;hb=b5a83cd3df5083ed0cccfe4876143e788b3836f9;hp=5b83061ae48abc917e5bc5af5130a77a89a5d01f;hpb=104592aabdc70b21065c35fe4d092fc6cdaa1f49;p=blank.git diff --git a/src/net/Client.hpp b/src/net/Client.hpp index 5b83061..5c0a9c2 100644 --- a/src/net/Client.hpp +++ b/src/net/Client.hpp @@ -20,23 +20,24 @@ public: }; public: - Client(const Config &, World &); + explicit Client(const Config &); ~Client(); void Handle(); void Update(int dt); - bool TimedOut() { return conn.TimedOut(); } + Connection &GetConnection() noexcept { return conn; } + const Connection &GetConnection() const noexcept { return conn; } - void SendPing(); - void SendLogin(const std::string &); + std::uint16_t SendPing(); + std::uint16_t SendLogin(const std::string &); + std::uint16_t SendPlayerUpdate(const Entity &); private: void HandlePacket(const UDPpacket &); private: - World &world; Connection conn; UDPsocket client_sock; UDPpacket client_pack;