[PENNMUSH-ANNOUNCE] 1.7.7-patch08

dunemush at tala.mede.uic.edu dunemush at tala.mede.uic.edu
Mon Jan 27 10:03:44 CST 2003


This is patch08 to PennMUSH 1.7.7. After applying this patch, you will
have version 1.7.7p8

To apply this patch, save it to a file in your top-level MUSH directory,
and do the following:
	patch -p1 < 1.7.7-patch08
	make install

If you use GNU patch 2.2, you probably want the above to be 'patch -b -p1',
not just 'patch -p1'.

Unix (or cygwin) users need not worry about failed hunks in src/switchinc.c,
hdrs/switches.h, hdrs/cmds.h, or hdrs/funs.h. These files are automatically
rebuilt on compile.

Then @shutdown and restart your MUSH.
    - Alan/Javelin

In this patch:

Minor Changes:
  * command_add now expects to receive the flag list and the 
    switch list as strings. Folks who hack into cmdlocal.c should
    take note and read example in the new cmdlocal.dst
Fixes:
  * Players were not created with all the player_flags. In a related
    bug, checking of command flag restrictions wouldn't work with
    all flags. Reported by Cory Descoteau.
  * Flagmasks on commands weren't grown properly when flags were added.


Prereq: 1.7.7p7
*** 1_7_7.149/Patchlevel Sat, 25 Jan 2003 20:58:54 -0600 dunemush (pennmush/5_Patchlevel 1.17.1.11.1.9 600)
--- 1_7_7.153(w)/Patchlevel Mon, 27 Jan 2003 09:38:38 -0600 dunemush (pennmush/5_Patchlevel 1.17.1.11.1.10 600)
***************
*** 1,2 ****
  Do not edit this file. It is maintained by the official PennMUSH patches.
! This is PennMUSH 1.7.7p7
--- 1,2 ----
  Do not edit this file. It is maintained by the official PennMUSH patches.
! This is PennMUSH 1.7.7p8
*** 1_7_7.149/CHANGES Sat, 25 Jan 2003 20:58:54 -0600 dunemush (pennmush/g/23_CHANGES 1.45 600)
--- 1_7_7.153(w)/CHANGES Mon, 27 Jan 2003 09:38:32 -0600 dunemush (pennmush/g/23_CHANGES 1.47 600)
***************
*** 18,23 ****
--- 18,36 ----
  
  ==========================================================================
  
+ Version 1.7.7 patchlevel 8                      January 27, 2003
+ 
+ Minor Changes:
+   * command_add now expects to receive the flag list and the 
+     switch list as strings. Folks who hack into cmdlocal.c should
+     take note and read example in the new cmdlocal.dst
+ Fixes:
+   * Players were not created with all the player_flags. In a related
+     bug, checking of command flag restrictions wouldn't work with
+     all flags. Reported by Cory Descoteau.
+   * Flagmasks on commands weren't grown properly when flags were added.
+ 
+ 
  Version 1.7.7 patchlevel 7                      January 25, 2003
  
  Fixes:
*** 1_7_7.149/game/txt/hlp/pennvers.hlp Sat, 25 Jan 2003 20:58:54 -0600 dunemush (pennmush/12_pennvers.h 1.169.1.42.1.3.1.2.2.2.1.1.1.3.1.1.1.5.1.4.1.1.1.1.1.1.1.1.1.5.1.1.1.3.1.1.1.3.1.1.1.54.1.10.1.2.1.1.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.2.1.1.1.1.1.7.1.1.1.1.1.2.1.1.1.4.1.2.1.1.1.1.1.1.1.2.1.1.1.2.1.1.1.1.1.1.1.1.1.6 600)
--- 1_7_7.153(w)/game/txt/hlp/pennvers.hlp Mon, 27 Jan 2003 09:38:58 -0600 dunemush (pennmush/12_pennvers.h 1.169.1.42.1.3.1.2.2.2.1.1.1.3.1.1.1.5.1.4.1.1.1.1.1.1.1.1.1.5.1.1.1.3.1.1.1.3.1.1.1.54.1.10.1.2.1.1.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.2.1.1.1.1.1.7.1.1.1.1.1.2.1.1.1.4.1.2.1.1.1.1.1.1.1.2.1.1.1.2.1.1.1.1.1.1.1.1.1.8 600)
***************
*** 1,5 ****
  & changes
! & 1.7.7p7
  This is a list of changes in this patchlevel which are probably of
  interest to players. More information about new commands and functions
  can probably be gotten via 'help <name of whatever>'. 'help credits'
