/* Does the desired name contain a string in the invalid list? */
for (i = 0; i < num_invalid; i++)
if (strstr(tempname, invalid_list[ i ]))
return (0);
return (1);
}
/**************************************************************************
* Code to check for invalid names (i.e., profanity, etc.) *
* Written by Sharon P. Goza *
**************************************************************************/
#define MAX_INVALID_NAMES 200
char *invalid_list[MAX_INVALID_NAMES];
int num_invalid = 0;
int Valid_Name(char *newname)
{
int i;
struct descriptor_data *dt;
char tempname[MAX_INPUT_LENGTH];
/*
* Make sure someone isn't trying to create this same name. We want to
* do a 'str_cmp' so people can't do 'Bob' and 'BoB'. The creating login
* will not have a character name yet and other people sitting at the
* prompt won't have characters yet.
*/
for (dt = descriptor_list; dt; dt = dt->next)
if (dt->character && GET_NAME(dt->character) && !str_cmp(GET_NAME(dt->character), newname))
return (STATE(dt) == CON_PLAYING);
/* return valid if list doesn't exist */
if (!invalid_list || num_invalid < 1)
return (1);
/* change to lowercase */
strcpy(tempname, newname);
for (i = 0; tempname[ i ]; i++)
tempname[ i ] = LOWER(tempname[ i ]);
/* Does the desired name contain a string in the invalid list? */
for (i = 0; i < num_invalid; i++)
if (strstr(tempname, invalid_list[ i ]))
return (0);
return (1);
}
void Read_Invalid_List(void)
{
FILE *fp;
char temp[256];
if (!(fp = fopen(XNAME_FILE, "r"))) {
perror("SYSERR: Unable to open '" XNAME_FILE "' for reading");
return;
}
num_invalid = 0;
while (get_line(fp, temp) && num_invalid < MAX_INVALID_NAMES)
invalid_list[num_invalid++] = str_dup(temp);
if (num_invalid >= MAX_INVALID_NAMES) {
log("SYSERR: Too many invalid names; change MAX_INVALID_NAMES in ban.c");
exit(1);
}
fclose(fp);
}
#0 0x0087d57e in strstr () from /lib/tls/libc.so.6
#1 0x080a4708 in Valid_Name (newname=0xbffdb1f0 "zorran") at ban.c:279
#2 0x080c1d9e in nanny (d=0xb7c0a008, arg=0xbffdb610 "zorran") at interpreter.c:1945
#3 0x0804e41b in game_loop (mother_desc=3) at comm.c:869
#4 0x0804e5b4 in init_game (port=1280) at comm.c:479
#5 0x0804e93b in main (argc=3, argv=0xbffdda44) at comm.c:349
I think its in the Nanny function so here's one print of a function that shows up a couple times in that line.
#2 0x080c1d9e in nanny (d=0xb7c0a008, arg=0xbffdb610 "zorran") at interpreter.c:1945
1945 if ((_parse_name(arg, tmp_name)) || strlen(tmp_name) < 2 ||
(gdb) print tmp_name
$2 = "zorran\000\n\000\000\000\000\001\000\000\000\030+\224\n\001\000\000\000\001\000\000\000\020²ý¿baha\000 are wasting my time.\000.\000ss its screen. \"Enter 'bet' to play.\"\000\000", 'd' <repeats 12 times>, "\b¸\231\n ø\223\000P\000\000\000¤'\207\000zorran\000aôß\223\000IJý¿¨²ý¿Á;\207\000IJý¿¤'\207\0000000\000\000\000\000ôß\223\000ä²ý¿È²ý¿Á;\207\000ä²ý¿À5000000\000\000\000\000ÿÿ"…
I get where the Baha part came from, Bahamut is the mob i was fighting when it crashed and Zorran was the character trying to login while the fight.