# HG changeset patch # User unc0rr # Date 1395990126 -14400 # Node ID 6928a323097f25e59abb11112450893e216fdeb9 # Parent 26fc5502ba229816d428c6e6e313a06759edfc42 Fix build diff -r 26fc5502ba22 -r 6928a323097f gameServer/Actions.hs --- a/gameServer/Actions.hs Thu Mar 27 23:25:31 2014 +0400 +++ b/gameServer/Actions.hs Fri Mar 28 11:02:06 2014 +0400 @@ -35,7 +35,7 @@ import EngineInteraction import FloodDetection import HWProtoCore - +import Votes othersChans :: StateT ServerState IO [ClientChan] othersChans = do diff -r 26fc5502ba22 -r 6928a323097f gameServer/RoomsAndClients.hs --- a/gameServer/RoomsAndClients.hs Thu Mar 27 23:25:31 2014 +0400 +++ b/gameServer/RoomsAndClients.hs Fri Mar 28 11:02:06 2014 +0400 @@ -22,6 +22,7 @@ client'sM, room'sM, allClientsM, + allRoomsM, clientsM, roomsM, roomClientsM, diff -r 26fc5502ba22 -r 6928a323097f gameServer/Votes.hs --- a/gameServer/Votes.hs Thu Mar 27 23:25:31 2014 +0400 +++ b/gameServer/Votes.hs Fri Mar 28 11:02:06 2014 +0400 @@ -2,7 +2,7 @@ module Votes where import Control.Monad.Reader -import Control.Monad.State +import Control.Monad.State.Strict import ServerState import qualified Data.ByteString.Char8 as B import qualified Data.List as L @@ -93,10 +93,9 @@ checkVotes :: StateT ServerState IO [Action] checkVotes = do rnc <- gets roomsClients - io $ do + liftM concat $ io $ do ris <- allRoomsM rnc - actions <- mapM (check rnc) ris - mapM_ processAction actions + mapM (check rnc) ris where check rnc ri = do e <- room'sM rnc voting ri @@ -104,11 +103,11 @@ Just rv -> do modifyRoom rnc (\r -> r{voting = if voteTTL rv == 0 then Nothing else Just rv{voteTTL = voteTTL rv - 1}}) ri if voteTTL rv == 0 then do - chans <- liftM sendChan $ roomClientsM rnc ri + chans <- liftM (map sendChan) $ roomClientsM rnc ri return [AnswerClients chans ["CHAT", "[server]", loc "Voting expired"]] else return [] - Nothing -> return [] + Nothing -> return [] voteInfo :: VoteType -> B.ByteString