Invalid Player Names

From: Desmond Daignault (tekdd@dtol.datatimes.com)
Date: 12/05/96


If you want to stop those nasty players that like to login to the mud with
the name of a mob (inorder to have other players to attack him), you might
want to add the following piece of code inside the Valid_Name function in
ban.c...

/******* Add this after the #defines ********/
extern int top_of_mobt;
extern struct char_data *mob_proto;
/*******************************************/


int Valid_Name(char *newname)
{
  int i;

  char tempname[MAX_NAME_LENGTH];

  /* 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;

/********  Add this  **********/
  for (i = 0; i < top_of_mobt; i++) {
    if (isname(tempname, mob_proto[i].player.name))
      return 0;
  }
/*****************************/

  return 1;
}



--

Dez.
_____________________________
Datatimes Text DBA Contractor
      749-2784 751-6400
_____________________________

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



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