equal
deleted
inserted
replaced
40 case r of |
40 case r of |
41 Accept ci -> processAction (AddClient ci) |
41 Accept ci -> processAction (AddClient ci) |
42 |
42 |
43 ClientMessage (ci, cmd) -> do |
43 ClientMessage (ci, cmd) -> do |
44 liftIO $ debugM "Clients" $ show ci ++ ": " ++ show cmd |
44 liftIO $ debugM "Clients" $ show ci ++ ": " ++ show cmd |
45 |
45 |
46 removed <- gets removedClients |
46 removed <- gets removedClients |
47 unless (ci `Set.member` removed) $ do |
47 unless (ci `Set.member` removed) $ do |
48 as <- get |
48 modify (\s -> s{clientIndex = Just ci}) |
49 put $! as{clientIndex = Just ci} |
|
50 reactCmd cmd |
49 reactCmd cmd |
51 |
50 |
52 Remove ci -> |
51 Remove ci -> |
53 processAction (DeleteClient ci) |
52 processAction (DeleteClient ci) |
54 |
53 |
55 ClientAccountInfo ci uid info -> do |
54 ClientAccountInfo ci uid info -> do |
56 rnc <- gets roomsClients |
55 rnc <- gets roomsClients |
57 exists <- liftIO $ clientExists rnc ci |
56 exists <- liftIO $ clientExists rnc ci |
58 when exists $ do |
57 when exists $ do |
59 as <- get |
58 modify (\s -> s{clientIndex = Just ci}) |
60 put $! as{clientIndex = Just ci} |
|
61 uid' <- client's clUID |
59 uid' <- client's clUID |
62 when (uid == hashUnique uid') $ processAction (ProcessAccountInfo info) |
60 when (uid == hashUnique uid') $ processAction (ProcessAccountInfo info) |
63 return () |
61 return () |
64 |
62 |
65 TimerAction tick -> |
63 TimerAction tick -> |