/
     This grant code was originaly written by Jaey of Crimson Souls MUD
for use by Crimson Souls MUD.  The purpose of this document is to list
the features of the grant code, and the steps necessary to maintain it
through mud expansion.  The original version of this code was completed
on December 6, 1996, and it has since gone through a series of bug
fixes and enhancements.  The decision to release this code to the
public was made in early March of 1998 and it was released soon after.
Any questions or bug reports relating to the grant code can be directed
to Steven Carrico via scarrico@mail.transy.edu.

     The main purpose of the grant code is to allow greater versatility
in the delving out of immortal commands.  The standard ROM code gives
out immortal commands depending on the trusted level of a character,
and doesn't allow one to give out individual commands.  The problem with
this system comes to light when someone manages to exploit bugs in the
code to gain a high level character, and all the commands that come with
it.  A secondary purpose of the code then is to help prevent someone
from gaining unauthorized access to immortal commands.  This is
accomplished through a variety of methods which will be described
later.
---------------------------------------------------------------------------
     First of all, once you get the code in, you will need to add the
following line to your player file to get things started:

<keyword> 'grant' -1  

Where <keyword> should be the the word you have chosen to denote granted
commands, and should be something that can't be easily guessed.  When it
comes down to it <keyword> will act as a password to protect granted
commands from the same kind of attack used to hack a high level character.
This is the first line of defense used to prevent unauthorized access to
immortal commands.  Once this is done, you can log on to the MUD and give
yourself the rest of the commands by typing:

grant self 92
grant self 93
...
...
grant self 100

A quick note about the use of grant self.  Under normal conditions, a
player can only grant a command that they themselves have been granted
permanently.  The exceptions to this rule are the character names
hard coded into the grant_duration() function in act_wiz.c.  Only those
exceptions are allowed to grant commands that they don't already poses.
This cuts out the need to manualy edit a player file each time an
immortal command is added.  Once the grant structure has been
implemented, no imms will have commands until you give them to them.

    Here is a breakdown of the different syntax's for the grant and revoke  
commands:

grant <name> -- will list all the imm commands that <name> does NOT have.
                                                                                
grant <name> <command> -- will give <command> to <name>
                                                                                
grant <name> <level#> -- will give <name> all the level <level#> commands.

grant <name> <commands> <duration> -- will give <command> to <name> for
                                      <duration> ticks.

grant <name> <level#> <duration> -- will give <name> all the level
                                    <level#> commands for <duration>
                                    ticks.

If you don't specify a duration, the duration is set to permanent.

revoke <name> -- lists all the commands that <name> does have.

revoke <name> <command> -- Takes <command> away from <name>

revoke <name> <level#> -- Takes away all the level <level#> commands
                          from <name>

The same rules that apply to the grant command also apply to the
revoke command.  For both "grant" and "revoke", the full name of
the player is required.

     The modifications made to the help command for grant make it
so that players can only view help files for immortal commands
they have access to.  The normal level limits apply to any help
files that are not commands.

     One of the early enhancements to this code was the addition of
a less powerful command which could be used to view the duration
of the commands granted to a player.  I have included the code for
the "gstat" command along with the code for "grant" and "revoke"

     Another one of the enhancements to this code was the addition of
the pair table.  The pair table is there to make sure that commands
that belong together are granted together.  The format for a table
entry is {"command1","command2",one_way}

If one_way is set to FALSE then granting someone command1 will
auto-grant them command2, or granting someone command2 will auto-grant
them command1.

This method is useful for such things as the "switch" and "return"
commands or the "reboo" and "reboot" commands.

If one_way is set to TRUE then granting someone command1 will
auto-grant them command2, but granting someone command2 will NOT
auto-grant them command1.

This second method is useful if you have a general set command,
as well as individual set commands such as oset, mset, rset, and 
sset.  For example if you have:

{"set","oset",TRUE},
{"set","mset",TRUE},
{"set","rset",TRUE},
{"set","sset",TRUE}
                                                                                
grant <name> set will give <name> the set,oset,mset,rset, and sset
commands, while grant <name> mset will only give <name> the mset
command.

     Other small changes were made as time went on.  These include
the automatic return executed with the loss of the "return" command,
and the inability to use "force" on the "grant" command.