Add Discord presence ioctlv to /dev/dolphin

This commit is contained in:
InvoxiPlayGames
2022-08-03 05:46:11 +01:00
parent 7d2d5d914b
commit f9e39cf200
10 changed files with 254 additions and 2 deletions

View File

@ -8,6 +8,9 @@
namespace Discord
{
// The number is the client ID for Dolphin, it's used for images and the application name
const std::string DEFAULT_CLIENT_ID = "455712169795780630";
class Handler
{
public:
@ -24,9 +27,19 @@ enum class SecretType
RoomID,
};
static bool s_using_custom_client = false;
void Init();
void InitNetPlayFunctionality(Handler& handler);
void CallPendingCallbacks();
void UpdateClientID(const std::string& new_client = {});
bool UpdateDiscordPresenceRaw(const std::string& details = {}, const std::string& state = {},
const std::string& large_image_key = {},
const std::string& large_image_text = {},
const std::string& small_image_key = {},
const std::string& small_image_text = {},
const int64_t start_timestamp = 0, const int64_t end_timestamp = 0,
const int party_size = 0, const int party_max = 0);
void UpdateDiscordPresence(int party_size = 0, SecretType type = SecretType::Empty,
const std::string& secret = {}, const std::string& current_game = {});
std::string CreateSecretFromIPAddress(const std::string& ip_address, int port);