<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alliedmods.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kilandor</id>
	<title>AlliedModders Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alliedmods.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kilandor"/>
	<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/Special:Contributions/Kilandor"/>
	<updated>2026-06-06T22:21:18Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.6</generator>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Reserved_Slots_(SourceMod)&amp;diff=7803</id>
		<title>Reserved Slots (SourceMod)</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Reserved_Slots_(SourceMod)&amp;diff=7803"/>
		<updated>2010-08-29T15:47:49Z</updated>

		<summary type="html">&lt;p&gt;Kilandor: /* Reserve Slots */ fixed incorrect cvar&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Cvars==&lt;br /&gt;
&lt;br /&gt;
*[[#Reserve Type|sm_reserve_type &amp;lt;0|1|2&amp;gt;]]&lt;br /&gt;
*[[#Reserve Slots|sm_reserve_slots &amp;lt;#&amp;gt;]]&lt;br /&gt;
*[[#Hidden Slots|sm_hide_slots &amp;lt;0|1&amp;gt;]]&lt;br /&gt;
*[[#Max Admins|sm_reserve_maxadmins &amp;lt;#&amp;gt;]]&lt;br /&gt;
*[[#Kick Type|sm_reserve_kicktype &amp;lt;0|1|2&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==Reserve Type==&lt;br /&gt;
&lt;br /&gt;
sm_reserve_type &amp;lt;0|1|2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This controls how reserve slots work on the server (the default is 0).&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;sm_reserve_type 0&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Public slots are used in preference to reserved slots. Reserved slots are freed before public slots.&lt;br /&gt;
No players are ever kicked and once reserved slots are filled by a reserve slot player (and the rest of the server is full) they will remain occupied until a player leaves.&lt;br /&gt;
The use of this is that there can always be at least one admin (assuming you only give reserved slots to admins) on the server at any time. If players inform you that there is a hacker on the server, at least one admin should be able to get it and do something about it.&lt;br /&gt;
If a player without reserve slot access joins when there are only reserved spaces remaining they will be kicked from the server.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;sm_reserve_type 1&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If someone with reserve access joins into a reserved slot, the player with the highest latency and without reserve access (spectator players are selected first) is kicked to make room. Thus, the reserved slots always remain free. The only situation where the reserved slot(s) can become properly occupied is if the server is full with reserve slot access clients. &lt;br /&gt;
This is for servers that want some people to have playing preference over other. With this method admins could one by one join a full server until they all get in.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;sm_reserve_type 2&amp;lt;/tt&amp;gt; - Only available in SourceMod 1.1 or higher.&lt;br /&gt;
&lt;br /&gt;
The same as sm_reserve_type 1 except once a certain number of admins have been reached the reserve slot stops kicking people and anyone can join to fill the server.&lt;br /&gt;
You can use this to simulate having a large number of reserved slots with sm_reserve_type 0 but with only need to have 1 slot unavailable when there are less admins connected.&lt;br /&gt;
&lt;br /&gt;
==Reserve Slots==&lt;br /&gt;
&lt;br /&gt;
sm_reserved_slots &amp;lt;#&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This controls how many slots get reserved by the plugin (the default is 0). &lt;br /&gt;
&lt;br /&gt;
Using sm_reserve_type 0 this is how many admins can join the server after it appears full to the public.&lt;br /&gt;
Using sm_reserve_type 1 this is how many slots are saved for swapping admins in (you shouldn't need more than one)&lt;br /&gt;
&lt;br /&gt;
==Hidden Slots==&lt;br /&gt;
&lt;br /&gt;
sm_hide_slots &amp;lt;0|1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This controls the plugin hides the reserved slots (the default is 0).&lt;br /&gt;
&lt;br /&gt;
If enabled (1) reserve slots are hidden in the server browser window when they are not in use. For example a 24 player server with 2 reserved slots will show as a 22 player server (until the reserved slots are occupied).&lt;br /&gt;
To connect to the reserved slot of a server that shows as full you will need to use 'connect ip:port' in console. (e.g. 'connect 192.168.1.100:27015')&lt;br /&gt;
&lt;br /&gt;
There is no possible way for the reserved slots to be visible to admins and hidden from normal users. Admin authentication can only happen after the user is fully connected to the server and their steam id is available to SourceMod. For this reason it is often better to hide the slots otherwise public users will attempt to join the server and will get kicked again (rendering the ‘autojoin’ feature useless)&lt;br /&gt;
&lt;br /&gt;
==Max Admins==&lt;br /&gt;
&lt;br /&gt;
sm_reserve_maxadmins &amp;lt;#&amp;gt; - Only available in SourceMod 1.1 or higher.&lt;br /&gt;
&lt;br /&gt;
This controls how many admins can join the server before the reserved slots are made public (only relevant to sm_reserve_type 2) &lt;br /&gt;
&lt;br /&gt;
==Kick Type==&lt;br /&gt;
&lt;br /&gt;
sm_reserve_kicktype &amp;lt;0|1|2&amp;gt; - Only available in SourceMod 1.1 or higher.&lt;br /&gt;
&lt;br /&gt;
This controls how a client is selected to be kicked (only relevant to sm_reserve_type 1/2)&lt;br /&gt;
&lt;br /&gt;
Clients with reserve slot access or the override 'sm_reskick_immunity' are always immune to being kicked. Spectating clients are chosen before playing clients.&lt;br /&gt;
&lt;br /&gt;
0 - Highest Ping&amp;lt;br&amp;gt;&lt;br /&gt;
1 - Highest Connection Time&amp;lt;br&amp;gt;&lt;br /&gt;
2 - Random Player&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Immunity==&lt;br /&gt;
&lt;br /&gt;
To make players immune from being kicked by the reserved slots plugin they need to have access to the override 'sm_reskick_immunity' (users with root or reserved slot access are already immune).&lt;br /&gt;
&lt;br /&gt;
NB: This is only relevant when using sm_reserve_type 1/2.&lt;br /&gt;
&lt;br /&gt;
You can either assign this override to a flag using admin_overrides.cfg (e.g. &amp;quot;sm_reskick_immunity&amp;quot; &amp;quot;o&amp;quot; - to give all users with flag 'o' (custom flag 1) immunity from being kicked)&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
Give groups access to the overrides in admin_groups.cfg (e.g. &amp;quot;sm_reskick_immunity&amp;quot; &amp;quot;allow&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Then add your VIP members or other users you wish to be immune from being kicked as admins with either the flag you specified or as members of the group you gave access to. (You can create a group with 0 flags and ‘0’ normal immunity and only this override if you don't want them to have any other privileges) &lt;br /&gt;
&lt;br /&gt;
Full details on overriding command access can be found at [[Overriding Command Access (SourceMod)]]&lt;br /&gt;
&lt;br /&gt;
==Possible Future Additions==&lt;br /&gt;
&lt;br /&gt;
These are possible feature additions that have been requested and are under consideration for inclusion in later versions of SourceMod&lt;br /&gt;
&lt;br /&gt;
*Choice to redirect players instead of kicking.&lt;br /&gt;
&lt;br /&gt;
[[Category:SourceMod Documentation|Categories]]&lt;/div&gt;</summary>
		<author><name>Kilandor</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Admin_API_(SourceMod)&amp;diff=7778</id>
		<title>Admin API (SourceMod)</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Admin_API_(SourceMod)&amp;diff=7778"/>
		<updated>2010-07-18T01:28:05Z</updated>

		<summary type="html">&lt;p&gt;Kilandor: Undo revision 7777 by Kilandor (Talk) - I was completley wrong&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The SourceMod Administration API abstracts user permissions for administration actions.  Permissions are stored across two primary object types: ''Admins'', which define per-user permission sets, and ''Groups'', which define permission sets that are meant to be inherited by one or more users.&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
It is important to note the purpose of the Administration API: '''It is a cache, not a permanent data store'''.  It is designed such that external data sources can load objects into the cache for optimizing in two different ways: Fast Lookup, and On-Demand Lookup&lt;br /&gt;
&lt;br /&gt;
Fast Lookup is ideal for storage methods which do not have inherently fast lookup, but are small enough to be easily cached in memory.  The flat file implementation admin format of SourceMod fits this scenario.  The entire file is read and stored in the cache.  &lt;br /&gt;
&lt;br /&gt;
On-Demand Lookup is ideal for storage methods which work over a network, or contain a large number of entries unsuitable for full retrieval, but fast atomic lookup.  This is what SQL is good at.  The SQL implementation of the SourceMod admin reader only stores admins in the cache once they have connected.&lt;br /&gt;
&lt;br /&gt;
Note the difference between the two: In the first example, the cache is being used as a lookup mechanism itself, as well as storing the permissions.  In the second example, the cache is being used ''only'' to store permissions, since lookup was done by the SQL server.  &lt;br /&gt;
&lt;br /&gt;
=Permissions=&lt;br /&gt;
==Admin Flags==&lt;br /&gt;
Permissions are granted through the ''AdminFlag'' data type.  Each flag specifies an action or permission type that requires administrative access.  For each admin, the set of flags which are enabled is called the admin's ''effective permissions''.  &lt;br /&gt;
&lt;br /&gt;
AdminFlags are stored in a variety of ways to account for various coding flexibilities.  Functions to convert in between these storage methods are available in the administration APIs for both C++ extensions and Pawn scripts.&lt;br /&gt;
*&amp;lt;tt&amp;gt;AdminFlag&amp;lt;/tt&amp;gt;: Represents a single admin permission as part of an enumeration.&lt;br /&gt;
*&amp;lt;tt&amp;gt;AdminFlag[]&amp;lt;/tt&amp;gt;: Represents an array of AdminFlags in no specific order, each member being a different flag enabled.&lt;br /&gt;
*&amp;lt;tt&amp;gt;bool[]&amp;lt;/tt&amp;gt;: Represents a bit array, where each index &amp;lt;tt&amp;gt;i&amp;lt;/tt&amp;gt; of the array specifies whether AdminFlag &amp;lt;tt&amp;gt;i&amp;lt;/tt&amp;gt; is enabled (true) or disabled (false).&lt;br /&gt;
*&amp;lt;tt&amp;gt;FlagBits&amp;lt;/tt&amp;gt;: Represents an unsigned 32bit integer, where each bit &amp;lt;tt&amp;gt;n&amp;lt;/tt&amp;gt; of the integer specifies whether AdminFlag &amp;lt;tt&amp;gt;n&amp;lt;/tt&amp;gt; is enabled (bit 1) or disabled (bit 0).  Convenience macros are available for dealing with bitwise numbers.  They are found in &amp;lt;tt&amp;gt;IAdminSystem.h&amp;lt;/tt&amp;gt; and each start with &amp;lt;tt&amp;gt;ADMFLAG&amp;lt;/tt&amp;gt; instead of &amp;lt;tt&amp;gt;Admin&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Overrides==&lt;br /&gt;
Permissions can also be granted through ''overrides''.  Overrides are specific permissions that override the default effective permissions.  They can act on both commands and command groups (a command group is a set of commands under a common name).  There are two types of overrides:&lt;br /&gt;
*'''Global Overrides''': These override the default admin flag(s) required for a given command or command group.&lt;br /&gt;
*'''Group Overrides''': These override whether members of the group can or cannot access a given command.  &lt;br /&gt;
&lt;br /&gt;
==Immunity==&lt;br /&gt;
Immunity in SourceMod is based on ''immunity levels'', which are arbitrary numbers greater than or equal to zero.  If an admin has an immunity level of 0, that admin has no immunity.  An admin can only target other admins if their immunity level is greater than or equal to the target's immunity level.  This functionality can be tweaked via &amp;lt;tt&amp;gt;sm_immunity_mode&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;cfg/sourcemod.cfg&amp;lt;/tt&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;If the targeting AdminId is &amp;lt;tt&amp;gt;INVALID_ADMIN_ID&amp;lt;/tt&amp;gt; (not an admin), targeting fails.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;If the targeted AdminId is &amp;lt;tt&amp;gt;INVALID_ADMIN_ID&amp;lt;/tt&amp;gt; (not an admin), targeting succeeds.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;If the targeted AdminId is the same as the targeting AdminId (i.e. self-targeting), then targeting succeeds.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;If the targeting admin is root, targeting succeeds.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;If the targeted admin has access higher than the targeting admin (determined by the &amp;lt;tt&amp;gt;sm_immunity_mode&amp;lt;/tt&amp;gt; rules), then targeting fails.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;If the targeted admin has specific immunity from the targeting admin via group immunities, targeting fails.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;Targeting succeeds.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The primary function for computing immunity is &amp;lt;tt&amp;gt;CanUserTarget()&amp;lt;/tt&amp;gt; (clients.inc).&lt;br /&gt;
&lt;br /&gt;
=Cache Types=&lt;br /&gt;
There are three cache types in the Administration API.  To ''invalidate'' a cache means to entirely delete it and rebuild it from scratch.  Rebuilding a cache means requesting each IAdminListener to rebuild that portion of the cache.  Aside from rebuilding a cache, there are generally three major operations to each cache: Reading, Appending (adding new settings), and Deleting (deleting individual records).&lt;br /&gt;
&lt;br /&gt;
*'''Global Override Cache''': Holds global overrides.&lt;br /&gt;
**Invalidation: Atomic&lt;br /&gt;
**Readable: Yes&lt;br /&gt;
**Appendable: Yes&lt;br /&gt;
**Deletable: Yes&lt;br /&gt;
*'''User Cache''': Holds Admin User objects.&lt;br /&gt;
**Invalidation: Atomic&lt;br /&gt;
**Readable: Yes&lt;br /&gt;
**Appendable: Yes&lt;br /&gt;
**Deletable: Yes&lt;br /&gt;
*'''Group Cache''': Holds Admin Group objects.&lt;br /&gt;
**Invalidation: Invalidates self and Admin Cache.&lt;br /&gt;
**Readable: Yes&lt;br /&gt;
**Appendable: Yes&lt;br /&gt;
**Deletable: No&lt;br /&gt;
&lt;br /&gt;
==Global Override Cache==&lt;br /&gt;
The global override cache stores information about global overrides.  Every operation to this cache occurs both retroactively and for future command creations.  An override need not be tied to a command; however, if a command has the same name, the command will inherit that override's permissions.&lt;br /&gt;
&lt;br /&gt;
===Writing/Appending===&lt;br /&gt;
New entries to the global override cache will affect both already existing commands and future commands registered during the cache's lifetime.&lt;br /&gt;
&lt;br /&gt;
Each command can be assigned any or no access flags.&lt;br /&gt;
&lt;br /&gt;
===Deleting/Invalidation===&lt;br /&gt;
Deleting a part or the whole of the global override cache will cause affected commands to revert to their original access behavior.&lt;br /&gt;
&lt;br /&gt;
==Group Cache==&lt;br /&gt;
The group cache scores all information about current groups.  It is designed to be quite static, and thus modifying groups in memory is not very flexible.&lt;br /&gt;
&lt;br /&gt;
Groups have a few important properties:&lt;br /&gt;
*'''Add Flags''': These are flags added to any user who inherits the group.&lt;br /&gt;
*'''Immunity''': Specifies rules for which admins cannot target this group.&lt;br /&gt;
*'''Immunity Level''': If a user inheriting the group has a lower immunity level than this number, they inherit the new higher value from the group.&lt;br /&gt;
*'''Specific''': Immunity from a list of specific groups.&lt;br /&gt;
*'''Overrides''': Allows commands or command groups to be allowed or denied to this group.&lt;br /&gt;
&lt;br /&gt;
===Writing/Appending===&lt;br /&gt;
*'''Add Flags''': These can be modified at any time.  However, users which inherit the group will not have their member permissions updated for performance reasons.&lt;br /&gt;
*'''Immunity''': Default and global immunity can be changed at any time.  Users inheriting the group will be affected by the changes.  Specific immunity can have new groups added (and it will affect member admins).&lt;br /&gt;
*'''Overrides''': Overrides can be changed between allow or deny at any time.&lt;br /&gt;
&lt;br /&gt;
===Deleting/Invalidation===&lt;br /&gt;
Per-group immunities cannot be removed once added.  Groups themselves cannot be removed either, as this would be a potentially expensive operation.  Instead, the entire group cache must be rebuilt (and with it, the admin cache).  The goal with this design decision is to make group invalidations rare.  In order to change a group fully, the entire admin cache must be &amp;quot;refreshed.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Admin/User Cache==&lt;br /&gt;
The user cache stores all information about currently known admins.  Users stored can either be ''live'' (as in, their permissions are currently in use by a player), or ''idle'' (cached for future lookup).   &lt;br /&gt;
&lt;br /&gt;
Users have the following properties:&lt;br /&gt;
*'''Flags''': These are the permission flags the admin inherits by default.&lt;br /&gt;
*'''Effective Flags''': These are the permission flags the admin has at runtime.  They are a combination of the base flags and the flags inherited from groups.&lt;br /&gt;
*'''Groups''': The groups the admin is a member of.&lt;br /&gt;
*'''Password''': A generic password that an authentication method might require.&lt;br /&gt;
*'''Identities''': One or more mappings between authentication methods and unique identification strings.&lt;br /&gt;
&lt;br /&gt;
===Writing/Appending===&lt;br /&gt;
*'''Flags''': Flags can be changed at any time.  Changing flags will affect effective flags, even if done after groups are inherited.&lt;br /&gt;
*'''Groups''': Groups can be inherited at any time, although a group cannot be inherited twice.  Permissions inherited from groups cannot be updated (yet).&lt;br /&gt;
*'''Password''': Passwords can be changed at any time.&lt;br /&gt;
*'''Identities''': Identities can be added, but not changed or removed.&lt;br /&gt;
&lt;br /&gt;
===Deleting/Invalidation===&lt;br /&gt;
Groups cannot be removed from an admin's inherited group list.  However, admins can be invalidated.  This lets an authentication system, such as SQL, remove individual admins to refresh their privileges.  Resources used by an admin object are always reclaimed efficiently.&lt;br /&gt;
&lt;br /&gt;
[[Category:SourceMod Development]]&lt;br /&gt;
[[Category:SourceMod Scripting]]&lt;/div&gt;</summary>
		<author><name>Kilandor</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Admin_API_(SourceMod)&amp;diff=7777</id>
		<title>Admin API (SourceMod)</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Admin_API_(SourceMod)&amp;diff=7777"/>
		<updated>2010-07-18T01:06:34Z</updated>

		<summary type="html">&lt;p&gt;Kilandor: /* Admin Flags */  added list of flags, since they are not found in api, and require digging into source files&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The SourceMod Administration API abstracts user permissions for administration actions.  Permissions are stored across two primary object types: ''Admins'', which define per-user permission sets, and ''Groups'', which define permission sets that are meant to be inherited by one or more users.&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
It is important to note the purpose of the Administration API: '''It is a cache, not a permanent data store'''.  It is designed such that external data sources can load objects into the cache for optimizing in two different ways: Fast Lookup, and On-Demand Lookup&lt;br /&gt;
&lt;br /&gt;
Fast Lookup is ideal for storage methods which do not have inherently fast lookup, but are small enough to be easily cached in memory.  The flat file implementation admin format of SourceMod fits this scenario.  The entire file is read and stored in the cache.  &lt;br /&gt;
&lt;br /&gt;
On-Demand Lookup is ideal for storage methods which work over a network, or contain a large number of entries unsuitable for full retrieval, but fast atomic lookup.  This is what SQL is good at.  The SQL implementation of the SourceMod admin reader only stores admins in the cache once they have connected.&lt;br /&gt;
&lt;br /&gt;
Note the difference between the two: In the first example, the cache is being used as a lookup mechanism itself, as well as storing the permissions.  In the second example, the cache is being used ''only'' to store permissions, since lookup was done by the SQL server.  &lt;br /&gt;
&lt;br /&gt;
=Permissions=&lt;br /&gt;
==Admin Flags==&lt;br /&gt;
Permissions are granted through the ''AdminFlag'' data type.  Each flag specifies an action or permission type that requires administrative access.  For each admin, the set of flags which are enabled is called the admin's ''effective permissions''.  &lt;br /&gt;
&lt;br /&gt;
AdminFlags are stored in a variety of ways to account for various coding flexibilities.  Functions to convert in between these storage methods are available in the administration APIs for both C++ extensions and Pawn scripts.&lt;br /&gt;
*&amp;lt;tt&amp;gt;AdminFlag&amp;lt;/tt&amp;gt;: Represents a single admin permission as part of an enumeration.&lt;br /&gt;
*&amp;lt;tt&amp;gt;AdminFlag[]&amp;lt;/tt&amp;gt;: Represents an array of AdminFlags in no specific order, each member being a different flag enabled.&lt;br /&gt;
*&amp;lt;tt&amp;gt;bool[]&amp;lt;/tt&amp;gt;: Represents a bit array, where each index &amp;lt;tt&amp;gt;i&amp;lt;/tt&amp;gt; of the array specifies whether AdminFlag &amp;lt;tt&amp;gt;i&amp;lt;/tt&amp;gt; is enabled (true) or disabled (false).&lt;br /&gt;
*&amp;lt;tt&amp;gt;FlagBits&amp;lt;/tt&amp;gt;: Represents an unsigned 32bit integer, where each bit &amp;lt;tt&amp;gt;n&amp;lt;/tt&amp;gt; of the integer specifies whether AdminFlag &amp;lt;tt&amp;gt;n&amp;lt;/tt&amp;gt; is enabled (bit 1) or disabled (bit 0).  Convenience macros are available for dealing with bitwise numbers.  They are found in &amp;lt;tt&amp;gt;IAdminSystem.h&amp;lt;/tt&amp;gt; and each start with &amp;lt;tt&amp;gt;ADMFLAG&amp;lt;/tt&amp;gt; instead of &amp;lt;tt&amp;gt;Admin&amp;lt;/tt&amp;gt;.&lt;br /&gt;
**&amp;lt;tt&amp;gt;ADMFLAG_RESERVATION&amp;lt;/tt&amp;gt;&lt;br /&gt;
**&amp;lt;tt&amp;gt;ADMFLAG_GENERIC&amp;lt;/tt&amp;gt;&lt;br /&gt;
**&amp;lt;tt&amp;gt;ADMFLAG_KICK&amp;lt;/tt&amp;gt;&lt;br /&gt;
**&amp;lt;tt&amp;gt;ADMFLAG_BAN&amp;lt;/tt&amp;gt;&lt;br /&gt;
**&amp;lt;tt&amp;gt;ADMFLAG_UNBAN&amp;lt;/tt&amp;gt;&lt;br /&gt;
**&amp;lt;tt&amp;gt;ADMFLAG_SLAY&amp;lt;/tt&amp;gt;&lt;br /&gt;
**&amp;lt;tt&amp;gt;ADMFLAG_CHANGEMAP&amp;lt;/tt&amp;gt;&lt;br /&gt;
**&amp;lt;tt&amp;gt;ADMFLAG_CONVARS&amp;lt;/tt&amp;gt;&lt;br /&gt;
**&amp;lt;tt&amp;gt;ADMFLAG_CONFIG&amp;lt;/tt&amp;gt;&lt;br /&gt;
**&amp;lt;tt&amp;gt;ADMFLAG_CHAT&amp;lt;/tt&amp;gt;&lt;br /&gt;
**&amp;lt;tt&amp;gt;ADMFLAG_VOTE&amp;lt;/tt&amp;gt;&lt;br /&gt;
**&amp;lt;tt&amp;gt;ADMFLAG_PASSWORD&amp;lt;/tt&amp;gt;&lt;br /&gt;
**&amp;lt;tt&amp;gt;ADMFLAG_RCON&amp;lt;/tt&amp;gt;&lt;br /&gt;
**&amp;lt;tt&amp;gt;ADMFLAG_CHEATS&amp;lt;/tt&amp;gt;&lt;br /&gt;
**&amp;lt;tt&amp;gt;ADMFLAG_ROOT&amp;lt;/tt&amp;gt;&lt;br /&gt;
**&amp;lt;tt&amp;gt;ADMFLAG_CUSTOM1&amp;lt;/tt&amp;gt;&lt;br /&gt;
**&amp;lt;tt&amp;gt;ADMFLAG_CUSTOM2&amp;lt;/tt&amp;gt;&lt;br /&gt;
**&amp;lt;tt&amp;gt;ADMFLAG_CUSTOM3&amp;lt;/tt&amp;gt;&lt;br /&gt;
**&amp;lt;tt&amp;gt;ADMFLAG_CUSTOM4&amp;lt;/tt&amp;gt;&lt;br /&gt;
**&amp;lt;tt&amp;gt;ADMFLAG_CUSTOM5&amp;lt;/tt&amp;gt;&lt;br /&gt;
**&amp;lt;tt&amp;gt;ADMFLAG_CUSTOM6&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Overrides==&lt;br /&gt;
Permissions can also be granted through ''overrides''.  Overrides are specific permissions that override the default effective permissions.  They can act on both commands and command groups (a command group is a set of commands under a common name).  There are two types of overrides:&lt;br /&gt;
*'''Global Overrides''': These override the default admin flag(s) required for a given command or command group.&lt;br /&gt;
*'''Group Overrides''': These override whether members of the group can or cannot access a given command.  &lt;br /&gt;
&lt;br /&gt;
==Immunity==&lt;br /&gt;
Immunity in SourceMod is based on ''immunity levels'', which are arbitrary numbers greater than or equal to zero.  If an admin has an immunity level of 0, that admin has no immunity.  An admin can only target other admins if their immunity level is greater than or equal to the target's immunity level.  This functionality can be tweaked via &amp;lt;tt&amp;gt;sm_immunity_mode&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;cfg/sourcemod.cfg&amp;lt;/tt&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;If the targeting AdminId is &amp;lt;tt&amp;gt;INVALID_ADMIN_ID&amp;lt;/tt&amp;gt; (not an admin), targeting fails.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;If the targeted AdminId is &amp;lt;tt&amp;gt;INVALID_ADMIN_ID&amp;lt;/tt&amp;gt; (not an admin), targeting succeeds.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;If the targeted AdminId is the same as the targeting AdminId (i.e. self-targeting), then targeting succeeds.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;If the targeting admin is root, targeting succeeds.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;If the targeted admin has access higher than the targeting admin (determined by the &amp;lt;tt&amp;gt;sm_immunity_mode&amp;lt;/tt&amp;gt; rules), then targeting fails.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;If the targeted admin has specific immunity from the targeting admin via group immunities, targeting fails.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;Targeting succeeds.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The primary function for computing immunity is &amp;lt;tt&amp;gt;CanUserTarget()&amp;lt;/tt&amp;gt; (clients.inc).&lt;br /&gt;
&lt;br /&gt;
=Cache Types=&lt;br /&gt;
There are three cache types in the Administration API.  To ''invalidate'' a cache means to entirely delete it and rebuild it from scratch.  Rebuilding a cache means requesting each IAdminListener to rebuild that portion of the cache.  Aside from rebuilding a cache, there are generally three major operations to each cache: Reading, Appending (adding new settings), and Deleting (deleting individual records).&lt;br /&gt;
&lt;br /&gt;
*'''Global Override Cache''': Holds global overrides.&lt;br /&gt;
**Invalidation: Atomic&lt;br /&gt;
**Readable: Yes&lt;br /&gt;
**Appendable: Yes&lt;br /&gt;
**Deletable: Yes&lt;br /&gt;
*'''User Cache''': Holds Admin User objects.&lt;br /&gt;
**Invalidation: Atomic&lt;br /&gt;
**Readable: Yes&lt;br /&gt;
**Appendable: Yes&lt;br /&gt;
**Deletable: Yes&lt;br /&gt;
*'''Group Cache''': Holds Admin Group objects.&lt;br /&gt;
**Invalidation: Invalidates self and Admin Cache.&lt;br /&gt;
**Readable: Yes&lt;br /&gt;
**Appendable: Yes&lt;br /&gt;
**Deletable: No&lt;br /&gt;
&lt;br /&gt;
==Global Override Cache==&lt;br /&gt;
The global override cache stores information about global overrides.  Every operation to this cache occurs both retroactively and for future command creations.  An override need not be tied to a command; however, if a command has the same name, the command will inherit that override's permissions.&lt;br /&gt;
&lt;br /&gt;
===Writing/Appending===&lt;br /&gt;
New entries to the global override cache will affect both already existing commands and future commands registered during the cache's lifetime.&lt;br /&gt;
&lt;br /&gt;
Each command can be assigned any or no access flags.&lt;br /&gt;
&lt;br /&gt;
===Deleting/Invalidation===&lt;br /&gt;
Deleting a part or the whole of the global override cache will cause affected commands to revert to their original access behavior.&lt;br /&gt;
&lt;br /&gt;
==Group Cache==&lt;br /&gt;
The group cache scores all information about current groups.  It is designed to be quite static, and thus modifying groups in memory is not very flexible.&lt;br /&gt;
&lt;br /&gt;
Groups have a few important properties:&lt;br /&gt;
*'''Add Flags''': These are flags added to any user who inherits the group.&lt;br /&gt;
*'''Immunity''': Specifies rules for which admins cannot target this group.&lt;br /&gt;
*'''Immunity Level''': If a user inheriting the group has a lower immunity level than this number, they inherit the new higher value from the group.&lt;br /&gt;
*'''Specific''': Immunity from a list of specific groups.&lt;br /&gt;
*'''Overrides''': Allows commands or command groups to be allowed or denied to this group.&lt;br /&gt;
&lt;br /&gt;
===Writing/Appending===&lt;br /&gt;
*'''Add Flags''': These can be modified at any time.  However, users which inherit the group will not have their member permissions updated for performance reasons.&lt;br /&gt;
*'''Immunity''': Default and global immunity can be changed at any time.  Users inheriting the group will be affected by the changes.  Specific immunity can have new groups added (and it will affect member admins).&lt;br /&gt;
*'''Overrides''': Overrides can be changed between allow or deny at any time.&lt;br /&gt;
&lt;br /&gt;
===Deleting/Invalidation===&lt;br /&gt;
Per-group immunities cannot be removed once added.  Groups themselves cannot be removed either, as this would be a potentially expensive operation.  Instead, the entire group cache must be rebuilt (and with it, the admin cache).  The goal with this design decision is to make group invalidations rare.  In order to change a group fully, the entire admin cache must be &amp;quot;refreshed.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Admin/User Cache==&lt;br /&gt;
The user cache stores all information about currently known admins.  Users stored can either be ''live'' (as in, their permissions are currently in use by a player), or ''idle'' (cached for future lookup).   &lt;br /&gt;
&lt;br /&gt;
Users have the following properties:&lt;br /&gt;
*'''Flags''': These are the permission flags the admin inherits by default.&lt;br /&gt;
*'''Effective Flags''': These are the permission flags the admin has at runtime.  They are a combination of the base flags and the flags inherited from groups.&lt;br /&gt;
*'''Groups''': The groups the admin is a member of.&lt;br /&gt;
*'''Password''': A generic password that an authentication method might require.&lt;br /&gt;
*'''Identities''': One or more mappings between authentication methods and unique identification strings.&lt;br /&gt;
&lt;br /&gt;
===Writing/Appending===&lt;br /&gt;
*'''Flags''': Flags can be changed at any time.  Changing flags will affect effective flags, even if done after groups are inherited.&lt;br /&gt;
*'''Groups''': Groups can be inherited at any time, although a group cannot be inherited twice.  Permissions inherited from groups cannot be updated (yet).&lt;br /&gt;
*'''Password''': Passwords can be changed at any time.&lt;br /&gt;
*'''Identities''': Identities can be added, but not changed or removed.&lt;br /&gt;
&lt;br /&gt;
===Deleting/Invalidation===&lt;br /&gt;
Groups cannot be removed from an admin's inherited group list.  However, admins can be invalidated.  This lets an authentication system, such as SQL, remove individual admins to refresh their privileges.  Resources used by an admin object are always reclaimed efficiently.&lt;br /&gt;
&lt;br /&gt;
[[Category:SourceMod Development]]&lt;br /&gt;
[[Category:SourceMod Scripting]]&lt;/div&gt;</summary>
		<author><name>Kilandor</name></author>
		
	</entry>
</feed>