aboutsummaryrefslogtreecommitdiff
path: root/server/src/forum/forum.h
diff options
context:
space:
mode:
authorauth <[email protected]>2020-07-13 23:05:20 +0200
committerauth <[email protected]>2020-07-13 23:05:20 +0200
commite177151308cbdfb2b96119389cf5bf7c2659b94e (patch)
tree7e5737aca17322bf3d39ee5643b3ae2d5deea8f3 /server/src/forum/forum.h
parentSmall changes. (diff)
downloadloader-e177151308cbdfb2b96119389cf5bf7c2659b94e.tar.xz
loader-e177151308cbdfb2b96119389cf5bf7c2659b94e.zip
Forum integration.
Added separate packet ids for login request/response. Added login responses. Small code changes.
Diffstat (limited to 'server/src/forum/forum.h')
-rw-r--r--server/src/forum/forum.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/server/src/forum/forum.h b/server/src/forum/forum.h
new file mode 100644
index 0000000..df18cb4
--- /dev/null
+++ b/server/src/forum/forum.h
@@ -0,0 +1,24 @@
+#pragma once
+#include <cpr/cpr.h>
+#include <json.hpp>
+// XenForo forum api wrapper
+
+struct user_data {
+ std::string hwid;
+ bool banned;
+ bool active;
+};
+
+enum forum_response { api_fail = 0, api_error, api_timeout, api_success };
+
+class xenforo_forum {
+ std::string m_link;
+ std::string m_api;
+
+ cpr::Header m_header;
+
+ public:
+ void init(const std::string_view link, const std::string_view key);
+ int check_login(const std::string_view username,
+ const std::string_view password, user_data &data);
+}; \ No newline at end of file