# HG changeset patch # User unc0rr # Date 1285441312 -14400 # Node ID 124b4755914b388e94711d6aee567a175f768197 # Parent 5fe24180fc724dffae198d06c39be91ccb252312 Show database errors in stderr diff -r 5fe24180fc72 -r 124b4755914b gameServer/CoreTypes.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 diff -r 5fe24180fc72 -r 124b4755914b gameServer/OfficialServer/extdbinterface.hs --- 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) diff -r 5fe24180fc72 -r 124b4755914b gameServer/RoomsAndClients.hs --- 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, diff -r 5fe24180fc72 -r 124b4755914b gameServer/Store.hs --- 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