--- 1,5 ----
  & changes
! & 1.7.7p8
  This is a list of changes in this patchlevel which are probably of
  interest to players. More information about new commands and functions
  can probably be gotten via 'help <name of whatever>'. 'help credits'
***************
*** 11,16 ****
--- 11,30 ----
  A list of the patchlevels associated with each release can
  be read in 'help patchlevels'.
  
+ Version 1.7.7 patchlevel 8                      January 27, 2003
+ 
+ Minor Changes:
+   * command_add now expects to receive the flag list and the 
+     switch list as strings. Folks who hack into cmdlocal.c should
+     take note and read example in the new cmdlocal.dst
+ Fixes:
+   * Players were not created with all the player_flags. In a related
+     bug, checking of command flag restrictions wouldn't work with
+     all flags. Reported by Cory Descoteau.
+   * Flagmasks on commands weren't grown properly when flags were added.
+ 
+ 
+ & 1.7.7p7
  Version 1.7.7 patchlevel 7                      January 25, 2003
  
  Fixes:
***************
*** 6031,6037 ****
  For information on a specific patchlevel of one of the versions listed,
  type 'help <version>p<patchlevel>'. For example, 'help 1.7.2p3'
  
! 1.7.7: 0, 1, 2, 3, 4, 5, 6, 7
  1.7.6: 0, 1, 2, 3, 4, 5, 6
  1.7.5: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
  1.7.4: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
--- 6045,6051 ----
  For information on a specific patchlevel of one of the versions listed,
  type 'help <version>p<patchlevel>'. For example, 'help 1.7.2p3'
  
! 1.7.7: 0, 1, 2, 3, 4, 5, 6, 7, 8
  1.7.6: 0, 1, 2, 3, 4, 5, 6
  1.7.5: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
  1.7.4: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
*** 1_7_7.149/src/cmdlocal.dst Wed, 01 Jan 2003 18:08:01 -0600 dunemush (pennmush/b/21_cmdlocal.d 1.11 660)
--- 1_7_7.153(w)/src/cmdlocal.dst Mon, 27 Jan 2003 09:58:00 -0600 dunemush (pennmush/b/21_cmdlocal.d 1.13 660)
***************
*** 58,69 ****
   * This is where you'd put calls to command_add to insert a local
   * command into the command hash table. Any command you add here
   * will be auto-aliased for you.
   */
  void
  local_commands()
  {
  #ifdef EXAMPLE
!   command_add("@SILLY", CMD_T_ANY, 0, 0, switchmask("NOISY NOEVAL"),
  	      cmd_local_silly);
  #endif
  }
--- 58,78 ----
   * This is where you'd put calls to command_add to insert a local
   * command into the command hash table. Any command you add here
   * will be auto-aliased for you.
+  * The way to call command_add is illustrated below. The arguments are:
+  *   Name of the command, a string ("@SILLY")
+  *   Command parsing modifiers, a bitmask (see hdrs/command.h)
+  *   Flags to restrict command to, a string ("WIZARD ROYALTY") or NULL
+  *     (Someone with *any* one of these flags can use the command)
+  *   Powers to restrict command to, a bitmask (see hdrs/flags.h) or 0
+  *     (Someone with this power can use the command)
+  *   Switches the command can take, a string or NULL ("NOISY NOEVAL")
+  *   Hardcoded function the command should call (cmd_local_silly)
   */
  void
  local_commands()
  {
  #ifdef EXAMPLE
!   command_add("@SILLY", CMD_T_ANY, "WIZARD ROYALTY", SEE_ALL, "NOISY NOEVAL",
  	      cmd_local_silly);
  #endif
  }
