Show database errors in stderr
authorunc0rr
Sat, 25 Sep 2010 23:01:52 +0400
changeset 3901 124b4755914b
parent 3900 5fe24180fc72
child 3905 7768ac820d5a
Show database errors in stderr
gameServer/CoreTypes.hs
gameServer/OfficialServer/extdbinterface.hs
gameServer/RoomsAndClients.hs
gameServer/Store.hs
--- a/gameServer/CoreTypes.hs	Fri Sep 24 15:14:40 2010 -0400
+++ b/gameServer/CoreTypes.hs	Sat Sep 25 23:01:52 2010 +0400
@@ -31,7 +31,7 @@
         roomID :: RoomIndex,
         pingsQueue :: !Word,
         isMaster :: Bool,
-        isReady :: Bool,
+        isReady :: !Bool,
         isAdministrator :: Bool,
         clientClan :: B.ByteString,
         teamsInGame :: Word
--- a/gameServer/OfficialServer/extdbinterface.hs	Fri Sep 24 15:14:40 2010 -0400
+++ b/gameServer/OfficialServer/extdbinterface.hs	Sat Sep 25 23:01:52 2010 +0400
@@ -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)
--- a/gameServer/RoomsAndClients.hs	Fri Sep 24 15:14:40 2010 -0400
+++ b/gameServer/RoomsAndClients.hs	Sat Sep 25 23:01:52 2010 +0400
@@ -13,7 +13,6 @@
     lobbyId,
     moveClientToLobby,
     moveClientToRoom,
-    clientRoom,
     clientRoomM,
     clientExists,
     client,
--- a/gameServer/Store.hs	Fri Sep 24 15:14:40 2010 -0400
+++ b/gameServer/Store.hs	Sat Sep 25 23:01:52 2010 +0400
@@ -93,7 +93,7 @@
 modifyElem :: MStore e -> (e -> e) -> ElemIndex -> IO ()
 modifyElem (MStore ref) f (ElemIndex n) = do
     (_, _, arr) <- readIORef ref
-    IOA.readArray arr n >>= (IOA.writeArray arr n) . f
+    IOA.readArray arr n >>= IOA.writeArray arr n . f
 
 elemExists :: MStore e -> ElemIndex -> IO Bool
 elemExists (MStore ref) (ElemIndex n) = do