1 #ifndef BLANK_NET_CLIENT_HPP_
2 #define BLANK_NET_CLIENT_HPP_
4 #include "Connection.hpp"
5 #include "../app/IntervalTimer.hpp"
19 std::string host = "localhost";
24 explicit Client(const Config &);
31 Connection &GetConnection() noexcept { return conn; }
32 const Connection &GetConnection() const noexcept { return conn; }
34 std::uint16_t SendPing();
35 std::uint16_t SendLogin(const std::string &);
36 std::uint16_t SendPart();
37 // this may not send the update at all, in which case it returns -1
38 int SendPlayerUpdate(const Entity &);
41 void HandlePacket(const UDPpacket &);
45 UDPsocket client_sock;
46 UDPpacket client_pack;
47 IntervalTimer update_timer;