mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-21 14:50:26 -08:00
initial commit for rooms
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
class Server_Player;
|
||||
class Server_Card;
|
||||
class ServerInfo_User;
|
||||
class Server_Room;
|
||||
class QTimer;
|
||||
|
||||
class Server_ProtocolHandler : public QObject {
|
||||
@@ -17,15 +18,14 @@ class Server_ProtocolHandler : public QObject {
|
||||
protected:
|
||||
Server *server;
|
||||
QMap<int, QPair<Server_Game *, Server_Player *> > games;
|
||||
QMap<QString, Server_ChatChannel *> chatChannels;
|
||||
QMap<int, Server_Room *> rooms;
|
||||
|
||||
Server *getServer() const { return server; }
|
||||
QPair<Server_Game *, Server_Player *> getGame(int gameId) const;
|
||||
|
||||
AuthenticationResult authState;
|
||||
bool acceptsGameListChanges;
|
||||
bool acceptsUserListChanges;
|
||||
bool acceptsChatChannelListChanges;
|
||||
bool acceptsRoomListChanges;
|
||||
ServerInfo_User *userInfo;
|
||||
|
||||
private:
|
||||
@@ -45,14 +45,13 @@ private:
|
||||
virtual ResponseCode cmdDeckUpload(Command_DeckUpload *cmd, CommandContainer *cont) = 0;
|
||||
virtual ResponseCode cmdDeckDownload(Command_DeckDownload *cmd, CommandContainer *cont) = 0;
|
||||
ResponseCode cmdGetUserInfo(Command_GetUserInfo *cmd, CommandContainer *cont);
|
||||
ResponseCode cmdListChatChannels(Command_ListChatChannels *cmd, CommandContainer *cont);
|
||||
ResponseCode cmdChatJoinChannel(Command_ChatJoinChannel *cmd, CommandContainer *cont);
|
||||
ResponseCode cmdChatLeaveChannel(Command_ChatLeaveChannel *cmd, CommandContainer *cont, Server_ChatChannel *channel);
|
||||
ResponseCode cmdChatSay(Command_ChatSay *cmd, CommandContainer *cont, Server_ChatChannel *channel);
|
||||
ResponseCode cmdListRooms(Command_ListRooms *cmd, CommandContainer *cont);
|
||||
ResponseCode cmdJoinRoom(Command_JoinRoom *cmd, CommandContainer *cont);
|
||||
ResponseCode cmdLeaveRoom(Command_LeaveRoom *cmd, CommandContainer *cont, Server_Room *room);
|
||||
ResponseCode cmdRoomSay(Command_RoomSay *cmd, CommandContainer *cont, Server_Room *room);
|
||||
ResponseCode cmdListUsers(Command_ListUsers *cmd, CommandContainer *cont);
|
||||
ResponseCode cmdListGames(Command_ListGames *cmd, CommandContainer *cont);
|
||||
ResponseCode cmdCreateGame(Command_CreateGame *cmd, CommandContainer *cont);
|
||||
ResponseCode cmdJoinGame(Command_JoinGame *cmd, CommandContainer *cont);
|
||||
ResponseCode cmdCreateGame(Command_CreateGame *cmd, CommandContainer *cont, Server_Room *room);
|
||||
ResponseCode cmdJoinGame(Command_JoinGame *cmd, CommandContainer *cont, Server_Room *room);
|
||||
ResponseCode cmdLeaveGame(Command_LeaveGame *cmd, CommandContainer *cont, Server_Game *game, Server_Player *player);
|
||||
ResponseCode cmdConcede(Command_Concede *cmd, CommandContainer *cont, Server_Game *game, Server_Player *player);
|
||||
ResponseCode cmdReadyStart(Command_ReadyStart *cmd, CommandContainer *cont, Server_Game *game, Server_Player *player);
|
||||
@@ -91,9 +90,8 @@ public:
|
||||
~Server_ProtocolHandler();
|
||||
void playerRemovedFromGame(Server_Game *game);
|
||||
|
||||
bool getAcceptsGameListChanges() const { return acceptsGameListChanges; }
|
||||
bool getAcceptsUserListChanges() const { return acceptsUserListChanges; }
|
||||
bool getAcceptsChatChannelListChanges() const { return acceptsChatChannelListChanges; }
|
||||
bool getAcceptsRoomListChanges() const { return acceptsRoomListChanges; }
|
||||
ServerInfo_User *getUserInfo() const { return userInfo; }
|
||||
void setUserInfo(ServerInfo_User *_userInfo) { userInfo = _userInfo; }
|
||||
const QDateTime &getLastCommandTime() const { return lastCommandTime; }
|
||||
|
||||
Reference in New Issue
Block a user