From 1b7f782f57d4cd7a33899cf5e011b09bb9e55ff0 Mon Sep 17 00:00:00 2001 From: Chris Marsh Date: Fri, 28 Jul 2017 13:53:05 -0700 Subject: [PATCH] register join and spectate handlers too --- examples/send-presence/send-presence.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/examples/send-presence/send-presence.c b/examples/send-presence/send-presence.c index ceb6805..b2051cb 100644 --- a/examples/send-presence/send-presence.c +++ b/examples/send-presence/send-presence.c @@ -50,6 +50,16 @@ static void handleDiscordError(int errcode, const char* 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) { int res; @@ -108,6 +118,9 @@ int main(int argc, char* argv[]) handlers.ready = handleDiscordReady; handlers.disconnected = handleDiscordDisconnected; handlers.errored = handleDiscordError; + handlers.joinGame = handleDiscordJoin; + handlers.spectateGame = handleDiscordSpectate; + Discord_Initialize(APPLICATION_ID, &handlers, 1); gameLoop();