mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-22 07:10:25 -08:00
server crash fix
This commit is contained in:
@@ -353,7 +353,6 @@ ResponseCode Server_ProtocolHandler::cmdJoinRoom(Command_JoinRoom *cmd, CommandC
|
|||||||
return RespNameNotFound;
|
return RespNameNotFound;
|
||||||
|
|
||||||
r->addClient(this);
|
r->addClient(this);
|
||||||
connect(r, SIGNAL(gameCreated(Server_Game *)), this, SLOT(gameCreated(Server_Game *)));
|
|
||||||
rooms.insert(r->getId(), r);
|
rooms.insert(r->getId(), r);
|
||||||
|
|
||||||
enqueueProtocolItem(new Event_RoomSay(r->getId(), QString(), r->getJoinMessage()));
|
enqueueProtocolItem(new Event_RoomSay(r->getId(), QString(), r->getJoinMessage()));
|
||||||
|
|||||||
@@ -91,7 +91,6 @@ private:
|
|||||||
ResponseCode processCommandHelper(Command *command, CommandContainer *cont);
|
ResponseCode processCommandHelper(Command *command, CommandContainer *cont);
|
||||||
private slots:
|
private slots:
|
||||||
void pingClockTimeout();
|
void pingClockTimeout();
|
||||||
void gameCreated(Server_Game *game);
|
|
||||||
public:
|
public:
|
||||||
Server_ProtocolHandler(Server *_server, QObject *parent = 0);
|
Server_ProtocolHandler(Server *_server, QObject *parent = 0);
|
||||||
~Server_ProtocolHandler();
|
~Server_ProtocolHandler();
|
||||||
@@ -104,6 +103,7 @@ public:
|
|||||||
const QMap<QString, ServerInfo_User *> &getBuddyList() const { return buddyList; }
|
const QMap<QString, ServerInfo_User *> &getBuddyList() const { return buddyList; }
|
||||||
const QMap<QString, ServerInfo_User *> &getIgnoreList() const { return ignoreList; }
|
const QMap<QString, ServerInfo_User *> &getIgnoreList() const { return ignoreList; }
|
||||||
|
|
||||||
|
void gameCreated(Server_Game *game);
|
||||||
int getLastCommandTime() const { return timeRunning - lastDataReceived; }
|
int getLastCommandTime() const { return timeRunning - lastDataReceived; }
|
||||||
void processCommandContainer(CommandContainer *cont);
|
void processCommandContainer(CommandContainer *cont);
|
||||||
virtual void sendProtocolItem(ProtocolItem *item, bool deleteItem = true) = 0;
|
virtual void sendProtocolItem(ProtocolItem *item, bool deleteItem = true) = 0;
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ void Server_Room::doCreateGame(const QString &description, const QString &passwo
|
|||||||
|
|
||||||
broadcastGameListUpdate(newGame);
|
broadcastGameListUpdate(newGame);
|
||||||
|
|
||||||
|
creator->gameCreated(newGame);
|
||||||
emit gameCreated(newGame);
|
emit gameCreated(newGame);
|
||||||
emit roomInfoChanged();
|
emit roomInfoChanged();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user