gameServer/Actions.hs
changeset 2343 3ab763dc14a3
parent 2341 408edb2f254c
child 2345 daf1785f2337
equal deleted inserted replaced
2342:ba22dc845b2d 2343:3ab763dc14a3
   192 processAction (clID, serverInfo, clients, rooms) (RoomRemoveThisClient msg) = do
   192 processAction (clID, serverInfo, clients, rooms) (RoomRemoveThisClient msg) = do
   193 	(_, _, newClients, newRooms) <-
   193 	(_, _, newClients, newRooms) <-
   194 		if roomID client /= 0 then
   194 		if roomID client /= 0 then
   195 			if isMaster client then
   195 			if isMaster client then
   196 				if (gameinprogress room) && (playersIn room > 1) then
   196 				if (gameinprogress room) && (playersIn room > 1) then
   197 					changeMaster
   197 					(changeMaster >>= (\state -> foldM processAction state
       
   198 						[AnswerOthersInRoom ["LEFT", nick client, msg],
       
   199 						RemoveClientTeams clID]))
   198 				else -- not in game
   200 				else -- not in game
   199 					processAction (clID, serverInfo, clients, rooms) RemoveRoom
   201 					processAction (clID, serverInfo, clients, rooms) RemoveRoom
   200 			else -- not master
   202 			else -- not master
   201 				foldM
   203 				foldM
   202 					processAction
   204 					processAction