mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -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:
43
Source/Core/DolphinQt/DiscordHandler.h
Normal file
43
Source/Core/DolphinQt/DiscordHandler.h
Normal file
@ -0,0 +1,43 @@
|
||||
// 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;
|
||||
};
|
Reference in New Issue
Block a user