diff -r 8fd1808b12ed -r db7743e2fad1 gameServer/OfficialServer/extdbinterface.hs --- a/gameServer/OfficialServer/extdbinterface.hs Wed Feb 24 22:37:03 2016 +0300 +++ b/gameServer/OfficialServer/extdbinterface.hs Thu Feb 25 23:17:52 2016 +0300 @@ -140,13 +140,13 @@ ps bs ps ("GHOST_POINTS" : n : bs) = do let pointsNum = readInt_ n - (loc, time) <- get - res <- io $ query dbConn dbQueryBestTime $ Only loc + (location, time) <- get + res <- io $ query dbConn dbQueryBestTime $ Only location let bestTime = case res of [Only a] -> a _ -> maxBound :: Int when (time < bestTime) $ do - -- store it + io $ writeFile (B.unpack $ "ghosts/" `B.append` sanitizeName location) $ show (map readInt_ $ take (2 * pointsNum) bs) return () ps (drop (2 * pointsNum) bs) ps (b:bs) = ps bs