# HG changeset patch # User unc0rr # Date 1296155424 -10800 # Node ID a9e4093a7e789dfd46392e793b1f4ede7f57aa53 # Parent 31e042ab870c3a3b0b8c133434188389661bbbd4 Reimplement one more Action diff -r 31e042ab870c -r a9e4093a7e78 gameServer/Actions.hs --- a/gameServer/Actions.hs Thu Jan 27 22:06:42 2011 +0300 +++ b/gameServer/Actions.hs Thu Jan 27 22:10:24 2011 +0300 @@ -45,7 +45,6 @@ | CheckRegistered | ClearAccountsCache | ProcessAccountInfo AccountInfo - | Dump | AddClient ClientInfo | DeleteClient ClientIndex | PingAll @@ -365,18 +364,12 @@ liftIO $ writeChan db $ CheckAccount ci n h return () -{- -processAction (clID, serverInfo, rnc) (ClearAccountsCache) = do - writeChan (dbQueries serverInfo) ClearCache - return (clID, serverInfo, rnc) - where - client = clients ! clID +processAction ClearAccountsCache = do + dbq <- gets (dbQueries . serverInfo) + liftIO $ writeChan dbq ClearCache + return () -processAction (clID, serverInfo, rnc) (Dump) = do - writeChan (sendChan $ clients ! clID) ["DUMP", show serverInfo, showTree clients, showTree rooms] - return (clID, serverInfo, rnc) --} processAction (ProcessAccountInfo info) = case info of diff -r 31e042ab870c -r a9e4093a7e78 gameServer/Utils.hs --- a/gameServer/Utils.hs Thu Jan 27 22:06:42 2011 +0300 +++ b/gameServer/Utils.hs Thu Jan 27 22:10:24 2011 +0300 @@ -121,3 +121,5 @@ showB :: Show a => a -> B.ByteString showB = B.pack .show + +io = liftIO