File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,13 @@ void DiscordInstance::after_ready() {
9494 spdlog::error (" Current Connected User Error: {}" , result.ToString ());
9595 }
9696 );
97+
98+ auto result = m_client.RegisterLaunchCommand (
99+ constants::discord::application_id, constants::discord::platform_dependent_launch_arguments
100+ );
101+ if (not result) {
102+ spdlog::warn (" Discord: Failed to Register Launch Command" );
103+ };
97104}
98105
99106
Original file line number Diff line number Diff line change 2424namespace constants ::discord {
2525 constexpr u64 application_id = 1220147916371394650ULL ;
2626
27+
28+ // TODO(Totto): this isn't correct for all platforms and needs to be tested
29+ #if defined(__ANDROID__)
30+ #error "Not supported"
31+ #elif defined(__CONSOLE__)
32+ #error "Not supported"
33+ #elif defined(FLATPAK_BUILD)
34+ constexpr const char * platform_dependent_launch_arguments =
35+ " flatpak run io.github.openbrickprotocolfoundation.oopetris --discord" ;
36+ #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
37+ constexpr const char * platform_dependent_launch_arguments = " oopetris.exe --discord" ;
38+ #elif defined(__APPLE__)
39+ constexpr const char * platform_dependent_launch_arguments = " TODO" ;
40+ #elif defined(__linux__)
41+ constexpr const char * platform_dependent_launch_arguments = " oopetris --discord" ;
42+ #else
43+ #error "Unsupported platform"
44+ #endif
45+
2746#if defined(__ANDROID__)
2847 constexpr const discordpp::ActivityGamePlatforms supported_platforms = discordpp::ActivityGamePlatforms::Android;
2948#elif defined(__CONSOLE__)
You can’t perform that action at this time.
0 commit comments