Fix even more
authorunc0rr
Wed, 02 Feb 2011 21:23:47 +0300
changeset 4906 22cc9c2b5ae5
parent 4905 7842d085acf4
child 4907 8bf14795a528
Fix even more
gameServer/OfficialServer/DBInteraction.hs
gameServer/OfficialServer/extdbinterface.hs
--- a/gameServer/OfficialServer/DBInteraction.hs	Wed Feb 02 21:23:12 2011 +0300
+++ b/gameServer/OfficialServer/DBInteraction.hs	Wed Feb 02 21:23:47 2011 +0300
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP, ScopedTypeVariables #-}
+{-# LANGUAGE CPP, ScopedTypeVariables, OverloadedStrings #-}
 module OfficialServer.DBInteraction
 (
     startDBConnection
@@ -20,7 +20,7 @@
 
 localAddressList = ["127.0.0.1", "0:0:0:0:0:0:0:1", "0:0:0:0:0:ffff:7f00:1"]
 
-fakeDbConnection serverInfo = do
+fakeDbConnection serverInfo = forever $ do
     q <- readChan $ dbQueries serverInfo
     case q of
         CheckAccount clUid _ clHost -> do
@@ -29,8 +29,6 @@
         ClearCache -> return ()
         SendStats {} -> return ()
 
-    fakeDbConnection serverInfo
-
 
 #if defined(OFFICIAL_SERVER)
 pipeDbConnectionLoop queries coreChan hIn hOut accountsCache =
--- a/gameServer/OfficialServer/extdbinterface.hs	Wed Feb 02 21:23:12 2011 +0300
+++ b/gameServer/OfficialServer/extdbinterface.hs	Wed Feb 02 21:23:47 2011 +0300
@@ -1,4 +1,4 @@
-{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE ScopedTypeVariables, OverloadedStrings #-}
 
 module Main where
 
@@ -26,7 +26,7 @@
     case q of
         CheckAccount clUid clNick _ -> do
                 statement <- prepare dbConn dbQueryAccount
-                execute statement [SqlString $ clNick]
+                execute statement [SqlByteString $ clNick]
                 passAndRole <- fetchRow statement
                 finish statement
                 let response = 
@@ -47,7 +47,7 @@
 
 
 dbConnectionLoop mySQLConnectionInfo =
-    Control.Exception.handle (\(_ :: IOException) -> return ()) $ handleSqlError $
+    Control.Exception.handle (\(e :: IOException) -> hPutStrLn stderr $ show e) $ handleSqlError $
         bracket
             (connectMySQL mySQLConnectionInfo)
             (disconnect)