okies, she builds now so up next is making it actually do something

useful
This commit is contained in:
DarthArgus
2016-10-17 21:39:44 +00:00
parent 08cc494dda
commit 83d2c16179
3 changed files with 12 additions and 16 deletions
+3 -2
View File
@@ -70,7 +70,7 @@ template<uint32_t... Idx> struct vxCplEncryptedString<vxCplIndexList<Idx...> > {
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<uint32_t... Idx> struct vxCplEncryptedString<vxCplIndexList<Idx...> > {
};
// Compile-time string encryption macro
#define vxENCRYPT(Str) (vxCplEncryptedString<vxCplIndexes<sizeof(Str) - 1>::Result>(Str).decrypt())
//#define vxENCRYPT(Str) (vxCplEncryptedString<vxCplIndexes<sizeof(Str) - 1>::Result>(Str).decrypt())
#define vxENCRYPT(Str) (vxCplEncryptedString<vxCplIndexes<sizeof(Str) - 1>::Result>(Str))
+7 -7
View File
@@ -6,16 +6,16 @@
using namespace StellaBellum;
webAPIHeartbeat:webAPIHeartbeat() {
vxCplEncryptedString u = vxENCRYPT("https://login.stellabellum.net/metriccontroller/shoulderTap?type=server");
#define vxENCRYPT2(Str) (vxCplEncryptedString<vxCplIndexes<sizeof(Str) - 1>::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;
};
};
+2 -7
View File
@@ -5,20 +5,15 @@
#ifndef webAPIHeartbeat_H
#define webAPIHeartbeat_H
#include <unordered_list>
#include "webAPI.h"
#include "../libLeff/libLeff.h"
namespace StellaBellum {
class webAPIHeartbeat {
public:
webAPIHeartbeat:webAPIHeartbeat();
webAPIHeartbeat:~webAPIHeartbeat();
bool sendHeartbeat(std::unordered_map<std::string, std::string> metricsData = nullptr);
webAPIHeartbeat();
~webAPIHeartbeat();
};
}