gameServer/EngineInteraction.hs
changeset 10067 8df84ec62600
parent 10066 1a6e1aad58d6
child 10343 fe9853dea6c4
equal deleted inserted replaced
10066:1a6e1aad58d6 10067:8df84ec62600
    93         ]
    93         ]
    94     where
    94     where
    95         keys1, keys2 :: Set.Set B.ByteString
    95         keys1, keys2 :: Set.Set B.ByteString
    96         keys1 = Set.fromList ["MAP", "MAPGEN", "MAZE_SIZE", "SEED", "TEMPLATE"]
    96         keys1 = Set.fromList ["MAP", "MAPGEN", "MAZE_SIZE", "SEED", "TEMPLATE"]
    97         keys2 = Set.fromList ["AMMO", "SCHEME", "SCRIPT", "THEME"]
    97         keys2 = Set.fromList ["AMMO", "SCHEME", "SCRIPT", "THEME"]
    98         sane = Set.null (Map.keysSet mParams Set.\\ keys1)
    98         sane = Set.null (keys1 Set.\\ Map.keysSet mParams)
    99             && Set.null (Map.keysSet prms Set.\\ keys2)
    99             && Set.null (keys2 Set.\\ Map.keysSet prms)
   100             && (not . null . drop 27 $ scheme)
   100             && (not . null . drop 27 $ scheme)
   101             && (not . null . tail $ prms Map.! "AMMO")
   101             && (not . null . tail $ prms Map.! "AMMO")
   102         mapGenTypes = ["+rnd+", "+maze+", "+drawn+"]
   102         mapGenTypes = ["+rnd+", "+maze+", "+drawn+"]
   103         maybeScript = let s = head . fromMaybe ["Normal"] $ Map.lookup "SCRIPT" prms in if s == "Normal" then [] else [eml ["escript Scripts/Multiplayer/", s, ".lua"]]
   103         maybeScript = let s = head . fromMaybe ["Normal"] $ Map.lookup "SCRIPT" prms in if s == "Normal" then [] else [eml ["escript Scripts/Multiplayer/", s, ".lua"]]
   104         maybeMap = let m = mParams Map.! "MAP" in if m `elem` mapGenTypes then [] else [eml ["emap ", m]]
   104         maybeMap = let m = mParams Map.! "MAP" in if m `elem` mapGenTypes then [] else [eml ["emap ", m]]