mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2026-04-03 06:16:15 +00:00
discord rpc test
This commit is contained in:
@@ -5,13 +5,13 @@
|
||||
|
||||
#include <discord_rpc.h>
|
||||
#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";
|
||||
|
||||
@@ -9,13 +9,14 @@
|
||||
#include <windows.h>
|
||||
#include <shellapi.h>
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user