*** 1_7_7.149/src/timer.c Wed, 01 Jan 2003 18:08:01 -0600 dunemush (pennmush/b/29_timer.c 1.29.1.7.1.3 660)
--- 1_7_7.153(w)/src/timer.c Mon, 27 Jan 2003 09:58:03 -0600 dunemush (pennmush/b/29_timer.c 1.29.1.7.1.4 660)
***************
*** 96,102 ****
    /* this routine can be used to poll from intrface.c */
    if (hup_triggered) {
      do_rawlog(LT_ERR, T("SIGHUP received: reloading .txt and .cnf files"));
!     config_file_startup(NULL);
      fcache_load(NOTHING);
      help_reindex(NOTHING);
      read_access_file();
--- 96,103 ----
    /* this routine can be used to poll from intrface.c */
    if (hup_triggered) {
      do_rawlog(LT_ERR, T("SIGHUP received: reloading .txt and .cnf files"));
!     config_file_startup(NULL, 0);
!     config_file_startup(NULL, 1);
      fcache_load(NOTHING);
      help_reindex(NOTHING);
      read_access_file();
*** 1_7_7.149/src/help.c Wed, 01 Jan 2003 18:08:01 -0600 dunemush (pennmush/f/32_help.c 1.4.1.2.1.1.1.3.2.2.1.1.2.1.1.2.1.2.1.2.1.3.1.8 660)
--- 1_7_7.153(w)/src/help.c Mon, 27 Jan 2003 09:58:02 -0600 dunemush (pennmush/f/32_help.c 1.4.1.2.1.1.1.3.2.2.1.1.2.1.1.2.1.2.1.2.1.3.1.9 660)
***************
*** 108,114 ****
      mush_free(h, "help_file.entry");
      return;
    }
!   (void) command_add(h->command, CMD_T_ANY | CMD_T_NOPARSE, 0, 0, NULL,
  		     cmd_helpcmd);
    hashadd(h->command, h, &help_files);
  }
--- 108,114 ----
      mush_free(h, "help_file.entry");
      return;
    }
!   (void) command_add(h->command, CMD_T_ANY | CMD_T_NOPARSE, NULL, 0, NULL,
  		     cmd_helpcmd);
    hashadd(h->command, h, &help_files);
  }
*** 1_7_7.149/src/game.c Mon, 06 Jan 2003 16:46:06 -0600 dunemush (pennmush/c/10_game.c 1.50.1.8.1.1.1.1.2.1.1.1.2.1.1.4.1.1.1.1.1.1.1.1.1.1.2.1.1.2.1.1.1.1.1.1.1.2.1.1.1.2.1.1.1.1.1.1.1.1.1.5.1.3.1.2.1.2.1.1.1.2.1.1 660)
--- 1_7_7.153(w)/src/game.c Mon, 27 Jan 2003 09:58:02 -0600 dunemush (pennmush/c/10_game.c 1.50.1.8.1.1.1.1.2.1.1.1.2.1.1.4.1.1.1.1.1.1.1.1.1.1.2.1.1.2.1.1.1.1.1.1.1.2.1.1.1.2.1.1.1.1.1.1.1.1.1.5.1.3.1.2.1.2.1.1.1.2.1.2 660)
***************
*** 101,106 ****
--- 101,107 ----
  int paranoid_dump = 0;		/* if paranoid, scan before dumping */
  int paranoid_checkpt = 0;	/* write out an okay message every x objs */
  extern long indb_flags;
+ extern void conf_default_set(void);
  static void dump_database_internal(void);
  static FILE *db_open(const char *filename);
  static FILE *db_open_write(const char *filename);
***************
*** 625,636 ****
  
    memset(&current_state, 0, sizeof current_state);
  
    command_init_preconfig();
-   config_file_startup(conf);
    command_init_postconfig();
    function_init_postconfig();
  }
  
  int
  init_game_dbs()
  {
--- 626,651 ----
  
    memset(&current_state, 0, sizeof current_state);
  
+   /* Load all the config file stuff except restrict_* */
+   conf_default_set();
+   config_file_startup(conf, 0);
+ }
+ 
+ /* Code that should be run after dbs are loaded (usually because we 
+  * need to have the flag table loaded
+  */
+ void
+ init_game_postdb(const char *conf)
+ {
+   /* Commands and functions require the flag table for restrictions */
    command_init_preconfig();
    command_init_postconfig();
    function_init_postconfig();
+   /* Load further restrictions from config file */
+   config_file_startup(conf, 1);
  }
  
