1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-20 03:29:32 +02:00
vcmi/launcher/lobby/lobby_moc.h

93 lines
1.7 KiB
C++
Raw Normal View History

2022-11-29 19:42:09 +04: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 04:20:44 +04:00
#pragma once
2022-10-21 05:53:30 +04:00
#include <QWidget>
2022-11-10 04:20:44 +04:00
#include "lobby.h"
2022-10-21 05:53:30 +04:00
namespace Ui {
class Lobby;
}
class Lobby : public QWidget
{
Q_OBJECT
void changeEvent(QEvent *event) override;
2022-10-21 05:53:30 +04:00
public:
explicit Lobby(QWidget *parent = nullptr);
~Lobby();
2022-12-26 04:34:10 +04:00
signals:
void enableMod(QString mod);
void disableMod(QString mod);
public slots:
void updateMods();
2022-10-21 05:53:30 +04:00
private slots:
2022-10-23 02:55:22 +04:00
void dispatchMessage(QString);
void serverCommand(const ServerCommand &);
2023-09-03 03:05:48 +04:00
void onMessageSent(QString message);
2023-09-03 16:47:34 +04:00
void onChannelSwitch(QString channel);
2022-10-21 05:53:30 +04:00
2022-10-21 20:29:27 +04:00
void on_connectButton_toggled(bool checked);
2022-10-23 02:55:22 +04:00
void on_newButton_clicked();
void on_joinButton_clicked();
2022-10-23 23:10:46 +04:00
void on_buttonLeave_clicked();
void on_buttonReady_clicked();
2022-10-25 05:27:53 +04:00
void onDisconnected();
2022-11-27 03:41:06 +04:00
void on_sessionsTable_itemSelectionChanged();
2022-11-27 05:35:05 +04:00
void on_playersList_currentRowChanged(int currentRow);
void on_kickButton_clicked();
2022-12-26 02:37:35 +04:00
void on_buttonResolve_clicked();
void on_optNewGame_toggled(bool checked);
void on_optLoadGame_toggled(bool checked);
2022-10-21 05:53:30 +04:00
private:
2022-11-27 03:41:06 +04:00
QString serverUrl;
int serverPort;
2022-12-26 02:37:35 +04:00
bool isLoadGameMode = false;
2022-11-27 03:41:06 +04:00
2022-10-21 05:53:30 +04:00
Ui::Lobby *ui;
2022-10-21 20:29:27 +04:00
SocketLobby socketLobby;
2022-10-23 02:55:22 +04:00
QString hostSession;
QString session;
QString username;
2022-11-08 04:44:34 +04:00
QStringList gameArgs;
2022-12-26 04:34:10 +04:00
QMap<QString, QString> hostModsMap;
2023-09-09 00:20:30 +02:00
QMap<QString, QMap<QString, QString>> clientsModsMap;
2022-10-23 02:55:22 +04:00
2022-11-17 04:30:43 +04:00
enum AuthStatus
2022-11-17 03:15:26 +04:00
{
2022-11-17 04:30:43 +04:00
AUTH_NONE, AUTH_OK, AUTH_ERROR
2022-11-17 03:15:26 +04:00
};
2022-11-17 04:30:43 +04:00
AuthStatus authentificationStatus = AUTH_NONE;
2022-11-16 23:53:54 +04:00
2022-10-23 02:55:22 +04:00
private:
2022-11-17 03:15:26 +04:00
QMap<QString, QString> buildModsMap() const;
bool isModAvailable(const QString & modName, const QString & modVersion) const;
2022-10-23 02:55:22 +04:00
void protocolAssert(bool);
2022-10-21 05:53:30 +04:00
};