Reimplement one more Action server_refactor
authorunc0rr
Thu, 27 Jan 2011 22:10:24 +0300
branchserver_refactor
changeset 4599 a9e4093a7e78
parent 4597 31e042ab870c
child 4601 08ae94dd4c0d
Reimplement one more Action
gameServer/Actions.hs
gameServer/Utils.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
--- 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