Difference between revisions of "SemiAdmin"

From WolfWiki
Jump to: navigation, search
(b_semiAdminCmds#: cvars and cfgs)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[ETPro]] allows admins to use SemiAdmins. These are admins who can do some server commands without having full [[rcon]] access.
+
'''Semi Admins''' are admins who can perform only certain commands without having full referee or rcon access.
 +
The commands each semiadmin can perform and the password each needs for logging in are defined via cvars.
  
Semiadmin is split up in levels from 1 to 999 but you probably wont need them all, each level can have different commands.
+
==cvar overview==
  
 +
{| cellspacing="2" cellpadding="2"
 +
|- style="background: #CCCCFF;"
 +
!width="200"|cvar
 +
!width="100"|default
 +
!description
 +
|- style="background-color: #F4F4F4;"
 +
|<tt style="color: green;">b_semiAdminLevels</tt>
 +
|align="center"|0
 +
|The number of semiadmin levels.
 +
|- style="background-color: #EEEEEE;"
 +
|<tt style="color: green;">b_semiAdminPass#</tt>
 +
|align="center" style="color: gray;"|undefined
 +
|Defines the password for each semiadmin level, where # is the level to set the password for.
 +
|- style="background-color: #F4F4F4;"
 +
|<tt style="color:green;">b_semiAdminCmds#</tt>
 +
|align="center" style="color: gray;"|undefined
 +
|A space-seperated list of commands a level # semiadmin can use.
 +
|}
  
----
 
  
 +
==cvar descriptions==
  
First you need a server variable called:
+
===b_semiAdminLevels===
  
''b_semiAdminLevels #''
+
Defines the number of semiadmin levels to use. Valid values are 0–999. The default value of 0 disables semiadmin functionality.
 +
set b_semiAdminLevels 3  // you will have 3 semiadmin levels
  
 +
===b_semiAdminPass#===
  
This variable uses 1 number, it is the number of semiadmin levels you want use
+
Sets the password for each semiadmin level. # is the level to set the password for. Every level must have its own password.
the number can be from 0 to 999, where 0 is no semiadmins at all. Any value higher than 0 is the number of levels so if you have it set to 2 you will have 2 semiadmin levels.
+
set b_semiAdminPass1 "foo"  // foo is the password to log in as a level 1 semiadmin
  
 +
===b_semiAdminCmds#===
  
----
+
A space-seperated list of commands a semiadmin with level # is allowed to perform. Be carefull with commands like <code>set</code>, <code>exec</code>, <code>vstr</code> etc.
 +
set b_semiAdminCmds1 "clientkick say kick"
  
 +
In addition to built in commands, you can permit semi-admins to exec .cfg files or vstr cvars.
 +
If blah is in b_semiAdminCmds# <code>sa blah</code> looks for a file named blah.cfg and then a cvar named blah.cvar, and finally a builtin command named blah.
  
The second thing you need is the password this is done by a variable called:
+
==Example configuration==
''b_semiAdminPass# "thepassword"''
+
  
 +
set b_semiAdminLevels  "3"                // we will have 3 semiadmin levels
 +
set b_semiAdminPass1    "foo"              // foo is the password for level 1
 +
set b_semiAdminPass2    "bar"              // the password for level 2
 +
set b_semiAdminPass3    "foobar"
 +
<span style="color: red;">set b_semiAdminPass4    "wrong"            // will not work since we have only defined 3 semiadmin levels</span>
 +
set b_semiAdminCmds1    "say map_restart"
 +
set b_semiAdminCmds2    "kick say clientkick g_friendyfire"        // level 2 is allowed to change the cvar g_friendlyfire
 +
set b_semiAdminCmds3    "set kick clientkick exec"
  
The # is the level number you want to use for this password.
+
The above lines will create 3 semiadmin levels. Each level has its own password and an own list of commands which can be used by a semiadmin with that level.
so b_semiadminpass2 "lol" will make 'lol' the password to log into level 2, but b_semiadminlevels must be 2 or higher than 2 for level 2 to work.
+
Also every level must have its own password, since the password is used to choose which level a person logs in like:
+
''b_semiadminpass1 "omg"''
+
''b_semiadminpass2 "lol"'' this will make anyone that logs in with 'lol' a level 2 semiadmin and everyone that logs in with 'omg' a level 1 semiadmin.
+
  
  
----
+
==Usage of the semiadmin functionality==
  
 +
To log in as a semiadmin use the command <code>/semiadminlogin <password></code> or the shorter one <code>/sal <password></code>. Performing a command is done via the commands <code>/semiadmin <command></code> or <code>/sa <command></code>.
  
Third, you need the command that can be used by a level this is done by a variable called:
+
Some commands send information back, like the rcon command <code>status</code>. These information will not be sent back to the semiadmin.
  
''b_semiAdminCmds# "command"''
+
Typing <code>/sa</code> without any parameters will give you a list of commands you’re allowed to perform.
  
 +
/sal baz                              // login with the password baz
 +
/semiadmin say Hello all              // perform the command "say Hello all"
 +
/sa                                  // shows you a list of commands you’re able to perform
  
The # is the level number you want to use for these commands.
+
[[Category:ETPro]]
Each command must be separated with a space so ''b_semiadmincmds1 "say broadcast"'' allows any level 1 semiadmin to use both 'broadcast' and 'say', any arguments that are added to any of those commands are also sent, so it's possible to do ''/sa say "hello all"''
+
 
+
Be careful with that in cases of ''b_semiadmincmds2 "exec vstr set"'' the level2 semiadmin can add any arguments to these commands so, they can exec any .cfg on the server using ''/sa exec filename.cfg'' and, they can vstr any string using ''/sa vstr stringname'' and they can also set any cvar using ''/sa set cvarname value'' this means they can even set ''rconpassword Very Happy''
+
But this can be done a different way, you can add the variable in the cmd list just like you wont need "set" in the server console.
+
For strings that you want to vstr you can add the string name in the cmd list then a semiadmin can /sa stringname to vstr it
+
This both allows you to limit the powers more specific e.g.
+
''b_semiadmincmds3 "g_speed g_gravity m1 m2 m3"''
+
 
+
For the rest of the cmds list can contain any console command and it will also be done as if it was typed in the server console itself with only 1 big exception:
+
Some command send information back, such as when you do ''/rcon status'' it will show the server status, sadly this does not work for semiadmins, if a semiadmin does a command like that, it will do the command on the server only but the text will never reach it back to the client.
+
 
+
 
+
----
+
 
+
 
+
Now when that is all done people should be able to log in, this is done by the command ''/semiadminlogin'' or short ''/sal'' like this:
+
 
+
''/semiadminlogin passwordofyourlevel''
+
 
+
 
+
If it succeeds it will broadcast ''‘playername has become a semiadmin’'' and in your console it says ''seminadmin level yourlevel logged in''. Now you can start using the SemiAdmon commands.
+
 
+
To do server commands you use the command ''/semiadmin'' or ''/sa'' like:
+
 
+
''/semiadmin yourcommand''
+
 
+
 
+
If you don't know what commands you can do you can just type /sa to get your level number and your commands.
+
if the command is not in your command list (/sa) you cannot use it.
+

Latest revision as of 02:23, 24 April 2007

Semi Admins are admins who can perform only certain commands without having full referee or rcon access. The commands each semiadmin can perform and the password each needs for logging in are defined via cvars.

cvar overview

cvar default description
b_semiAdminLevels 0 The number of semiadmin levels.
b_semiAdminPass# undefined Defines the password for each semiadmin level, where # is the level to set the password for.
b_semiAdminCmds# undefined A space-seperated list of commands a level # semiadmin can use.


cvar descriptions

b_semiAdminLevels

Defines the number of semiadmin levels to use. Valid values are 0–999. The default value of 0 disables semiadmin functionality.

set b_semiAdminLevels 3   // you will have 3 semiadmin levels

b_semiAdminPass#

Sets the password for each semiadmin level. # is the level to set the password for. Every level must have its own password.

set b_semiAdminPass1 "foo"   // foo is the password to log in as a level 1 semiadmin

b_semiAdminCmds#

A space-seperated list of commands a semiadmin with level # is allowed to perform. Be carefull with commands like set, exec, vstr etc.

set b_semiAdminCmds1 "clientkick say kick"

In addition to built in commands, you can permit semi-admins to exec .cfg files or vstr cvars. If blah is in b_semiAdminCmds# sa blah looks for a file named blah.cfg and then a cvar named blah.cvar, and finally a builtin command named blah.

Example configuration

set b_semiAdminLevels   "3"                 // we will have 3 semiadmin levels
set b_semiAdminPass1    "foo"               // foo is the password for level 1
set b_semiAdminPass2    "bar"               // the password for level 2
set b_semiAdminPass3    "foobar"
set b_semiAdminPass4    "wrong"             // will not work since we have only defined 3 semiadmin levels
set b_semiAdminCmds1    "say map_restart"
set b_semiAdminCmds2    "kick say clientkick g_friendyfire"         // level 2 is allowed to change the cvar g_friendlyfire
set b_semiAdminCmds3    "set kick clientkick exec"

The above lines will create 3 semiadmin levels. Each level has its own password and an own list of commands which can be used by a semiadmin with that level.


Usage of the semiadmin functionality

To log in as a semiadmin use the command /semiadminlogin <password> or the shorter one /sal <password>. Performing a command is done via the commands /semiadmin <command> or /sa <command>.

Some commands send information back, like the rcon command status. These information will not be sent back to the semiadmin.

Typing /sa without any parameters will give you a list of commands you’re allowed to perform.

/sal baz                              // login with the password baz
/semiadmin say Hello all              // perform the command "say Hello all"
/sa                                   // shows you a list of commands you’re able to perform