gameServer/HWProtoNEState.hs
changeset 2150 45b695f3a7b9
parent 1879 bb114339eb4e
child 2155 d897222d3339
equal deleted inserted replaced
2149:2eda77999bec 2150:45b695f3a7b9
    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 	if not . null $ nick client then
    15 	if not . null $ nick client then
    16 		[ProtocolError "Nick already chosen"]
    16 		[ProtocolError "Nickname already chosen"]
    17 	else if haveSameNick then
    17 	else if haveSameNick then
    18 		[AnswerThisClient ["WARNING", "Nick collision"]]
    18 		[AnswerThisClient ["WARNING", "Nickname collision"]]
    19 		++ [ByeClient ""]
    19 		++ [ByeClient ""]
       
    20 	else if illegalName newNick then
       
    21 		[ByeClient "Illegal nickname"]
    20 	else
    22 	else
    21 		[ModifyClient (\c -> c{nick = newNick}),
    23 		[ModifyClient (\c -> c{nick = newNick}),
    22 		AnswerThisClient ["NICK", newNick]]
    24 		AnswerThisClient ["NICK", newNick]]
    23 		++ checkPassword
    25 		++ checkPassword
    24 	where
    26 	where