gameServer/OfficialServer/GameReplayStore.hs
changeset 10086 4a7ce724357f
parent 10051 cc6f62d7aea2
child 10460 8dcea9087d75
equal deleted inserted replaced
10085:3e6cb7d80986 10086:4a7ce724357f
    50         else
    50         else
    51         return (Nothing, [])
    51         return (Nothing, [])
    52     where
    52     where
    53         loadFile :: String -> IO (Maybe CheckInfo, [B.ByteString])
    53         loadFile :: String -> IO (Maybe CheckInfo, [B.ByteString])
    54         loadFile fileName = E.handle (\(e :: SomeException) ->
    54         loadFile fileName = E.handle (\(e :: SomeException) ->
    55                     warningM "REPLAYS" ("Problems reading " ++ fileName ++ ": " ++ show e) >> return (Nothing, [])) $ do
    55                     warningM "REPLAYS" ("Problems reading " ++ fileName ++ ": " ++ show e) >> return (Just $ CheckInfo fileName [], [])) $ do
    56             (teams, params1, params2, roundMsgs) <- liftM read $ readFile fileName
    56             (teams, params1, params2, roundMsgs) <- liftM read $ readFile fileName
    57             return $ (
    57             return $ (
    58                 Just (CheckInfo fileName teams)
    58                 Just (CheckInfo fileName teams)
    59                 , let d = replayToDemo teams (Map.fromList params1) (Map.fromList params2) (reverse roundMsgs) in d `deepseq` d
    59                 , let d = replayToDemo teams (Map.fromList params1) (Map.fromList params2) (reverse roundMsgs) in d `deepseq` d
    60                 )
    60                 )