equal
deleted
inserted
replaced
567 infoM "Clients" (show ci ++ ": New client. Time: " ++ show (connectTime cl)) |
567 infoM "Clients" (show ci ++ ": New client. Time: " ++ show (connectTime cl)) |
568 |
568 |
569 return ci |
569 return ci |
570 |
570 |
571 modify (\s -> s{clientIndex = Just newClId}) |
571 modify (\s -> s{clientIndex = Just newClId}) |
572 mapM_ processAction |
572 |
573 [ |
573 jm <- gets joinsMonitor |
574 AnswerClients [sendChan cl] ["CONNECTED", "Hedgewars server http://www.hedgewars.org/", serverVersion] |
574 pass <- io $ joinsSentry jm (host cl) (connectTime cl) |
575 , CheckBanned True |
575 |
576 , AddIP2Bans (host cl) "Reconnected too fast" (addUTCTime 10 $ connectTime cl) |
576 if pass then |
577 ] |
577 mapM_ processAction |
578 |
578 [ |
|
579 CheckBanned True |
|
580 , AnswerClients [sendChan cl] ["CONNECTED", "Hedgewars server http://www.hedgewars.org/", serverVersion] |
|
581 ] |
|
582 else |
|
583 processAction $ ByeClient $ loc "Reconnected too fast" |
579 |
584 |
580 processAction (AddNick2Bans n reason expiring) = do |
585 processAction (AddNick2Bans n reason expiring) = do |
581 processAction $ ModifyServerInfo (\s -> s{bans = BanByNick n reason expiring : bans s}) |
586 processAction $ ModifyServerInfo (\s -> s{bans = BanByNick n reason expiring : bans s}) |
582 |
587 |
583 processAction (AddIP2Bans ip reason expiring) = do |
588 processAction (AddIP2Bans ip reason expiring) = do |
758 , answerAllTeams cl teams' |
763 , answerAllTeams cl teams' |
759 , [AnswerClients [c] ["RUN_GAME"]] |
764 , [AnswerClients [c] ["RUN_GAME"]] |
760 , [AnswerClients [c] $ "EM" : roundMsgs'] |
765 , [AnswerClients [c] $ "EM" : roundMsgs'] |
761 , [AnswerClients [c] ["KICKED"]] |
766 , [AnswerClients [c] ["KICKED"]] |
762 ] |
767 ] |
|
768 |
|
769 |
|
770 processAction Cleanup = do |
|
771 jm <- gets joinsMonitor |
|
772 |
|
773 io $ do |
|
774 t <- getCurrentTime |
|
775 cleanup jm t |