gameServer/Actions.hs
changeset 10014 56d2f2d5aad8
parent 9973 7589978c9912
child 10015 4feced261c68
equal deleted inserted replaced
10013:4d7302e9b617 10014:56d2f2d5aad8
   452         processAction $ CheckBanned False
   452         processAction $ CheckBanned False
   453         liftM B.null $ client's nick
   453         liftM B.null $ client's nick
   454     checkerLogin _ False _ = processAction $ ByeClient $ loc "No checker rights"
   454     checkerLogin _ False _ = processAction $ ByeClient $ loc "No checker rights"
   455     checkerLogin p True _ = do
   455     checkerLogin p True _ = do
   456         wp <- client's webPassword
   456         wp <- client's webPassword
   457         processAction $
   457         chan <- client's sendChan
   458             if wp == p then ModifyClient $ \c -> c{logonPassed = True} else ByeClient $ loc "Authentication failed"
   458         mapM_ processAction $
       
   459             if wp == p then 
       
   460                 [ModifyClient $ \c -> c{logonPassed = True}
       
   461                 , AnswerClients [chan] ["LOGONPASSED"]
       
   462                 ]
       
   463                 else 
       
   464                 [ByeClient $ loc "Authentication failed"]
   459     playerLogin p a contr = do
   465     playerLogin p a contr = do
   460         chan <- client's sendChan
   466         chan <- client's sendChan
   461         mapM_ processAction [
   467         mapM_ processAction [
   462             AnswerClients [chan] ["ASKPASSWORD"]
   468             AnswerClients [chan] ["ASKPASSWORD"]
   463             , ModifyClient (\c -> c{webPassword = p, isAdministrator = a, isContributor = contr})
   469             , ModifyClient (\c -> c{webPassword = p, isAdministrator = a, isContributor = contr})