public/IAdminSystem.h
changeset 372 47f21574db6d
parent 348 b30ce8321295
child 375 a31ff1b6ae46
     1.1 --- a/public/IAdminSystem.h	Thu Jan 25 22:39:12 2007 +0000
     1.2 +++ b/public/IAdminSystem.h	Fri Jan 26 01:55:06 2007 +0000
     1.3 @@ -1,3 +1,17 @@
     1.4 +/**
     1.5 + * ===============================================================
     1.6 + * SourceMod (C)2004-2007 AlliedModders LLC.  All rights reserved.
     1.7 + * ===============================================================
     1.8 + *
     1.9 + *  This file is part of the SourceMod/SourcePawn SDK.  This file may only be used 
    1.10 + * or modified under the Terms and Conditions of its License Agreement, which is found 
    1.11 + * in LICENSE.txt.  The Terms and Conditions for making SourceMod extensions/plugins 
    1.12 + * may change at any time.  To view the latest information, see:
    1.13 + *   http://www.sourcemod.net/license.php
    1.14 + *
    1.15 + * Version: $Id$
    1.16 + */
    1.17 +
    1.18  #ifndef _INCLUDE_SOURCEMOD_ADMINISTRATION_SYSTEM_H_
    1.19  #define _INCLUDE_SOURCEMOD_ADMINISTRATION_SYSTEM_H_
    1.20  
    1.21 @@ -7,8 +21,9 @@
    1.22  #define SMINTERFACE_ADMINSYS_VERSION	1
    1.23  
    1.24  /**
    1.25 - * Detailed notes:
    1.26 - * ---------------
    1.27 + * @file IAdminSystem.h
    1.28 + * @brief Defines the interface to manage the Admin Users/Groups and Override caches.
    1.29 + *
    1.30   *   The administration system is more of a volatile cache than a system.  It is designed to be 
    1.31   * temporary rather than permanent, in order to compensate for more storage methods.  For example,
    1.32   * a flat file might be read into the cache all at once.  But a MySQL-based system might only cache
    1.33 @@ -28,53 +43,74 @@
    1.34  
    1.35  namespace SourceMod
    1.36  {
    1.37 +	/**
    1.38 +	 * @brief Access levels (flags) for admins.
    1.39 +	 */
    1.40  	enum AdminFlag
    1.41  	{
    1.42  		Admin_None = 0,
    1.43 -		Admin_Reservation,		/* Reserved slot */
    1.44 -		Admin_Kick,				/* Kick another user */
    1.45 -		Admin_Ban,				/* Ban another user */
    1.46 -		Admin_Unban,			/* Unban another user */
    1.47 -		Admin_Slay,				/* Slay/kill/damage another user */
    1.48 -		Admin_Changemap,		/* Change the map */
    1.49 -		Admin_Convars,			/* Change basic convars */
    1.50 -		Admin_Configs,			/* Change configs */
    1.51 -		Admin_Chat,				/* Special chat privileges */
    1.52 -		Admin_Vote,				/* Special vote privileges */
    1.53 -		Admin_Password,			/* Set a server password */
    1.54 -		Admin_RCON,				/* Use RCON */
    1.55 -		Admin_Cheats,			/* Change sv_cheats and use its commands */
    1.56 -		Admin_Root,				/* All access by default */
    1.57 +		Admin_Reservation,		/**< Reserved slot */
    1.58 +		Admin_Kick,				/**< Kick another user */
    1.59 +		Admin_Ban,				/**< Ban another user */
    1.60 +		Admin_Unban,			/**< Unban another user */
    1.61 +		Admin_Slay,				/**< Slay/kill/damage another user */
    1.62 +		Admin_Changemap,		/**< Change the map */
    1.63 +		Admin_Convars,			/**< Change basic convars */
    1.64 +		Admin_Configs,			/**< Change configs */
    1.65 +		Admin_Chat,				/**< Special chat privileges */
    1.66 +		Admin_Vote,				/**< Special vote privileges */
    1.67 +		Admin_Password,			/**< Set a server password */
    1.68 +		Admin_RCON,				/**< Use RCON */
    1.69 +		Admin_Cheats,			/**< Change sv_cheats and use its commands */
    1.70 +		Admin_Root,				/**< All access by default */
    1.71  		/* --- */
    1.72  		AdminFlags_TOTAL,
    1.73  	};
    1.74  
    1.75 +	/**
    1.76 +	 * @brief Specifies which type of command to override (command or command group).
    1.77 +	 */
    1.78  	enum OverrideType
    1.79  	{
    1.80 -		Override_Command = 1,	/* Command */
    1.81 -		Override_CommandGroup,	/* Command group */
    1.82 +		Override_Command = 1,	/**< Command */
    1.83 +		Override_CommandGroup,	/**< Command group */
    1.84  	};
    1.85  
    1.86 +	/**
    1.87 +	 * @brief Specifies how a command is overridden for a user group.
    1.88 +	 */
    1.89  	enum OverrideRule
    1.90  	{
    1.91 -		Command_Deny = 0,
    1.92 -		Command_Allow = 1,
    1.93 +		Command_Deny = 0,		/**< Deny access */
    1.94 +		Command_Allow = 1,		/**< Allow access */
    1.95  	};
    1.96  
    1.97 +	/**
    1.98 +	 * @brief Specifies a generic immunity type.
    1.99 +	 */
   1.100  	enum ImmunityType
   1.101  	{
   1.102 -		Immunity_Default = 1,	/* Immune from everyone with no immunity */
   1.103 -		Immunity_Global,		/* Immune from everyone (except root admins) */
   1.104 +		Immunity_Default = 1,	/**< Immune from everyone with no immunity */
   1.105 +		Immunity_Global,		/**< Immune from everyone (except root admins) */
   1.106  	};
   1.107  
   1.108 +	/**
   1.109 +	 * @brief Represents an index to one group.
   1.110 +	 */
   1.111  	typedef int		GroupId;
   1.112  
   1.113  	#define ADMIN_CACHE_OVERRIDES	(1<<0)
   1.114  	#define ADMIN_CACHE_ADMINS		(1<<1)
   1.115  	#define ADMIN_CACHE_GROUPS		((1<<2)|ADMIN_CACHE_ADMINS)
   1.116  
   1.117 +	/**
   1.118 +	 * @brief Represents an invalid/nonexistant group or an erroneous operation.
   1.119 +	 */
   1.120  	#define INVALID_GROUP_ID	-1
   1.121  
   1.122 +	/**
   1.123 +	 * @brief Provides callbacks for admin cache operations.
   1.124 +	 */
   1.125  	class IAdminListener
   1.126  	{
   1.127  	public:
   1.128 @@ -88,7 +124,7 @@
   1.129  	};
   1.130  
   1.131  	/**
   1.132 -	 * @brief This is the administration options cache.
   1.133 +	 * @brief Provides functions for manipulating the admin options cache.
   1.134  	 */
   1.135  	class IAdminSystem : public SMInterface
   1.136  	{
   1.137 @@ -238,7 +274,7 @@
   1.138  		 * @param id			Group id.
   1.139  		 * @param name			String containing command name (case sensitive).
   1.140  		 * @param type			Override type (specific command or group).
   1.141 -		 * @param rule			Optional pointer to store allow/deny setting.
   1.142 +		 * @param pRule			Optional pointer to store allow/deny setting.
   1.143  		 * @return				True if an override exists, false otherwise.
   1.144  		 */
   1.145  		virtual bool GetGroupCommandOverride(GroupId id,