+ 
  int
  init_game_dbs()
  {
*** 1_7_7.149/src/flags.c Thu, 23 Jan 2003 22:04:56 -0600 dunemush (pennmush/c/20_flags.c 1.1.1.1.1.1.1.1.1.1.1.1.1.6.1.2.1.1.1.1.1.2.2.2.2.1.2.1.1.3.1.2.1.1.1.1.1.1.1.1.1.3.1.9.1.2.2.1.1.2.1.26 660)
--- 1_7_7.153(w)/src/flags.c Mon, 27 Jan 2003 09:58:01 -0600 dunemush (pennmush/c/20_flags.c 1.1.1.1.1.1.1.1.1.1.1.1.1.6.1.2.1.1.1.1.1.2.2.2.2.1.2.1.1.3.1.2.1.1.1.1.1.1.1.1.1.3.1.9.1.2.2.1.1.2.1.27 660)
***************
*** 24,29 ****
--- 24,30 ----
  #include <stdlib.h>
  
  #include "conf.h"
+ #include "command.h"
  #include "attrib.h"
  #include "mushdb.h"
  #include "externs.h"
***************
*** 58,63 ****
--- 59,67 ----
  				 * position. Aliases not inclued. */
  static int flagbits = 0;	/* The current length of the flags array */
  
+ extern PTAB ptab_command;	/* Uses flag bitmasks */
+ 
+ 
  /* This is the old default flag table. We still use it when we have to
   * convert old dbs
   */
***************
*** 381,386 ****
--- 385,391 ----
  {
    dbref it;
    object_flag_type p;
+   COMMAND_INFO *command;
  
    for (it = 0; it < db_top; it++) {
      Flags(it) = (object_flag_type) realloc(Flags(it), numbytes);
***************
*** 388,393 ****
--- 393,412 ----
      p = Flags(it) + numbytes - 1;
      memset(p, 0, 1);
    }
+   /* We also need to make sure that all the command flagmasks are
+    * reallocated!
+    */
+   command = (COMMAND_INFO *) ptab_firstentry(&ptab_command);
+   while (command) {
+     if (command->flagmask) {
+       command->flagmask =
+ 	(object_flag_type) realloc(command->flagmask, numbytes);
+       /* Zero them out */
+       p = command->flagmask + numbytes - 1;
+       memset(p, 0, 1);
+     }
+     command = (COMMAND_INFO *) ptab_nextentry(&ptab_command);
+   }
  }
  
  
***************
*** 654,660 ****
  void
  copy_flag_bitmask(object_flag_type dest, object_flag_type given)
  {
!   memcpy((void *) dest, (void *) given, sizeof(dest));
  }
  
  /* Deallocate a flag bitmask */
--- 673,680 ----
  void
  copy_flag_bitmask(object_flag_type dest, object_flag_type given)
  {
!   int flagbytes = 1 + flagbits / 8;
!   memcpy((void *) dest, (void *) given, flagbytes);
  }
  
  /* Deallocate a flag bitmask */
***************
*** 708,714 ****
  {
    unsigned int i;
    int ok = 1;
!   for (i = 0; i < sizeof(source); i++)
      ok &= ((*(bitmask + i) & *(source + i)) == *(bitmask + i));
    return ok;
  }
--- 728,735 ----
  {
    unsigned int i;
    int ok = 1;
!   unsigned int flagbytes = 1 + flagbits / 8;
!   for (i = 0; i < flagbytes; i++)
      ok &= ((*(bitmask + i) & *(source + i)) == *(bitmask + i));
    return ok;
  }
***************
*** 719,725 ****
  {
    unsigned int i;
    int ok = 0;
!   for (i = 0; i < sizeof(source); i++)
      ok |= (*(bitmask + i) & *(source + i));
    return ok;
  }
--- 740,747 ----
  {
    unsigned int i;
    int ok = 0;
!   unsigned int flagbytes = 1 + flagbits / 8;
!   for (i = 0; i < flagbytes; i++)
      ok |= (*(bitmask + i) & *(source + i));
    return ok;
  }
*** 1_7_7.149/src/conf.c Thu, 23 Jan 2003 10:35:55 -0600 dunemush (pennmush/c/31_conf.c 1.41.2.3.1.3.1.2.1.15.1.1.1.2.1.2.1.5 660)
--- 1_7_7.153(w)/src/conf.c Mon, 27 Jan 2003 09:58:01 -0600 dunemush (pennmush/c/31_conf.c 1.41.2.3.1.3.1.2.1.15.1.1.1.2.1.2.1.7 660)
***************
*** 65,71 ****
  	     int source);
  int cf_flag(const char *opt, const char *val, void *loc, int maxval,
  	    int source);
! int config_set(const char *opt, char *val, int source);
  void conf_default_set(void);
  
  CONF conftable[] = {
--- 65,71 ----
  	     int source);
  int cf_flag(const char *opt, const char *val, void *loc, int maxval,
  	    int source);
! int config_set(const char *opt, char *val, int source, int restrictions);
  void conf_default_set(void);
  
  CONF conftable[] = {
***************
*** 593,599 ****
  }
  
  int
! config_set(const char *opt, char *val, int source)
      /* source: 0 from mush.cnf, 1 from @config or config() */
  {
    CONF *cp;
--- 593,599 ----
  }
  
  int
