gameServer/HWProtoNEState.hs
branchserver_refactor
changeset 4610 9541b2a76067
parent 4579 4e61c2a42121
child 4904 0eab727d4717
equal deleted inserted replaced
4608:d0f758d0ff91 4610:9541b2a76067
    18 handleCmd_NotEntered ["NICK", newNick] = do
    18 handleCmd_NotEntered ["NICK", newNick] = do
    19     (ci, irnc) <- ask
    19     (ci, irnc) <- ask
    20     let cl = irnc `client` ci
    20     let cl = irnc `client` ci
    21     if not . B.null $ nick cl then return [ProtocolError "Nickname already chosen"]
    21     if not . B.null $ nick cl then return [ProtocolError "Nickname already chosen"]
    22         else
    22         else
    23         if haveSameNick irnc then return [{-AnswerClients [sendChan cl] ["WARNING", "Nickname already in use"], -}ByeClient "Nickname already in use"]
    23         if haveSameNick irnc then return [NoticeMessage NickAlreadyInUse]
    24             else
    24             else
    25             if illegalName newNick then return [ByeClient "Illegal nickname"]
    25             if illegalName newNick then return [ByeClient "Illegal nickname"]
    26                 else
    26                 else
    27                 return $
    27                 return $
    28                     ModifyClient (\c -> c{nick = newNick}) :
    28                     ModifyClient (\c -> c{nick = newNick}) :
    55     if passwd == webPassword cl then
    55     if passwd == webPassword cl then
    56         return $ JoinLobby : [AnswerClients [sendChan cl] ["ADMIN_ACCESS"] | isAdministrator cl]
    56         return $ JoinLobby : [AnswerClients [sendChan cl] ["ADMIN_ACCESS"] | isAdministrator cl]
    57         else
    57         else
    58         return [ByeClient "Authentication failed"]
    58         return [ByeClient "Authentication failed"]
    59 
    59 
    60 {-
       
    61 
       
    62 handleCmd_NotEntered clID clients _ ["DUMP"] =
       
    63     if isAdministrator (clients IntMap.! clID) then [Dump] else []
       
    64 -}
       
    65 
    60 
    66 handleCmd_NotEntered _ = return [ProtocolError "Incorrect command (state: not entered)"]
    61 handleCmd_NotEntered _ = return [ProtocolError "Incorrect command (state: not entered)"]