gameServer/EngineInteraction.hs
changeset 10760 fcef7d62d3c4
parent 10755 f78a5ca6e0af
child 10777 18afcfaa4d5a
equal deleted inserted replaced
10758:0f3a0f117810 10760:fcef7d62d3c4
   115         keys1, keys2 :: Set.Set B.ByteString
   115         keys1, keys2 :: Set.Set B.ByteString
   116         keys1 = Set.fromList ["FEATURE_SIZE", "MAP", "MAPGEN", "MAZE_SIZE", "SEED", "TEMPLATE"]
   116         keys1 = Set.fromList ["FEATURE_SIZE", "MAP", "MAPGEN", "MAZE_SIZE", "SEED", "TEMPLATE"]
   117         keys2 = Set.fromList ["AMMO", "SCHEME", "SCRIPT", "THEME"]
   117         keys2 = Set.fromList ["AMMO", "SCHEME", "SCRIPT", "THEME"]
   118         sane = Set.null (keys1 Set.\\ Map.keysSet mParams)
   118         sane = Set.null (keys1 Set.\\ Map.keysSet mParams)
   119             && Set.null (keys2 Set.\\ Map.keysSet prms)
   119             && Set.null (keys2 Set.\\ Map.keysSet prms)
   120             && (not . null . drop 40 $ scheme)
   120             && (not . null . drop 41 $ scheme)
   121             && (not . null . tail $ prms Map.! "AMMO")
   121             && (not . null . tail $ prms Map.! "AMMO")
   122         mapGenTypes = ["+rnd+", "+maze+", "+drawn+"]
   122         mapGenTypes = ["+rnd+", "+maze+", "+drawn+"]
   123         maybeScript = let s = head . fromMaybe ["Normal"] $ Map.lookup "SCRIPT" prms in if s == "Normal" then [] else [eml ["escript Scripts/Multiplayer/", s, ".lua"]]
   123         maybeScript = let s = head . fromMaybe ["Normal"] $ Map.lookup "SCRIPT" prms in if s == "Normal" then [] else [eml ["escript Scripts/Multiplayer/", s, ".lua"]]
   124         maybeMap = let m = mParams Map.! "MAP" in if m `elem` mapGenTypes then [] else [eml ["emap ", m]]
   124         maybeMap = let m = mParams Map.! "MAP" in if m `elem` mapGenTypes then [] else [eml ["emap ", m]]
   125         scheme = tail $ prms Map.! "SCHEME"
   125         scheme = tail $ prms Map.! "SCHEME"