gameServer/HWProtoNEState.hs
changeset 3566 772a46ef8288
parent 3538 b11ac2677e42
child 3671 a94d1dc4a8d9
equal deleted inserted replaced
3565:bc3410104894 3566:772a46ef8288
    33 
    33 
    34 handleCmd_NotEntered ["PROTO", protoNum] = do
    34 handleCmd_NotEntered ["PROTO", protoNum] = do
    35     (ci, irnc) <- ask
    35     (ci, irnc) <- ask
    36     let cl = irnc `client` ci
    36     let cl = irnc `client` ci
    37     if clientProto cl > 0 then return [ProtocolError "Protocol already known"]
    37     if clientProto cl > 0 then return [ProtocolError "Protocol already known"]
    38         else 
    38         else
    39         if parsedProto == 0 then return [ProtocolError "Bad number"]
    39         if parsedProto == 0 then return [ProtocolError "Bad number"]
    40             else 
    40             else
    41             return $
    41             return $
    42                 ModifyClient (\c -> c{clientProto = parsedProto}) :
    42                 ModifyClient (\c -> c{clientProto = parsedProto}) :
    43                 AnswerClients [sendChan cl] ["PROTO", B.pack $ show parsedProto] :
    43                 AnswerClients [sendChan cl] ["PROTO", B.pack $ show parsedProto] :
    44                 [CheckRegistered | not . B.null $ nick cl]
    44                 [CheckRegistered | not . B.null $ nick cl]
    45     where
    45     where