mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 23:19:19 +02:00
Disable discord rpc running on non containing builds
This commit is contained in:
@@ -197,9 +197,9 @@ int eu07_application::run_crashgui()
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
#ifdef WITH_DISCORD_RPC
|
||||||
void eu07_application::DiscordRPCService()
|
void eu07_application::DiscordRPCService()
|
||||||
{
|
{
|
||||||
#if WITH_DISCORD_RPC
|
|
||||||
// initialize discord-rpc
|
// initialize discord-rpc
|
||||||
WriteLog("Initializing Discord Rich Presence...");
|
WriteLog("Initializing Discord Rich Presence...");
|
||||||
static const char *discord_app_id = "1343662664504840222";
|
static const char *discord_app_id = "1343662664504840222";
|
||||||
@@ -299,8 +299,9 @@ void eu07_application::DiscordRPCService()
|
|||||||
}
|
}
|
||||||
|
|
||||||
Discord_Shutdown();
|
Discord_Shutdown();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int eu07_application::init(int Argc, char *Argv[])
|
int eu07_application::init(int Argc, char *Argv[])
|
||||||
{
|
{
|
||||||
@@ -397,9 +398,12 @@ int eu07_application::init(int Argc, char *Argv[])
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef WITH_DISCORD_RPC
|
||||||
// Run DiscordRPC service
|
// Run DiscordRPC service
|
||||||
std::thread sDiscordRPC(&eu07_application::DiscordRPCService, this);
|
std::thread sDiscordRPC(&eu07_application::DiscordRPCService, this);
|
||||||
Global.threads.emplace("DiscordRPC", std::move(sDiscordRPC));
|
Global.threads.emplace("DiscordRPC", std::move(sDiscordRPC));
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!init_network())
|
if (!init_network())
|
||||||
return -1;
|
return -1;
|
||||||
@@ -686,12 +690,14 @@ void eu07_application::exit()
|
|||||||
it->second.join();
|
it->second.join();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WITH_DISCORD_RPC
|
||||||
it = Global.threads.find("DiscordRPC");
|
it = Global.threads.find("DiscordRPC");
|
||||||
if (it != Global.threads.end())
|
if (it != Global.threads.end())
|
||||||
{
|
{
|
||||||
if (it->second.joinable())
|
if (it->second.joinable())
|
||||||
it->second.join();
|
it->second.join();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void eu07_application::render_ui()
|
void eu07_application::render_ui()
|
||||||
|
|||||||
@@ -38,7 +38,9 @@ public:
|
|||||||
run();
|
run();
|
||||||
// issues request for a worker thread to perform specified task. returns: true if task was scheduled
|
// issues request for a worker thread to perform specified task. returns: true if task was scheduled
|
||||||
|
|
||||||
|
#ifdef WITH_DISCORD_RPC
|
||||||
void DiscordRPCService(); // discord rich presence service function (runs as separate thread)
|
void DiscordRPCService(); // discord rich presence service function (runs as separate thread)
|
||||||
|
#endif
|
||||||
bool
|
bool
|
||||||
request( python_taskqueue::task_request const &Task );
|
request( python_taskqueue::task_request const &Task );
|
||||||
// ensures the main thread holds the python gil and can safely execute python calls
|
// ensures the main thread holds the python gil and can safely execute python calls
|
||||||
|
|||||||
Reference in New Issue
Block a user