gameServer/ServerCore.hs
changeset 4918 c6d3aec73f93
parent 4904 0eab727d4717
child 4932 f11d80bac7ed
equal deleted inserted replaced
4917:8ff92bdc9f98 4918:c6d3aec73f93
     7 import Control.Monad.Reader
     7 import Control.Monad.Reader
     8 import Control.Monad.State.Strict
     8 import Control.Monad.State.Strict
     9 import Data.Set as Set
     9 import Data.Set as Set
    10 import qualified Data.ByteString.Char8 as B
    10 import qualified Data.ByteString.Char8 as B
    11 import Control.DeepSeq
    11 import Control.DeepSeq
       
    12 import Data.Unique
    12 --------------------------------------
    13 --------------------------------------
    13 import CoreTypes
    14 import CoreTypes
    14 import NetRoutines
    15 import NetRoutines
    15 import HWProtoCore
    16 import HWProtoCore
    16 import Actions
    17 import Actions
    55                 --else
    56                 --else
    56                 --do
    57                 --do
    57                 --debugM "Clients" "Message from dead client"
    58                 --debugM "Clients" "Message from dead client"
    58                 --return (serverInfo, rnc)
    59                 --return (serverInfo, rnc)
    59 
    60 
    60         ClientAccountInfo (ci, info) -> do
    61         ClientAccountInfo ci uid info -> do
    61             rnc <- gets roomsClients
    62             rnc <- gets roomsClients
    62             exists <- liftIO $ clientExists rnc ci
    63             exists <- liftIO $ clientExists rnc ci
    63             when (exists) $ do
    64             when (exists) $ do
    64                 as <- get
    65                 as <- get
    65                 put $! as{clientIndex = Just ci}
    66                 put $! as{clientIndex = Just ci}
    66                 processAction (ProcessAccountInfo info)
    67                 uid' <- client's clUID
       
    68                 when (uid == (hashUnique uid')) $ processAction (ProcessAccountInfo info)
    67                 return ()
    69                 return ()
    68 
    70 
    69         TimerAction tick ->
    71         TimerAction tick ->
    70                 mapM_ processAction $
    72                 mapM_ processAction $
    71                     PingAll : [StatsAction | even tick]
    73                     PingAll : [StatsAction | even tick]