Re: [NEWBIE]Invalid names

From: Strider Aragorn (stridera@hotmail.com)
Date: 11/10/99


They way I got around this was to include two lists.  One with names that
couldn't be ANYWHERE in the name:
           if (strstr(tempname, unacceptable_list[i]))
And a list that had names that I didn't WANT the person to have (ie: if
there was a NPC or something that had the name, and I didn't want a player
taking it.
            if (!strcmp(tmpname, nouse_list[i]))

There is a little bit more to it (loading the list, etc) but copy the code
already there and it should be easy.

Strider Aragorn


>From: Peter Ajamian <pajamian@CHEAPSAM.COM>
>Emil Nilimaa wrote:
>
> > how do i change it to be such that it only make those names
> > which only contains that particular string, and nothing else to
> > think this is the code for it in ban.c
> >
> > /* 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);
>
>replace this line...
>
>  if (strstr(tempname, invalid_list[i]))
>
>with this...
>
>if (!strcmp(tmpname, invalid_list[i]))
>
>A note of warning...
>
>There is a reason that it is setup to match any substring of a name,
>players
>have a tendancy to skirt the issue of using deragotory names by making that
>name a substring of the entire name, hence when your game goes public and
>eventually becomes popular you will see players with names such as
>ImAMotherF_____ (fill in the blank yourself) note that players are very
>creative and it is virutually impossible to put in a check for every
>possible combination except by testing for substrings.  By changing this to
>a test which only fails if the entire name matches you are setting yourself
>up for a lot of trouble in the future.
>
>Regards, Peter
>
>
>      +------------------------------------------------------------+
>      | Ensure that you have read the CircleMUD Mailing List FAQ:  |
>      |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
>      +------------------------------------------------------------+

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST