diff options
| author | auth12 <[email protected]> | 2020-07-27 09:46:17 -0700 |
|---|---|---|
| committer | auth12 <[email protected]> | 2020-07-27 09:46:17 -0700 |
| commit | a2e89fde1acc5b189c55e0b8b38146194e455cd0 (patch) | |
| tree | 1f130027975733e0704a583aebb1a1832a22ec11 /server/src/client | |
| parent | Compile fix. (diff) | |
| download | loader-a2e89fde1acc5b189c55e0b8b38146194e455cd0.tar.xz loader-a2e89fde1acc5b189c55e0b8b38146194e455cd0.zip | |
Removed spdlog, using fmt wrapper instead.
More process class changes, support for 32/64bit processes.
Injection process improvements.
Other small changes.
Diffstat (limited to 'server/src/client')
| -rw-r--r-- | server/src/client/blacklist.h | 6 | ||||
| -rw-r--r-- | server/src/client/client.cpp | 8 | ||||
| -rw-r--r-- | server/src/client/client.h | 5 |
3 files changed, 9 insertions, 10 deletions
diff --git a/server/src/client/blacklist.h b/server/src/client/blacklist.h index b2bc9f8..f016f17 100644 --- a/server/src/client/blacklist.h +++ b/server/src/client/blacklist.h @@ -19,7 +19,7 @@ class blacklist { m_data = nlohmann::json::parse(data); } - void add(const std::string_view hwid) { + void add(const uint32_t hwid) { m_data["hwids"].emplace_back(hwid); save(); @@ -31,9 +31,9 @@ class blacklist { o.close(); } - bool find(const std::string &key) { + bool find(const uint32_t key) { for (auto &item : m_data["hwids"]) { - if (item.get<std::string>() == key) { + if (item.get<uint32_t>() == key) { return true; } } diff --git a/server/src/client/client.cpp b/server/src/client/client.cpp index 9b46574..11a6cfb 100644 --- a/server/src/client/client.cpp +++ b/server/src/client/client.cpp @@ -19,8 +19,7 @@ bool tcp::client::init_ssl(SSL_CTX* server_ctx) { if (ret <= 0) { int err = SSL_get_error(m_ssl, ret); - io::logger->error("{} failed to accept ssl, return code {}.", m_ip, - err); + io::logger->error("{} failed to accept ssl, return code {}.", m_ip, err); return false; } @@ -38,7 +37,7 @@ void tcp::client::gen_session() { } } -int tcp::client::stream(std::vector<char>& data, float *dur/*= nullptr*/) { +int tcp::client::stream(std::vector<char>& data, float* dur /*= nullptr*/) { auto size = data.size(); auto networked_size = htonl(size); @@ -63,8 +62,7 @@ int tcp::client::stream(std::vector<char>& data, float *dur/*= nullptr*/) { auto end = std::chrono::steady_clock::now(); std::chrono::duration<float> time = end - start; - if(dur) - *dur = time.count(); + if (dur) *dur = time.count(); return sent; } diff --git a/server/src/client/client.h b/server/src/client/client.h index 54df957..ef61b75 100644 --- a/server/src/client/client.h +++ b/server/src/client/client.h @@ -25,7 +25,8 @@ class client { std::string m_session_id; public: - std::string hwid; + uint32_t hwid; + std::string hwid_data; std::string username; int state; @@ -63,7 +64,7 @@ class client { int stream(std::vector<char>& data, float* dur = nullptr); int read_stream(std::vector<char>& out); - int stream(std::string& str) { + int stream(const std::string_view str) { std::vector<char> vec(str.begin(), str.end()); return stream(vec); } |