! config_set(const char *opt, char *val, int source, int restrictions)
      /* source: 0 from mush.cnf, 1 from @config or config() */
  {
    CONF *cp;
***************
*** 601,606 ****
--- 601,608 ----
  
    /* Was this "restrict_command <command> <restriction>"? If so, do it */
    if (!strcasecmp(opt, "restrict_command")) {
+     if (!restrictions)
+       return 1;
      for (p = val; *p && !isspace((unsigned char) *p); p++) ;
      if (*p) {
        *p++ = '\0';
***************
*** 621,649 ****
        return 0;
      }
      return 1;
!   } else if (!strcasecmp(opt, "command_alias")) {
      for (p = val; *p && !isspace((unsigned char) *p); p++) ;
      if (*p) {
        *p++ = '\0';
!       if (!alias_command(val, p)) {
  	if (source == 0) {
! 	  do_rawlog(LT_ERR, T("CONFIG: Couldn't alias %s to %s.\n"), p, val);
  	}
  	return 0;
        }
      } else {
        if (source == 0) {
  	do_rawlog(LT_ERR,
! 		  T("CONFIG: command_alias %s requires an alias.\n"), val);
        }
        return 0;
      }
      return 1;
!   } else if (!strcasecmp(opt, "attribute_alias")) {
      for (p = val; *p && !isspace((unsigned char) *p); p++) ;
      if (*p) {
        *p++ = '\0';
!       if (!alias_attribute(val, p)) {
  	if (source == 0) {
  	  do_rawlog(LT_ERR, T("CONFIG: Couldn't alias %s to %s.\n"), p, val);
  	}
--- 623,664 ----
        return 0;
      }
      return 1;
!   } else if (!strcasecmp(opt, "restrict_function")) {
!     if (!restrictions)
!       return 1;
      for (p = val; *p && !isspace((unsigned char) *p); p++) ;
      if (*p) {
        *p++ = '\0';
!       if (!restrict_function(val, p)) {
  	if (source == 0) {
! 	  do_rawlog(LT_ERR,
! 		    T("CONFIG: Invalid function or restriction for %s.\n"),
! 		    val);
  	}
  	return 0;
        }
      } else {
        if (source == 0) {
  	do_rawlog(LT_ERR,
! 		  T
! 		  ("CONFIG: restrict_function %s requires a restriction value.\n"),
! 		  val);
        }
        return 0;
      }
      return 1;
!   } else if (!strcasecmp(opt, "reserve_alias")) {
!     if (!restrictions)
!       return 1;
!     reserve_alias(val);
!     return 1;
!   } else if (!strcasecmp(opt, "command_alias")) {
!     if (!restrictions)
!       return 1;
      for (p = val; *p && !isspace((unsigned char) *p); p++) ;
      if (*p) {
        *p++ = '\0';
!       if (!alias_command(val, p)) {
  	if (source == 0) {
  	  do_rawlog(LT_ERR, T("CONFIG: Couldn't alias %s to %s.\n"), p, val);
  	}
***************
*** 652,667 ****
      } else {
        if (source == 0) {
  	do_rawlog(LT_ERR,
! 		  T("CONFIG: attribute_alias %s requires an alias.\n"), val);
        }
        return 0;
      }
      return 1;
!   } else if (!strcasecmp(opt, "function_alias")) {
      for (p = val; *p && !isspace((unsigned char) *p); p++) ;
      if (*p) {
        *p++ = '\0';
!       if (!alias_function(val, p)) {
  	if (source == 0) {
  	  do_rawlog(LT_ERR, T("CONFIG: Couldn't alias %s to %s.\n"), p, val);
  	}
--- 667,684 ----
      } else {
        if (source == 0) {
  	do_rawlog(LT_ERR,
! 		  T("CONFIG: command_alias %s requires an alias.\n"), val);
        }
        return 0;
      }
      return 1;
!   } else if (!strcasecmp(opt, "attribute_alias")) {
!     if (!restrictions)
!       return 1;
      for (p = val; *p && !isspace((unsigned char) *p); p++) ;
      if (*p) {
        *p++ = '\0';
!       if (!alias_attribute(val, p)) {
  	if (source == 0) {
  	  do_rawlog(LT_ERR, T("CONFIG: Couldn't alias %s to %s.\n"), p, val);
  	}
***************
*** 670,709 ****
      } else {
        if (source == 0) {
  	do_rawlog(LT_ERR,
! 		  T("CONFIG: function_alias %s requires an alias.\n"), val);
        }
        return 0;
      }
      return 1;
!   } else if (!strcasecmp(opt, "restrict_function")) {
      for (p = val; *p && !isspace((unsigned char) *p); p++) ;
      if (*p) {
        *p++ = '\0';
!       if (!restrict_function(val, p)) {
  	if (source == 0) {
! 	  do_rawlog(LT_ERR,
! 		    T("CONFIG: Invalid function or restriction for %s.\n"),
! 		    val);
  	}
  	return 0;
        }
      } else {
        if (source == 0) {
  	do_rawlog(LT_ERR,
! 		  T
! 		  ("CONFIG: restrict_function %s requires a restriction value.\n"),
! 		  val);
        }
        return 0;
      }
      return 1;
-   } else if (!strcasecmp(opt, "reserve_alias")) {
-     reserve_alias(val);
-     return 1;
    } else if (!strcasecmp(opt, "help_command")
  	     || !strcasecmp(opt, "ahelp_command")) {
      char *comm, *file;
      int admin = !strcasecmp(opt, "ahelp_command");
      /* Add a new help-like command */
      if (source == 1)
        return 0;
--- 687,723 ----
      } else {
        if (source == 0) {
  	do_rawlog(LT_ERR,
! 		  T("CONFIG: attribute_alias %s requires an alias.\n"), val);
        }
        return 0;
      }
      return 1;
!   } else if (!strcasecmp(opt, "function_alias")) {
!     if (!restrictions)
!       return 1;
      for (p = val; *p && !isspace((unsigned char) *p); p++) ;
      if (*p) {
        *p++ = '\0';
!       if (!alias_function(val, p)) {
  	if (source == 0) {
! 	  do_rawlog(LT_ERR, T("CONFIG: Couldn't alias %s to %s.\n"), p, val);
  	}
  	return 0;
        }
      } else {
        if (source == 0) {
  	do_rawlog(LT_ERR,
! 		  T("CONFIG: function_alias %s requires an alias.\n"), val);
        }
        return 0;
      }
      return 1;
    } else if (!strcasecmp(opt, "help_command")
  	     || !strcasecmp(opt, "ahelp_command")) {
      char *comm, *file;
      int admin = !strcasecmp(opt, "ahelp_command");
+     if (!restrictions)
+       return 1;
      /* Add a new help-like command */
      if (source == 1)
        return 0;
***************
*** 725,730 ****
--- 739,746 ----
  		("CONFIG: help_command requires a command name and file name.\n"));
        return 0;
      }
+   } else if (restrictions) {
+     return 1;
    }
    /* search conf table for the option; if found, add it, if not found,
     * complain about it. Forbid use of @config to set options without
***************
*** 905,913 ****
  static int conf_recursion = 0;
  
  int
! config_file_startup(const char *conf)
  {
    /* read a configuration file. Return 0 on failure, 1 on success */
  
    FILE *fp = NULL;
    CONF *cp;
--- 921,932 ----
  static int conf_recursion = 0;
  
  int
! config_file_startup(const char *conf, int restrictions)
  {
    /* read a configuration file. Return 0 on failure, 1 on success */
+   /* If 'restrictions' is 0, ignore restrict*. If it's 1, only
+    * look at restrict*
+    */
  
    FILE *fp = NULL;
    CONF *cp;
***************
*** 928,934 ****
        return 0;
      }
      do_rawlog(LT_ERR, "Reading %s", cfile);
-     conf_default_set();		/* initialize defaults the first time */
    } else {
      if (conf && *conf)
  #ifdef macintosh
--- 947,952 ----
***************
*** 994,1004 ****
  	  do_rawlog(LT_ERR, T("CONFIG: include depth too deep in file %s"),
  		    conf);
  	} else {
! 	  config_file_startup(q);
  	}
  	conf_recursion--;
        } else
