Blamite Game Engine - Blam (Core)
Blam::DiscordRPC Namespace Reference

Namespace containing things related to Discord Rich Presence. More...

Functions

BLAM void InitDiscord ()
 Initialize Discord RPC. More...
 
BLAM void ShutdownDiscord ()
 Shuts down Discord RPC. More...
 
BLAM void UpdatePresence (DiscordRichPresence discordPresence)
 Update the current Discord presence. More...
 
BLAM void UpdatePresence (const char *state, const char *details)
 Update the current Discord presence state and details. More...
 
BLAM void DummyEvent (int id)
 Triggers a dummy event. More...
 

Detailed Description

Namespace containing things related to Discord Rich Presence.

Todo:
The .cpp file for this needs some cleanup, as it was written in the earlier days of the Blamite codebase.
Bug:
Game join events never fire. This may be a bug with our implementation or a bug with DiscordRPC itself.

Function Documentation

◆ DummyEvent()

void Blam::DiscordRPC::DummyEvent ( int  id)

Triggers a dummy event.

Parameters
id- The event type to trigger. Available options include:
  • 1 - User logon
  • 2 - Error
  • 3 - User disconnect
  • 4 - Join game
  • 5 - Spectate game
  • 6 - Join request
Todo:
Change this to use an enum instead of relying on an integer.

◆ InitDiscord()

void Blam::DiscordRPC::InitDiscord ( )

Initialize Discord RPC.

◆ ShutdownDiscord()

void Blam::DiscordRPC::ShutdownDiscord ( )

Shuts down Discord RPC.

◆ UpdatePresence() [1/2]

void Blam::DiscordRPC::UpdatePresence ( const char *  state,
const char *  details 
)

Update the current Discord presence state and details.

Parameters
state- The new game state. Ex: "Forge World"
details- The new activity details. Ex: "Using the Forge"

◆ UpdatePresence() [2/2]

void Blam::DiscordRPC::UpdatePresence ( DiscordRichPresence  discordPresence)

Update the current Discord presence.

Parameters
discordPresence- The new presence data to use.