dolphin/Source/Core/UICommon/DiscordPresence.h

37 lines
912 B
C
Raw Normal View History

2018-05-26 22:24:13 -06:00
// Copyright 2018 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
2018-07-03 15:50:08 -06:00
#include <functional>
2018-08-06 15:56:40 -06:00
#include <string>
2018-07-03 15:50:08 -06:00
2018-05-26 22:24:13 -06:00
namespace Discord
{
class Handler
{
public:
virtual ~Handler();
virtual void DiscordJoin() = 0;
virtual void DiscordJoinRequest(const char* id, const std::string& discord_tag,
const char* avatar) = 0;
};
enum class SecretType
2018-07-03 15:50:08 -06:00
{
Empty,
IPAddress,
RoomID,
};
2018-05-26 22:24:13 -06:00
void Init();
void InitNetPlayFunctionality(Handler& handler);
2018-07-03 15:50:08 -06:00
void CallPendingCallbacks();
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);
2018-05-26 22:24:13 -06:00
void Shutdown();
void SetDiscordPresenceEnabled(bool enabled);
2018-05-26 22:24:13 -06:00
} // namespace Discord