mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 16:19:28 +01:00
c2aedb7649
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
44 lines
942 B
C++
44 lines
942 B
C++
// Copyright 2018 Dolphin Emulator Project
|
|
// Licensed under GPLv2+
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
// Note using a ifdef around this class causes link issues with qt
|
|
|
|
#include <list>
|
|
#include <thread>
|
|
|
|
#include <QObject>
|
|
|
|
#include "Common/Flag.h"
|
|
|
|
#include "DolphinQt/DiscordJoinRequestDialog.h"
|
|
|
|
#include "UICommon/DiscordPresence.h"
|
|
|
|
class DiscordHandler : public QObject, public Discord::Handler
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit DiscordHandler(QWidget* parent);
|
|
~DiscordHandler();
|
|
|
|
void Start();
|
|
void Stop();
|
|
void DiscordJoin() override;
|
|
void DiscordJoinRequest(const char* id, const std::string& discord_tag,
|
|
const char* avatar) override;
|
|
void ShowNewJoinRequest();
|
|
signals:
|
|
void Join();
|
|
void JoinRequest();
|
|
|
|
private:
|
|
void Run();
|
|
QWidget* m_parent;
|
|
Common::Flag m_stop_requested;
|
|
std::thread m_thread;
|
|
std::list<DiscordJoinRequestDialog> m_request_dialogs;
|
|
};
|