From 83d2c161795089312f506c377255cce11b240293 Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Mon, 17 Oct 2016 21:39:44 +0000 Subject: [PATCH] okies, she builds now so up next is making it actually do something useful --- external/3rd/library/libLeff/libLeff.h | 5 +++-- external/3rd/library/webAPI/webAPIHeartbeat.cpp | 14 +++++++------- external/3rd/library/webAPI/webAPIHeartbeat.h | 9 ++------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/external/3rd/library/libLeff/libLeff.h b/external/3rd/library/libLeff/libLeff.h index f6a0f2f5..28faae9f 100644 --- a/external/3rd/library/libLeff/libLeff.h +++ b/external/3rd/library/libLeff/libLeff.h @@ -70,7 +70,7 @@ template struct vxCplEncryptedString > { char Value[sizeof...(Idx) + 1]; // Buffer for a string // Compile-time constructor - constexpr inline vxCplEncryptedString(const char *const Str) : Value({vxCplEncryptChar(Str[Idx], Idx)...}) {} + constexpr inline vxCplEncryptedString(const char *const Str) : Value{vxCplEncryptChar(Str[Idx], Idx)...} {} // Run-time decryption char *decrypt() { @@ -83,4 +83,5 @@ template struct vxCplEncryptedString > { }; // Compile-time string encryption macro -#define vxENCRYPT(Str) (vxCplEncryptedString::Result>(Str).decrypt()) +//#define vxENCRYPT(Str) (vxCplEncryptedString::Result>(Str).decrypt()) +#define vxENCRYPT(Str) (vxCplEncryptedString::Result>(Str)) diff --git a/external/3rd/library/webAPI/webAPIHeartbeat.cpp b/external/3rd/library/webAPI/webAPIHeartbeat.cpp index c4b853d1..e3cd0670 100644 --- a/external/3rd/library/webAPI/webAPIHeartbeat.cpp +++ b/external/3rd/library/webAPI/webAPIHeartbeat.cpp @@ -6,16 +6,16 @@ using namespace StellaBellum; -webAPIHeartbeat:webAPIHeartbeat() { - vxCplEncryptedString u = vxENCRYPT("https://login.stellabellum.net/metriccontroller/shoulderTap?type=server"); +#define vxENCRYPT2(Str) (vxCplEncryptedString::Result>(Str)) - webAPI handle = webAPI::webAPI(u.decrypt()); +webAPIHeartbeat::webAPIHeartbeat() { + auto u = vxENCRYPT("https://login.stellabellum.net/metriccontroller/shoulderTap?type=server"); + + webAPI handle = webAPI::webAPI(std::string(u.decrypt())); handle.addJsonData("ip", "test"); - bool result = fetch.submit(); // data is stored as a class member + bool result = handle.submit(); // data is stored as a class member // do stuff - - delete handle; -}; \ No newline at end of file +}; diff --git a/external/3rd/library/webAPI/webAPIHeartbeat.h b/external/3rd/library/webAPI/webAPIHeartbeat.h index 4e8fb605..96f1422f 100644 --- a/external/3rd/library/webAPI/webAPIHeartbeat.h +++ b/external/3rd/library/webAPI/webAPIHeartbeat.h @@ -5,20 +5,15 @@ #ifndef webAPIHeartbeat_H #define webAPIHeartbeat_H -#include - #include "webAPI.h" #include "../libLeff/libLeff.h" - namespace StellaBellum { class webAPIHeartbeat { public: - webAPIHeartbeat:webAPIHeartbeat(); - webAPIHeartbeat:~webAPIHeartbeat(); - - bool sendHeartbeat(std::unordered_map metricsData = nullptr); + webAPIHeartbeat(); + ~webAPIHeartbeat(); }; }