gameServer/HWProtoNEState.hs
changeset 2747 7889a3a9724f
parent 2352 7eaf82cf0890
child 2867 9be6693c78cb
equal deleted inserted replaced
2746:55593f8a490b 2747:7889a3a9724f
    11 
    11 
    12 handleCmd_NotEntered :: CmdHandler
    12 handleCmd_NotEntered :: CmdHandler
    13 
    13 
    14 handleCmd_NotEntered clID clients _ ["NICK", newNick]
    14 handleCmd_NotEntered clID clients _ ["NICK", newNick]
    15 	| not . null $ nick client = [ProtocolError "Nickname already chosen"]
    15 	| not . null $ nick client = [ProtocolError "Nickname already chosen"]
    16 	| haveSameNick = [AnswerThisClient ["WARNING", "Nickname collision"], ByeClient ""]
    16 	| haveSameNick = [AnswerThisClient ["WARNING", "Nickname already in use"], ByeClient ""]
    17 	| illegalName newNick = [ByeClient "Illegal nickname"]
    17 	| illegalName newNick = [ByeClient "Illegal nickname"]
    18 	| otherwise =
    18 	| otherwise =
    19 		ModifyClient (\c -> c{nick = newNick}) :
    19 		ModifyClient (\c -> c{nick = newNick}) :
    20 		AnswerThisClient ["NICK", newNick] :
    20 		AnswerThisClient ["NICK", newNick] :
    21 		[CheckRegistered | clientProto client /= 0]
    21 		[CheckRegistered | clientProto client /= 0]