Illegal name, capital letters

Posted by Zeno on Mon 07 Mar 2005 10:47 PM — 9 posts, 28,448 views.

USA #0
One of the name rules in Smaug is this...
 - Comprised of various capital letters, such as 'BrACkkA' or 'CORTO'.


Yet they never hard coded that rule in, and that's what I'd like to do. Make names with capital letters (besides first letter of course) illegal. I know what function to modify and the basic idea how to do it, but not how to actual code it in...
USA #1
Why not just 'tolower' every letter except the first?
USA #2
Because then people who make "DemonSlayer" will have the name still go through. I think its better just to make these type of names illegal since people who try two word names will try it without a space next. Demon Slayer -> DemonSlayer.
USA #3
But then they can type 'Demonslayer' and it'll work, so I'm not sure I see what the difference is. I'm just suggesting that you take whatever they typed, run it against other checks, and then when it's acceptable otherwise, convert all letters to lowercase except the first one.
USA #4
Yeah, might as well. Now the problem is, I've searched through comm.c and I could not find where it would set ch->name on a new character.

[EDIT] What if I just did:
capitalize( argument )


Or something like that?
Amended on Mon 07 Mar 2005 11:56 PM by Zeno
USA #5
I think it actually uses load_char or something weird like that on a new character. I can't conveniently access the code right now (in class) but I think it's in save.c.
USA #6
Well that was actually easy. Anything wrong with this?

    case CON_GET_NAME:
        if ( argument[0] == '\0' )
        {
            close_socket( d, FALSE );
            return;
        }

        argument[0] = UPPER(argument[0]);
        argument = capitalize(argument);



I mean it works fine and everything. *shrug*
USA #7
Well i agree with the whole illegal name on the Demonslayer
issue.. but as for the capitol letter thing.. what about
people who want to have names like Jar'Kol... anyhoo.. just
my 2 cents
USA #8
You mean you want to allow that name? You'd have to change the player struct around a bit, so it won't save that as a filename, or it'll strip symbols.