room stuff and minor fixes
This commit is contained in:
parent
80277ff573
commit
78d81ae65a
19 changed files with 159 additions and 99 deletions
|
@ -5,7 +5,7 @@ INCLUDEPATH += . src ../common
|
||||||
MOC_DIR = build
|
MOC_DIR = build
|
||||||
OBJECTS_DIR = build
|
OBJECTS_DIR = build
|
||||||
RESOURCES = cockatrice.qrc
|
RESOURCES = cockatrice.qrc
|
||||||
QT += network svg
|
QT += network svg webkit
|
||||||
|
|
||||||
HEADERS += src/counter.h \
|
HEADERS += src/counter.h \
|
||||||
src/dlg_creategame.h \
|
src/dlg_creategame.h \
|
||||||
|
|
|
@ -46,6 +46,7 @@ signals:
|
||||||
void listRoomsEventReceived(Event_ListRooms *event);
|
void listRoomsEventReceived(Event_ListRooms *event);
|
||||||
void gameJoinedEventReceived(Event_GameJoined *event);
|
void gameJoinedEventReceived(Event_GameJoined *event);
|
||||||
void messageEventReceived(Event_Message *event);
|
void messageEventReceived(Event_Message *event);
|
||||||
|
void userInfoChanged(ServerInfo_User *userInfo);
|
||||||
protected slots:
|
protected slots:
|
||||||
void processProtocolItem(ProtocolItem *item);
|
void processProtocolItem(ProtocolItem *item);
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -42,12 +42,17 @@ void RemoteClient::slotConnected()
|
||||||
setStatus(StatusAwaitingWelcome);
|
setStatus(StatusAwaitingWelcome);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoteClient::loginResponse(ResponseCode response)
|
void RemoteClient::loginResponse(ProtocolResponse *response)
|
||||||
{
|
{
|
||||||
if (response == RespOk)
|
Response_Login *resp = qobject_cast<Response_Login *>(response);
|
||||||
|
if (!resp)
|
||||||
|
disconnectFromServer();
|
||||||
|
|
||||||
|
if (resp->getResponseCode() == RespOk) {
|
||||||
setStatus(StatusLoggedIn);
|
setStatus(StatusLoggedIn);
|
||||||
else {
|
emit userInfoChanged(resp->getUserInfo());
|
||||||
emit serverError(response);
|
} else {
|
||||||
|
emit serverError(resp->getResponseCode());
|
||||||
setStatus(StatusDisconnecting);
|
setStatus(StatusDisconnecting);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,7 +83,7 @@ void RemoteClient::readData()
|
||||||
|
|
||||||
setStatus(StatusLoggingIn);
|
setStatus(StatusLoggingIn);
|
||||||
Command_Login *cmdLogin = new Command_Login(userName, password);
|
Command_Login *cmdLogin = new Command_Login(userName, password);
|
||||||
connect(cmdLogin, SIGNAL(finished(ResponseCode)), this, SLOT(loginResponse(ResponseCode)));
|
connect(cmdLogin, SIGNAL(finished(ProtocolResponse *)), this, SLOT(loginResponse(ProtocolResponse *)));
|
||||||
sendCommand(cmdLogin);
|
sendCommand(cmdLogin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
#define REMOTECLIENT_H
|
#define REMOTECLIENT_H
|
||||||
|
|
||||||
#include <QTcpSocket>
|
#include <QTcpSocket>
|
||||||
#include "protocol_datastructures.h"
|
|
||||||
#include "abstractclient.h"
|
#include "abstractclient.h"
|
||||||
|
|
||||||
class QTimer;
|
class QTimer;
|
||||||
|
@ -22,7 +21,7 @@ private slots:
|
||||||
void readData();
|
void readData();
|
||||||
void slotSocketError(QAbstractSocket::SocketError error);
|
void slotSocketError(QAbstractSocket::SocketError error);
|
||||||
void ping();
|
void ping();
|
||||||
void loginResponse(ResponseCode response);
|
void loginResponse(ProtocolResponse *response);
|
||||||
private:
|
private:
|
||||||
static const int maxTimeout = 10;
|
static const int maxTimeout = 10;
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
#include <QScrollBar>
|
||||||
#include "dlg_creategame.h"
|
#include "dlg_creategame.h"
|
||||||
#include "tab_room.h"
|
#include "tab_room.h"
|
||||||
#include "userlist.h"
|
#include "userlist.h"
|
||||||
|
@ -17,6 +18,8 @@
|
||||||
#include "protocol_items.h"
|
#include "protocol_items.h"
|
||||||
#include "gamesmodel.h"
|
#include "gamesmodel.h"
|
||||||
|
|
||||||
|
#include <QTextTable>
|
||||||
|
|
||||||
GameSelector::GameSelector(AbstractClient *_client, int _roomId, QWidget *parent)
|
GameSelector::GameSelector(AbstractClient *_client, int _roomId, QWidget *parent)
|
||||||
: QGroupBox(parent), client(_client), roomId(_roomId)
|
: QGroupBox(parent), client(_client), roomId(_roomId)
|
||||||
{
|
{
|
||||||
|
@ -119,14 +122,50 @@ void GameSelector::processGameInfo(ServerInfo_Game *info)
|
||||||
gameListModel->updateGameList(info);
|
gameListModel->updateGameList(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
TabRoom::TabRoom(AbstractClient *_client, ServerInfo_Room *info)
|
ChatView::ChatView(const QString &_ownName, QWidget *parent)
|
||||||
: Tab(), client(_client), roomId(info->getRoomId()), roomName(info->getName())
|
: QTextEdit(parent), ownName(_ownName)
|
||||||
|
{
|
||||||
|
setTextInteractionFlags(Qt::TextSelectableByMouse);
|
||||||
|
|
||||||
|
QTextTableFormat format;
|
||||||
|
format.setBorderStyle(QTextFrameFormat::BorderStyle_None);
|
||||||
|
table = textCursor().insertTable(1, 3, format);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ChatView::appendMessage(const QString &sender, const QString &message)
|
||||||
|
{
|
||||||
|
QTextCursor cellCursor = table->cellAt(table->rows() - 1, 0).lastCursorPosition();
|
||||||
|
cellCursor.insertText(QDateTime::currentDateTime().toString("[hh:mm]"));
|
||||||
|
QTextTableCell senderCell = table->cellAt(table->rows() - 1, 1);
|
||||||
|
QTextCharFormat senderFormat;
|
||||||
|
if (sender == ownName) {
|
||||||
|
senderFormat.setFontWeight(QFont::Bold);
|
||||||
|
senderFormat.setForeground(Qt::red);
|
||||||
|
} else
|
||||||
|
senderFormat.setForeground(Qt::blue);
|
||||||
|
senderCell.setFormat(senderFormat);
|
||||||
|
cellCursor = senderCell.lastCursorPosition();
|
||||||
|
cellCursor.insertText(sender);
|
||||||
|
QTextTableCell messageCell = table->cellAt(table->rows() - 1, 2);
|
||||||
|
QTextCharFormat messageFormat;
|
||||||
|
if (sender.isEmpty())
|
||||||
|
messageFormat.setForeground(Qt::darkGreen);
|
||||||
|
messageCell.setFormat(messageFormat);
|
||||||
|
cellCursor = messageCell.lastCursorPosition();
|
||||||
|
cellCursor.insertText(message);
|
||||||
|
|
||||||
|
table->appendRows(1);
|
||||||
|
|
||||||
|
verticalScrollBar()->setValue(verticalScrollBar()->maximum());
|
||||||
|
}
|
||||||
|
|
||||||
|
TabRoom::TabRoom(AbstractClient *_client, const QString &_ownName, ServerInfo_Room *info)
|
||||||
|
: Tab(), client(_client), roomId(info->getRoomId()), roomName(info->getName()), ownName(_ownName)
|
||||||
{
|
{
|
||||||
gameSelector = new GameSelector(client, roomId);
|
gameSelector = new GameSelector(client, roomId);
|
||||||
userList = new UserList(false);
|
userList = new UserList(false);
|
||||||
|
|
||||||
textEdit = new QTextEdit;
|
chatView = new ChatView(ownName);
|
||||||
textEdit->setReadOnly(true);
|
|
||||||
sayLabel = new QLabel;
|
sayLabel = new QLabel;
|
||||||
sayEdit = new QLineEdit;
|
sayEdit = new QLineEdit;
|
||||||
sayLabel->setBuddy(sayEdit);
|
sayLabel->setBuddy(sayEdit);
|
||||||
|
@ -137,7 +176,7 @@ TabRoom::TabRoom(AbstractClient *_client, ServerInfo_Room *info)
|
||||||
sayHbox->addWidget(sayEdit);
|
sayHbox->addWidget(sayEdit);
|
||||||
|
|
||||||
QVBoxLayout *chatVbox = new QVBoxLayout;
|
QVBoxLayout *chatVbox = new QVBoxLayout;
|
||||||
chatVbox->addWidget(textEdit);
|
chatVbox->addWidget(chatView);
|
||||||
chatVbox->addLayout(sayHbox);
|
chatVbox->addLayout(sayHbox);
|
||||||
|
|
||||||
chatGroupBox = new QGroupBox;
|
chatGroupBox = new QGroupBox;
|
||||||
|
@ -221,23 +260,18 @@ void TabRoom::processListGamesEvent(Event_ListGames *event)
|
||||||
|
|
||||||
void TabRoom::processJoinRoomEvent(Event_JoinRoom *event)
|
void TabRoom::processJoinRoomEvent(Event_JoinRoom *event)
|
||||||
{
|
{
|
||||||
textEdit->append(tr("%1 has joined the room.").arg(sanitizeHtml(event->getUserInfo()->getName())));
|
chatView->appendMessage(QString(), tr("%1 has joined the room.").arg(event->getUserInfo()->getName()));
|
||||||
userList->processUserInfo(event->getUserInfo());
|
userList->processUserInfo(event->getUserInfo());
|
||||||
emit userEvent();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabRoom::processLeaveRoomEvent(Event_LeaveRoom *event)
|
void TabRoom::processLeaveRoomEvent(Event_LeaveRoom *event)
|
||||||
{
|
{
|
||||||
textEdit->append(tr("%1 has left the room.").arg(sanitizeHtml(event->getPlayerName())));
|
chatView->appendMessage(QString(), tr("%1 has left the room.").arg(event->getPlayerName()));
|
||||||
userList->deleteUser(event->getPlayerName());
|
userList->deleteUser(event->getPlayerName());
|
||||||
emit userEvent();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabRoom::processSayEvent(Event_RoomSay *event)
|
void TabRoom::processSayEvent(Event_RoomSay *event)
|
||||||
{
|
{
|
||||||
if (event->getPlayerName().isEmpty())
|
chatView->appendMessage(event->getPlayerName(), event->getMessage());
|
||||||
textEdit->append(QString("<font color=\"blue\">%1</font").arg(sanitizeHtml(event->getMessage())));
|
|
||||||
else
|
|
||||||
textEdit->append(QString("<font color=\"red\">%1:</font> %2").arg(sanitizeHtml(event->getPlayerName())).arg(sanitizeHtml(event->getMessage())));
|
|
||||||
emit userEvent();
|
emit userEvent();
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "tab.h"
|
#include "tab.h"
|
||||||
#include "protocol_datastructures.h"
|
#include "protocol_datastructures.h"
|
||||||
#include <QGroupBox>
|
#include <QGroupBox>
|
||||||
|
#include <QTextEdit>
|
||||||
|
|
||||||
class AbstractClient;
|
class AbstractClient;
|
||||||
class UserList;
|
class UserList;
|
||||||
|
@ -12,6 +13,7 @@ class QTextEdit;
|
||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
class QTreeView;
|
class QTreeView;
|
||||||
class QPushButton;
|
class QPushButton;
|
||||||
|
class QTextTable;
|
||||||
class QCheckBox;
|
class QCheckBox;
|
||||||
class GamesModel;
|
class GamesModel;
|
||||||
class GamesProxyModel;
|
class GamesProxyModel;
|
||||||
|
@ -47,16 +49,27 @@ public:
|
||||||
void processGameInfo(ServerInfo_Game *info);
|
void processGameInfo(ServerInfo_Game *info);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class ChatView : public QTextEdit {
|
||||||
|
Q_OBJECT;
|
||||||
|
private:
|
||||||
|
QTextTable *table;
|
||||||
|
QString ownName;
|
||||||
|
public:
|
||||||
|
ChatView(const QString &_ownName, QWidget *parent = 0);
|
||||||
|
void appendMessage(const QString &sender, const QString &message);
|
||||||
|
};
|
||||||
|
|
||||||
class TabRoom : public Tab {
|
class TabRoom : public Tab {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private:
|
private:
|
||||||
AbstractClient *client;
|
AbstractClient *client;
|
||||||
int roomId;
|
int roomId;
|
||||||
QString roomName;
|
QString roomName;
|
||||||
|
QString ownName;
|
||||||
|
|
||||||
GameSelector *gameSelector;
|
GameSelector *gameSelector;
|
||||||
UserList *userList;
|
UserList *userList;
|
||||||
QTextEdit *textEdit;
|
ChatView *chatView;
|
||||||
QLabel *sayLabel;
|
QLabel *sayLabel;
|
||||||
QLineEdit *sayEdit;
|
QLineEdit *sayEdit;
|
||||||
QGroupBox *chatGroupBox;
|
QGroupBox *chatGroupBox;
|
||||||
|
@ -74,7 +87,7 @@ private slots:
|
||||||
void processLeaveRoomEvent(Event_LeaveRoom *event);
|
void processLeaveRoomEvent(Event_LeaveRoom *event);
|
||||||
void processSayEvent(Event_RoomSay *event);
|
void processSayEvent(Event_RoomSay *event);
|
||||||
public:
|
public:
|
||||||
TabRoom(AbstractClient *_client, ServerInfo_Room *info);
|
TabRoom(AbstractClient *_client, const QString &_ownName, ServerInfo_Room *info);
|
||||||
~TabRoom();
|
~TabRoom();
|
||||||
void retranslateUi();
|
void retranslateUi();
|
||||||
void processRoomEvent(RoomEvent *event);
|
void processRoomEvent(RoomEvent *event);
|
||||||
|
|
|
@ -116,32 +116,7 @@ void RoomSelector::joinFinished(ProtocolResponse *r)
|
||||||
emit roomJoined(resp->getRoomInfo());
|
emit roomJoined(resp->getRoomInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
ServerMessageLog::ServerMessageLog(AbstractClient *_client, QWidget *parent)
|
UserInfoBox::UserInfoBox(ServerInfo_User *userInfo, QWidget *parent)
|
||||||
: QGroupBox(parent)
|
|
||||||
{
|
|
||||||
textEdit = new QTextEdit;
|
|
||||||
textEdit->setReadOnly(true);
|
|
||||||
|
|
||||||
QVBoxLayout *vbox = new QVBoxLayout;
|
|
||||||
vbox->addWidget(textEdit);
|
|
||||||
|
|
||||||
setLayout(vbox);
|
|
||||||
retranslateUi();
|
|
||||||
|
|
||||||
connect(_client, SIGNAL(serverMessageEventReceived(Event_ServerMessage *)), this, SLOT(processServerMessageEvent(Event_ServerMessage *)));
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerMessageLog::retranslateUi()
|
|
||||||
{
|
|
||||||
setTitle(tr("Server messages"));
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerMessageLog::processServerMessageEvent(Event_ServerMessage *event)
|
|
||||||
{
|
|
||||||
textEdit->append(event->getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
UserInfoBox::UserInfoBox(AbstractClient *_client, QWidget *parent)
|
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
avatarLabel = new QLabel;
|
avatarLabel = new QLabel;
|
||||||
|
@ -169,9 +144,7 @@ UserInfoBox::UserInfoBox(AbstractClient *_client, QWidget *parent)
|
||||||
|
|
||||||
setLayout(mainLayout);
|
setLayout(mainLayout);
|
||||||
|
|
||||||
Command_GetUserInfo *cmd = new Command_GetUserInfo;
|
updateInfo(userInfo);
|
||||||
connect(cmd, SIGNAL(finished(ProtocolResponse *)), this, SLOT(processResponse(ProtocolResponse *)));
|
|
||||||
_client->sendCommand(cmd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserInfoBox::retranslateUi()
|
void UserInfoBox::retranslateUi()
|
||||||
|
@ -180,12 +153,8 @@ void UserInfoBox::retranslateUi()
|
||||||
userLevelLabel1->setText(tr("User level:"));
|
userLevelLabel1->setText(tr("User level:"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserInfoBox::processResponse(ProtocolResponse *response)
|
void UserInfoBox::updateInfo(ServerInfo_User *user)
|
||||||
{
|
{
|
||||||
Response_GetUserInfo *resp = qobject_cast<Response_GetUserInfo *>(response);
|
|
||||||
if (!resp)
|
|
||||||
return;
|
|
||||||
ServerInfo_User *user = resp->getUserInfo();
|
|
||||||
int userLevel = user->getUserLevel();
|
int userLevel = user->getUserLevel();
|
||||||
|
|
||||||
QPixmap avatarPixmap;
|
QPixmap avatarPixmap;
|
||||||
|
@ -208,21 +177,20 @@ void UserInfoBox::processResponse(ProtocolResponse *response)
|
||||||
userLevelLabel3->setText(userLevelText);
|
userLevelLabel3->setText(userLevelText);
|
||||||
}
|
}
|
||||||
|
|
||||||
TabServer::TabServer(AbstractClient *_client, QWidget *parent)
|
TabServer::TabServer(AbstractClient *_client, ServerInfo_User *userInfo, QWidget *parent)
|
||||||
: Tab(parent), client(_client)
|
: Tab(parent), client(_client)
|
||||||
{
|
{
|
||||||
roomSelector = new RoomSelector(client);
|
roomSelector = new RoomSelector(client);
|
||||||
serverMessageLog = new ServerMessageLog(client);
|
serverInfoBox = new QTextBrowser;
|
||||||
userInfoBox = new UserInfoBox(client);
|
userInfoBox = new UserInfoBox(userInfo);
|
||||||
userList = new UserList(true);
|
userList = new UserList(true);
|
||||||
|
|
||||||
// connect(gameSelector, SIGNAL(gameJoined(int)), this, SIGNAL(gameJoined(int)));
|
|
||||||
connect(roomSelector, SIGNAL(roomJoined(ServerInfo_Room *)), this, SIGNAL(roomJoined(ServerInfo_Room *)));
|
connect(roomSelector, SIGNAL(roomJoined(ServerInfo_Room *)), this, SIGNAL(roomJoined(ServerInfo_Room *)));
|
||||||
connect(userList, SIGNAL(openMessageDialog(const QString &, bool)), this, SIGNAL(openMessageDialog(const QString &, bool)));
|
connect(userList, SIGNAL(openMessageDialog(const QString &, bool)), this, SIGNAL(openMessageDialog(const QString &, bool)));
|
||||||
connect(userList, SIGNAL(userLeft(const QString &)), this, SIGNAL(userLeft(const QString &)));
|
|
||||||
|
|
||||||
connect(client, SIGNAL(userJoinedEventReceived(Event_UserJoined *)), this, SLOT(processUserJoinedEvent(Event_UserJoined *)));
|
connect(client, SIGNAL(userJoinedEventReceived(Event_UserJoined *)), this, SLOT(processUserJoinedEvent(Event_UserJoined *)));
|
||||||
connect(client, SIGNAL(userLeftEventReceived(Event_UserLeft *)), this, SLOT(processUserLeftEvent(Event_UserLeft *)));
|
connect(client, SIGNAL(userLeftEventReceived(Event_UserLeft *)), this, SLOT(processUserLeftEvent(Event_UserLeft *)));
|
||||||
|
connect(client, SIGNAL(serverMessageEventReceived(Event_ServerMessage *)), this, SLOT(processServerMessageEvent(Event_ServerMessage *)));
|
||||||
|
|
||||||
Command_ListUsers *cmd = new Command_ListUsers;
|
Command_ListUsers *cmd = new Command_ListUsers;
|
||||||
connect(cmd, SIGNAL(finished(ProtocolResponse *)), this, SLOT(processListUsersResponse(ProtocolResponse *)));
|
connect(cmd, SIGNAL(finished(ProtocolResponse *)), this, SLOT(processListUsersResponse(ProtocolResponse *)));
|
||||||
|
@ -230,7 +198,7 @@ TabServer::TabServer(AbstractClient *_client, QWidget *parent)
|
||||||
|
|
||||||
QVBoxLayout *vbox = new QVBoxLayout;
|
QVBoxLayout *vbox = new QVBoxLayout;
|
||||||
vbox->addWidget(roomSelector);
|
vbox->addWidget(roomSelector);
|
||||||
vbox->addWidget(serverMessageLog);
|
vbox->addWidget(serverInfoBox);
|
||||||
|
|
||||||
QVBoxLayout *vbox2 = new QVBoxLayout;
|
QVBoxLayout *vbox2 = new QVBoxLayout;
|
||||||
vbox2->addWidget(userInfoBox);
|
vbox2->addWidget(userInfoBox);
|
||||||
|
@ -246,11 +214,15 @@ TabServer::TabServer(AbstractClient *_client, QWidget *parent)
|
||||||
void TabServer::retranslateUi()
|
void TabServer::retranslateUi()
|
||||||
{
|
{
|
||||||
roomSelector->retranslateUi();
|
roomSelector->retranslateUi();
|
||||||
serverMessageLog->retranslateUi();
|
|
||||||
userInfoBox->retranslateUi();
|
userInfoBox->retranslateUi();
|
||||||
userList->retranslateUi();
|
userList->retranslateUi();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TabServer::processServerMessageEvent(Event_ServerMessage *event)
|
||||||
|
{
|
||||||
|
serverInfoBox->setHtml(event->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
void TabServer::processListUsersResponse(ProtocolResponse *response)
|
void TabServer::processListUsersResponse(ProtocolResponse *response)
|
||||||
{
|
{
|
||||||
Response_ListUsers *resp = qobject_cast<Response_ListUsers *>(response);
|
Response_ListUsers *resp = qobject_cast<Response_ListUsers *>(response);
|
||||||
|
|
|
@ -3,8 +3,9 @@
|
||||||
|
|
||||||
#include <QGroupBox>
|
#include <QGroupBox>
|
||||||
#include <QTreeWidget>
|
#include <QTreeWidget>
|
||||||
|
#include <QTextBrowser>
|
||||||
#include "tab.h"
|
#include "tab.h"
|
||||||
#include "protocol_datastructures.h"
|
//#include "protocol_datastructures.h"
|
||||||
|
|
||||||
class AbstractClient;
|
class AbstractClient;
|
||||||
class QTextEdit;
|
class QTextEdit;
|
||||||
|
@ -17,6 +18,8 @@ class Event_ServerMessage;
|
||||||
class Event_UserJoined;
|
class Event_UserJoined;
|
||||||
class Event_UserLeft;
|
class Event_UserLeft;
|
||||||
class ProtocolResponse;
|
class ProtocolResponse;
|
||||||
|
class ServerInfo_User;
|
||||||
|
class ServerInfo_Room;
|
||||||
|
|
||||||
class RoomSelector : public QGroupBox {
|
class RoomSelector : public QGroupBox {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -37,25 +40,13 @@ public:
|
||||||
void retranslateUi();
|
void retranslateUi();
|
||||||
};
|
};
|
||||||
|
|
||||||
class ServerMessageLog : public QGroupBox {
|
|
||||||
Q_OBJECT
|
|
||||||
private:
|
|
||||||
QTextEdit *textEdit;
|
|
||||||
private slots:
|
|
||||||
void processServerMessageEvent(Event_ServerMessage *event);
|
|
||||||
public:
|
|
||||||
ServerMessageLog(AbstractClient *_client, QWidget *parent = 0);
|
|
||||||
void retranslateUi();
|
|
||||||
};
|
|
||||||
|
|
||||||
class UserInfoBox : public QWidget {
|
class UserInfoBox : public QWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private:
|
private:
|
||||||
QLabel *avatarLabel, *nameLabel, *countryLabel1, *countryLabel2, *userLevelLabel1, *userLevelLabel2, *userLevelLabel3;
|
QLabel *avatarLabel, *nameLabel, *countryLabel1, *countryLabel2, *userLevelLabel1, *userLevelLabel2, *userLevelLabel3;
|
||||||
private slots:
|
void updateInfo(ServerInfo_User *user);
|
||||||
void processResponse(ProtocolResponse *response);
|
|
||||||
public:
|
public:
|
||||||
UserInfoBox(AbstractClient *_client, QWidget *parent = 0);
|
UserInfoBox(ServerInfo_User *userInfo, QWidget *parent = 0);
|
||||||
void retranslateUi();
|
void retranslateUi();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -63,21 +54,21 @@ class TabServer : public Tab {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
signals:
|
signals:
|
||||||
void roomJoined(ServerInfo_Room *info);
|
void roomJoined(ServerInfo_Room *info);
|
||||||
// void gameJoined(int gameId);
|
|
||||||
void openMessageDialog(const QString &userName, bool focus);
|
void openMessageDialog(const QString &userName, bool focus);
|
||||||
void userLeft(const QString &userName);
|
void userLeft(const QString &userName);
|
||||||
private slots:
|
private slots:
|
||||||
void processListUsersResponse(ProtocolResponse *response);
|
void processListUsersResponse(ProtocolResponse *response);
|
||||||
void processUserJoinedEvent(Event_UserJoined *event);
|
void processUserJoinedEvent(Event_UserJoined *event);
|
||||||
void processUserLeftEvent(Event_UserLeft *event);
|
void processUserLeftEvent(Event_UserLeft *event);
|
||||||
|
void processServerMessageEvent(Event_ServerMessage *event);
|
||||||
private:
|
private:
|
||||||
AbstractClient *client;
|
AbstractClient *client;
|
||||||
RoomSelector *roomSelector;
|
RoomSelector *roomSelector;
|
||||||
ServerMessageLog *serverMessageLog;
|
QTextBrowser *serverInfoBox;
|
||||||
UserList *userList;
|
UserList *userList;
|
||||||
UserInfoBox *userInfoBox;
|
UserInfoBox *userInfoBox;
|
||||||
public:
|
public:
|
||||||
TabServer(AbstractClient *_client, QWidget *parent = 0);
|
TabServer(AbstractClient *_client, ServerInfo_User *userInfo, QWidget *parent = 0);
|
||||||
void retranslateUi();
|
void retranslateUi();
|
||||||
QString getTabText() const { return tr("Server"); }
|
QString getTabText() const { return tr("Server"); }
|
||||||
};
|
};
|
||||||
|
|
|
@ -51,16 +51,18 @@ void TabSupervisor::myAddTab(Tab *tab)
|
||||||
addTab(tab, tab->getTabText());
|
addTab(tab, tab->getTabText());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabSupervisor::start(AbstractClient *_client)
|
void TabSupervisor::start(AbstractClient *_client, ServerInfo_User *userInfo)
|
||||||
{
|
{
|
||||||
client = _client;
|
client = _client;
|
||||||
|
userName = userInfo->getName();
|
||||||
|
|
||||||
connect(client, SIGNAL(roomEventReceived(RoomEvent *)), this, SLOT(processRoomEvent(RoomEvent *)));
|
connect(client, SIGNAL(roomEventReceived(RoomEvent *)), this, SLOT(processRoomEvent(RoomEvent *)));
|
||||||
connect(client, SIGNAL(gameEventContainerReceived(GameEventContainer *)), this, SLOT(processGameEventContainer(GameEventContainer *)));
|
connect(client, SIGNAL(gameEventContainerReceived(GameEventContainer *)), this, SLOT(processGameEventContainer(GameEventContainer *)));
|
||||||
connect(client, SIGNAL(gameJoinedEventReceived(Event_GameJoined *)), this, SLOT(gameJoined(Event_GameJoined *)));
|
connect(client, SIGNAL(gameJoinedEventReceived(Event_GameJoined *)), this, SLOT(gameJoined(Event_GameJoined *)));
|
||||||
connect(client, SIGNAL(messageEventReceived(Event_Message *)), this, SLOT(processMessageEvent(Event_Message *)));
|
connect(client, SIGNAL(messageEventReceived(Event_Message *)), this, SLOT(processMessageEvent(Event_Message *)));
|
||||||
connect(client, SIGNAL(maxPingTime(int, int)), this, SLOT(updatePingTime(int, int)));
|
connect(client, SIGNAL(maxPingTime(int, int)), this, SLOT(updatePingTime(int, int)));
|
||||||
|
|
||||||
tabServer = new TabServer(client);
|
tabServer = new TabServer(client, userInfo);
|
||||||
connect(tabServer, SIGNAL(roomJoined(ServerInfo_Room *)), this, SLOT(addRoomTab(ServerInfo_Room *)));
|
connect(tabServer, SIGNAL(roomJoined(ServerInfo_Room *)), this, SLOT(addRoomTab(ServerInfo_Room *)));
|
||||||
connect(tabServer, SIGNAL(openMessageDialog(const QString &, bool)), this, SLOT(addMessageTab(const QString &, bool)));
|
connect(tabServer, SIGNAL(openMessageDialog(const QString &, bool)), this, SLOT(addMessageTab(const QString &, bool)));
|
||||||
connect(tabServer, SIGNAL(userLeft(const QString &)), this, SLOT(processUserLeft(const QString &)));
|
connect(tabServer, SIGNAL(userLeft(const QString &)), this, SLOT(processUserLeft(const QString &)));
|
||||||
|
@ -162,7 +164,7 @@ void TabSupervisor::gameLeft(TabGame *tab)
|
||||||
|
|
||||||
void TabSupervisor::addRoomTab(ServerInfo_Room *info)
|
void TabSupervisor::addRoomTab(ServerInfo_Room *info)
|
||||||
{
|
{
|
||||||
TabRoom *tab = new TabRoom(client, info);
|
TabRoom *tab = new TabRoom(client, userName, info);
|
||||||
connect(tab, SIGNAL(roomClosing(TabRoom *)), this, SLOT(roomLeft(TabRoom *)));
|
connect(tab, SIGNAL(roomClosing(TabRoom *)), this, SLOT(roomLeft(TabRoom *)));
|
||||||
myAddTab(tab);
|
myAddTab(tab);
|
||||||
roomTabs.insert(info->getRoomId(), tab);
|
roomTabs.insert(info->getRoomId(), tab);
|
||||||
|
@ -177,12 +179,15 @@ void TabSupervisor::roomLeft(TabRoom *tab)
|
||||||
removeTab(indexOf(tab));
|
removeTab(indexOf(tab));
|
||||||
}
|
}
|
||||||
|
|
||||||
TabMessage *TabSupervisor::addMessageTab(const QString &userName, bool focus)
|
TabMessage *TabSupervisor::addMessageTab(const QString &receiverName, bool focus)
|
||||||
{
|
{
|
||||||
TabMessage *tab = new TabMessage(client, userName);
|
if (receiverName == userName)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
TabMessage *tab = new TabMessage(client, receiverName);
|
||||||
connect(tab, SIGNAL(talkClosing(TabMessage *)), this, SLOT(talkLeft(TabMessage *)));
|
connect(tab, SIGNAL(talkClosing(TabMessage *)), this, SLOT(talkLeft(TabMessage *)));
|
||||||
myAddTab(tab);
|
myAddTab(tab);
|
||||||
messageTabs.insert(userName, tab);
|
messageTabs.insert(receiverName, tab);
|
||||||
if (focus)
|
if (focus)
|
||||||
setCurrentWidget(tab);
|
setCurrentWidget(tab);
|
||||||
return tab;
|
return tab;
|
||||||
|
@ -230,6 +235,8 @@ void TabSupervisor::processMessageEvent(Event_Message *event)
|
||||||
tab = messageTabs.value(event->getReceiverName());
|
tab = messageTabs.value(event->getReceiverName());
|
||||||
if (!tab)
|
if (!tab)
|
||||||
tab = addMessageTab(event->getSenderName(), false);
|
tab = addMessageTab(event->getSenderName(), false);
|
||||||
|
if (!tab)
|
||||||
|
return;
|
||||||
tab->processMessageEvent(event);
|
tab->processMessageEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,10 +17,12 @@ class GameEventContainer;
|
||||||
class Event_GameJoined;
|
class Event_GameJoined;
|
||||||
class Event_Message;
|
class Event_Message;
|
||||||
class ServerInfo_Room;
|
class ServerInfo_Room;
|
||||||
|
class ServerInfo_User;
|
||||||
|
|
||||||
class TabSupervisor : public QTabWidget {
|
class TabSupervisor : public QTabWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private:
|
private:
|
||||||
|
QString userName;
|
||||||
QIcon *tabChangedIcon;
|
QIcon *tabChangedIcon;
|
||||||
AbstractClient *client;
|
AbstractClient *client;
|
||||||
QList<AbstractClient *> localClients;
|
QList<AbstractClient *> localClients;
|
||||||
|
@ -34,7 +36,7 @@ public:
|
||||||
TabSupervisor(QWidget *parent = 0);
|
TabSupervisor(QWidget *parent = 0);
|
||||||
~TabSupervisor();
|
~TabSupervisor();
|
||||||
void retranslateUi();
|
void retranslateUi();
|
||||||
void start(AbstractClient *_client);
|
void start(AbstractClient *_client, ServerInfo_User *userInfo);
|
||||||
void startLocal(const QList<AbstractClient *> &_clients);
|
void startLocal(const QList<AbstractClient *> &_clients);
|
||||||
void stop();
|
void stop();
|
||||||
int getGameCount() const { return gameTabs.size(); }
|
int getGameCount() const { return gameTabs.size(); }
|
||||||
|
|
|
@ -64,15 +64,18 @@ void MainWindow::statusChanged(ClientStatus _status)
|
||||||
aConnect->setEnabled(false);
|
aConnect->setEnabled(false);
|
||||||
aDisconnect->setEnabled(true);
|
aDisconnect->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
case StatusLoggedIn: {
|
case StatusLoggedIn:
|
||||||
tabSupervisor->start(client);
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::userInfoReceived(ServerInfo_User *info)
|
||||||
|
{
|
||||||
|
tabSupervisor->start(client, info);
|
||||||
|
}
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
|
|
||||||
void MainWindow::actConnect()
|
void MainWindow::actConnect()
|
||||||
|
@ -260,6 +263,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
connect(client, SIGNAL(serverTimeout()), this, SLOT(serverTimeout()));
|
connect(client, SIGNAL(serverTimeout()), this, SLOT(serverTimeout()));
|
||||||
connect(client, SIGNAL(statusChanged(ClientStatus)), this, SLOT(statusChanged(ClientStatus)));
|
connect(client, SIGNAL(statusChanged(ClientStatus)), this, SLOT(statusChanged(ClientStatus)));
|
||||||
connect(client, SIGNAL(protocolVersionMismatch(int, int)), this, SLOT(protocolVersionMismatch(int, int)));
|
connect(client, SIGNAL(protocolVersionMismatch(int, int)), this, SLOT(protocolVersionMismatch(int, int)));
|
||||||
|
connect(client, SIGNAL(userInfoChanged(ServerInfo_User *)), this, SLOT(userInfoReceived(ServerInfo_User *)));
|
||||||
|
|
||||||
tabSupervisor = new TabSupervisor;
|
tabSupervisor = new TabSupervisor;
|
||||||
connect(tabSupervisor, SIGNAL(setMenu(QMenu *)), this, SLOT(updateTabMenu(QMenu *)));
|
connect(tabSupervisor, SIGNAL(setMenu(QMenu *)), this, SLOT(updateTabMenu(QMenu *)));
|
||||||
|
|
|
@ -28,6 +28,7 @@ class TabSupervisor;
|
||||||
class RemoteClient;
|
class RemoteClient;
|
||||||
class LocalClient;
|
class LocalClient;
|
||||||
class LocalServer;
|
class LocalServer;
|
||||||
|
class ServerInfo_User;
|
||||||
|
|
||||||
class MainWindow : public QMainWindow {
|
class MainWindow : public QMainWindow {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -38,6 +39,7 @@ private slots:
|
||||||
void serverError(ResponseCode r);
|
void serverError(ResponseCode r);
|
||||||
void socketError(const QString &errorStr);
|
void socketError(const QString &errorStr);
|
||||||
void protocolVersionMismatch(int localVersion, int remoteVersion);
|
void protocolVersionMismatch(int localVersion, int remoteVersion);
|
||||||
|
void userInfoReceived(ServerInfo_User *userInfo);
|
||||||
void localGameEnded();
|
void localGameEnded();
|
||||||
|
|
||||||
void actConnect();
|
void actConnect();
|
||||||
|
|
|
@ -44,6 +44,7 @@ void ProtocolItem::initializeHash()
|
||||||
registerSerializableItem("respdeck_download", Response_DeckDownload::newItem);
|
registerSerializableItem("respdeck_download", Response_DeckDownload::newItem);
|
||||||
registerSerializableItem("respdeck_upload", Response_DeckUpload::newItem);
|
registerSerializableItem("respdeck_upload", Response_DeckUpload::newItem);
|
||||||
registerSerializableItem("respdump_zone", Response_DumpZone::newItem);
|
registerSerializableItem("respdump_zone", Response_DumpZone::newItem);
|
||||||
|
registerSerializableItem("resplogin", Response_Login::newItem);
|
||||||
|
|
||||||
registerSerializableItem("room_eventlist_games", Event_ListGames::newItem);
|
registerSerializableItem("room_eventlist_games", Event_ListGames::newItem);
|
||||||
registerSerializableItem("room_eventjoin_room", Event_JoinRoom::newItem);
|
registerSerializableItem("room_eventjoin_room", Event_JoinRoom::newItem);
|
||||||
|
@ -281,6 +282,14 @@ Response_DumpZone::Response_DumpZone(int _cmdId, ResponseCode _responseCode, Ser
|
||||||
insertItem(_zone);
|
insertItem(_zone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Response_Login::Response_Login(int _cmdId, ResponseCode _responseCode, ServerInfo_User *_userInfo)
|
||||||
|
: ProtocolResponse(_cmdId, _responseCode, "login")
|
||||||
|
{
|
||||||
|
if (!_userInfo)
|
||||||
|
_userInfo = new ServerInfo_User;
|
||||||
|
insertItem(_userInfo);
|
||||||
|
}
|
||||||
|
|
||||||
GameEvent::GameEvent(const QString &_eventName, int _playerId)
|
GameEvent::GameEvent(const QString &_eventName, int _playerId)
|
||||||
: ProtocolItem("game_event", _eventName)
|
: ProtocolItem("game_event", _eventName)
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,6 +44,7 @@ enum ItemId {
|
||||||
ItemId_Response_DeckUpload = ItemId_Other + 304,
|
ItemId_Response_DeckUpload = ItemId_Other + 304,
|
||||||
ItemId_Response_DumpZone = ItemId_Other + 305,
|
ItemId_Response_DumpZone = ItemId_Other + 305,
|
||||||
ItemId_Response_JoinRoom = ItemId_Other + 306,
|
ItemId_Response_JoinRoom = ItemId_Other + 306,
|
||||||
|
ItemId_Response_Login = ItemId_Other + 307,
|
||||||
ItemId_Invalid = ItemId_Other + 1000
|
ItemId_Invalid = ItemId_Other + 1000
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -268,6 +269,15 @@ public:
|
||||||
ServerInfo_Zone *getZone() const { return static_cast<ServerInfo_Zone *>(itemMap.value("zone")); }
|
ServerInfo_Zone *getZone() const { return static_cast<ServerInfo_Zone *>(itemMap.value("zone")); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Response_Login : public ProtocolResponse {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
Response_Login(int _cmdId = -1, ResponseCode _responseCode = RespOk, ServerInfo_User *_userInfo = 0);
|
||||||
|
int getItemId() const { return ItemId_Response_Login; }
|
||||||
|
static SerializableItem *newItem() { return new Response_Login; }
|
||||||
|
ServerInfo_User *getUserInfo() const { return static_cast<ServerInfo_User *>(itemMap.value("user")); }
|
||||||
|
};
|
||||||
|
|
||||||
// --------------
|
// --------------
|
||||||
// --- EVENTS ---
|
// --- EVENTS ---
|
||||||
// --------------
|
// --------------
|
||||||
|
|
|
@ -108,6 +108,11 @@ void Server::broadcastRoomUpdate()
|
||||||
delete event;
|
delete event;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Server::gameCreated(Server_Game *game)
|
||||||
|
{
|
||||||
|
games.insert(game->getGameId(), game);
|
||||||
|
}
|
||||||
|
|
||||||
void Server::gameClosing(int gameId)
|
void Server::gameClosing(int gameId)
|
||||||
{
|
{
|
||||||
qDebug("Server::gameClosing");
|
qDebug("Server::gameClosing");
|
||||||
|
|
|
@ -18,6 +18,7 @@ class Server : public QObject
|
||||||
signals:
|
signals:
|
||||||
void pingClockTimeout();
|
void pingClockTimeout();
|
||||||
private slots:
|
private slots:
|
||||||
|
void gameCreated(Server_Game *game);
|
||||||
void gameClosing(int gameId);
|
void gameClosing(int gameId);
|
||||||
void broadcastRoomUpdate();
|
void broadcastRoomUpdate();
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -25,6 +25,10 @@ Server_ProtocolHandler::~Server_ProtocolHandler()
|
||||||
// so it will not receive the game update event.
|
// so it will not receive the game update event.
|
||||||
server->removeClient(this);
|
server->removeClient(this);
|
||||||
|
|
||||||
|
QMapIterator<int, Server_Room *> roomIterator(rooms);
|
||||||
|
while (roomIterator.hasNext())
|
||||||
|
roomIterator.next().value()->removeClient(this);
|
||||||
|
|
||||||
QMapIterator<int, QPair<Server_Game *, Server_Player *> > gameIterator(games);
|
QMapIterator<int, QPair<Server_Game *, Server_Player *> > gameIterator(games);
|
||||||
while (gameIterator.hasNext()) {
|
while (gameIterator.hasNext()) {
|
||||||
gameIterator.next();
|
gameIterator.next();
|
||||||
|
@ -37,10 +41,6 @@ Server_ProtocolHandler::~Server_ProtocolHandler()
|
||||||
p->setProtocolHandler(0);
|
p->setProtocolHandler(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMapIterator<int, Server_Room *> roomIterator(rooms);
|
|
||||||
while (roomIterator.hasNext())
|
|
||||||
roomIterator.next().value()->removeClient(this);
|
|
||||||
|
|
||||||
delete userInfo;
|
delete userInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,8 +234,9 @@ ResponseCode Server_ProtocolHandler::cmdLogin(Command_Login *cmd, CommandContain
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return RespOk;
|
cont->setResponse(new Response_Login(cont->getCmdId(), RespOk, new ServerInfo_User(userInfo, true)));
|
||||||
|
return RespNothing;
|
||||||
}
|
}
|
||||||
|
|
||||||
ResponseCode Server_ProtocolHandler::cmdMessage(Command_Message *cmd, CommandContainer *cont)
|
ResponseCode Server_ProtocolHandler::cmdMessage(Command_Message *cmd, CommandContainer *cont)
|
||||||
|
@ -302,6 +303,8 @@ ResponseCode Server_ProtocolHandler::cmdJoinRoom(Command_JoinRoom *cmd, CommandC
|
||||||
r->addClient(this);
|
r->addClient(this);
|
||||||
rooms.insert(r->getId(), r);
|
rooms.insert(r->getId(), r);
|
||||||
|
|
||||||
|
enqueueProtocolItem(new Event_RoomSay(r->getId(), QString(), r->getJoinMessage()));
|
||||||
|
|
||||||
cont->setResponse(new Response_JoinRoom(cont->getCmdId(), RespOk, r->getInfo(true)));
|
cont->setResponse(new Response_JoinRoom(cont->getCmdId(), RespOk, r->getInfo(true)));
|
||||||
return RespNothing;
|
return RespNothing;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,6 @@ ServerInfo_Room *Server_Room::getInfo(bool complete) const
|
||||||
{
|
{
|
||||||
QList<ServerInfo_Game *> gameList;
|
QList<ServerInfo_Game *> gameList;
|
||||||
QList<ServerInfo_User *> userList;
|
QList<ServerInfo_User *> userList;
|
||||||
qDebug() << "getInfo: complete=" << complete;
|
|
||||||
if (complete) {
|
if (complete) {
|
||||||
QMapIterator<int, Server_Game *> gameIterator(games);
|
QMapIterator<int, Server_Game *> gameIterator(games);
|
||||||
while (gameIterator.hasNext())
|
while (gameIterator.hasNext())
|
||||||
|
@ -79,6 +78,7 @@ Server_Game *Server_Room::createGame(const QString &description, const QString &
|
||||||
broadcastGameListUpdate(newGame);
|
broadcastGameListUpdate(newGame);
|
||||||
|
|
||||||
emit gameCreated(newGame);
|
emit gameCreated(newGame);
|
||||||
|
emit roomInfoChanged();
|
||||||
|
|
||||||
return newGame;
|
return newGame;
|
||||||
}
|
}
|
||||||
|
@ -90,4 +90,5 @@ void Server_Room::removeGame()
|
||||||
games.remove(game->getGameId());
|
games.remove(game->getGameId());
|
||||||
|
|
||||||
emit gameClosing(game->getGameId());
|
emit gameClosing(game->getGameId());
|
||||||
|
emit roomInfoChanged();
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@ public:
|
||||||
QString getName() const { return name; }
|
QString getName() const { return name; }
|
||||||
QString getDescription() const { return description; }
|
QString getDescription() const { return description; }
|
||||||
bool getAutoJoin() const { return autoJoin; }
|
bool getAutoJoin() const { return autoJoin; }
|
||||||
|
QString getJoinMessage() const { return joinMessage; }
|
||||||
const QMap<int, Server_Game *> &getGames() const { return games; }
|
const QMap<int, Server_Game *> &getGames() const { return games; }
|
||||||
Server *getServer() const;
|
Server *getServer() const;
|
||||||
ServerInfo_Room *getInfo(bool complete) const;
|
ServerInfo_Room *getInfo(bool complete) const;
|
||||||
|
|
Loading…
Reference in a new issue