gameServer/Actions.hs
changeset 10195 d1c23bb73346
parent 10148 a599593e1dc2
child 10212 5fb3bb2de9d2
--- a/gameServer/Actions.hs	Thu Mar 13 23:25:31 2014 +0400
+++ b/gameServer/Actions.hs	Fri Mar 14 00:42:04 2014 +0400
@@ -777,6 +777,15 @@
             , [AnswerClients [c] ["KICKED"]]
             ]
 
+processAction (SaveRoom rname) = do
+    rnc <- gets roomsClients
+    ri <- clientRoomA
+    rm <- io $ room'sM rnc id ri
+    liftIO $ writeFile (B.unpack rname) $ show (greeting rm, roomSaves rm)
+
+processAction (LoadRoom rname) = do
+    (g, rs) <- liftIO $ liftM read $ readFile (B.unpack rname)
+    processAction $ ModifyRoom $ \r -> r{greeting = g, roomSaves = rs}
 
 processAction Cleanup = do
     jm <- gets joinsMonitor