mirror of
https://github.com/yuzu-emu/discord-rpc.git
synced 2024-11-24 05:55:43 +01:00
register join and spectate handlers too
This commit is contained in:
parent
059ab337c8
commit
1b7f782f57
@ -50,6 +50,16 @@ static void handleDiscordError(int errcode, const char* message)
|
|||||||
printf("\nDiscord: error (%d: %s)\n", errcode, message);
|
printf("\nDiscord: error (%d: %s)\n", errcode, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void handleDiscordJoin(const char* secret)
|
||||||
|
{
|
||||||
|
printf("\nDiscord: join (%s)\n", secret);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void handleDiscordSpectate(const char* secret)
|
||||||
|
{
|
||||||
|
printf("\nDiscord: spectate (%s)\n", secret);
|
||||||
|
}
|
||||||
|
|
||||||
static int prompt(char* line, size_t size)
|
static int prompt(char* line, size_t size)
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
@ -108,6 +118,9 @@ int main(int argc, char* argv[])
|
|||||||
handlers.ready = handleDiscordReady;
|
handlers.ready = handleDiscordReady;
|
||||||
handlers.disconnected = handleDiscordDisconnected;
|
handlers.disconnected = handleDiscordDisconnected;
|
||||||
handlers.errored = handleDiscordError;
|
handlers.errored = handleDiscordError;
|
||||||
|
handlers.joinGame = handleDiscordJoin;
|
||||||
|
handlers.spectateGame = handleDiscordSpectate;
|
||||||
|
|
||||||
Discord_Initialize(APPLICATION_ID, &handlers, 1);
|
Discord_Initialize(APPLICATION_ID, &handlers, 1);
|
||||||
|
|
||||||
gameLoop();
|
gameLoop();
|
||||||
|
Loading…
Reference in New Issue
Block a user