diff -r 51521238724f -r 7d99655130ff gameServer/HWProtoNEState.hs --- a/gameServer/HWProtoNEState.hs Tue Jun 22 18:06:55 2010 +0200 +++ b/gameServer/HWProtoNEState.hs Tue Jun 22 22:21:44 2010 +0400 @@ -31,6 +31,7 @@ where haveSameNick irnc = False --isJust $ find (\cl -> newNick == nick cl) $ IntMap.elems clients + handleCmd_NotEntered ["PROTO", protoNum] = do (ci, irnc) <- ask let cl = irnc `client` ci @@ -47,18 +48,17 @@ Just (i, t) | B.null t -> fromIntegral i otherwise -> 0 -{- + +handleCmd_NotEntered ["PASSWORD", passwd] = do + (ci, irnc) <- ask + let cl = irnc `client` ci -handleCmd_NotEntered clID clients _ ["PASSWORD", passwd] = - if passwd == webPassword client then - [ModifyClient (\cl -> cl{logonPassed = True}), - MoveToLobby] ++ adminNotice - else - [ByeClient "Authentication failed"] - where - client = clients IntMap.! clID - adminNotice = [AnswerThisClient ["ADMIN_ACCESS"] | isAdministrator client] + if passwd == webPassword cl then + return $ JoinLobby : [AnswerClients [sendChan cl] ["ADMIN_ACCESS"] | isAdministrator cl] + else + return [ByeClient "Authentication failed"] +{- handleCmd_NotEntered clID clients _ ["DUMP"] = if isAdministrator (clients IntMap.! clID) then [Dump] else []