Send updated info on map switched by voting
authorunc0rr
Fri, 28 Mar 2014 23:04:23 +0400
changeset 10218 1d7112ccb3e9
parent 10217 1a1da2342c5b
child 10219 bbeb1e9aaa65
Send updated info on map switched by voting
gameServer/Votes.hs
--- a/gameServer/Votes.hs	Fri Mar 28 21:20:25 2014 +0400
+++ b/gameServer/Votes.hs	Fri Mar 28 23:04:23 2014 +0400
@@ -68,7 +68,17 @@
         let rs = Map.lookup roomSave (roomSaves rm)
         case rs of
              Nothing -> return []
-             Just (mp, p) -> return [ModifyRoom $ \r -> r{params = p, mapParams = mp}]
+             Just (mp, p) -> do
+                 cl <- thisClient
+                 chans <- roomClientsChans
+                 let a = map (replaceChans chans) $ answerFullConfigParams cl mp p
+                 return $ 
+                    (ModifyRoom $ \r -> r{params = p, mapParams = mp})
+                    : SendUpdateOnThisRoom
+                    : a
+        where
+            replaceChans chans (AnswerClients _ msg) = AnswerClients chans msg
+            replaceChans _ a = a
 
 
 startVote :: VoteType -> Reader (ClientIndex, IRnC) [Action]