gameServer/Votes.hs
changeset 10195 d1c23bb73346
parent 10090 a471a7bbc339
child 10212 5fb3bb2de9d2
--- a/gameServer/Votes.hs	Thu Mar 13 23:25:31 2014 +0400
+++ b/gameServer/Votes.hs	Fri Mar 14 00:42:04 2014 +0400
@@ -6,6 +6,7 @@
 import ServerState
 import qualified Data.ByteString.Char8 as B
 import qualified Data.List as L
+import qualified Data.Map as Map
 import Data.Maybe
 -------------------
 import Utils
@@ -61,6 +62,12 @@
                 && sameRoom
                 && ((isNothing $ gameInfo rm) || teamsInGame kickCl == 0)
             ]
+    act (VoteMap roomSave) = do
+        rm <- thisRoom
+        let rs = Map.lookup roomSave (roomSaves rm)
+        case rs of
+             Nothing -> return []
+             Just (mp, p) -> return [ModifyRoom $ \r -> r{params = p, mapParams = mp}]
 
 
 startVote :: VoteType -> Reader (ClientIndex, IRnC) [Action]
@@ -86,4 +93,4 @@
 
 voteInfo :: VoteType -> B.ByteString
 voteInfo (VoteKick n) = B.concat [loc "kick", " ", n]
-
+voteInfo (VoteMap n) = B.concat [loc "map", " ", n]