1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-20 20:23:03 +02:00
vcmi/launcher/lobby/lobby_moc.h

93 lines
1.7 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
void changeEvent(QEvent *event) override;
2022-10-21 03:53:30 +02:00
public:
explicit Lobby(QWidget *parent = nullptr);
~Lobby();
2022-12-26 02:34:10 +02:00
signals:
void enableMod(QString mod);
void disableMod(QString mod);
public slots:
void updateMods();
2022-10-21 03:53:30 +02:00
private slots:
2022-10-23 00:55:22 +02:00
void dispatchMessage(QString);
void serverCommand(const ServerCommand &);
2023-09-03 01:05:48 +02:00
void onMessageSent(QString message);
2023-09-03 14:47:34 +02:00
void onChannelSwitch(QString channel);
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-12-26 02:34:10 +02:00
QMap<QString, QString> hostModsMap;
2023-09-09 00:20:30 +02:00
QMap<QString, QMap<QString, QString>> clientsModsMap;
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
};