gameServer/Actions.hs
changeset 10195 d1c23bb73346
parent 10148 a599593e1dc2
child 10212 5fb3bb2de9d2
equal deleted inserted replaced
10194:7025bd3c3131 10195:d1c23bb73346
   775             , [AnswerClients [c]  ["RUN_GAME"]]
   775             , [AnswerClients [c]  ["RUN_GAME"]]
   776             , [AnswerClients [c] $ "EM" : roundMsgs']
   776             , [AnswerClients [c] $ "EM" : roundMsgs']
   777             , [AnswerClients [c] ["KICKED"]]
   777             , [AnswerClients [c] ["KICKED"]]
   778             ]
   778             ]
   779 
   779 
       
   780 processAction (SaveRoom rname) = do
       
   781     rnc <- gets roomsClients
       
   782     ri <- clientRoomA
       
   783     rm <- io $ room'sM rnc id ri
       
   784     liftIO $ writeFile (B.unpack rname) $ show (greeting rm, roomSaves rm)
       
   785 
       
   786 processAction (LoadRoom rname) = do
       
   787     (g, rs) <- liftIO $ liftM read $ readFile (B.unpack rname)
       
   788     processAction $ ModifyRoom $ \r -> r{greeting = g, roomSaves = rs}
   780 
   789 
   781 processAction Cleanup = do
   790 processAction Cleanup = do
   782     jm <- gets joinsMonitor
   791     jm <- gets joinsMonitor
   783 
   792 
   784     io $ do
   793     io $ do