Exemple #1
0
def cg_name_handler(sock, arg):
    if not check_char_name(arg):
        sock.send("{cIllegal name, please pick another.{n\r\n")
    elif mudsys.player_exists(arg):
        sock.send("{cA player with that name already exists.{n\r\n")
    elif mudsys.player_creating(arg):
        sock.send("{cA player is already being created with that name.{n\r\n")
    elif arg.lower().startswith("guest"):
        sock.send("{cCharacter names cannot begin with 'guest'.{n\r\n")
    else:
        name = arg[0].upper() + arg[1:]
        ch = mudsys.create_player(name)

        if ch == None:
            sock.send("{cIllegal name, please pick another.{n\r\n")
        else:
            mudsys.attach_char_socket(ch, sock)
            ch.rdesc = ch.name + " is here."
            sock.pop_ih()
Exemple #2
0
def cg_name_handler(sock, arg):
    if not check_char_name(arg):
        sock.send("{cIllegal name, please pick another.{n\r\n")
    elif mudsys.player_exists(arg):
        sock.send("{cA player with that name already exists.{n\r\n")
    elif mudsys.player_creating(arg):
        sock.send("{cA player is already being created with that name.{n\r\n")
    elif arg.lower().startswith("guest"):
        sock.send("{cCharacter names cannot begin with 'guest'.{n\r\n")
    else:
        name = arg[0].upper() + arg[1:]
        ch = mudsys.create_player(name)

        if ch == None:
            sock.send("{cIllegal name, please pick another.{n\r\n")
        else:
            mudsys.attach_char_socket(ch, sock)
            ch.rdesc = ch.name + " is here."
            sock.pop_ih()
def cg_name_handler(sock, arg):
    if not check_char_name(arg):
        sock.send("{cIllegal name, please pick another.{n\r\n")
    elif mudsys.player_exists(arg):
        sock.send("{cA player with that name already exists.{n\r\n")
    elif mudsys.player_creating(arg):
        sock.send("{cA player is already being created with that name.{n\r\n")
    elif arg.lower().startswith("guest"):
        sock.send("{cCharacter names cannot begin with 'guest'.{n\r\n")
    else:
        name = arg[0].upper() + arg[1:]
        ch = mudsys.create_player(name)

        if ch == None:
            sock.send("{cIllegal name, please pick another.{n\r\n")
        else:
            mudsys.attach_char_socket(ch, sock)
            ch.rdesc = ch.name + " is here."
            ch.desc = "You see a [me.height] [me.sex].  [me.heshe] has \
                [me.hair_length] [me.hair_texture] [me.hair_color] hair. \
                [me.hisher] [me.nose] nose is set over [me.lips] lips \
                and a [me.chin] chin in [me.hisher] [me.face] face."
            sock.pop_ih()
def cg_name_handler(sock, arg):
    if not check_char_name(arg):
        sock.send("{cIllegal name, please pick another.{n\r\n")
    elif mudsys.player_exists(arg):
        sock.send("{cA player with that name already exists.{n\r\n")
    elif mudsys.player_creating(arg):
        sock.send("{cA player is already being created with that name.{n\r\n")
    elif arg.lower().startswith("guest"):
        sock.send("{cCharacter names cannot begin with 'guest'.{n\r\n")
    else:
        name = arg[0].upper() + arg[1:]
        ch = mudsys.create_player(name)

        if ch == None:
            sock.send("{cIllegal name, please pick another.{n\r\n")
        else:
            mudsys.attach_char_socket(ch, sock)
            ch.rdesc = ch.name + " is here."
            ch.desc = "You see a [me.height] [me.sex].  [me.heshe] has \
                [me.hair_length] [me.hair_texture] [me.hair_color] hair. \
                [me.hisher] [me.nose] nose is set over [me.lips] lips \
                and a [me.chin] chin in [me.hisher] [me.face] face."

            sock.pop_ih()