mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Adds a UI for accepting Discord join requests in Dolphin
also did these things fixed crash from joining user that isn't hosting via a direct connection current game stat can now pass to override the current game in config uses ip endpoint from dolphin.org
This commit is contained in:
@ -9,8 +9,19 @@
|
||||
namespace Discord
|
||||
{
|
||||
using JoinFunction = std::function<void()>;
|
||||
using JoinRequestFunction =
|
||||
std::function<void(const char* id, const std::string& discord_tag, const char* avatar)>;
|
||||
|
||||
enum class SecretType : char
|
||||
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
|
||||
{
|
||||
Empty,
|
||||
IPAddress,
|
||||
@ -18,10 +29,11 @@ enum class SecretType : char
|
||||
};
|
||||
|
||||
void Init();
|
||||
void InitNetPlayFunctionality(const JoinFunction& join);
|
||||
void InitNetPlayFunctionality(Handler& handler);
|
||||
void CallPendingCallbacks();
|
||||
void UpdateDiscordPresence(int party_size = 0, SecretType type = SecretType::Empty,
|
||||
const std::string& secret = {});
|
||||
const std::string& secret = {}, const std::string& current_game = {});
|
||||
std::string CreateSecretFromIPAddress(const std::string& ip_address, int port);
|
||||
void Shutdown();
|
||||
void SetDiscordPresenceEnabled(bool enabled);
|
||||
} // namespace Discord
|
||||
|
Reference in New Issue
Block a user