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:
Sleepy Flower Girl
2018-07-20 18:27:43 -04:00
parent b7c241ea4c
commit c2aedb7649
16 changed files with 393 additions and 130 deletions

View 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;
};