register join and spectate handlers too

This commit is contained in:
Chris Marsh 2017-07-28 13:53:05 -07:00
parent 059ab337c8
commit 1b7f782f57

View file

@ -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();