gameServer/OfficialServer/DBInteraction.hs
changeset 4996 76ef3d8bd78e
parent 4992 408301a9d2d6
child 7331 0e50456d652c
equal deleted inserted replaced
4995:d3ca68e4860e 4996:76ef3d8bd78e
    34         CheckAccount clId clUid _ clHost ->
    34         CheckAccount clId clUid _ clHost ->
    35             writeChan (coreChan si) $ ClientAccountInfo clId clUid (if clHost `L.elem` localAddressList then Admin else Guest)
    35             writeChan (coreChan si) $ ClientAccountInfo clId clUid (if clHost `L.elem` localAddressList then Admin else Guest)
    36         ClearCache -> return ()
    36         ClearCache -> return ()
    37         SendStats {} -> return ()
    37         SendStats {} -> return ()
    38 
    38 
    39 --dbConnectionLoop :: forall b. (ServerInfo c) -> IO b
    39 dbConnectionLoop :: ServerInfo -> IO ()
       
    40 
    40 #if defined(OFFICIAL_SERVER)
    41 #if defined(OFFICIAL_SERVER)
    41 flushRequests :: ServerInfo -> IO ()
    42 flushRequests :: ServerInfo -> IO ()
    42 flushRequests si = do
    43 flushRequests si = do
    43     e <- isEmptyChan $ dbQueries si
    44     e <- isEmptyChan $ dbQueries si
    44     unless e $ do
    45     unless e $ do
   113 
   114 
   114     when (newErrNum > 1) $ flushRequests si
   115     when (newErrNum > 1) $ flushRequests si
   115     threadDelay (3000000)
   116     threadDelay (3000000)
   116     pipeDbConnection updatedCache si newErrNum
   117     pipeDbConnection updatedCache si newErrNum
   117 
   118 
   118 dbConnectionLoop :: ServerInfo -> IO ()
       
   119 dbConnectionLoop si =
   119 dbConnectionLoop si =
   120         if (not . B.null $ dbHost si) then
   120         if (not . B.null $ dbHost si) then
   121             pipeDbConnection Map.empty si 0
   121             pipeDbConnection Map.empty si 0
   122         else
   122         else
   123             fakeDbConnection si
   123             fakeDbConnection si