Disabled discord since it randomly crashes smh

This commit is contained in:
Anonymous275
2022-01-19 23:08:37 +02:00
parent 2b73c120a8
commit 09b18a40c5
3 changed files with 10 additions and 5 deletions

View File

@@ -49,6 +49,7 @@ private: //functions
private: //variables
uint32_t GamePID{0};
bool EnableUI = true;
int64_t DiscordTime{};
bool LoginAuth = false;
fs::path CurrentPath{};
std::string BeamRoot{};

View File

@@ -8,21 +8,19 @@
#include "Logger.h"
void Launcher::RichPresence() {
Discord_Initialize("629743237988352010", nullptr, 1,nullptr);
int64_t Start{};
Discord_Initialize("629743237988352010", nullptr, 1, nullptr);
while(!Shutdown.load()) {
DiscordRichPresence discordPresence;
memset(&discordPresence, 0, sizeof(discordPresence));
discordPresence.state = DiscordMessage.c_str();
discordPresence.startTimestamp = Start;
discordPresence.startTimestamp = DiscordTime;
discordPresence.largeImageKey = "mainlogo";
Discord_UpdatePresence(&discordPresence);
Discord_RunCallbacks();
std::this_thread::sleep_for(std::chrono::seconds(1));
}
Discord_ClearPresence();
}
void Launcher::RunDiscordRPC() {
DiscordRPC = std::thread(&Launcher::RichPresence, this);
//DiscordRPC = std::thread(&Launcher::RichPresence, this);
}

View File

@@ -10,10 +10,16 @@
#include <windows.h>
#include <shellapi.h>
LONG WINAPI CrashHandler(EXCEPTION_POINTERS* p) {
LOG(ERROR) << "CAUGHT EXCEPTION! Code " << p->ExceptionRecord->ExceptionCode;
return EXCEPTION_EXECUTE_HANDLER;
}
Launcher::Launcher(int argc, char* argv[]) : CurrentPath(std::filesystem::path(argv[0])), DiscordMessage("Just launched") {
Launcher::StaticAbort(this);
Log::Init();
WindowsInit();
SetUnhandledExceptionFilter(CrashHandler);
LOG(INFO) << "Starting Launcher V" << FullVersion;
UpdateCheck();
}