fixed shuffling, more chat widget code

This commit is contained in:
Max-Wilhelm Bruker 2009-08-22 21:57:03 +02:00
parent 947cd1736c
commit 120193fb0b
8 changed files with 131 additions and 9 deletions

View file

@ -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)

View file

@ -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;
}