diff --git a/src/Discord.cpp b/src/Discord.cpp index e55ea6f..e4f9ecb 100644 --- a/src/Discord.cpp +++ b/src/Discord.cpp @@ -5,13 +5,13 @@ #include #include "Launcher.h" +#include "Logger.h" void Launcher::richPresence() { Discord_Initialize("629743237988352010", nullptr, 1,nullptr); while(!Shutdown) { DiscordRichPresence discordPresence; memset(&discordPresence, 0, sizeof(discordPresence)); - if(DiscordMessage.empty()) DiscordMessage = "Playing with friends!"; discordPresence.state = DiscordMessage.c_str(); discordPresence.startTimestamp = 0; discordPresence.largeImageKey = "mainlogo"; diff --git a/src/Launcher.cpp b/src/Launcher.cpp index a713192..4dbb9b7 100644 --- a/src/Launcher.cpp +++ b/src/Launcher.cpp @@ -9,13 +9,14 @@ #include #include -Launcher::Launcher(int argc, char* argv[]) : DirPath(argv[0]) { +Launcher::Launcher(int argc, char* argv[]) : DirPath(argv[0]), DiscordMessage("Just launched") { DirPath = DirPath.substr(0, DirPath.find_last_of("\\/") + 1); Log::Init(); WindowsInit(); } Launcher::~Launcher() { + Shutdown = true; if(DiscordRPC.joinable()) { DiscordRPC.join(); } diff --git a/src/main.cpp b/src/main.cpp index b7fbd73..595be1b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,9 +7,11 @@ #include "Logger.h" int main(int argc, char* argv[]) { Launcher launcher(argc, argv); + launcher.runDiscordRPC(); launcher.loadConfig(); launcher.checkKey(); //UI call - + std::this_thread::sleep_for(std::chrono::seconds(50)); + LOG(INFO) << "Shutting down"; return 0; }