2018-05-27 04:24:13 +00:00
|
|
|
// Copyright 2018 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2018-05-27 04:24:13 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2018-07-03 21:50:08 +00:00
|
|
|
#include <functional>
|
2018-08-06 21:56:40 +00:00
|
|
|
#include <string>
|
2018-07-03 21:50:08 +00:00
|
|
|
|
2018-05-27 04:24:13 +00:00
|
|
|
namespace Discord
|
|
|
|
{
|
2018-07-20 22:27:43 +00:00
|
|
|
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 21:50:08 +00:00
|
|
|
{
|
|
|
|
Empty,
|
|
|
|
IPAddress,
|
|
|
|
RoomID,
|
|
|
|
};
|
|
|
|
|
2018-05-27 04:24:13 +00:00
|
|
|
void Init();
|
2018-07-20 22:27:43 +00:00
|
|
|
void InitNetPlayFunctionality(Handler& handler);
|
2018-07-03 21:50:08 +00:00
|
|
|
void CallPendingCallbacks();
|
|
|
|
void UpdateDiscordPresence(int party_size = 0, SecretType type = SecretType::Empty,
|
2018-07-20 22:27:43 +00:00
|
|
|
const std::string& secret = {}, const std::string& current_game = {});
|
|
|
|
std::string CreateSecretFromIPAddress(const std::string& ip_address, int port);
|
2018-05-27 04:24:13 +00:00
|
|
|
void Shutdown();
|
2018-06-06 04:16:42 +00:00
|
|
|
void SetDiscordPresenceEnabled(bool enabled);
|
2018-05-27 04:24:13 +00:00
|
|
|
} // namespace Discord
|