gameServer/Actions.hs
changeset 10786 712283ed86e0
parent 10732 7c4f9e5e447c
child 10814 810ac1d21fd0
--- a/gameServer/Actions.hs	Mon Jan 12 08:20:20 2015 -0500
+++ b/gameServer/Actions.hs	Tue Jan 13 23:37:07 2015 +0300
@@ -425,6 +425,15 @@
     mapM_ processAction removeTeamActions
 
 
+processAction SetRandomSeed = do
+    ri <- clientRoomA
+    thisRoomChans <- liftM (map sendChan) $ roomClientsS ri
+    seed <- liftM showB $ io $ (randomRIO (0, 10^9) :: IO Int)
+    mapM_ processAction [
+        ModifyRoom (\r -> r{mapParams = Map.insert "SEED" seed $ mapParams r})
+        , AnswerClients thisRoomChans ["CFG", "SEED", seed]
+        ]
+
 
 processAction CheckRegistered = do
     (Just ci) <- gets clientIndex