mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-15 03:28:49 -07:00
fixed shuffling, more chat widget code
This commit is contained in:
parent
947cd1736c
commit
120193fb0b
8 changed files with 131 additions and 9 deletions
|
|
@ -11,7 +11,7 @@ void ChatChannel::addPlayer(ServerSocket *player)
|
|||
QString str = QString("chat|join_channel|%1|%2").arg(name).arg(player->getPlayerName());
|
||||
for (int i = 0; i < size(); ++i)
|
||||
at(i)->msg(str);
|
||||
|
||||
|
||||
append(player);
|
||||
|
||||
for (int i = 0; i < size(); ++i)
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@ ServerSocket::~ServerSocket()
|
|||
server->removePlayer(this);
|
||||
if (game)
|
||||
game->removePlayer(this);
|
||||
for (int i = 0; i < chatChannels.size(); ++i)
|
||||
chatChannels[i]->removePlayer(this);
|
||||
}
|
||||
|
||||
int ServerSocket::newCardId()
|
||||
|
|
@ -256,9 +258,10 @@ ReturnMessage::ReturnCode ServerSocket::cmdChatJoinChannel(const QList<QVariant>
|
|||
QList<ChatChannel *> allChannels = server->getChatChannelList();
|
||||
for (int i = 0; i < allChannels.size(); ++i)
|
||||
if (allChannels[i]->getName() == params[0]) {
|
||||
remsg->send(ReturnMessage::ReturnOk);
|
||||
allChannels[i]->addPlayer(this);
|
||||
chatChannels << allChannels[i];
|
||||
return ReturnMessage::ReturnOk;
|
||||
return ReturnMessage::ReturnNothing;
|
||||
}
|
||||
return ReturnMessage::ReturnNameNotFound;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue