gameServer/HWProtoNEState.hs
changeset 4942 1c85a8e6e11c
parent 4932 f11d80bac7ed
child 4975 31da8979e5b1
equal deleted inserted replaced
4941:90572c338e60 4942:1c85a8e6e11c
    16 handleCmd_NotEntered ["NICK", newNick] = do
    16 handleCmd_NotEntered ["NICK", newNick] = do
    17     (ci, irnc) <- ask
    17     (ci, irnc) <- ask
    18     let cl = irnc `client` ci
    18     let cl = irnc `client` ci
    19     if not . B.null $ nick cl then return [ProtocolError "Nickname already chosen"]
    19     if not . B.null $ nick cl then return [ProtocolError "Nickname already chosen"]
    20         else
    20         else
    21         if haveSameNick irnc then return [NoticeMessage NickAlreadyInUse]
    21         if haveSameNick irnc then if clientProto cl < 38 then return [ByeClient "Nickname is already in use"] else return [NoticeMessage NickAlreadyInUse]
    22             else
    22             else
    23             if illegalName newNick then return [ByeClient "Illegal nickname"]
    23             if illegalName newNick then return [ByeClient "Illegal nickname"]
    24                 else
    24                 else
    25                 return $
    25                 return $
    26                     ModifyClient (\c -> c{nick = newNick}) :
    26                     ModifyClient (\c -> c{nick = newNick}) :