mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2026-04-07 16:26:02 +00:00
Disabled discord since it randomly crashes smh
This commit is contained in:
@@ -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{};
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user