equal
deleted
inserted
replaced
403 let newLogins = takeWhile (\(_ , (time, _)) -> connectTime cl `diffUTCTime` time <= 0) $ lastLogins si |
403 let newLogins = takeWhile (\(_ , (time, _)) -> connectTime cl `diffUTCTime` time <= 0) $ lastLogins si |
404 let info = host cl `Prelude.lookup` newLogins |
404 let info = host cl `Prelude.lookup` newLogins |
405 if isJust info then |
405 if isJust info then |
406 mapM_ processAction [ModifyServerInfo (\s -> s{lastLogins = newLogins}), ByeClient (snd . fromJust $ info)] |
406 mapM_ processAction [ModifyServerInfo (\s -> s{lastLogins = newLogins}), ByeClient (snd . fromJust $ info)] |
407 else |
407 else |
408 processAction $ ModifyServerInfo (\s -> s{lastLogins = (host cl, (addUTCTime 10 $ connectTime cl, "Reconnected too fast")) : newLogins}) |
408 processAction $ ModifyServerInfo (\s -> s{lastLogins = (host cl, (addUTCTime 0 $ connectTime cl, "Reconnected too fast")) : newLogins}) |
409 |
409 |
410 |
410 |
411 processAction PingAll = do |
411 processAction PingAll = do |
412 rnc <- gets roomsClients |
412 rnc <- gets roomsClients |
413 io (allClientsM rnc) >>= mapM_ (kickTimeouted rnc) |
413 io (allClientsM rnc) >>= mapM_ (kickTimeouted rnc) |