gameServer/OfficialServer/extdbinterface.hs
changeset 11575 db7743e2fad1
parent 11573 8fd1808b12ed
child 11579 d389ea7ca66f
--- 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