mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 17:14:52 -07:00
bugfix, more deck list submission code
This commit is contained in:
parent
fdf921e718
commit
7a07a395f1
10 changed files with 118 additions and 113 deletions
|
|
@ -4,62 +4,61 @@ ItemId_Command_Login = 1002,
|
|||
ItemId_Command_DeckList = 1003,
|
||||
ItemId_Command_DeckNewDir = 1004,
|
||||
ItemId_Command_DeckDelDir = 1005,
|
||||
ItemId_Command_DeckNew = 1006,
|
||||
ItemId_Command_DeckDel = 1007,
|
||||
ItemId_Command_DeckDownload = 1008,
|
||||
ItemId_Command_ListChatChannels = 1009,
|
||||
ItemId_Command_ChatJoinChannel = 1010,
|
||||
ItemId_Command_ChatLeaveChannel = 1011,
|
||||
ItemId_Command_ChatSay = 1012,
|
||||
ItemId_Command_ListGames = 1013,
|
||||
ItemId_Command_CreateGame = 1014,
|
||||
ItemId_Command_JoinGame = 1015,
|
||||
ItemId_Command_LeaveGame = 1016,
|
||||
ItemId_Command_Say = 1017,
|
||||
ItemId_Command_Shuffle = 1018,
|
||||
ItemId_Command_RollDie = 1019,
|
||||
ItemId_Command_DrawCards = 1020,
|
||||
ItemId_Command_MoveCard = 1021,
|
||||
ItemId_Command_CreateToken = 1022,
|
||||
ItemId_Command_CreateArrow = 1023,
|
||||
ItemId_Command_DeleteArrow = 1024,
|
||||
ItemId_Command_SetCardAttr = 1025,
|
||||
ItemId_Command_ReadyStart = 1026,
|
||||
ItemId_Command_IncCounter = 1027,
|
||||
ItemId_Command_AddCounter = 1028,
|
||||
ItemId_Command_SetCounter = 1029,
|
||||
ItemId_Command_DelCounter = 1030,
|
||||
ItemId_Command_NextTurn = 1031,
|
||||
ItemId_Command_SetActivePhase = 1032,
|
||||
ItemId_Command_DumpZone = 1033,
|
||||
ItemId_Command_StopDumpZone = 1034,
|
||||
ItemId_Command_DumpAll = 1035,
|
||||
ItemId_Command_SubmitDeck = 1036,
|
||||
ItemId_Event_Say = 1037,
|
||||
ItemId_Event_Join = 1038,
|
||||
ItemId_Event_Leave = 1039,
|
||||
ItemId_Event_GameClosed = 1040,
|
||||
ItemId_Event_ReadyStart = 1041,
|
||||
ItemId_Event_SetupZones = 1042,
|
||||
ItemId_Event_GameStart = 1043,
|
||||
ItemId_Event_Shuffle = 1044,
|
||||
ItemId_Event_RollDie = 1045,
|
||||
ItemId_Event_MoveCard = 1046,
|
||||
ItemId_Event_CreateToken = 1047,
|
||||
ItemId_Event_CreateArrow = 1048,
|
||||
ItemId_Event_DeleteArrow = 1049,
|
||||
ItemId_Event_SetCardAttr = 1050,
|
||||
ItemId_Event_AddCounter = 1051,
|
||||
ItemId_Event_SetCounter = 1052,
|
||||
ItemId_Event_DelCounter = 1053,
|
||||
ItemId_Event_SetActivePlayer = 1054,
|
||||
ItemId_Event_SetActivePhase = 1055,
|
||||
ItemId_Event_DumpZone = 1056,
|
||||
ItemId_Event_StopDumpZone = 1057,
|
||||
ItemId_Event_ServerMessage = 1058,
|
||||
ItemId_Event_GameJoined = 1059,
|
||||
ItemId_Event_ChatJoinChannel = 1060,
|
||||
ItemId_Event_ChatLeaveChannel = 1061,
|
||||
ItemId_Event_ChatSay = 1062,
|
||||
ItemId_Other = 1063
|
||||
ItemId_Command_DeckDel = 1006,
|
||||
ItemId_Command_DeckDownload = 1007,
|
||||
ItemId_Command_ListChatChannels = 1008,
|
||||
ItemId_Command_ChatJoinChannel = 1009,
|
||||
ItemId_Command_ChatLeaveChannel = 1010,
|
||||
ItemId_Command_ChatSay = 1011,
|
||||
ItemId_Command_ListGames = 1012,
|
||||
ItemId_Command_CreateGame = 1013,
|
||||
ItemId_Command_JoinGame = 1014,
|
||||
ItemId_Command_LeaveGame = 1015,
|
||||
ItemId_Command_Say = 1016,
|
||||
ItemId_Command_Shuffle = 1017,
|
||||
ItemId_Command_RollDie = 1018,
|
||||
ItemId_Command_DrawCards = 1019,
|
||||
ItemId_Command_MoveCard = 1020,
|
||||
ItemId_Command_CreateToken = 1021,
|
||||
ItemId_Command_CreateArrow = 1022,
|
||||
ItemId_Command_DeleteArrow = 1023,
|
||||
ItemId_Command_SetCardAttr = 1024,
|
||||
ItemId_Command_ReadyStart = 1025,
|
||||
ItemId_Command_IncCounter = 1026,
|
||||
ItemId_Command_AddCounter = 1027,
|
||||
ItemId_Command_SetCounter = 1028,
|
||||
ItemId_Command_DelCounter = 1029,
|
||||
ItemId_Command_NextTurn = 1030,
|
||||
ItemId_Command_SetActivePhase = 1031,
|
||||
ItemId_Command_DumpZone = 1032,
|
||||
ItemId_Command_StopDumpZone = 1033,
|
||||
ItemId_Command_DumpAll = 1034,
|
||||
ItemId_Command_SubmitDeck = 1035,
|
||||
ItemId_Event_Say = 1036,
|
||||
ItemId_Event_Join = 1037,
|
||||
ItemId_Event_Leave = 1038,
|
||||
ItemId_Event_GameClosed = 1039,
|
||||
ItemId_Event_ReadyStart = 1040,
|
||||
ItemId_Event_SetupZones = 1041,
|
||||
ItemId_Event_GameStart = 1042,
|
||||
ItemId_Event_Shuffle = 1043,
|
||||
ItemId_Event_RollDie = 1044,
|
||||
ItemId_Event_MoveCard = 1045,
|
||||
ItemId_Event_CreateToken = 1046,
|
||||
ItemId_Event_CreateArrow = 1047,
|
||||
ItemId_Event_DeleteArrow = 1048,
|
||||
ItemId_Event_SetCardAttr = 1049,
|
||||
ItemId_Event_AddCounter = 1050,
|
||||
ItemId_Event_SetCounter = 1051,
|
||||
ItemId_Event_DelCounter = 1052,
|
||||
ItemId_Event_SetActivePlayer = 1053,
|
||||
ItemId_Event_SetActivePhase = 1054,
|
||||
ItemId_Event_DumpZone = 1055,
|
||||
ItemId_Event_StopDumpZone = 1056,
|
||||
ItemId_Event_ServerMessage = 1057,
|
||||
ItemId_Event_GameJoined = 1058,
|
||||
ItemId_Event_ChatJoinChannel = 1059,
|
||||
ItemId_Event_ChatLeaveChannel = 1060,
|
||||
ItemId_Event_ChatSay = 1061,
|
||||
ItemId_Other = 1062
|
||||
};
|
||||
|
|
|
|||
|
|
@ -33,29 +33,15 @@ void Command_DeckNewDir::extractParameters()
|
|||
path = parameters["path"];
|
||||
name = parameters["name"];
|
||||
}
|
||||
Command_DeckDelDir::Command_DeckDelDir(const QString &_path, const QString &_name)
|
||||
: Command("deck_del_dir"), path(_path), name(_name)
|
||||
Command_DeckDelDir::Command_DeckDelDir(const QString &_path)
|
||||
: Command("deck_del_dir"), path(_path)
|
||||
{
|
||||
setParameter("path", path);
|
||||
setParameter("name", name);
|
||||
}
|
||||
void Command_DeckDelDir::extractParameters()
|
||||
{
|
||||
Command::extractParameters();
|
||||
path = parameters["path"];
|
||||
name = parameters["name"];
|
||||
}
|
||||
Command_DeckNew::Command_DeckNew(const QString &_path, int _id)
|
||||
: Command("deck_new"), path(_path), id(_id)
|
||||
{
|
||||
setParameter("path", path);
|
||||
setParameter("id", id);
|
||||
}
|
||||
void Command_DeckNew::extractParameters()
|
||||
{
|
||||
Command::extractParameters();
|
||||
path = parameters["path"];
|
||||
id = parameters["id"].toInt();
|
||||
}
|
||||
Command_DeckDel::Command_DeckDel(int _id)
|
||||
: Command("deck_del"), id(_id)
|
||||
|
|
@ -672,7 +658,6 @@ void ProtocolItem::initializeHashAuto()
|
|||
itemNameHash.insert("cmddeck_list", Command_DeckList::newItem);
|
||||
itemNameHash.insert("cmddeck_new_dir", Command_DeckNewDir::newItem);
|
||||
itemNameHash.insert("cmddeck_del_dir", Command_DeckDelDir::newItem);
|
||||
itemNameHash.insert("cmddeck_new", Command_DeckNew::newItem);
|
||||
itemNameHash.insert("cmddeck_del", Command_DeckDel::newItem);
|
||||
itemNameHash.insert("cmddeck_download", Command_DeckDownload::newItem);
|
||||
itemNameHash.insert("cmdlist_chat_channels", Command_ListChatChannels::newItem);
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
0:login:s,username:s,password
|
||||
0:deck_list
|
||||
0:deck_new_dir:s,path:s,name
|
||||
0:deck_del_dir:s,path:s,name
|
||||
0:deck_new:s,path:i,id
|
||||
0:deck_del_dir:s,path
|
||||
0:deck_del:i,id
|
||||
0:deck_download:i,id
|
||||
0:list_chat_channels
|
||||
|
|
|
|||
|
|
@ -51,30 +51,14 @@ class Command_DeckDelDir : public Command {
|
|||
Q_OBJECT
|
||||
private:
|
||||
QString path;
|
||||
QString name;
|
||||
public:
|
||||
Command_DeckDelDir(const QString &_path = QString(), const QString &_name = QString());
|
||||
Command_DeckDelDir(const QString &_path = QString());
|
||||
QString getPath() const { return path; }
|
||||
QString getName() const { return name; }
|
||||
static ProtocolItem *newItem() { return new Command_DeckDelDir; }
|
||||
int getItemId() const { return ItemId_Command_DeckDelDir; }
|
||||
protected:
|
||||
void extractParameters();
|
||||
};
|
||||
class Command_DeckNew : public Command {
|
||||
Q_OBJECT
|
||||
private:
|
||||
QString path;
|
||||
int id;
|
||||
public:
|
||||
Command_DeckNew(const QString &_path = QString(), int _id = -1);
|
||||
QString getPath() const { return path; }
|
||||
int getId() const { return id; }
|
||||
static ProtocolItem *newItem() { return new Command_DeckNew; }
|
||||
int getItemId() const { return ItemId_Command_DeckNew; }
|
||||
protected:
|
||||
void extractParameters();
|
||||
};
|
||||
class Command_DeckDel : public Command {
|
||||
Q_OBJECT
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -87,7 +87,6 @@ void Server_ProtocolHandler::processCommand(Command *command)
|
|||
case ItemId_Command_DeckList: response = cmdDeckList(qobject_cast<Command_DeckList *>(command)); break;
|
||||
case ItemId_Command_DeckNewDir: response = cmdDeckNewDir(qobject_cast<Command_DeckNewDir *>(command)); break;
|
||||
case ItemId_Command_DeckDelDir: response = cmdDeckDelDir(qobject_cast<Command_DeckDelDir *>(command)); break;
|
||||
case ItemId_Command_DeckNew: response = cmdDeckNew(qobject_cast<Command_DeckNew *>(command)); break;
|
||||
case ItemId_Command_DeckDel: response = cmdDeckDel(qobject_cast<Command_DeckDel *>(command)); break;
|
||||
case ItemId_Command_DeckUpload: response = cmdDeckUpload(qobject_cast<Command_DeckUpload *>(command)); break;
|
||||
case ItemId_Command_DeckDownload: response = cmdDeckDownload(qobject_cast<Command_DeckDownload *>(command)); break;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ private:
|
|||
virtual ResponseCode cmdDeckList(Command_DeckList *cmd) = 0;
|
||||
virtual ResponseCode cmdDeckNewDir(Command_DeckNewDir *cmd) = 0;
|
||||
virtual ResponseCode cmdDeckDelDir(Command_DeckDelDir *cmd) = 0;
|
||||
virtual ResponseCode cmdDeckNew(Command_DeckNew *cmd) = 0;
|
||||
virtual ResponseCode cmdDeckDel(Command_DeckDel *cmd) = 0;
|
||||
virtual ResponseCode cmdDeckUpload(Command_DeckUpload *cmd) = 0;
|
||||
virtual ResponseCode cmdDeckDownload(Command_DeckDownload *cmd) = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue