mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-15 16:49:55 +00:00
d03722b3f4
(cherry picked from commits5c79e7106f
,57353cdfff
,15723adb9a
,01a5196a92
,ed75563a94
,3839a2dcfd
,1fd16ba69c
,66283943c5
,ba8613a179
,5b8f4f3e92
,35b771b19e
,043eb224e2
,05fac2f67d
)
51 lines
1.1 KiB
C++
51 lines
1.1 KiB
C++
//
|
|
// Created by koncord on 07.01.17.
|
|
//
|
|
|
|
#ifndef NEWLAUNCHER_SERVERINFODIALOG_HPP
|
|
#define NEWLAUNCHER_SERVERINFODIALOG_HPP
|
|
|
|
#include "ui_ServerInfo.h"
|
|
#include <apps/browser/netutils/Utils.hpp>
|
|
#include <RakNetTypes.h>
|
|
#include <components/openmw-mp/Master/MasterData.hpp>
|
|
|
|
class ThrWorker;
|
|
|
|
class ServerInfoDialog : public QDialog, public Ui::Dialog
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit ServerInfoDialog(const QString &addr, QWidget *parent = nullptr);
|
|
~ServerInfoDialog() override;
|
|
bool isUpdated();
|
|
void setData(std::pair<RakNet::SystemAddress, QueryData> &newSD);
|
|
public slots:
|
|
void refresh();
|
|
int exec() Q_DECL_OVERRIDE;
|
|
private:
|
|
QThread *refreshThread;
|
|
ThrWorker* worker;
|
|
std::pair<RakNet::SystemAddress, QueryData> sd;
|
|
};
|
|
|
|
class ThrWorker: public QObject
|
|
{
|
|
friend class ServerInfoDialog;
|
|
Q_OBJECT
|
|
public:
|
|
ThrWorker(ServerInfoDialog *dialog, QString addr, unsigned short port);
|
|
|
|
public slots:
|
|
void process();
|
|
signals:
|
|
void finished();
|
|
private:
|
|
QString addr;
|
|
unsigned short port;
|
|
bool stopped;
|
|
ServerInfoDialog *dialog;
|
|
};
|
|
|
|
|
|
#endif //NEWLAUNCHER_SERVERINFODIALOG_HPP
|