gameServer/OfficialServer/DBInteraction.hs
changeset 2155 d897222d3339
parent 2129 8664554d5547
child 2172 80d34c0b9dfe
equal deleted inserted replaced
2154:3d2917be12c3 2155:d897222d3339
    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 
    31 
    31 	fakeDbConnection serverInfo
    32 	fakeDbConnection serverInfo
    32 
    33 
    33 
    34 
    34 #if defined(OFFICIAL_SERVER)
    35 #if defined(OFFICIAL_SERVER)
    61 					(unGetChan queries q)
    62 					(unGetChan queries q)
    62 				else
    63 				else
    63 				do
    64 				do
    64 					writeChan coreChan $ ClientAccountInfo (clUid, snd $ fromJust cacheEntry)
    65 					writeChan coreChan $ ClientAccountInfo (clUid, snd $ fromJust cacheEntry)
    65 					return accountsCache
    66 					return accountsCache
       
    67 
       
    68 		ClearCache -> return Map.empty
    66 	
    69 	
    67 	return updatedCache
    70 	return updatedCache
    68 	where
    71 	where
    69 		maybeException (Just a) = return a
    72 		maybeException (Just a) = return a
    70 		maybeException Nothing = ioError (userError "Can't read")
    73 		maybeException Nothing = ioError (userError "Can't read")