diff options
| author | auth <[email protected]> | 2020-07-05 11:25:10 +0200 |
|---|---|---|
| committer | auth <[email protected]> | 2020-07-05 11:25:10 +0200 |
| commit | e1ca40bf09255ea74602a6b31e0e17ae611e3e3b (patch) | |
| tree | d163ae07461108a2667107153b72180f69981a9c /server/src/client | |
| parent | Replaced std::byte by uint8_t (diff) | |
| download | loader-e1ca40bf09255ea74602a6b31e0e17ae611e3e3b.tar.xz loader-e1ca40bf09255ea74602a6b31e0e17ae611e3e3b.zip | |
Added support for packet actions.
Added support for client hwid handling.
Removed timeout client message.
Diffstat (limited to 'server/src/client')
| -rw-r--r-- | server/src/client/client.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/server/src/client/client.h b/server/src/client/client.h index 52e0c42..4dad02e 100644 --- a/server/src/client/client.h +++ b/server/src/client/client.h @@ -13,6 +13,9 @@ class client { std::string m_session_id; public: + std::string hwid; + + client() : m_socket{-1} {}; client(const int& socket, const std::string_view ip) : m_socket{std::move(socket)}, m_ip{ip}, m_ssl{nullptr} {} @@ -27,7 +30,7 @@ class client { } void reset() { std::time(&m_time); } - bool timeout() { return std::difftime(std::time(nullptr), m_time) >= 30; } + bool timeout() { return std::difftime(std::time(nullptr), m_time) >= 300; } int write(const packet_t& packet) { if (!packet) return 0; @@ -57,8 +60,8 @@ class client { void gen_session(); - int get_socket() { return m_socket; } - auto get_ip() { return m_ip; } - auto get_session() { return m_session_id; } + int &get_socket() { return m_socket; } + auto &get_ip() { return m_ip; } + auto &get_session() { return m_session_id; } }; }; // namespace tcp
\ No newline at end of file |