! 	config_set(p, q, 0);
      }
      fgets(tbuf1, BUFFER_LEN, fp);
    }
--- 1012,1022 ----
  	  do_rawlog(LT_ERR, T("CONFIG: include depth too deep in file %s"),
  		    conf);
  	} else {
! 	  config_file_startup(q, restrictions);
  	}
  	conf_recursion--;
        } else
! 	config_set(p, q, 0, restrictions);
      }
      fgets(tbuf1, BUFFER_LEN, fp);
    }
***************
*** 1212,1218 ****
        safe_str(T("#-1 NO VALUE GIVEN"), buff, bp);
        return;
      }
!     if (!config_set(args[0], args[1], 1)) {
        safe_str(T("#-1 UNABLE TO SET OPTION"), buff, bp);
        return;
      }
--- 1230,1237 ----
        safe_str(T("#-1 NO VALUE GIVEN"), buff, bp);
        return;
      }
!     if (!config_set(args[0], args[1], 1, 0)
! 	&& !config_set(args[0], args[1], 1, 1)) {
        safe_str(T("#-1 UNABLE TO SET OPTION"), buff, bp);
        return;
      }
*** 1_7_7.149/src/command.c Tue, 14 Jan 2003 23:28:47 -0600 dunemush (pennmush/c/36_command.c 1.56.1.1.1.1.1.1.1.2.1.1.1.1.1.5.1.2.1.1.1.1.1.2.1.3.1.10.1.1.2.4.2.4 660)
--- 1_7_7.153(w)/src/command.c Mon, 27 Jan 2003 09:58:01 -0600 dunemush (pennmush/c/36_command.c 1.56.1.1.1.1.1.1.1.2.1.1.1.1.1.5.1.2.1.1.1.1.1.2.1.3.1.10.1.1.2.4.2.5 660)
***************
*** 414,423 ****
  }
  
  COMMAND_INFO *
