gameServer/HWProtoNEState.hs
changeset 8371 0551b5c3de9a
parent 5090 2922455e606e
child 8372 3c193ec03e09
equal deleted inserted replaced
8370:0c79946e96f8 8371:0551b5c3de9a
    46         return $ JoinLobby : [AnswerClients [sendChan cl] ["ADMIN_ACCESS"] | isAdministrator cl]
    46         return $ JoinLobby : [AnswerClients [sendChan cl] ["ADMIN_ACCESS"] | isAdministrator cl]
    47         else
    47         else
    48         return [ByeClient "Authentication failed"]
    48         return [ByeClient "Authentication failed"]
    49 
    49 
    50 
    50 
       
    51 handleCmd_NotEntered ["CHECKER", protoNum, newNick, password] = do
       
    52     (ci, irnc) <- ask
       
    53     let cl = irnc `client` ci
       
    54 
       
    55     if parsedProto == 0 then return [ProtocolError "Bad number"]
       
    56         else
       
    57         return $ [
       
    58             ModifyClient (\c -> c{clientProto = parsedProto, nick = newNick, webPassword = password, isChecker = True})
       
    59             , CheckRegistered]
       
    60     where
       
    61         parsedProto = readInt_ protoNum
       
    62 
       
    63 
    51 handleCmd_NotEntered _ = return [ProtocolError "Incorrect command (state: not entered)"]
    64 handleCmd_NotEntered _ = return [ProtocolError "Incorrect command (state: not entered)"]