aboutsummaryrefslogtreecommitdiff
path: root/server/src/client/blacklist.h
diff options
context:
space:
mode:
authorauth <[email protected]>2020-07-14 16:16:02 +0200
committerauth <[email protected]>2020-07-14 16:16:02 +0200
commit275010eaa0a46012fec547efdd76256b25e47f54 (patch)
tree00d9e0a19424c3e3d81e2ed74d7986da987123d1 /server/src/client/blacklist.h
parentForum integration. (diff)
downloadloader-275010eaa0a46012fec547efdd76256b25e47f54.tar.xz
loader-275010eaa0a46012fec547efdd76256b25e47f54.zip
Client login handling on server.
More error handling for forum responses.
Diffstat (limited to 'server/src/client/blacklist.h')
-rw-r--r--server/src/client/blacklist.h16
1 files changed, 2 insertions, 14 deletions
diff --git a/server/src/client/blacklist.h b/server/src/client/blacklist.h
index 70f5c7a..b2bc9f8 100644
--- a/server/src/client/blacklist.h
+++ b/server/src/client/blacklist.h
@@ -1,10 +1,5 @@
#pragma once
-struct blacklist_data {
- std::string ip;
- std::string hwid;
-};
-
class blacklist {
nlohmann::json m_data;
std::string m_name;
@@ -24,9 +19,8 @@ class blacklist {
m_data = nlohmann::json::parse(data);
}
- void add(const blacklist_data &data) {
- m_data["ips"].emplace_back(data.ip);
- m_data["hwids"].emplace_back(data.hwid);
+ void add(const std::string_view hwid) {
+ m_data["hwids"].emplace_back(hwid);
save();
}
@@ -38,12 +32,6 @@ class blacklist {
}
bool find(const std::string &key) {
- for (auto &item : m_data["ips"]) {
- if (item.get<std::string>() == key) {
- return true;
- }
- }
-
for (auto &item : m_data["hwids"]) {
if (item.get<std::string>() == key) {
return true;