mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2026-06-22 08:31:07 +00:00
Added discord-rpc with different commit and proper signal handling
This commit is contained in:
@@ -13,3 +13,6 @@
|
|||||||
[submodule "include/easyloggingpp"]
|
[submodule "include/easyloggingpp"]
|
||||||
path = include/easyloggingpp
|
path = include/easyloggingpp
|
||||||
url = https://github.com/amrayn/easyloggingpp.git
|
url = https://github.com/amrayn/easyloggingpp.git
|
||||||
|
[submodule "include/discord-rpc"]
|
||||||
|
path = include/discord-rpc
|
||||||
|
url = https://github.com/discord/discord-rpc.git
|
||||||
|
|||||||
+6
-8
@@ -43,12 +43,10 @@ Launcher::~Launcher() {
|
|||||||
Abort();
|
Abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL WINAPI CtrlHandler(DWORD Flag) {
|
void ShutdownHandler(int sig) {
|
||||||
if((Flag >= 0 && Flag < 3) || (Flag > 4 && Flag < 7)) {
|
LOG(INFO) << "Got signal " << sig;
|
||||||
Launcher::StaticAbort();
|
Launcher::StaticAbort();
|
||||||
return 1;
|
exit(sig);
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Launcher::StaticAbort(Launcher* Instance) {
|
void Launcher::StaticAbort(Launcher* Instance) {
|
||||||
@@ -63,9 +61,9 @@ void Launcher::StaticAbort(Launcher* Instance) {
|
|||||||
void Launcher::WindowsInit() {
|
void Launcher::WindowsInit() {
|
||||||
system("cls");
|
system("cls");
|
||||||
SetConsoleTitleA(("BeamMP Launcher v" + FullVersion).c_str());
|
SetConsoleTitleA(("BeamMP Launcher v" + FullVersion).c_str());
|
||||||
if(!SetConsoleCtrlHandler(CtrlHandler, TRUE)) {
|
signal(SIGINT, ShutdownHandler);
|
||||||
LOG(WARNING) << "Failed to set CtrlHandler";
|
signal(SIGTERM, ShutdownHandler);
|
||||||
}
|
signal(SIGABRT, ShutdownHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Launcher::LaunchGame() {
|
void Launcher::LaunchGame() {
|
||||||
|
|||||||
Reference in New Issue
Block a user