1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-18 17:40:48 +02:00
vcmi/launcher/lobby/lobby_moc.h

84 lines
1.6 KiB
C
Raw Normal View History

2022-11-29 17:42:09 +02:00
/*
* lobby_moc.h, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
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-11-27 01:41:06 +02:00
void on_sessionsTable_itemSelectionChanged();
2022-11-27 03:35:05 +02:00
void on_playersList_currentRowChanged(int currentRow);
void on_kickButton_clicked();
2022-12-26 00:37:35 +02:00
void on_buttonResolve_clicked();
void on_optNewGame_toggled(bool checked);
void on_optLoadGame_toggled(bool checked);
2022-10-21 03:53:30 +02:00
private:
2022-11-27 01:41:06 +02:00
QString serverUrl;
int serverPort;
2022-12-26 00:37:35 +02:00
bool isLoadGameMode = false;
2022-11-27 01:41:06 +02:00
2022-10-21 03:53:30 +02:00
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 02:30:43 +02:00
enum AuthStatus
2022-11-17 01:15:26 +02:00
{
2022-11-17 02:30:43 +02:00
AUTH_NONE, AUTH_OK, AUTH_ERROR
2022-11-17 01:15:26 +02:00
};
2022-11-17 02:30:43 +02:00
AuthStatus authentificationStatus = AUTH_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
};