2022-11-10 02:20:44 +02:00
|
|
|
#pragma once
|
2022-10-21 03:53:30 +02:00
|
|
|
#include <QWidget>
|
2022-11-10 02:20:44 +02:00
|
|
|
#include "lobby.h"
|
2022-10-21 03:53:30 +02:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class Lobby;
|
|
|
|
}
|
|
|
|
|
|
|
|
class Lobby : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit Lobby(QWidget *parent = nullptr);
|
|
|
|
~Lobby();
|
|
|
|
|
|
|
|
private slots:
|
2022-10-21 18:29:27 +02:00
|
|
|
void on_messageEdit_returnPressed();
|
2022-10-21 03:53:30 +02:00
|
|
|
|
2022-11-16 02:22:48 +02:00
|
|
|
void chatMessage(QString title, QString body, bool isSystem = false);
|
|
|
|
void sysMessage(QString body);
|
2022-10-23 00:55:22 +02:00
|
|
|
void dispatchMessage(QString);
|
|
|
|
void serverCommand(const ServerCommand &);
|
2022-10-21 03:53:30 +02:00
|
|
|
|
2022-10-21 18:29:27 +02:00
|
|
|
void on_connectButton_toggled(bool checked);
|
|
|
|
|
2022-10-23 00:55:22 +02:00
|
|
|
void on_newButton_clicked();
|
|
|
|
|
|
|
|
void on_joinButton_clicked();
|
|
|
|
|
2022-10-23 21:10:46 +02:00
|
|
|
void on_buttonLeave_clicked();
|
|
|
|
|
|
|
|
void on_buttonReady_clicked();
|
|
|
|
|
2022-10-25 03:27:53 +02:00
|
|
|
void onDisconnected();
|
|
|
|
|
2022-10-21 03:53:30 +02:00
|
|
|
private:
|
|
|
|
Ui::Lobby *ui;
|
2022-10-21 18:29:27 +02:00
|
|
|
SocketLobby socketLobby;
|
2022-10-23 00:55:22 +02:00
|
|
|
QString hostSession;
|
|
|
|
QString session;
|
|
|
|
QString username;
|
2022-11-08 02:44:34 +02:00
|
|
|
QStringList gameArgs;
|
2022-10-23 00:55:22 +02:00
|
|
|
|
2022-11-17 01:15:26 +02:00
|
|
|
enum AuthStatus
|
|
|
|
{
|
|
|
|
NONE, OK, ERROR
|
|
|
|
};
|
|
|
|
|
|
|
|
AuthStatus authentificationStatus = NONE;
|
2022-11-16 21:53:54 +02:00
|
|
|
|
2022-10-23 00:55:22 +02:00
|
|
|
private:
|
2022-11-17 01:15:26 +02:00
|
|
|
QMap<QString, QString> buildModsMap() const;
|
|
|
|
bool isModAvailable(const QString & modName, const QString & modVersion) const;
|
|
|
|
|
|
|
|
|
2022-10-23 00:55:22 +02:00
|
|
|
void protocolAssert(bool);
|
2022-10-21 03:53:30 +02:00
|
|
|
};
|