diff --git a/Tadah.DLL/Discord.cpp b/Tadah.DLL/Discord.cpp index 97a8008..354aba4 100644 --- a/Tadah.DLL/Discord.cpp +++ b/Tadah.DLL/Discord.cpp @@ -8,7 +8,7 @@ bool isRunning = false; std::string username; int placeId; -void Discord::Initialize(std::string joinScriptUrl) +void Discord::Initialize(const std::string joinScriptUrl) { // Check if Discord should be enabled by checking if the binary is the client as well as if the binary's containing folder contains a ".nodiscord" file std::string path = Helpers::getModulePath(); diff --git a/Tadah.DLL/Helpers.cpp b/Tadah.DLL/Helpers.cpp index 6f5fb13..f56c76e 100644 --- a/Tadah.DLL/Helpers.cpp +++ b/Tadah.DLL/Helpers.cpp @@ -18,7 +18,7 @@ bool Helpers::isASCII(const std::string& s) { return !std::any_of(s.begin(), s.end(), [](char c) { return static_cast(c) > 127; - }); + }); } // https://stackoverflow.com/questions/313970/how-to-convert-an-instance-of-stdstring-to-lower-case @@ -71,7 +71,7 @@ std::vector Helpers::base64Decode(const std::string_view data) } // https://stackoverflow.com/a/28269049 -std::map Helpers::parseQueryString(std::string query) +std::map Helpers::parseQueryString(const std::string query) { std::istringstream stream(query); std::map parsed; @@ -90,7 +90,7 @@ std::map Helpers::parseQueryString(std::string query) return parsed; } -std::string Helpers::joinQueryString(std::map query) +std::string Helpers::joinQueryString(const std::map query) { std::stringstream stream; stream << "?"; @@ -107,7 +107,7 @@ std::string Helpers::joinQueryString(std::map query) } // https://stackoverflow.com/a/12097772 -std::string Helpers::ws2s(std::wstring widestring) +std::string Helpers::ws2s(const std::wstring widestring) { std::string string; std::transform(widestring.begin(), widestring.end(), std::back_inserter(string), [](wchar_t c) { @@ -144,7 +144,7 @@ std::string Helpers::getISOTimestamp() return std::string(buffer); } -std::pair> Helpers::parseURL(std::string url) +std::pair> Helpers::parseURL(const std::string url) { CURLU* curl = curl_url(); CURLUcode result = curl_url_set(curl, CURLUPART_URL, url.c_str(), 0); @@ -179,7 +179,7 @@ std::pair> Helpers::parseURL(std::strin return std::make_pair(success, map); } -std::pair Helpers::httpGet(std::string url) +std::pair Helpers::httpGet(const std::string url) { bool success = false; std::string data; diff --git a/Tadah.DLL/Include/Configuration.h b/Tadah.DLL/Include/Configuration.h index bfc14c2..75aa7e1 100644 --- a/Tadah.DLL/Include/Configuration.h +++ b/Tadah.DLL/Include/Configuration.h @@ -1,6 +1,8 @@ #pragma once -//#define SERVER +// This is commented out since our CI defines this automatically +// #define SERVER + #define BASE_URL "https://tadah.rocks" #define DISCORD_APP_ID 923705431543668736 diff --git a/Tadah.DLL/Include/Discord.h b/Tadah.DLL/Include/Discord.h index f80ad30..b4f282e 100644 --- a/Tadah.DLL/Include/Discord.h +++ b/Tadah.DLL/Include/Discord.h @@ -1,6 +1,5 @@ #pragma once -#include #include #include #include @@ -12,7 +11,7 @@ class Discord { public: - static void Initialize(std::string joinScriptUrl); + static void Initialize(const std::string joinScriptUrl); static void Cleanup(); private: static void Update(); diff --git a/Tadah.DLL/Include/Helpers.h b/Tadah.DLL/Include/Helpers.h index 5150baa..3f0e167 100644 --- a/Tadah.DLL/Include/Helpers.h +++ b/Tadah.DLL/Include/Helpers.h @@ -15,12 +15,12 @@ public: static bool isASCII(const std::string& s); static std::string toLower(std::string s); static std::vector base64Decode(const std::string_view data); - static std::map parseQueryString(std::string query); - static std::string joinQueryString(std::map query); - static std::string ws2s(std::wstring widestring); + static std::map parseQueryString(const std::string query); + static std::string joinQueryString(const std::map query); + static std::string ws2s(const std::wstring widestring); static size_t write(char* contents, size_t size, size_t memory, void* pointer); static std::string getModulePath(); static std::string getISOTimestamp(); - static std::pair> parseURL(std::string url); - static std::pair httpGet(std::string url); + static std::pair> parseURL(const std::string url); + static std::pair httpGet(const std::string url); }; \ No newline at end of file