mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 08:14:47 -07:00
code merge
This commit is contained in:
commit
72ee0d7bdf
23 changed files with 257 additions and 75 deletions
|
|
@ -109,7 +109,6 @@ AbstractDecklistNode *InnerDecklistNode::findChild(const QString &name)
|
|||
|
||||
int InnerDecklistNode::height() const
|
||||
{
|
||||
Q_ASSERT(!isEmpty());
|
||||
return at(0)->height() + 1;
|
||||
}
|
||||
|
||||
|
|
@ -469,11 +468,6 @@ void DeckList::cleanList()
|
|||
setComments();
|
||||
}
|
||||
|
||||
bool DeckList::isEmpty() const
|
||||
{
|
||||
return root->isEmpty();
|
||||
}
|
||||
|
||||
DecklistCardNode *DeckList::addCard(const QString &cardName, const QString &zoneName)
|
||||
{
|
||||
InnerDecklistNode *zoneNode = dynamic_cast<InnerDecklistNode *>(root->findChild(zoneName));
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ public:
|
|||
static FileFormat getFormatFromNameFilter(const QString &selectedNameFilter);
|
||||
|
||||
void cleanList();
|
||||
bool isEmpty() const;
|
||||
bool isEmpty() const { return root->isEmpty() && name.isEmpty() && comments.isEmpty() && sideboardPlans.isEmpty(); }
|
||||
|
||||
InnerDecklistNode *getRoot() const { return root; }
|
||||
DecklistCardNode *addCard(const QString &cardName, const QString &zoneName);
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ public:
|
|||
bool getReceiverMayDelete() const { return receiverMayDelete; }
|
||||
void setReceiverMayDelete(bool _receiverMayDelete) { receiverMayDelete = _receiverMayDelete; }
|
||||
ProtocolItem(const QString &_itemType, const QString &_itemSubType);
|
||||
bool isEmpty() const { return false; }
|
||||
};
|
||||
|
||||
class ProtocolItem_Invalid : public ProtocolItem {
|
||||
|
|
@ -80,6 +81,7 @@ public:
|
|||
TopLevelProtocolItem();
|
||||
bool readElement(QXmlStreamReader *xml);
|
||||
void writeElement(QXmlStreamWriter *xml);
|
||||
bool isEmpty() const { return false; }
|
||||
};
|
||||
|
||||
// ----------------
|
||||
|
|
@ -161,6 +163,15 @@ public:
|
|||
void setGameId(int _gameId) { static_cast<SerializableItem_Int *>(itemMap.value("game_id"))->setData(_gameId); }
|
||||
};
|
||||
|
||||
class AdminCommand : public Command {
|
||||
Q_OBJECT
|
||||
public:
|
||||
AdminCommand(const QString &_cmdName)
|
||||
: Command(_cmdName)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class Command_DeckUpload : public Command {
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -68,5 +68,6 @@ ItemId_Event_RoomSay = 1066,
|
|||
ItemId_Context_ReadyStart = 1067,
|
||||
ItemId_Context_Concede = 1068,
|
||||
ItemId_Context_DeckSelect = 1069,
|
||||
ItemId_Other = 1070
|
||||
ItemId_Command_UpdateServerMessage = 1070,
|
||||
ItemId_Other = 1071
|
||||
};
|
||||
|
|
|
|||
|
|
@ -425,6 +425,10 @@ Context_DeckSelect::Context_DeckSelect(int _deckId)
|
|||
{
|
||||
insertItem(new SerializableItem_Int("deck_id", _deckId));
|
||||
}
|
||||
Command_UpdateServerMessage::Command_UpdateServerMessage()
|
||||
: AdminCommand("update_server_message")
|
||||
{
|
||||
}
|
||||
void ProtocolItem::initializeHashAuto()
|
||||
{
|
||||
itemNameHash.insert("cmdping", Command_Ping::newItem);
|
||||
|
|
@ -496,4 +500,5 @@ void ProtocolItem::initializeHashAuto()
|
|||
itemNameHash.insert("game_event_contextready_start", Context_ReadyStart::newItem);
|
||||
itemNameHash.insert("game_event_contextconcede", Context_Concede::newItem);
|
||||
itemNameHash.insert("game_event_contextdeck_select", Context_DeckSelect::newItem);
|
||||
itemNameHash.insert("cmdupdate_server_message", Command_UpdateServerMessage::newItem);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,3 +67,4 @@
|
|||
6:ready_start
|
||||
6:concede
|
||||
6:deck_select:i,deck_id
|
||||
7:update_server_message
|
||||
|
|
|
|||
|
|
@ -634,5 +634,12 @@ public:
|
|||
static SerializableItem *newItem() { return new Context_DeckSelect; }
|
||||
int getItemId() const { return ItemId_Context_DeckSelect; }
|
||||
};
|
||||
class Command_UpdateServerMessage : public AdminCommand {
|
||||
Q_OBJECT
|
||||
public:
|
||||
Command_UpdateServerMessage();
|
||||
static SerializableItem *newItem() { return new Command_UpdateServerMessage; }
|
||||
int getItemId() const { return ItemId_Command_UpdateServerMessage; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -73,6 +73,13 @@ while (<file>) {
|
|||
$parentConstructorCall = "$baseClass(\"$name1\")";
|
||||
$constructorParamsH = "";
|
||||
$constructorParamsCpp = "";
|
||||
} elsif ($type == 7) {
|
||||
$type = 'cmd';
|
||||
$namePrefix = 'Command';
|
||||
$baseClass = 'AdminCommand';
|
||||
$parentConstructorCall = "$baseClass(\"$name1\")";
|
||||
$constructorParamsH = "";
|
||||
$constructorParamsCpp = "";
|
||||
}
|
||||
$className = $namePrefix . '_' . $name2;
|
||||
$itemEnum .= "ItemId_$className = " . ++$itemId . ",\n";
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include "serializable_item.h"
|
||||
#include <QXmlStreamReader>
|
||||
#include <QXmlStreamWriter>
|
||||
|
||||
#include <QDebug>
|
||||
QHash<QString, SerializableItem::NewItemFunction> SerializableItem::itemNameHash;
|
||||
|
||||
SerializableItem *SerializableItem::getNewItem(const QString &name)
|
||||
|
|
@ -25,6 +25,9 @@ bool SerializableItem::readElement(QXmlStreamReader *xml)
|
|||
|
||||
void SerializableItem::write(QXmlStreamWriter *xml)
|
||||
{
|
||||
if (isEmpty())
|
||||
return;
|
||||
|
||||
xml->writeStartElement(itemType);
|
||||
if (!itemSubType.isEmpty())
|
||||
xml->writeAttribute("type", itemSubType);
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ public:
|
|||
const QString &getItemSubType() const { return itemSubType; }
|
||||
virtual bool readElement(QXmlStreamReader *xml);
|
||||
virtual void writeElement(QXmlStreamWriter *xml) = 0;
|
||||
virtual bool isEmpty() const = 0;
|
||||
void write(QXmlStreamWriter *xml);
|
||||
};
|
||||
|
||||
|
|
@ -36,6 +37,7 @@ class SerializableItem_Invalid : public SerializableItem {
|
|||
public:
|
||||
SerializableItem_Invalid(const QString &_itemType) : SerializableItem(_itemType) { }
|
||||
void writeElement(QXmlStreamWriter * /*xml*/) { }
|
||||
bool isEmpty() const { return true; }
|
||||
};
|
||||
|
||||
class SerializableItem_Map : public SerializableItem {
|
||||
|
|
@ -67,6 +69,7 @@ public:
|
|||
~SerializableItem_Map();
|
||||
bool readElement(QXmlStreamReader *xml);
|
||||
void writeElement(QXmlStreamWriter *xml);
|
||||
bool isEmpty() const { return itemMap.isEmpty() && itemList.isEmpty(); }
|
||||
void appendItem(SerializableItem *item) { itemList.append(item); }
|
||||
};
|
||||
|
||||
|
|
@ -81,6 +84,7 @@ public:
|
|||
: SerializableItem(_itemType), data(_data) { }
|
||||
const QString &getData() { return data; }
|
||||
void setData(const QString &_data) { data = _data; }
|
||||
bool isEmpty() const { return data.isEmpty(); }
|
||||
};
|
||||
|
||||
class SerializableItem_Int : public SerializableItem {
|
||||
|
|
@ -94,6 +98,7 @@ public:
|
|||
: SerializableItem(_itemType), data(_data) { }
|
||||
int getData() { return data; }
|
||||
void setData(int _data) { data = _data; }
|
||||
bool isEmpty() const { return data == -1; }
|
||||
};
|
||||
|
||||
class SerializableItem_Bool : public SerializableItem {
|
||||
|
|
@ -107,6 +112,7 @@ public:
|
|||
: SerializableItem(_itemType), data(_data) { }
|
||||
bool getData() { return data; }
|
||||
void setData(bool _data) { data = _data; }
|
||||
bool isEmpty() const { return data == false; }
|
||||
};
|
||||
|
||||
class SerializableItem_Color : public SerializableItem {
|
||||
|
|
@ -120,6 +126,7 @@ public:
|
|||
: SerializableItem(_itemType), data(_data) { }
|
||||
const Color &getData() { return data; }
|
||||
void setData(const Color &_data) { data = _data; }
|
||||
bool isEmpty() const { return data.getValue() == 0; }
|
||||
};
|
||||
|
||||
class SerializableItem_DateTime : public SerializableItem {
|
||||
|
|
@ -133,6 +140,7 @@ public:
|
|||
: SerializableItem(_itemType), data(_data) { }
|
||||
const QDateTime &getData() { return data; }
|
||||
void setData(const QDateTime &_data) { data = _data; }
|
||||
bool isEmpty() const { return data == QDateTime(); }
|
||||
};
|
||||
|
||||
class SerializableItem_ByteArray : public SerializableItem {
|
||||
|
|
@ -146,6 +154,7 @@ public:
|
|||
: SerializableItem(_itemType), data(_data) { }
|
||||
const QByteArray &getData() { return data; }
|
||||
void setData(const QByteArray &_data) { data = _data; }
|
||||
bool isEmpty() const { return data.isEmpty(); }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ ResponseCode Server_ProtocolHandler::processCommandHelper(Command *command, Comm
|
|||
lastCommandTime = QDateTime::currentDateTime();
|
||||
|
||||
RoomCommand *roomCommand = qobject_cast<RoomCommand *>(command);
|
||||
GameCommand *gameCommand = qobject_cast<GameCommand *>(command);
|
||||
if (roomCommand) {
|
||||
qDebug() << "received RoomCommand: roomId =" << roomCommand->getRoomId();
|
||||
if (authState == PasswordWrong)
|
||||
|
|
@ -66,12 +65,15 @@ ResponseCode Server_ProtocolHandler::processCommandHelper(Command *command, Comm
|
|||
return RespNameNotFound;
|
||||
|
||||
switch (command->getItemId()) {
|
||||
case ItemId_Command_LeaveRoom: return cmdLeaveRoom(qobject_cast<Command_LeaveRoom *>(command), cont, room);
|
||||
case ItemId_Command_RoomSay: return cmdRoomSay(qobject_cast<Command_RoomSay *>(command), cont, room);
|
||||
case ItemId_Command_CreateGame: return cmdCreateGame(qobject_cast<Command_CreateGame *>(command), cont, room);
|
||||
case ItemId_Command_JoinGame: return cmdJoinGame(qobject_cast<Command_JoinGame *>(command), cont, room);
|
||||
case ItemId_Command_LeaveRoom: return cmdLeaveRoom(static_cast<Command_LeaveRoom *>(command), cont, room);
|
||||
case ItemId_Command_RoomSay: return cmdRoomSay(static_cast<Command_RoomSay *>(command), cont, room);
|
||||
case ItemId_Command_CreateGame: return cmdCreateGame(static_cast<Command_CreateGame *>(command), cont, room);
|
||||
case ItemId_Command_JoinGame: return cmdJoinGame(static_cast<Command_JoinGame *>(command), cont, room);
|
||||
default: return RespInvalidCommand;
|
||||
}
|
||||
} else if (gameCommand) {
|
||||
}
|
||||
GameCommand *gameCommand = qobject_cast<GameCommand *>(command);
|
||||
if (gameCommand) {
|
||||
qDebug() << "received GameCommand: game =" << gameCommand->getGameId();
|
||||
if (authState == PasswordWrong)
|
||||
return RespLoginNeeded;
|
||||
|
|
@ -85,54 +87,65 @@ ResponseCode Server_ProtocolHandler::processCommandHelper(Command *command, Comm
|
|||
Server_Player *player = gamePair.second;
|
||||
|
||||
switch (command->getItemId()) {
|
||||
case ItemId_Command_DeckSelect: return cmdDeckSelect(qobject_cast<Command_DeckSelect *>(command), cont, game, player);
|
||||
case ItemId_Command_SetSideboardPlan: return cmdSetSideboardPlan(qobject_cast<Command_SetSideboardPlan *>(command), cont, game, player);
|
||||
case ItemId_Command_LeaveGame: return cmdLeaveGame(qobject_cast<Command_LeaveGame *>(command), cont, game, player);
|
||||
case ItemId_Command_ReadyStart: return cmdReadyStart(qobject_cast<Command_ReadyStart *>(command), cont, game, player);
|
||||
case ItemId_Command_Concede: return cmdConcede(qobject_cast<Command_Concede *>(command), cont, game, player);
|
||||
case ItemId_Command_Say: return cmdSay(qobject_cast<Command_Say *>(command), cont, game, player);
|
||||
case ItemId_Command_Shuffle: return cmdShuffle(qobject_cast<Command_Shuffle *>(command), cont, game, player);
|
||||
case ItemId_Command_Mulligan: return cmdMulligan(qobject_cast<Command_Mulligan *>(command), cont, game, player);
|
||||
case ItemId_Command_RollDie: return cmdRollDie(qobject_cast<Command_RollDie *>(command), cont, game, player);
|
||||
case ItemId_Command_DrawCards: return cmdDrawCards(qobject_cast<Command_DrawCards *>(command), cont, game, player);
|
||||
case ItemId_Command_MoveCard: return cmdMoveCard(qobject_cast<Command_MoveCard *>(command), cont, game, player);
|
||||
case ItemId_Command_FlipCard: return cmdFlipCard(qobject_cast<Command_FlipCard *>(command), cont, game, player);
|
||||
case ItemId_Command_AttachCard: return cmdAttachCard(qobject_cast<Command_AttachCard *>(command), cont, game, player);
|
||||
case ItemId_Command_CreateToken: return cmdCreateToken(qobject_cast<Command_CreateToken *>(command), cont, game, player);
|
||||
case ItemId_Command_CreateArrow: return cmdCreateArrow(qobject_cast<Command_CreateArrow *>(command), cont, game, player);
|
||||
case ItemId_Command_DeleteArrow: return cmdDeleteArrow(qobject_cast<Command_DeleteArrow *>(command), cont, game, player);
|
||||
case ItemId_Command_SetCardAttr: return cmdSetCardAttr(qobject_cast<Command_SetCardAttr *>(command), cont, game, player);
|
||||
case ItemId_Command_SetCardCounter: return cmdSetCardCounter(qobject_cast<Command_SetCardCounter *>(command), cont, game, player);
|
||||
case ItemId_Command_IncCardCounter: return cmdIncCardCounter(qobject_cast<Command_IncCardCounter *>(command), cont, game, player);
|
||||
case ItemId_Command_IncCounter: return cmdIncCounter(qobject_cast<Command_IncCounter *>(command), cont, game, player);
|
||||
case ItemId_Command_CreateCounter: return cmdCreateCounter(qobject_cast<Command_CreateCounter *>(command), cont, game, player);
|
||||
case ItemId_Command_SetCounter: return cmdSetCounter(qobject_cast<Command_SetCounter *>(command), cont, game, player);
|
||||
case ItemId_Command_DelCounter: return cmdDelCounter(qobject_cast<Command_DelCounter *>(command), cont, game, player);
|
||||
case ItemId_Command_NextTurn: return cmdNextTurn(qobject_cast<Command_NextTurn *>(command), cont, game, player);
|
||||
case ItemId_Command_SetActivePhase: return cmdSetActivePhase(qobject_cast<Command_SetActivePhase *>(command), cont, game, player);
|
||||
case ItemId_Command_DumpZone: return cmdDumpZone(qobject_cast<Command_DumpZone *>(command), cont, game, player);
|
||||
case ItemId_Command_StopDumpZone: return cmdStopDumpZone(qobject_cast<Command_StopDumpZone *>(command), cont, game, player);
|
||||
case ItemId_Command_RevealCards: return cmdRevealCards(qobject_cast<Command_RevealCards *>(command), cont, game, player);
|
||||
}
|
||||
} else {
|
||||
qDebug() << "received generic Command";
|
||||
switch (command->getItemId()) {
|
||||
case ItemId_Command_Ping: return cmdPing(qobject_cast<Command_Ping *>(command), cont);
|
||||
case ItemId_Command_Login: return cmdLogin(qobject_cast<Command_Login *>(command), cont);
|
||||
case ItemId_Command_Message: return cmdMessage(qobject_cast<Command_Message *>(command), cont);
|
||||
case ItemId_Command_DeckList: return cmdDeckList(qobject_cast<Command_DeckList *>(command), cont);
|
||||
case ItemId_Command_DeckNewDir: return cmdDeckNewDir(qobject_cast<Command_DeckNewDir *>(command), cont);
|
||||
case ItemId_Command_DeckDelDir: return cmdDeckDelDir(qobject_cast<Command_DeckDelDir *>(command), cont);
|
||||
case ItemId_Command_DeckDel: return cmdDeckDel(qobject_cast<Command_DeckDel *>(command), cont);
|
||||
case ItemId_Command_DeckUpload: return cmdDeckUpload(qobject_cast<Command_DeckUpload *>(command), cont);
|
||||
case ItemId_Command_DeckDownload: return cmdDeckDownload(qobject_cast<Command_DeckDownload *>(command), cont);
|
||||
case ItemId_Command_GetUserInfo: return cmdGetUserInfo(qobject_cast<Command_GetUserInfo *>(command), cont);
|
||||
case ItemId_Command_ListRooms: return cmdListRooms(qobject_cast<Command_ListRooms *>(command), cont);
|
||||
case ItemId_Command_JoinRoom: return cmdJoinRoom(qobject_cast<Command_JoinRoom *>(command), cont);
|
||||
case ItemId_Command_ListUsers: return cmdListUsers(qobject_cast<Command_ListUsers *>(command), cont);
|
||||
case ItemId_Command_DeckSelect: return cmdDeckSelect(static_cast<Command_DeckSelect *>(command), cont, game, player);
|
||||
case ItemId_Command_SetSideboardPlan: return cmdSetSideboardPlan(static_cast<Command_SetSideboardPlan *>(command), cont, game, player);
|
||||
case ItemId_Command_LeaveGame: return cmdLeaveGame(static_cast<Command_LeaveGame *>(command), cont, game, player);
|
||||
case ItemId_Command_ReadyStart: return cmdReadyStart(static_cast<Command_ReadyStart *>(command), cont, game, player);
|
||||
case ItemId_Command_Concede: return cmdConcede(static_cast<Command_Concede *>(command), cont, game, player);
|
||||
case ItemId_Command_Say: return cmdSay(static_cast<Command_Say *>(command), cont, game, player);
|
||||
case ItemId_Command_Shuffle: return cmdShuffle(static_cast<Command_Shuffle *>(command), cont, game, player);
|
||||
case ItemId_Command_Mulligan: return cmdMulligan(static_cast<Command_Mulligan *>(command), cont, game, player);
|
||||
case ItemId_Command_RollDie: return cmdRollDie(static_cast<Command_RollDie *>(command), cont, game, player);
|
||||
case ItemId_Command_DrawCards: return cmdDrawCards(static_cast<Command_DrawCards *>(command), cont, game, player);
|
||||
case ItemId_Command_MoveCard: return cmdMoveCard(static_cast<Command_MoveCard *>(command), cont, game, player);
|
||||
case ItemId_Command_FlipCard: return cmdFlipCard(static_cast<Command_FlipCard *>(command), cont, game, player);
|
||||
case ItemId_Command_AttachCard: return cmdAttachCard(static_cast<Command_AttachCard *>(command), cont, game, player);
|
||||
case ItemId_Command_CreateToken: return cmdCreateToken(static_cast<Command_CreateToken *>(command), cont, game, player);
|
||||
case ItemId_Command_CreateArrow: return cmdCreateArrow(static_cast<Command_CreateArrow *>(command), cont, game, player);
|
||||
case ItemId_Command_DeleteArrow: return cmdDeleteArrow(static_cast<Command_DeleteArrow *>(command), cont, game, player);
|
||||
case ItemId_Command_SetCardAttr: return cmdSetCardAttr(static_cast<Command_SetCardAttr *>(command), cont, game, player);
|
||||
case ItemId_Command_SetCardCounter: return cmdSetCardCounter(static_cast<Command_SetCardCounter *>(command), cont, game, player);
|
||||
case ItemId_Command_IncCardCounter: return cmdIncCardCounter(static_cast<Command_IncCardCounter *>(command), cont, game, player);
|
||||
case ItemId_Command_IncCounter: return cmdIncCounter(static_cast<Command_IncCounter *>(command), cont, game, player);
|
||||
case ItemId_Command_CreateCounter: return cmdCreateCounter(static_cast<Command_CreateCounter *>(command), cont, game, player);
|
||||
case ItemId_Command_SetCounter: return cmdSetCounter(static_cast<Command_SetCounter *>(command), cont, game, player);
|
||||
case ItemId_Command_DelCounter: return cmdDelCounter(static_cast<Command_DelCounter *>(command), cont, game, player);
|
||||
case ItemId_Command_NextTurn: return cmdNextTurn(static_cast<Command_NextTurn *>(command), cont, game, player);
|
||||
case ItemId_Command_SetActivePhase: return cmdSetActivePhase(static_cast<Command_SetActivePhase *>(command), cont, game, player);
|
||||
case ItemId_Command_DumpZone: return cmdDumpZone(static_cast<Command_DumpZone *>(command), cont, game, player);
|
||||
case ItemId_Command_StopDumpZone: return cmdStopDumpZone(static_cast<Command_StopDumpZone *>(command), cont, game, player);
|
||||
case ItemId_Command_RevealCards: return cmdRevealCards(static_cast<Command_RevealCards *>(command), cont, game, player);
|
||||
default: return RespInvalidCommand;
|
||||
}
|
||||
}
|
||||
return RespInvalidCommand;
|
||||
AdminCommand *adminCommand = qobject_cast<AdminCommand *>(command);
|
||||
if (adminCommand) {
|
||||
qDebug() << "received AdminCommand";
|
||||
if (!(userInfo->getUserLevel() & ServerInfo_User::IsAdmin))
|
||||
return RespLoginNeeded;
|
||||
|
||||
switch (command->getItemId()) {
|
||||
case ItemId_Command_UpdateServerMessage: return cmdUpdateServerMessage(static_cast<Command_UpdateServerMessage *>(command), cont);
|
||||
default: return RespInvalidCommand;
|
||||
}
|
||||
}
|
||||
qDebug() << "received generic Command";
|
||||
switch (command->getItemId()) {
|
||||
case ItemId_Command_Ping: return cmdPing(static_cast<Command_Ping *>(command), cont);
|
||||
case ItemId_Command_Login: return cmdLogin(static_cast<Command_Login *>(command), cont);
|
||||
case ItemId_Command_Message: return cmdMessage(static_cast<Command_Message *>(command), cont);
|
||||
case ItemId_Command_DeckList: return cmdDeckList(static_cast<Command_DeckList *>(command), cont);
|
||||
case ItemId_Command_DeckNewDir: return cmdDeckNewDir(static_cast<Command_DeckNewDir *>(command), cont);
|
||||
case ItemId_Command_DeckDelDir: return cmdDeckDelDir(static_cast<Command_DeckDelDir *>(command), cont);
|
||||
case ItemId_Command_DeckDel: return cmdDeckDel(static_cast<Command_DeckDel *>(command), cont);
|
||||
case ItemId_Command_DeckUpload: return cmdDeckUpload(static_cast<Command_DeckUpload *>(command), cont);
|
||||
case ItemId_Command_DeckDownload: return cmdDeckDownload(static_cast<Command_DeckDownload *>(command), cont);
|
||||
case ItemId_Command_GetUserInfo: return cmdGetUserInfo(static_cast<Command_GetUserInfo *>(command), cont);
|
||||
case ItemId_Command_ListRooms: return cmdListRooms(static_cast<Command_ListRooms *>(command), cont);
|
||||
case ItemId_Command_JoinRoom: return cmdJoinRoom(static_cast<Command_JoinRoom *>(command), cont);
|
||||
case ItemId_Command_ListUsers: return cmdListUsers(static_cast<Command_ListUsers *>(command), cont);
|
||||
default: return RespInvalidCommand;
|
||||
}
|
||||
}
|
||||
|
||||
void Server_ProtocolHandler::processCommandContainer(CommandContainer *cont)
|
||||
|
|
@ -330,7 +343,7 @@ ResponseCode Server_ProtocolHandler::cmdListUsers(Command_ListUsers * /*cmd*/, C
|
|||
QList<ServerInfo_User *> resultList;
|
||||
QMapIterator<QString, Server_ProtocolHandler *> userIterator = server->getUsers();
|
||||
while (userIterator.hasNext())
|
||||
resultList.append(new ServerInfo_User(userIterator.next().value()->getUserInfo()));
|
||||
resultList.append(new ServerInfo_User(userIterator.next().value()->getUserInfo(), false));
|
||||
|
||||
acceptsUserListChanges = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@ private:
|
|||
ResponseCode cmdDumpZone(Command_DumpZone *cmd, CommandContainer *cont, Server_Game *game, Server_Player *player);
|
||||
ResponseCode cmdStopDumpZone(Command_StopDumpZone *cmd, CommandContainer *cont, Server_Game *game, Server_Player *player);
|
||||
ResponseCode cmdRevealCards(Command_RevealCards *cmd, CommandContainer *cont, Server_Game *game, Server_Player *player);
|
||||
virtual ResponseCode cmdUpdateServerMessage(Command_UpdateServerMessage *cmd, CommandContainer *cont) = 0;
|
||||
|
||||
ResponseCode processCommandHelper(Command *command, CommandContainer *cont);
|
||||
private slots:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue