equal
deleted
inserted
replaced
19 import CoreTypes |
19 import CoreTypes |
20 import Utils |
20 import Utils |
21 |
21 |
22 localAddressList = ["127.0.0.1", "0:0:0:0:0:0:0:1", "0:0:0:0:0:ffff:7f00:1"] |
22 localAddressList = ["127.0.0.1", "0:0:0:0:0:0:0:1", "0:0:0:0:0:ffff:7f00:1"] |
23 |
23 |
24 fakeDbConnection serverInfo = do |
24 fakeDbConnection serverInfo = forever $ do |
25 q <- readChan $ dbQueries serverInfo |
25 q <- readChan $ dbQueries serverInfo |
26 case q of |
26 case q of |
27 CheckAccount clUid _ clHost -> do |
27 CheckAccount clUid _ clHost -> do |
28 writeChan (coreChan serverInfo) $ ClientAccountInfo (clUid, |
28 writeChan (coreChan serverInfo) $ ClientAccountInfo (clUid, |
29 if clHost `elem` localAddressList then Admin else Guest) |
29 if clHost `elem` localAddressList then Admin else Guest) |
30 ClearCache -> return () |
30 ClearCache -> return () |
31 SendStats {} -> return () |
31 SendStats {} -> return () |
32 |
|
33 fakeDbConnection serverInfo |
|
34 |
32 |
35 |
33 |
36 #if defined(OFFICIAL_SERVER) |
34 #if defined(OFFICIAL_SERVER) |
37 pipeDbConnectionLoop queries coreChan hIn hOut accountsCache = |
35 pipeDbConnectionLoop queries coreChan hIn hOut accountsCache = |
38 Exception.handle (\(e :: Exception.IOException) -> warningM "Database" (show e) >> return accountsCache) $ |
36 Exception.handle (\(e :: Exception.IOException) -> warningM "Database" (show e) >> return accountsCache) $ |