SourceMod SDK
1.7
|
Provides functions for manipulating the admin options cache. More...
#include <public/IAdminSystem.h>
Public Member Functions | |
const char * | GetInterfaceName () |
Must return a string defining the interface's unique name. | |
unsigned int | GetInterfaceVersion () |
Must return an integer defining the interface's version. | |
virtual void | AddCommandOverride (const char *cmd, OverrideType type, FlagBits flags)=0 |
Adds a global command flag override. Any command registered with this name will assume the new flag. This is applied retroactively as well. More... | |
virtual bool | GetCommandOverride (const char *cmd, OverrideType type, FlagBits *pFlags)=0 |
Returns a command override. More... | |
virtual void | UnsetCommandOverride (const char *cmd, OverrideType type)=0 |
Unsets a command override. More... | |
virtual GroupId | AddGroup (const char *group_name)=0 |
Adds a new group. Name must be unique. More... | |
virtual GroupId | FindGroupByName (const char *group_name)=0 |
Finds a group by name. More... | |
virtual void | SetGroupAddFlag (GroupId id, AdminFlag flag, bool enabled)=0 |
Adds or removes a flag from a group's flag set. Note: These are called "add flags" because they add to a user's flags. More... | |
virtual bool | GetGroupAddFlag (GroupId id, AdminFlag flag)=0 |
Gets the set value of an add flag on a group's flag set. More... | |
virtual FlagBits | GetGroupAddFlags (GroupId id)=0 |
Returns an array of flag bits that are added to a user from their group. Note: These are called "add flags" because they add to a user's flags. More... | |
virtual void | SetGroupGenericImmunity (GroupId id, ImmunityType type, bool enabled)=0 |
DEPRECATED. Sets a group's immunity level using backwards compatible types. More... | |
virtual bool | GetGroupGenericImmunity (GroupId id, ImmunityType type)=0 |
DEPRECATED. Returns whether a group has an immunity level using backwards compatible types. More... | |
virtual void | AddGroupImmunity (GroupId id, GroupId other_id)=0 |
Adds immunity to a specific group. More... | |
virtual unsigned int | GetGroupImmunityCount (GroupId id)=0 |
Returns the number of specific group immunities. More... | |
virtual GroupId | GetGroupImmunity (GroupId id, unsigned int number)=0 |
Returns a group that this group is immune to given an index. More... | |
virtual void | AddGroupCommandOverride (GroupId id, const char *name, OverrideType type, OverrideRule rule)=0 |
Adds a group-specific override type. More... | |
virtual bool | GetGroupCommandOverride (GroupId id, const char *name, OverrideType type, OverrideRule *pRule)=0 |
Retrieves a group-specific command override. More... | |
virtual void | DumpAdminCache (AdminCachePart part, bool rebuild)=0 |
Tells the admin system to dump a portion of the cache. This calls into plugin forwards to rebuild the cache. More... | |
virtual void | AddAdminListener (IAdminListener *pListener)=0 |
Adds an admin interface listener. More... | |
virtual void | RemoveAdminListener (IAdminListener *pListener)=0 |
Removes an admin interface listener. More... | |
virtual void | RegisterAuthIdentType (const char *name)=0 |
Registers an authentication identity type. Note: Default types are "steam," "name," and "ip.". More... | |
virtual AdminId | CreateAdmin (const char *name)=0 |
Creates a new user entry. More... | |
virtual const char * | GetAdminName (AdminId id)=0 |
Gets an admin's user name. More... | |
virtual bool | BindAdminIdentity (AdminId id, const char *auth, const char *ident)=0 |
Binds a user entry to a particular auth method. This bind must be unique. More... | |
virtual void | SetAdminFlag (AdminId id, AdminFlag flag, bool enabled)=0 |
Sets whether or not a flag is enabled on an admin. More... | |
virtual bool | GetAdminFlag (AdminId id, AdminFlag flag, AccessMode mode)=0 |
Returns whether or not a flag is enabled on an admin. More... | |
virtual FlagBits | GetAdminFlags (AdminId id, AccessMode mode)=0 |
Returns the bitstring of access flags on an admin. More... | |
virtual void | SetAdminFlags (AdminId id, AccessMode mode, FlagBits bits)=0 |
Sets the bitstring of access flags on an admin. More... | |
virtual bool | AdminInheritGroup (AdminId id, GroupId gid)=0 |
Adds a group to an admin's inherited group list. Any flags the group has will be added to the admin's effective flags. More... | |
virtual unsigned int | GetAdminGroupCount (AdminId id)=0 |
Returns the number of groups this admin is a member of. More... | |
virtual GroupId | GetAdminGroup (AdminId id, unsigned int index, const char **name)=0 |
Returns group information from an admin. More... | |
virtual void | SetAdminPassword (AdminId id, const char *password)=0 |
Sets a password on an admin. More... | |
virtual const char * | GetAdminPassword (AdminId id)=0 |
Gets an admin's password. More... | |
virtual AdminId | FindAdminByIdentity (const char *auth, const char *identity)=0 |
Attempts to find an admin by an auth method and an identity. More... | |
virtual bool | InvalidateAdmin (AdminId id)=0 |
Invalidates an admin from the cache so its resources can be re-used. More... | |
virtual unsigned int | FlagBitsToBitArray (FlagBits bits, bool array[], unsigned int maxSize)=0 |
Converts a flag bit string to a bit array. More... | |
virtual FlagBits | FlagBitArrayToBits (const bool array[], unsigned int maxSize)=0 |
Converts a flag array to a bit string. More... | |
virtual FlagBits | FlagArrayToBits (const AdminFlag array[], unsigned int numFlags)=0 |
Converts an array of flags to bits. More... | |
virtual unsigned int | FlagBitsToArray (FlagBits bits, AdminFlag array[], unsigned int maxSize)=0 |
Converts a bit string to an array of flags. More... | |
virtual bool | CheckAdminFlags (AdminId id, FlagBits bits)=0 |
Checks whether a user has access to a given set of flag bits. Note: This is a wrapper around GetAdminFlags(). More... | |
virtual bool | CanAdminTarget (AdminId id, AdminId target)=0 |
Checks whether an AdminId can target another AdminId. More... | |
virtual bool | FindFlag (const char *flagname, AdminFlag *pAdmFlag)=0 |
Returns a flag from a named string. More... | |
virtual bool | FindFlag (char c, AdminFlag *pAdmFlag)=0 |
Reads a single character as a flag. More... | |
virtual FlagBits | ReadFlagString (const char *flags, const char **end)=0 |
Reads a string of flag letters and returns its access value. More... | |
virtual unsigned int | GetAdminSerialChange (AdminId id)=0 |
Returns a "serial number" for an AdminId. If the serial number has changed for a given AdminId, it means the permissions have changed. More... | |
virtual bool | CanAdminUseCommand (int client, const char *cmd)=0 |
Checks whether an admin can use the given command name. More... | |
virtual const char * | GetGroupName (GroupId gid)=0 |
Returns the name of a group. More... | |
virtual unsigned int | SetGroupImmunityLevel (GroupId gid, unsigned int level)=0 |
Sets the immunity level of a group. More... | |
virtual unsigned int | GetGroupImmunityLevel (GroupId gid)=0 |
Retrieves the immunity level of a group. More... | |
virtual unsigned int | SetAdminImmunityLevel (AdminId id, unsigned int level)=0 |
Sets the immunity level of an admin. More... | |
virtual unsigned int | GetAdminImmunityLevel (AdminId id)=0 |
Retrieves the immunity level of an admin. More... | |
virtual bool | CheckAccess (int client, const char *cmd, FlagBits flags, bool override_only)=0 |
Computers access to an override. More... | |
virtual bool | FindFlagChar (AdminFlag flag, char *c)=0 |
Reads a flag as the corresponding character. More... | |
virtual bool | IsValidAdmin (AdminId id)=0 |
Returns whether or not an admin id is valid. More... | |
virtual bool | CheckClientCommandAccess (int client, const char *cmd, FlagBits cmdflags)=0 |
Returns whether or not a client has access to a given command. More... | |
Public Member Functions inherited from SourceMod::SMInterface | |
virtual bool | IsVersionCompatible (unsigned int version) |
Must return whether the requested version number is backwards compatible. Note: This can be overridden for breaking changes or custom versioning. More... | |
Provides functions for manipulating the admin options cache.
|
pure virtual |
Adds an admin interface listener.
pListener | Pointer to an IAdminListener to add. |
|
pure virtual |
Adds a global command flag override. Any command registered with this name will assume the new flag. This is applied retroactively as well.
cmd | String containing command name (case sensitive). |
type | Override type (specific command or group). |
flags | New admin flag. |
|
pure virtual |
Adds a new group. Name must be unique.
group_name | String containing the group name. |
|
pure virtual |
Adds a group-specific override type.
id | Group id. |
name | String containing command name (case sensitive). |
type | Override type (specific command or group). |
rule | Override allow/deny setting. |
|
pure virtual |
Adds immunity to a specific group.
id | Group id. |
other_id | Group id to receive immunity to. |
|
pure virtual |
Adds a group to an admin's inherited group list. Any flags the group has will be added to the admin's effective flags.
id | AdminId index of the admin. |
gid | GroupId index of the group. |
|
pure virtual |
Binds a user entry to a particular auth method. This bind must be unique.
id | AdminId index of the admin. |
auth | Auth method to use. |
ident | Identity string to bind to. |
|
pure virtual |
Checks whether an AdminId can target another AdminId.
The hueristics for this check are as follows: 0. If the targeting AdminId is INVALID_ADMIN_ID, targeting fails.
id | AdminId index of admin doing the targeting. Can be INVALID_ADMIN_ID. |
target | AdminId index of the target admin. Can be INVALID_ADMIN_ID. |
|
pure virtual |
Checks whether an admin can use the given command name.
If the command does not exist, this will return true.
client | Client index. |
cmd | Command name. |
|
pure virtual |
Computers access to an override.
client | Client index. |
cmd | Override name. |
flags | Default flags. |
override_only | If false, if a command matches the override, then its flags will override the default. |
|
pure virtual |
Checks whether a user has access to a given set of flag bits. Note: This is a wrapper around GetAdminFlags().
id | AdminId index of admin. |
bits | Bitstring containing the permissions to check. |
|
pure virtual |
Returns whether or not a client has access to a given command.
client | Client index. |
cmd | Command name. |
flags | Command admin flags. |
|
pure virtual |
Creates a new user entry.
name | Name for this entry (does not have to be unique). Specify NULL for an anonymous admin. |
|
pure virtual |
Tells the admin system to dump a portion of the cache. This calls into plugin forwards to rebuild the cache.
part | Portion of the cache to dump. |
rebuild | If true, the rebuild forwards/events will fire. |
|
pure virtual |
Attempts to find an admin by an auth method and an identity.
auth | Auth method to try. |
identity | Identity string to look up. |
|
pure virtual |
Returns a flag from a named string.
flagname | Case sensitive flag name string (like "kick"). |
pAdmFlag | Pointer to store the found admin flag in. |
|
pure virtual |
Reads a single character as a flag.
c | Flag character. |
pAdmFlag | Pointer to store the admin flag. |
|
pure virtual |
Reads a flag as the corresponding character.
flag | Flag to look up. |
c | Variable to store flag char. |
|
pure virtual |
Finds a group by name.
group_name | String containing the group name. |
|
pure virtual |
Converts an array of flags to bits.
array | Array containing flags that are enabled. |
numFlags | Number of flags in the array. |
|
pure virtual |
Converts a flag array to a bit string.
array | Array containing true or false for each AdminFlag. |
maxSize | Maximum size of the flag array. |
|
pure virtual |
Converts a bit string to an array of flags.
bits | Bit string containing the flags. |
array | Output array to write flags. |
maxSize | Maximum size of the flag array. |
|
pure virtual |
Converts a flag bit string to a bit array.
bits | Bit string containing the flags. |
array | Array to write the flags to. Enabled flags will be 'true'. |
maxSize | Maximum number of flags the array can store. |
|
pure virtual |
Returns whether or not a flag is enabled on an admin.
id | AdminId index of the admin. |
flag | Admin flag to use. |
mode | Access mode to check. |
|
pure virtual |
Returns the bitstring of access flags on an admin.
id | AdminId index of the admin. |
mode | Access mode to use. |
|
pure virtual |
Returns group information from an admin.
id | AdminId index of the admin. |
index | Group number to retrieve, from 0 to N-1, where N is the value of GetAdminGroupCount(id). |
name | Optional pointer to store the group's name. |
|
pure virtual |
Returns the number of groups this admin is a member of.
id | AdminId index of the admin. |
|
pure virtual |
Retrieves the immunity level of an admin.
id | Admin Id. |
|
pure virtual |
Gets an admin's user name.
id | AdminId index for this admin. |
|
pure virtual |
Gets an admin's password.
id | AdminId index of the admin. |
|
pure virtual |
Returns a "serial number" for an AdminId. If the serial number has changed for a given AdminId, it means the permissions have changed.
id | AdminId value. |
|
pure virtual |
Returns a command override.
cmd | String containing command name (case sensitive). |
type | Override type (specific command or group). |
pFlags | Optional pointer to the set flag. |
|
pure virtual |
Gets the set value of an add flag on a group's flag set.
id | Group id. |
flag | Admin flag to retrieve. |
|
pure virtual |
Returns an array of flag bits that are added to a user from their group. Note: These are called "add flags" because they add to a user's flags.
id | GroupId of the group. |
|
pure virtual |
Retrieves a group-specific command override.
id | Group id. |
name | String containing command name (case sensitive). |
type | Override type (specific command or group). |
pRule | Optional pointer to store allow/deny setting. |
|
pure virtual |
DEPRECATED. Returns whether a group has an immunity level using backwards compatible types.
This simply checks whether the group's immunity value is greater than or equal to the new-style value for the old type.
id | Group id. |
type | Generic immunity type. |
|
pure virtual |
Returns a group that this group is immune to given an index.
id | Group id. |
number | Index from 0 to N-1, from GetGroupImmunities(). |
|
pure virtual |
Returns the number of specific group immunities.
id | Group id. |
|
pure virtual |
Retrieves the immunity level of a group.
gid | Group Id. |
|
pure virtual |
Returns the name of a group.
gid | Group Id. |
|
pure virtual |
Invalidates an admin from the cache so its resources can be re-used.
id | AdminId index to invalidate. |
|
pure virtual |
Returns whether or not an admin id is valid.
id | Admin id to check. |
|
pure virtual |
Reads a string of flag letters and returns its access value.
flags | Flag string. |
end | Pointer to store the last value read. On success, this will store a pointer to the null terminator. |
|
pure virtual |
Registers an authentication identity type. Note: Default types are "steam," "name," and "ip.".
name | String containing the type name. |
|
pure virtual |
Removes an admin interface listener.
pListener | Pointer to an IAdminListener to remove. |
|
pure virtual |
Sets whether or not a flag is enabled on an admin.
id | AdminId index of the admin. |
flag | Admin flag to use. |
enabled | True to enable, false to disable. |
|
pure virtual |
Sets the bitstring of access flags on an admin.
id | AdminId index of the admin. |
mode | Access mode to use (real affects both). |
bits | Bitstring to set. |
|
pure virtual |
Sets the immunity level of an admin.
id | Admin Id. |
level | Immunity level value. |
|
pure virtual |
Sets a password on an admin.
id | AdminId index of the admin. |
password | String containing the password. |
|
pure virtual |
Adds or removes a flag from a group's flag set. Note: These are called "add flags" because they add to a user's flags.
id | Group id. |
flag | Admin flag to toggle. |
enabled | True to set the flag, false to unset/disable. |
|
pure virtual |
DEPRECATED. Sets a group's immunity level using backwards compatible types.
If the new level being set is lower than the group's actual immunity level, no operation takes place.
id | Group id. |
type | Immunity type which will be converted to a numerical level. |
enabled | True to set the level. False sets the group's immunity value to 0. |
|
pure virtual |
Sets the immunity level of a group.
gid | Group Id. |
level | Immunity level value. |
|
pure virtual |
Unsets a command override.
cmd | String containing command name (case sensitive). |
type | Override type (specific command or group). |