gameServer/Actions.hs
branchserver_refactor
changeset 4599 a9e4093a7e78
parent 4597 31e042ab870c
child 4601 08ae94dd4c0d
equal deleted inserted replaced
4597:31e042ab870c 4599:a9e4093a7e78
    43     | ModifyServerInfo (ServerInfo -> ServerInfo)
    43     | ModifyServerInfo (ServerInfo -> ServerInfo)
    44     | AddRoom B.ByteString B.ByteString
    44     | AddRoom B.ByteString B.ByteString
    45     | CheckRegistered
    45     | CheckRegistered
    46     | ClearAccountsCache
    46     | ClearAccountsCache
    47     | ProcessAccountInfo AccountInfo
    47     | ProcessAccountInfo AccountInfo
    48     | Dump
       
    49     | AddClient ClientInfo
    48     | AddClient ClientInfo
    50     | DeleteClient ClientIndex
    49     | DeleteClient ClientIndex
    51     | PingAll
    50     | PingAll
    52     | StatsAction
    51     | StatsAction
    53 
    52 
   363     h <- client's host
   362     h <- client's host
   364     db <- gets (dbQueries . serverInfo)
   363     db <- gets (dbQueries . serverInfo)
   365     liftIO $ writeChan db $ CheckAccount ci n h
   364     liftIO $ writeChan db $ CheckAccount ci n h
   366     return ()
   365     return ()
   367 
   366 
   368 {-
   367 
   369 processAction (clID, serverInfo, rnc) (ClearAccountsCache) = do
   368 processAction ClearAccountsCache = do
   370     writeChan (dbQueries serverInfo) ClearCache
   369     dbq <- gets (dbQueries . serverInfo)
   371     return (clID, serverInfo, rnc)
   370     liftIO $ writeChan dbq ClearCache
   372     where
   371     return ()
   373         client = clients ! clID
   372 
   374 
       
   375 
       
   376 processAction (clID, serverInfo, rnc) (Dump) = do
       
   377     writeChan (sendChan $ clients ! clID) ["DUMP", show serverInfo, showTree clients, showTree rooms]
       
   378     return (clID, serverInfo, rnc)
       
   379 -}
       
   380 
   373 
   381 processAction (ProcessAccountInfo info) =
   374 processAction (ProcessAccountInfo info) =
   382     case info of
   375     case info of
   383         HasAccount passwd isAdmin -> do
   376         HasAccount passwd isAdmin -> do
   384             chan <- client's sendChan
   377             chan <- client's sendChan