! command_add(const char *name, int type, object_flag_type flagmask, int powers,
! 	    switch_mask *sw, command_func func)
  {
  
    ptab_start_inserts(&ptab_command);
    ptab_insert(&ptab_command, name,
  	      make_command(name, type, flagmask, powers, sw, func));
--- 414,427 ----
  }
  
  COMMAND_INFO *
! command_add(const char *name, int type, const char *flagstr,
! 	    int powers, const char *switchstr, command_func func)
  {
+   object_flag_type flagmask = NULL;
+   switch_mask *sw = switchmask(switchstr);
  
+   if (flagstr)
+     flagmask = string_to_bits(flagstr);
    ptab_start_inserts(&ptab_command);
    ptab_insert(&ptab_command, name,
  	      make_command(name, type, flagmask, powers, sw, func));
*** 1_7_7.149/src/cmds.c Tue, 14 Jan 2003 22:56:21 -0600 dunemush (pennmush/c/37_cmds.c 1.33.1.1.1.2.1.2.2.3.1.1.1.2.1.1.1.3.1.8.1.1.2.2.2.4 660)
--- 1_7_7.153(w)/src/cmds.c Mon, 27 Jan 2003 09:58:01 -0600 dunemush (pennmush/c/37_cmds.c 1.33.1.1.1.2.1.2.2.3.1.1.1.2.1.1.1.3.1.8.1.1.2.2.2.5 660)
***************
*** 46,52 ****
  void do_readcache(dbref player);
  void do_scan(dbref player, char *command, int flag);
  void do_uptime(dbref player, int mortal);
! extern int config_set(const char *opt, char *val, int source);
  
  /* From command.c */
  extern int rhs_present;
--- 46,52 ----
  void do_readcache(dbref player);
  void do_scan(dbref player, char *command, int flag);
  void do_uptime(dbref player, int mortal);
! extern int config_set(const char *opt, char *val, int source, int restrictions);
  
  /* From command.c */
  extern int rhs_present;
***************
*** 206,212 ****
        notify(player, T("What did you want to set that to?"));
        return;
      }
!     if (!config_set(arg_left, arg_right, 1))
        notify(player, T("Couldn't set that option"));
      else
        notify(player, T("Option set."));
--- 206,213 ----
        notify(player, T("What did you want to set that to?"));
        return;
      }
!     if (!config_set(arg_left, arg_right, 1, 0)
! 	&& !config_set(arg_left, arg_right, 1, 1))
        notify(player, T("Couldn't set that option"));
      else
        notify(player, T("Option set."));
*** 1_7_7.149/src/bsd.c Sat, 25 Jan 2003 14:34:48 -0600 dunemush (pennmush/c/38_bsd.c 1.58.1.11.1.2.1.5.1.7.1.14.1.13.1.9.1.4.1.2.1.12.1.1.1.1.1.2.1.1.1.13.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.8.2.1.1.1.1.1.1.1.1.2.1.1.1.1.1.8 660)
--- 1_7_7.153(w)/src/bsd.c Mon, 27 Jan 2003 09:58:01 -0600 dunemush (pennmush/c/38_bsd.c 1.58.1.11.1.2.1.5.1.7.1.14.1.13.1.9.1.4.1.2.1.12.1.1.1.1.1.2.1.1.1.13.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.8.2.1.1.1.1.1.1.1.1.2.1.1.1.1.1.8.1.1 660)
***************
*** 621,626 ****
--- 621,629 ----
      do_rawlog(LT_ERR, T("ERROR: Couldn't load databases! Exiting."));
      exit(2);
    }
