more mutexes

This commit is contained in:
Max-Wilhelm Bruker
2011-03-22 19:37:56 +01:00
parent 4548841a93
commit 81a5d58d70
10 changed files with 127 additions and 7 deletions

View File

@@ -68,6 +68,8 @@ ResponseCode Server_ProtocolHandler::processCommandHelper(Command *command, Comm
if (!room)
return RespNameNotFound;
QMutexLocker locker(&room->roomMutex);
switch (command->getItemId()) {
case ItemId_Command_LeaveRoom: return cmdLeaveRoom(static_cast<Command_LeaveRoom *>(command), cont, room);
case ItemId_Command_RoomSay: return cmdRoomSay(static_cast<Command_RoomSay *>(command), cont, room);
@@ -90,6 +92,8 @@ ResponseCode Server_ProtocolHandler::processCommandHelper(Command *command, Comm
Server_Game *game = gamePair.first;
Server_Player *player = gamePair.second;
QMutexLocker locker(&game->gameMutex);
switch (command->getItemId()) {
case ItemId_Command_DeckSelect: return cmdDeckSelect(static_cast<Command_DeckSelect *>(command), cont, game, player);
case ItemId_Command_SetSideboardPlan: return cmdSetSideboardPlan(static_cast<Command_SetSideboardPlan *>(command), cont, game, player);