client/server version bump; eventConnectionStateChanged

This commit is contained in:
Max-Wilhelm Bruker
2011-06-25 17:50:28 +02:00
parent d892d320ea
commit 4b84168bda
24 changed files with 1232 additions and 1076 deletions

View File

@@ -46,8 +46,10 @@ void Server_ProtocolHandler::prepareDestroy()
if ((authState == UnknownUser) || p->getSpectator())
g->removePlayer(p);
else
else {
p->setProtocolHandler(0);
g->postConnectionStatusUpdate(p, false);
}
}
gameListMutex.unlock();
@@ -392,6 +394,7 @@ ResponseCode Server_ProtocolHandler::cmdJoinRoom(Command_JoinRoom *cmd, CommandC
for (int j = 0; j < gamePlayers.size(); ++j)
if (gamePlayers[j]->getUserInfo()->getName() == userInfo->getName()) {
gamePlayers[j]->setProtocolHandler(this);
game->postConnectionStatusUpdate(gamePlayers[j], true);
games.insert(game->getGameId(), QPair<Server_Game *, Server_Player *>(game, gamePlayers[j]));
enqueueProtocolItem(new Event_GameJoined(game->getGameId(), game->getDescription(), gamePlayers[j]->getPlayerId(), gamePlayers[j]->getSpectator(), game->getSpectatorsCanTalk(), game->getSpectatorsSeeEverything(), true));