+ 
+   init_game_postdb(confname);
+ 
    set_signals();
  
  #ifdef INFO_SLAVE
*** 1_7_7.149/hdrs/version.h Sat, 25 Jan 2003 20:58:54 -0600 dunemush (pennmush/c/47_version.h 1.32.1.2.1.7.1.9.1.1.1.17.1.11 660)
--- 1_7_7.153(w)/hdrs/version.h Mon, 27 Jan 2003 09:58:07 -0600 dunemush (pennmush/c/47_version.h 1.32.1.2.1.7.1.9.1.1.1.17.1.12 660)
***************
*** 1,3 ****
! #define VERSION "PennMUSH version 1.7.7 patchlevel 7 [01/25/2003]"
! #define SHORTVN "PennMUSH 1.7.7p7"
! #define NUMVERSION 001007007007
--- 1,3 ----
! #define VERSION "PennMUSH version 1.7.7 patchlevel 8 [01/27/2003]"
! #define SHORTVN "PennMUSH 1.7.7p8"
! #define NUMVERSION 001007007008
*** 1_7_7.149/hdrs/game.h Tue, 14 Jan 2003 22:34:58 -0600 dunemush (pennmush/d/12_game.h 1.28.1.2.1.1.1.1.1.1.1.7.1.3 660)
--- 1_7_7.153(w)/hdrs/game.h Mon, 27 Jan 2003 09:58:04 -0600 dunemush (pennmush/d/12_game.h 1.28.1.2.1.1.1.1.1.1.1.7.1.4 660)
***************
*** 42,48 ****
  #endif
  
  /* From conf.c */
! extern int config_file_startup(const char *conf);
  
  /* From db.c */
  extern int db_paranoid_write(FILE * f, int flag);
--- 42,48 ----
  #endif
  
  /* From conf.c */
! extern int config_file_startup(const char *conf, int restrictions);
  
  /* From db.c */
  extern int db_paranoid_write(FILE * f, int flag);
*** 1_7_7.149/hdrs/externs.h Thu, 23 Jan 2003 22:16:51 -0600 dunemush (pennmush/d/16_externs.h 1.1.1.53.1.2.1.8.2.1.1.2.1.1.1.1.1.2.1.6.1.3.1.4.3.4 660)
--- 1_7_7.153(w)/hdrs/externs.h Mon, 27 Jan 2003 09:58:04 -0600 dunemush (pennmush/d/16_externs.h 1.1.1.53.1.2.1.8.2.1.1.2.1.1.1.1.1.2.1.6.1.3.1.4.3.5 660)
***************
*** 50,55 ****
--- 50,56 ----
  extern void process_command(dbref player, char *command,
  			    dbref cause, int from_port);
  extern int init_game_dbs(void);
+ extern void init_game_postdb(const char *conf);
  extern void init_game_config(const char *conf);
  extern void dump_database(void);
  extern void NORETURN panic(const char *message);
*** 1_7_7.149/hdrs/command.h Wed, 01 Jan 2003 18:08:01 -0600 dunemush (pennmush/d/24_command.h 1.20 660)
--- 1_7_7.153(w)/hdrs/command.h Mon, 27 Jan 2003 09:58:03 -0600 dunemush (pennmush/d/24_command.h 1.21 660)
***************
*** 164,171 ****
  extern COMMAND_INFO *command_find(const char *name);
  extern COMMAND_INFO *command_find_exact(const char *name);
  extern COMMAND_INFO *command_add
!   (const char *name, int type, object_flag_type flagmask, int powers,
!    switch_mask *sw, command_func func);
  extern COMMAND_INFO *make_command
    (const char *name, int type, object_flag_type flagmask, int powers,
     switch_mask *sw, command_func func);
--- 164,171 ----
  extern COMMAND_INFO *command_find(const char *name);
  extern COMMAND_INFO *command_find_exact(const char *name);
  extern COMMAND_INFO *command_add
!   (const char *name, int type, const char *flagstr, int powers,
!    const char *switchstr, command_func func);
  extern COMMAND_INFO *make_command
    (const char *name, int type, object_flag_type flagmask, int powers,
     switch_mask *sw, command_func func);


More information about the Pennmush-announce mailing list