2022-03-09 17:23:08 -05:00
|
|
|
#pragma once
|
2022-03-10 13:20:53 -05:00
|
|
|
#include <cstdint>
|
2022-03-09 17:23:08 -05:00
|
|
|
|
|
|
|
class RPC
|
|
|
|
{
|
|
|
|
private:
|
2022-03-10 13:20:53 -05:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
const char* state;
|
|
|
|
const char* details;
|
|
|
|
int64_t startTimestamp;
|
|
|
|
int64_t endTimestamp;
|
|
|
|
const char* largeImageKey;
|
|
|
|
const char* largeImageText;
|
|
|
|
const char* smallImageKey;
|
|
|
|
const char* smallImageText;
|
|
|
|
const char* partyId;
|
|
|
|
int partySize;
|
|
|
|
int partyMax;
|
|
|
|
const char* matchSecret;
|
|
|
|
const char* joinSecret;
|
|
|
|
const char* spectateSecret;
|
|
|
|
int8_t instance;
|
|
|
|
} DiscordRichPresence;
|
|
|
|
|
|
|
|
static inline FARPROC f_Init, f_ShutDown, f_Update;
|
|
|
|
static inline DiscordRichPresence drpc;
|
|
|
|
static inline HMODULE hDll = NULL;
|
|
|
|
static inline bool bInit;
|
|
|
|
static void Discord_Initialize(const char* applicationId, int handlers, int autoRegister, const char* optionalSteamId);
|
|
|
|
static void Discord_UpdatePresence(const DiscordRichPresence* presence);
|
2022-03-09 17:23:08 -05:00
|
|
|
public:
|
|
|
|
RPC() = delete;
|
|
|
|
RPC(RPC&) = delete;
|
|
|
|
|
|
|
|
static void Init();
|
|
|
|
static void Process();
|
|
|
|
static void Shutdown();
|
|
|
|
};
|