#include <public/IAdminSystem.h>
Inherits SourceMod::SMInterface.
Inheritance diagram for SourceMod::IAdminSystem:
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. | |
| virtual bool | GetCommandOverride (const char *cmd, OverrideType type, FlagBits *pFlags)=0 |
| Returns a command override. | |
| virtual void | UnsetCommandOverride (const char *cmd, OverrideType type)=0 |
| Unsets a command override. | |
| virtual GroupId | AddGroup (const char *group_name)=0 |
| Adds a new group. Name must be unique. | |
| virtual GroupId | FindGroupByName (const char *group_name)=0 |
| Finds a group by name. | |
| 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. | |
| virtual bool | GetGroupAddFlag (GroupId id, AdminFlag flag)=0 |
| Gets the set value of an add flag on a group's flag set. | |
| 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. | |
| virtual void | SetGroupGenericImmunity (GroupId id, ImmunityType type, bool enabled)=0 |
| DEPRECATED. Sets a group's immunity level using backwards compatible types. | |
| virtual bool | GetGroupGenericImmunity (GroupId id, ImmunityType type)=0 |
| DEPRECATED. Returns whether a group has an immunity level using backwards compatible types. | |
| virtual void | AddGroupImmunity (GroupId id, GroupId other_id)=0 |
| Adds immunity to a specific group. | |
| virtual unsigned int | GetGroupImmunityCount (GroupId id)=0 |
| Returns the number of specific group immunities. | |
| virtual GroupId | GetGroupImmunity (GroupId id, unsigned int number)=0 |
| Returns a group that this group is immune to given an index. | |
| virtual void | AddGroupCommandOverride (GroupId id, const char *name, OverrideType type, OverrideRule rule)=0 |
| Adds a group-specific override type. | |
| virtual bool | GetGroupCommandOverride (GroupId id, const char *name, OverrideType type, OverrideRule *pRule)=0 |
| Retrieves a group-specific command override. | |
| 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. | |
| virtual void | AddAdminListener (IAdminListener *pListener)=0 |
| Adds an admin interface listener. | |
| virtual void | RemoveAdminListener (IAdminListener *pListener)=0 |
| Removes an admin interface listener. | |
| virtual void | RegisterAuthIdentType (const char *name)=0 |
| Registers an authentication identity type. Note: Default types are "steam," "name," and "ip.". | |
| virtual AdminId | CreateAdmin (const char *name)=0 |
| Creates a new user entry. | |
| virtual const char * | GetAdminName (AdminId id)=0 |
| Gets an admin's user name. | |
| 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. | |
| virtual void | SetAdminFlag (AdminId id, AdminFlag flag, bool enabled)=0 |
| Sets whether or not a flag is enabled on an admin. | |
| virtual bool | GetAdminFlag (AdminId id, AdminFlag flag, AccessMode mode)=0 |
| Returns whether or not a flag is enabled on an admin. | |
| virtual FlagBits | GetAdminFlags (AdminId id, AccessMode mode)=0 |
| Returns the bitstring of access flags on an admin. | |
| virtual void | SetAdminFlags (AdminId id, AccessMode mode, FlagBits bits)=0 |
| Sets the bitstring of access flags on an admin. | |
| 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. | |
| virtual unsigned int | GetAdminGroupCount (AdminId id)=0 |
| Returns the number of groups this admin is a member of. | |
| virtual GroupId | GetAdminGroup (AdminId id, unsigned int index, const char **name)=0 |
| Returns group information from an admin. | |
| virtual void | SetAdminPassword (AdminId id, const char *password)=0 |
| Sets a password on an admin. | |
| virtual const char * | GetAdminPassword (AdminId id)=0 |
| Gets an admin's password. | |
| virtual AdminId | FindAdminByIdentity (const char *auth, const char *identity)=0 |
| Attempts to find an admin by an auth method and an identity. | |
| virtual bool | InvalidateAdmin (AdminId id)=0 |
| Invalidates an admin from the cache so its resources can be re-used. | |
| virtual unsigned int | FlagBitsToBitArray (FlagBits bits, bool array[], unsigned int maxSize)=0 |
| Converts a flag bit string to a bit array. | |
| virtual FlagBits | FlagBitArrayToBits (const bool array[], unsigned int maxSize)=0 |
| Converts a flag array to a bit string. | |
| virtual FlagBits | FlagArrayToBits (const AdminFlag array[], unsigned int numFlags)=0 |
| Converts an array of flags to bits. | |
| virtual unsigned int | FlagBitsToArray (FlagBits bits, AdminFlag array[], unsigned int maxSize)=0 |
| Converts a bit string to an array of flags. | |
| 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(). | |
| virtual bool | CanAdminTarget (AdminId id, AdminId target)=0 |
| Checks whether an AdminId can target another AdminId. | |
| virtual bool | FindFlag (const char *flagname, AdminFlag *pAdmFlag)=0 |
| Returns a flag from a named string. | |
| virtual bool | FindFlag (char c, AdminFlag *pAdmFlag)=0 |
| Reads a single character as a flag. | |
| virtual FlagBits | ReadFlagString (const char *flags, const char **end)=0 |
| Reads a string of flag letters and returns its access value. | |
| 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. | |
| virtual bool | CanAdminUseCommand (int client, const char *cmd)=0 |
| Checks whether an admin can use the given command name. | |
| virtual const char * | GetGroupName (GroupId gid)=0 |
| Returns the name of a group. | |
| virtual unsigned int | SetGroupImmunityLevel (GroupId gid, unsigned int level)=0 |
| Sets the immunity level of a group. | |
| virtual unsigned int | GetGroupImmunityLevel (GroupId gid)=0 |
| Retrieves the immunity level of a group. | |
| virtual unsigned int | SetAdminImmunityLevel (AdminId id, unsigned int level)=0 |
| Sets the immunity level of an admin. | |
| virtual unsigned int | GetAdminImmunityLevel (AdminId id)=0 |
| Retrieves the immunity level of an admin. | |
| virtual bool | CheckAccess (int client, const char *cmd, FlagBits flags, bool override_only)=0 |
| Computers access to an override. | |
Definition at line 220 of file IAdminSystem.h.
| virtual void SourceMod::IAdminSystem::AddCommandOverride | ( | const char * | cmd, | |
| OverrideType | type, | |||
| FlagBits | flags | |||
| ) | [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. |
| virtual bool SourceMod::IAdminSystem::GetCommandOverride | ( | const char * | cmd, | |
| OverrideType | type, | |||
| FlagBits * | pFlags | |||
| ) | [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. |
| virtual void SourceMod::IAdminSystem::UnsetCommandOverride | ( | const char * | cmd, | |
| OverrideType | type | |||
| ) | [pure virtual] |
Unsets a command override.
| cmd | String containing command name (case sensitive). | |
| type | Override type (specific command or group). |
| virtual GroupId SourceMod::IAdminSystem::AddGroup | ( | const char * | group_name | ) | [pure virtual] |
Adds a new group. Name must be unique.
| group_name | String containing the group name. |
| virtual GroupId SourceMod::IAdminSystem::FindGroupByName | ( | const char * | group_name | ) | [pure virtual] |
Finds a group by name.
| group_name | String containing the group name. |
| virtual void SourceMod::IAdminSystem::SetGroupAddFlag | ( | GroupId | id, | |
| AdminFlag | flag, | |||
| bool | enabled | |||
| ) | [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. |
Gets the set value of an add flag on a group's flag set.
| id | Group id. | |
| flag | Admin flag to retrieve. |
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. |
| virtual void SourceMod::IAdminSystem::SetGroupGenericImmunity | ( | GroupId | id, | |
| ImmunityType | type, | |||
| bool | enabled | |||
| ) | [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. |
| virtual bool SourceMod::IAdminSystem::GetGroupGenericImmunity | ( | GroupId | id, | |
| ImmunityType | type | |||
| ) | [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. |
| virtual void SourceMod::IAdminSystem::AddGroupImmunity | ( | GroupId | id, | |
| GroupId | other_id | |||
| ) | [pure virtual] |
Adds immunity to a specific group.
| id | Group id. | |
| other_id | Group id to receive immunity to. |
| virtual unsigned int SourceMod::IAdminSystem::GetGroupImmunityCount | ( | GroupId | id | ) | [pure virtual] |
Returns the number of specific group immunities.
| id | Group id. |
| virtual GroupId SourceMod::IAdminSystem::GetGroupImmunity | ( | GroupId | id, | |
| unsigned int | number | |||
| ) | [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(). |
| virtual void SourceMod::IAdminSystem::AddGroupCommandOverride | ( | GroupId | id, | |
| const char * | name, | |||
| OverrideType | type, | |||
| OverrideRule | rule | |||
| ) | [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. |
| virtual bool SourceMod::IAdminSystem::GetGroupCommandOverride | ( | GroupId | id, | |
| const char * | name, | |||
| OverrideType | type, | |||
| OverrideRule * | pRule | |||
| ) | [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. |
| virtual void SourceMod::IAdminSystem::DumpAdminCache | ( | AdminCachePart | part, | |
| bool | rebuild | |||
| ) | [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. |
| virtual void SourceMod::IAdminSystem::AddAdminListener | ( | IAdminListener * | pListener | ) | [pure virtual] |
| virtual void SourceMod::IAdminSystem::RemoveAdminListener | ( | IAdminListener * | pListener | ) | [pure virtual] |
| virtual void SourceMod::IAdminSystem::RegisterAuthIdentType | ( | const char * | name | ) | [pure virtual] |
Registers an authentication identity type. Note: Default types are "steam," "name," and "ip.".
| name | String containing the type name. |
| virtual AdminId SourceMod::IAdminSystem::CreateAdmin | ( | const char * | name | ) | [pure virtual] |
Creates a new user entry.
| name | Name for this entry (does not have to be unique). Specify NULL for an anonymous admin. |
| virtual const char* SourceMod::IAdminSystem::GetAdminName | ( | AdminId | id | ) | [pure virtual] |
Gets an admin's user name.
| id | AdminId index for this admin. |
| virtual bool SourceMod::IAdminSystem::BindAdminIdentity | ( | AdminId | id, | |
| const char * | auth, | |||
| const char * | ident | |||
| ) | [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. |
| virtual void SourceMod::IAdminSystem::SetAdminFlag | ( | AdminId | id, | |
| AdminFlag | flag, | |||
| bool | enabled | |||
| ) | [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. |
| virtual bool SourceMod::IAdminSystem::GetAdminFlag | ( | AdminId | id, | |
| AdminFlag | flag, | |||
| AccessMode | mode | |||
| ) | [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. |
| virtual FlagBits SourceMod::IAdminSystem::GetAdminFlags | ( | AdminId | id, | |
| AccessMode | mode | |||
| ) | [pure virtual] |
Returns the bitstring of access flags on an admin.
| id | AdminId index of the admin. | |
| mode | Access mode to use. |
| virtual void SourceMod::IAdminSystem::SetAdminFlags | ( | AdminId | id, | |
| AccessMode | mode, | |||
| FlagBits | bits | |||
| ) | [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. |
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. |
| virtual unsigned int SourceMod::IAdminSystem::GetAdminGroupCount | ( | AdminId | id | ) | [pure virtual] |
Returns the number of groups this admin is a member of.
| id | AdminId index of the admin. |
| virtual GroupId SourceMod::IAdminSystem::GetAdminGroup | ( | AdminId | id, | |
| unsigned int | index, | |||
| const char ** | name | |||
| ) | [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. |
| virtual void SourceMod::IAdminSystem::SetAdminPassword | ( | AdminId | id, | |
| const char * | password | |||
| ) | [pure virtual] |
Sets a password on an admin.
| id | AdminId index of the admin. | |
| password | String containing the password. |
| virtual const char* SourceMod::IAdminSystem::GetAdminPassword | ( | AdminId | id | ) | [pure virtual] |
Gets an admin's password.
| id | AdminId index of the admin. |
| virtual AdminId SourceMod::IAdminSystem::FindAdminByIdentity | ( | const char * | auth, | |
| const char * | identity | |||
| ) | [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. |
| virtual bool SourceMod::IAdminSystem::InvalidateAdmin | ( | AdminId | id | ) | [pure virtual] |
Invalidates an admin from the cache so its resources can be re-used.
| id | AdminId index to invalidate. |
| virtual unsigned int SourceMod::IAdminSystem::FlagBitsToBitArray | ( | FlagBits | bits, | |
| bool | array[], | |||
| unsigned int | maxSize | |||
| ) | [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. |
| virtual FlagBits SourceMod::IAdminSystem::FlagBitArrayToBits | ( | const bool | array[], | |
| unsigned int | maxSize | |||
| ) | [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. |
| virtual FlagBits SourceMod::IAdminSystem::FlagArrayToBits | ( | const AdminFlag | array[], | |
| unsigned int | numFlags | |||
| ) | [pure virtual] |
Converts an array of flags to bits.
| array | Array containing flags that are enabled. | |
| numFlags | Number of flags in the array. |
| virtual unsigned int SourceMod::IAdminSystem::FlagBitsToArray | ( | FlagBits | bits, | |
| AdminFlag | array[], | |||
| unsigned int | maxSize | |||
| ) | [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. |
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. |
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. 1. If the targeted AdminId is INVALID_ADMIN_ID, targeting succeeds. 2. If the targeted AdminId is the same as the targeting AdminId, (self) targeting succeeds. 3. If the targeting admin is root, targeting succeeds. 4. If the targeted admin has access higher (as interpreted by (sm_immunity_mode) than the targeting admin, then targeting fails. 5. If the targeted admin has specific immunity from the targeting admin via group immunities, targeting fails. 6. Targeting succeeds.
| 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. |
| virtual bool SourceMod::IAdminSystem::FindFlag | ( | const char * | flagname, | |
| AdminFlag * | pAdmFlag | |||
| ) | [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. |
| virtual bool SourceMod::IAdminSystem::FindFlag | ( | char | c, | |
| AdminFlag * | pAdmFlag | |||
| ) | [pure virtual] |
Reads a single character as a flag.
| c | Flag character. | |
| pAdmFlag | Pointer to store the admin flag. |
| virtual FlagBits SourceMod::IAdminSystem::ReadFlagString | ( | const char * | flags, | |
| const char ** | end | |||
| ) | [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. |
| virtual unsigned int SourceMod::IAdminSystem::GetAdminSerialChange | ( | AdminId | id | ) | [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. |
| virtual bool SourceMod::IAdminSystem::CanAdminUseCommand | ( | int | client, | |
| const char * | cmd | |||
| ) | [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. |
| virtual const char* SourceMod::IAdminSystem::GetGroupName | ( | GroupId | gid | ) | [pure virtual] |
Returns the name of a group.
| gid | Group Id. |
| virtual unsigned int SourceMod::IAdminSystem::SetGroupImmunityLevel | ( | GroupId | gid, | |
| unsigned int | level | |||
| ) | [pure virtual] |
Sets the immunity level of a group.
| gid | Group Id. | |
| level | Immunity level value. |
| virtual unsigned int SourceMod::IAdminSystem::GetGroupImmunityLevel | ( | GroupId | gid | ) | [pure virtual] |
Retrieves the immunity level of a group.
| gid | Group Id. |
| virtual unsigned int SourceMod::IAdminSystem::SetAdminImmunityLevel | ( | AdminId | id, | |
| unsigned int | level | |||
| ) | [pure virtual] |
Sets the immunity level of an admin.
| id | Admin Id. | |
| level | Immunity level value. |
| virtual unsigned int SourceMod::IAdminSystem::GetAdminImmunityLevel | ( | AdminId | id | ) | [pure virtual] |
Retrieves the immunity level of an admin.
| id | Admin Id. |
| virtual bool SourceMod::IAdminSystem::CheckAccess | ( | int | client, | |
| const char * | cmd, | |||
| FlagBits | flags, | |||
| bool | override_only | |||
| ) | [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. |
1.5.1