gameServer/OfficialServer/GameReplayStore.hs
changeset 11320 556eafd1443a
parent 11246 09a2d3988569
child 11341 e6e748d021d0
equal deleted inserted replaced
11319:3c4ec0742967 11320:556eafd1443a
    68         else
    68         else
    69         return (Nothing, [])
    69         return (Nothing, [])
    70     where
    70     where
    71         loadFile :: String -> IO (Maybe CheckInfo, [B.ByteString])
    71         loadFile :: String -> IO (Maybe CheckInfo, [B.ByteString])
    72         loadFile fileName = E.handle (\(e :: SomeException) ->
    72         loadFile fileName = E.handle (\(e :: SomeException) ->
    73                     warningM "REPLAYS" ("Problems reading " ++ fileName ++ ": " ++ show e) >> return (Just $ CheckInfo fileName [] "", [])) $ do
    73                     warningM "REPLAYS" ("Problems reading " ++ fileName ++ ": " ++ show e) >> return (Just $ CheckInfo fileName [] Nothing, [])) $ do
    74             (teams, params1, params2, roundMsgs) <- liftM read $ readFile fileName
    74             (teams, params1, params2, roundMsgs) <- liftM read $ readFile fileName
    75             let d = replayToDemo teams (Map.fromList params1) (Map.fromList params2) (reverse roundMsgs)
    75             let d = replayToDemo teams (Map.fromList params1) (Map.fromList params2) (reverse roundMsgs)
    76             d `deepseq` return $ (
    76             d `deepseq` return $ (
    77                 Just (CheckInfo fileName teams (head $ fst d))
    77                 Just (CheckInfo fileName teams (fst d))
    78                 , snd d
    78                 , snd d
    79                 )
    79                 )
    80 
    80 
    81 moveFailedRecord :: String -> IO ()
    81 moveFailedRecord :: String -> IO ()
    82 moveFailedRecord fn = E.handle (\(e :: SomeException) -> warningM "REPLAYS" $ show e) $
    82 moveFailedRecord fn = E.handle (\(e :: SomeException) -> warningM "REPLAYS" $ show e) $