dolphin/Source/Core/UICommon/DiscordPresence.h
Sleepy Flower Girl c2aedb7649 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
2018-08-06 16:12:03 -04:00

40 lines
1.0 KiB
C++

// Copyright 2018 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <functional>
namespace Discord
{
using JoinFunction = std::function<void()>;
using JoinRequestFunction =
std::function<void(const char* id, const std::string& discord_tag, const char* avatar)>;
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,
RoomID,
};
void Init();
void InitNetPlayFunctionality(Handler& handler);
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);
void Shutdown();
void SetDiscordPresenceEnabled(bool enabled);
} // namespace Discord