mirror of
https://github.com/libretro/RetroArch
synced 2025-01-31 15:32:59 +00:00
Merge pull request #7435 from fr500/lanrooms
start registering the application so it can be started from discord
This commit is contained in:
commit
2e67f4f02c
10
deps/discord-rpc/src/discord_register_win.cpp
vendored
10
deps/discord-rpc/src/discord_register_win.cpp
vendored
@ -77,22 +77,22 @@ static void Discord_RegisterW(const wchar_t* applicationId, const wchar_t* comma
|
||||
wchar_t openCommand[1024];
|
||||
|
||||
if (command && command[0]) {
|
||||
StringCbPrintfW(openCommand, sizeof(openCommand), L"%s", command);
|
||||
StringCbPrintfW(openCommand, sizeof(openCommand), L"%S", command);
|
||||
}
|
||||
else {
|
||||
// StringCbCopyW(openCommand, sizeof(openCommand), exeFilePath);
|
||||
StringCbPrintfW(openCommand, sizeof(openCommand), L"%s", exeFilePath);
|
||||
StringCbPrintfW(openCommand, sizeof(openCommand), L"%S", exeFilePath);
|
||||
}
|
||||
|
||||
wchar_t protocolName[64];
|
||||
StringCbPrintfW(protocolName, sizeof(protocolName), L"discord-%s", applicationId);
|
||||
StringCbPrintfW(protocolName, sizeof(protocolName), L"discord-%S", applicationId);
|
||||
wchar_t protocolDescription[128];
|
||||
StringCbPrintfW(
|
||||
protocolDescription, sizeof(protocolDescription), L"URL:Run game %s protocol", applicationId);
|
||||
protocolDescription, sizeof(protocolDescription), L"URL:Run game %S protocol", applicationId);
|
||||
wchar_t urlProtocol = 0;
|
||||
|
||||
wchar_t keyName[256];
|
||||
StringCbPrintfW(keyName, sizeof(keyName), L"Software\\Classes\\%s", protocolName);
|
||||
StringCbPrintfW(keyName, sizeof(keyName), L"Software\\Classes\\%S", protocolName);
|
||||
HKEY key;
|
||||
auto status =
|
||||
RegCreateKeyExW(HKEY_CURRENT_USER, keyName, 0, nullptr, 0, KEY_WRITE, nullptr, &key, nullptr);
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include <file/file_path.h>
|
||||
|
||||
#include "discord.h"
|
||||
#include "discord_register.h"
|
||||
|
||||
#include "../retroarch.h"
|
||||
#include "../configuration.h"
|
||||
@ -225,7 +226,11 @@ void discord_init(void)
|
||||
handlers.spectateGame = handle_discord_spectate;
|
||||
handlers.joinRequest = handle_discord_join_request;
|
||||
|
||||
Discord_Initialize(settings->arrays.discord_app_id, &handlers, 1, NULL);
|
||||
/* To-Do: Add the arguments RetroArch was started with to the register URI*/
|
||||
const char command[256] = "retroarch";
|
||||
|
||||
Discord_Initialize(settings->arrays.discord_app_id, &handlers, 0, NULL);
|
||||
Discord_Register(settings->arrays.discord_app_id, NULL);
|
||||
|
||||
discord_ready = true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user