com/CMD_ACCESS.c - example for course 06

[previous example] [course06] [Table of contents] [next example]
/* Filename      : CMD_ACCESS.c
 * Description   : 'command access rights' - file
 *
 * written       : 02-10-1996 - Gunner
 * last modified : 02-10-1998 - Gunner
 * HTML-Version  : 02-02-2000 - Ghorwin
 */

#include <mudlib.h>
inherit I_DAEMON;

int
query_access(object monster)
{
    return 1;   // TRUE = ALL livings may use the command in this dir.
}

/* You may here check for the creator of the monster or the name        */
/* to validate access to the commands in this dir.                      */
/* A return value of 0 would deny someone access to the dir.            */
/* This example would let any of Gunner's monsters use these commands   */
/* in addition to a monster with the name Gunner... ;-)                 */

/*
int
query_access(object monster)
{
  if ((string)(creator(monster) == "gunner")) return 1;
  if (monster->query_name() == "gunner") return 1;
  return 0;
} 
*/