2020-08-17 06:31:30 +00:00
|
|
|
// SONIC ROBO BLAST 2 KART
|
2018-10-22 04:34:45 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
2020-08-17 06:31:30 +00:00
|
|
|
// Copyright (C) 2018-2020 by Sally "TehRealSalt" Cochenour.
|
|
|
|
// Copyright (C) 2018-2020 by Kart Krew.
|
2018-10-22 04:34:45 +00:00
|
|
|
//
|
|
|
|
// This program is free software distributed under the
|
|
|
|
// terms of the GNU General Public License, version 2.
|
|
|
|
// See the 'LICENSE' file for more details.
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
/// \file discord.h
|
|
|
|
/// \brief Discord Rich Presence handling
|
|
|
|
|
2020-08-17 06:25:05 +00:00
|
|
|
#ifndef __DISCORD__
|
|
|
|
#define __DISCORD__
|
|
|
|
|
2018-10-22 04:34:45 +00:00
|
|
|
#ifdef HAVE_DISCORDRPC
|
|
|
|
|
|
|
|
#include "discord_rpc.h"
|
|
|
|
|
2020-08-17 06:25:05 +00:00
|
|
|
extern consvar_t cv_discordrp;
|
2020-08-22 05:53:27 +00:00
|
|
|
extern consvar_t cv_discordstreamer;
|
|
|
|
extern consvar_t cv_discordasks;
|
|
|
|
|
|
|
|
extern struct discordInfo_s {
|
|
|
|
UINT8 maxPlayers;
|
|
|
|
boolean joinsAllowed;
|
|
|
|
boolean everyoneCanInvite;
|
|
|
|
} discordInfo;
|
2020-08-17 06:25:05 +00:00
|
|
|
|
2020-08-21 08:14:33 +00:00
|
|
|
typedef struct discordRequest_s {
|
2020-08-22 05:53:27 +00:00
|
|
|
char *username; // Discord user name.
|
|
|
|
char *discriminator; // Discord discriminator (The little hashtag thing after the username). Separated for a "hide discriminators" cvar.
|
2020-08-21 08:14:33 +00:00
|
|
|
char *userID; // The ID of the Discord user, gets used with Discord_Respond()
|
|
|
|
|
|
|
|
// HAHAHA, no.
|
|
|
|
// *Maybe* if it was only PNG I would boot up curl just to get AND convert this to Doom GFX,
|
2020-08-22 05:53:27 +00:00
|
|
|
// but it can *also* be a JEPG, WebP, or GIF :)
|
|
|
|
// Hey, wanna add ImageMagick as a dependency? :dying:
|
2020-08-21 08:14:33 +00:00
|
|
|
//patch_t *avatar;
|
|
|
|
|
|
|
|
struct discordRequest_s *next; // Next request in the list.
|
|
|
|
struct discordRequest_s *prev; // Previous request in the list. Not used normally, but just in case something funky happens, this should repair the list.
|
|
|
|
} discordRequest_t;
|
|
|
|
|
|
|
|
extern discordRequest_t *discordRequestList;
|
|
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------
|
|
|
|
void DRPC_RemoveRequest(void);
|
|
|
|
|
|
|
|
Removes an invite from the list.
|
|
|
|
--------------------------------------------------*/
|
|
|
|
|
|
|
|
void DRPC_RemoveRequest(discordRequest_t *removeRequest);
|
|
|
|
|
|
|
|
|
2020-08-17 10:13:32 +00:00
|
|
|
/*--------------------------------------------------
|
|
|
|
void DRPC_Init(void);
|
|
|
|
|
|
|
|
Initalizes Discord Rich Presence by linking the Application ID
|
2020-08-21 05:16:11 +00:00
|
|
|
and setting the callback functions.
|
2020-08-17 10:13:32 +00:00
|
|
|
--------------------------------------------------*/
|
|
|
|
|
2018-10-22 04:34:45 +00:00
|
|
|
void DRPC_Init(void);
|
2020-08-17 10:13:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------
|
|
|
|
void DRPC_UpdatePresence(void);
|
|
|
|
|
|
|
|
Updates what is displayed by Rich Presence on the user's profile.
|
|
|
|
Should be called whenever something that is displayed is
|
|
|
|
changed in-game.
|
|
|
|
--------------------------------------------------*/
|
|
|
|
|
2018-10-22 04:34:45 +00:00
|
|
|
void DRPC_UpdatePresence(void);
|
|
|
|
|
2020-08-17 10:13:32 +00:00
|
|
|
|
2020-08-17 06:25:05 +00:00
|
|
|
#endif // HAVE_DISCORDRPC
|
|
|
|
|
|
|
|
#endif // __DISCORD__
|