NS2 B213 Server Admin System * Updated *
Sr Lance
Rhythm is a Lancer Join Date: 2004-11-18 Member: 32862Members, Constellation, Squad Five Blue
<b>Server Admin System Documentation: - Dedicated Server</b>
Natural Selection 2 Build 211 introduces an integrated Server Admin System which allows server owners to specify admin groups and use server commands in game.
<b>Change Log:</b>
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec--><b>Updated for B213 (New Server commands)
- sv_password
- sv_listbans
- sv_unban
</b>- Devicenulls rcon web console implemented (You will need to install and download the files from URL below and extract to the webpath location) - Only need to do this if you use the Web Spark interface - B214 will include the files
<a href="https://github.com/devicenull/ns2web" target="_blank">https://github.com/devicenull/ns2web</a><!--QuoteEnd--></div><!--QuoteEEnd-->
<b>File Structure:</b>
<a href="http://%appdata%/Natural%20Selection%202/config/" target="_blank">%appdata%/Natural Selection 2/config/</a>
--- ServerAdmin.json
--- BannedPlayers.json
--- mapcycle.txt
<b>Parameters for multiple instance servers:</b>
By default, the server will look in %appdata%/Natural Selection 2/config/ for ServerAdmin.json, BannedPlayers.json, and mapcycle.txt. This path can be partially overridden using a command line option or by editing the server.xml file.
For example:
-adminpath Server1AdminPath/
This will cause the server to look in %appdata%/Natural Selection 2/Server1AdminPath/ for the files.
<b>Group Permissions:</b>
The JSON file allows you to define permission groups. Each group has either a black list or a white list of commands allowed.
<b>Example:</b>
Defined by <group Name> <type allowed/disallowed> <commands>
Example can be found at <a href="http://www.skulkrush.com/NS2/serverAdmin.json" target="_blank">www.skulkrush.com/NS2/serverAdmin.json </a>
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->{
"groups":
{
"admin_group": { "type": "disallowed", "commands": [ ] },
"mod_group": { "type": "disallowed", "commands": [ "sv_ban", "sv_reset" ] },
"clan_group": { "type": "allowed", "commands": [ "sv_kick", "sv_say" ] }
}<!--QuoteEnd--></div><!--QuoteEEnd-->
A list of all commands are listed at the bottom:
<b>How to add users to groups:</b>
The users group is also specified within the ServerAdmin.json file under the permission group section.
<b>Steam ID:</b>
NS2 does not use the usual SteamID format. If you have your old SteamID (from the 'status' command in a game like TF2), you can convert it to a NS2 style SteamID using the following formulas:
<b>Forumula:</b>
STEAM_0:0:XXXXX :(SteamID * 2)
STEAM_0:1:XXXXX :(SteamID * 2 + 1)
<b>Example:</b>
STEAM_0:0:919317: 919317 * 2 = 1838634
STEAM_0:1:919317: 919317 * 2 + 1 = 1838635
Defined by <name> <steamID> <group name>
Example can be found at <a href="http://www.skulkrush.com/NS2/serverAdmin.json" target="_blank">www.skulkrush.com/NS2/serverAdmin.json </a>
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->}
"users":
{
"Murphy": { "id": 11641641, "groups": [ "admin_group" ] },
"Lance": { "id": 1838634, "groups": [ "mod_group", "clan_group" ] }
}
}<!--QuoteEnd--></div><!--QuoteEEnd-->
<b>Server Bans:</b>
Players that have been banned from the server will appear within the BannedPlayers.json.
<b>Example:</b>
You can add/remove bans either by using the sv_ban or sv_unban commands within the server.
<b>Do not edit BannedPlayers.json.</b>
Example can be found at <a href="http://www.skulkrush.com/NS2/bannedPlayers.json" target="_blank">www.skulkrush.com/NS2/bannedPlayers.json </a>
Defined by: <name> <steamID> <reason> <time in seconds>
Time 0 is a permanent ban.
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->}
{ "name": "Murphy", "id": 11641641, "reason": "Recycled Base", "time": 1903827289 }
}<!--QuoteEnd--></div><!--QuoteEEnd-->
<img src="http://www.skulkrush.com/NS2/server-commands2.png" border="0" class="linked-image" />
<b>Please note these are planned features and may or may not make it into the next build</b>
<img src="http://www.skulkrush.com/NS2/features.png" border="0" class="linked-image" />
Natural Selection 2 Build 211 introduces an integrated Server Admin System which allows server owners to specify admin groups and use server commands in game.
<b>Change Log:</b>
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec--><b>Updated for B213 (New Server commands)
- sv_password
- sv_listbans
- sv_unban
</b>- Devicenulls rcon web console implemented (You will need to install and download the files from URL below and extract to the webpath location) - Only need to do this if you use the Web Spark interface - B214 will include the files
<a href="https://github.com/devicenull/ns2web" target="_blank">https://github.com/devicenull/ns2web</a><!--QuoteEnd--></div><!--QuoteEEnd-->
<b>File Structure:</b>
<a href="http://%appdata%/Natural%20Selection%202/config/" target="_blank">%appdata%/Natural Selection 2/config/</a>
--- ServerAdmin.json
--- BannedPlayers.json
--- mapcycle.txt
<b>Parameters for multiple instance servers:</b>
By default, the server will look in %appdata%/Natural Selection 2/config/ for ServerAdmin.json, BannedPlayers.json, and mapcycle.txt. This path can be partially overridden using a command line option or by editing the server.xml file.
For example:
-adminpath Server1AdminPath/
This will cause the server to look in %appdata%/Natural Selection 2/Server1AdminPath/ for the files.
<b>Group Permissions:</b>
The JSON file allows you to define permission groups. Each group has either a black list or a white list of commands allowed.
<b>Example:</b>
Defined by <group Name> <type allowed/disallowed> <commands>
Example can be found at <a href="http://www.skulkrush.com/NS2/serverAdmin.json" target="_blank">www.skulkrush.com/NS2/serverAdmin.json </a>
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->{
"groups":
{
"admin_group": { "type": "disallowed", "commands": [ ] },
"mod_group": { "type": "disallowed", "commands": [ "sv_ban", "sv_reset" ] },
"clan_group": { "type": "allowed", "commands": [ "sv_kick", "sv_say" ] }
}<!--QuoteEnd--></div><!--QuoteEEnd-->
A list of all commands are listed at the bottom:
<b>How to add users to groups:</b>
The users group is also specified within the ServerAdmin.json file under the permission group section.
<b>Steam ID:</b>
NS2 does not use the usual SteamID format. If you have your old SteamID (from the 'status' command in a game like TF2), you can convert it to a NS2 style SteamID using the following formulas:
<b>Forumula:</b>
STEAM_0:0:XXXXX :(SteamID * 2)
STEAM_0:1:XXXXX :(SteamID * 2 + 1)
<b>Example:</b>
STEAM_0:0:919317: 919317 * 2 = 1838634
STEAM_0:1:919317: 919317 * 2 + 1 = 1838635
Defined by <name> <steamID> <group name>
Example can be found at <a href="http://www.skulkrush.com/NS2/serverAdmin.json" target="_blank">www.skulkrush.com/NS2/serverAdmin.json </a>
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->}
"users":
{
"Murphy": { "id": 11641641, "groups": [ "admin_group" ] },
"Lance": { "id": 1838634, "groups": [ "mod_group", "clan_group" ] }
}
}<!--QuoteEnd--></div><!--QuoteEEnd-->
<b>Server Bans:</b>
Players that have been banned from the server will appear within the BannedPlayers.json.
<b>Example:</b>
You can add/remove bans either by using the sv_ban or sv_unban commands within the server.
<b>Do not edit BannedPlayers.json.</b>
Example can be found at <a href="http://www.skulkrush.com/NS2/bannedPlayers.json" target="_blank">www.skulkrush.com/NS2/bannedPlayers.json </a>
Defined by: <name> <steamID> <reason> <time in seconds>
Time 0 is a permanent ban.
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->}
{ "name": "Murphy", "id": 11641641, "reason": "Recycled Base", "time": 1903827289 }
}<!--QuoteEnd--></div><!--QuoteEEnd-->
<img src="http://www.skulkrush.com/NS2/server-commands2.png" border="0" class="linked-image" />
<b>Please note these are planned features and may or may not make it into the next build</b>
<img src="http://www.skulkrush.com/NS2/features.png" border="0" class="linked-image" />
Comments
If you have an old steam ID you will have to convert it into the new steam ID format before adding it into the serverAdmin.json file, old IDs are determined by the start of your steam ID.
Example:
STEAM_0:0:919317 - STEAM_0:0 represents an old steam ID number.
(STEAM_0:1:11641641 - STEAM_0:1 represents a new steam ID. already the new format)
To calculate the new ID you will need to do the following:
(SteamID * 2) = 1838634
1838634 would be the Steam ID:<!--QuoteEnd--></div><!--QuoteEEnd-->
No sense this explanation makes.
2 old quotes by yours truly:
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->STEAM_0:n:x -> 2x+n. So if we have STEAM_0:1:12345678, the SteamID-number returned by the 'GetUserId'-method will be 2*12345678+1 = 24691357.<!--QuoteEnd--></div><!--QuoteEEnd--><!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->The 'n' (the auth-server ID) in STEAM_0:n:x is either 0 or 1, so you can deduce it by looking at whether the digested-id is even (n = 0) or odd (n = 1).<!--QuoteEnd--></div><!--QuoteEEnd-->
Whether a steam-id is 'old' or 'new' is determined simply by the sheer presence of the STEAM_-prefix alone.
What I think you mean to say here is <b>Do not edit BannedPlayers.json while the server is running</b>. IIRC it locks the file anyway, so that shouldn't be much of a concern.
%appdata%/Natural Selection 2/config/
--- ServerAdmin.json
--- BannedPlayers.json
Please explain more specific on how this pathing works. I have multiple servers, so that path wont work for me because all servers will use the same path? I want to move those files and have a seperate folder for each server and then with server command load that folder. Please explain how to make that to. Be very specific.
Thanks
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->Parameters for multiple instance servers:
By default, the server will look in %appdata%/Natural Selection 2/config/ for ServerAdmin.json, BannedPlayers.json, and mapcycle.txt. This path can be partially overridden using a command line option or by editing the server.xml file.
For example:
-adminpath Server1AdminPath/
This will cause the server to look in %appdata%/Natural Selection 2/Server1AdminPath/ for the files.<!--QuoteEnd--></div><!--QuoteEEnd-->
So for example like this?
-file c:\Service\NS2_Servers\Server_1\server.xml --adminpath c:\Service\NS2_Servers\Server_1\ServerAdmin\
And inside this folder i just add the following files:
--- ServerAdmin.json
--- BannedPlayers.json
Is this correct?
-file c:\Service\NS2_Servers\Server_1\server.xml --adminpath c:\Service\NS2_Servers\Server_1\ServerAdmin\
And inside this folder i just add the following files:
--- ServerAdmin.json
--- BannedPlayers.json
Is this correct?<!--QuoteEnd--></div><!--QuoteEEnd-->
Currently only supports within Appdata but there are plans to change this.
In regards to tournymode that is something on the agenda. Both teams saying ready and 5 or 10 sec countdown and round reset, or if someone types unready then it stops the countdown.
+1
%appdata%/Natural Selection 2/config/
--- ServerAdmin.json
--- BannedPlayers.json
I did not find those files in my appdata. :/ I'm guessing you have to manually created them? Also the example link doesnt work.
I wrote this on my ServerAdmin.json, and is this correct?
<b>{
"groups":
{
"admin_group": { "type": "allowed", "commands": [ "sv_kick", "sv_ban", "sv_switchteam", "sv_rrall", "sv_randonall", "sv_eject", "sv_help", "sv_status", "sv_say", "sv_tsay", "sv_psay", "sv_slay" ] }
}
"users":
{
"Poofighter": { "id": 1376984, "groups": [ "admin_group" ] }
}</b>
Yeah i did it? :) Or what in that code did i do wrong? :/
Yes, you edited your post after mine... In any case, you're missing a final }
This is mine (which works):
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->{
"groups":
{
"admin_group": { "type": "disallowed", "commands": [ ] }
}
"users":
{
"ceribik": { "id": ID_GOES_HERE, "groups": [ "admin_group" ] }
}
}<!--c2--></div><!--ec2-->
<b>File Structure:</b>
By default, the server will look in %appdata%/Natural Selection 2/config/ for ServerAdmin.json, BannedPlayers.json, and mapcycle.txt.<!--QuoteEnd--></div><!--QuoteEEnd-->
You mentioned by default it will look in the config folder.
So when I write following command <b>-adminpath Server_1\settings</b>
Then instead of it loading this folder <b>%appdata%/Natural Selection 2/config/</b> it will instead load this folder <b>%appdata%/Natural Selection 2/Server1/settings/</b>
Am I'm thinking correct?
This is mine (which works):
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->{
"groups":
{
"admin_group": { "type": "disallowed", "commands": [ ] }
}
"users":
{
"ceribik": { "id": ID_GOES_HERE, "groups": [ "admin_group" ] }
}
}<!--c2--></div><!--ec2--><!--QuoteEnd--></div><!--QuoteEEnd-->
Why do you have disallowed commands on admin_group? Should it then stop you from being an admin? If you look in my code again, i wrote allowed and then the following commands that give me access for giving those specific commands?
If you read it carefully, you would have seen that it specifies that no commands are to be disallowed (i.e. "I am not forbidden from using any command"). Due to way the privileges system is setup, this effectively gives me access to every command.
The way you did it works, although if any new commands are added, you will have to alter your admin file again.
In other words:
<b>disallowed</b> - blacklist (everything is available by default)
<b>allowed</b> - whitelist (nothing is available by default)
The way you did it works, although if any new commands are added, you will have to alter your admin file again.
In other words:
<b>disallowed</b> - blacklist (everything is available by default)
<b>allowed</b> - whitelist (nothing is available by default)<!--QuoteEnd--></div><!--QuoteEEnd-->
Thanks, sorry wasn't pain attension, tired & sleepy today.
Anyways, I didn't work for me. Admin commands doesnt work on my server.
Edit:
I just got pissed and putted in all app natural selection 2 which i found on my server . lol
2 old quotes by yours truly:
Whether a steam-id is 'old' or 'new' is determined simply by the sheer presence of the STEAM_-prefix alone.<!--QuoteEnd--></div><!--QuoteEEnd-->
I think the confusion stems from the use of "STEAM_1:X:Y" as a format in recent titles such as CS GO.
It would be nice to have the log files and config files all in a central location within the main server directory. Would make running multiple NS2 servers on 1 physical box a whole lot easier and simpler to manage.
It would be nice to have the log files and config files all in a central location within the main server directory. Would make running multiple NS2 servers on 1 physical box a whole lot easier and simpler to manage.<!--QuoteEnd--></div><!--QuoteEEnd-->
This is being worked on, not sure if it will make it to the next patch however.
ps: Nice job Sr Lance
This would help the admins to restart the server if needed without leaving the game.
Kept getting a syntax error using examples however a good friend corrected my edits using a online editor at <a href="http://jsoneditoronline.org/" target="_blank">http://jsoneditoronline.org/</a> <a href='index.php?act=findpost&pid=0'>jsoneditoronline.org</a>
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>{
"groups": {
"admin_group": {
"type": "allowed",
"commands": [
"sv_changemap",
"sv_reset",
"sv_say",
"sv_cheats",
"sv_slay",
"sv_tsay",
"sv_psay",
"sv_status",
"sv_help",
"sv_rrall",
"sv_randomall",
"sv_votemap",
"sv_switchteam",
"sv_eject",
"sv_password"
]
},
"mod_group": {
"type": "disallowed",
"commands": [
"sv_ban",
"sv_reset"
]
},
"clan_group": {
"type": "allowed",
"commands": [
"sv_kick",
"sv_say"
]
}
},
"users": {
"Woody56": {
"id": 115656,
"groups": [
"admin_group"
]
},
"rxxxx": {
"id": 259294,
"groups": [
"admin_group"
]
},
"TimeLord": {
"id": 612942,
"groups": [
"admin_group"
]
},
"Jxxxx": {
"id": 3543367,
"groups": [
"mod_group"
]
},
"Injxxxx": {
"id": 10340618,
"groups": [
"clan_group"
]
}
}
}</div>
Is it possible to manage ns2 server with rcon protocol ?
Is it possible to manage ns2 server with rcon protocol ?<!--QuoteEnd--></div><!--QuoteEEnd-->
<a href="http://www.unknownworlds.com/ns2/wiki/index.php/Dedicated_Server#Web_Administration" target="_blank">http://www.unknownworlds.com/ns2/wiki/inde..._Administration</a>
sv_password - implemented (sv_password on its own to remove the password)
sv_unban - added
sv_listbans - added
Can you add a value in the json data to identify if server has a password or not ?
Edit: this post is dedicated to Locke, a victim of two mis-kickings
Edit: this post is dedicated to Locke, a victim of two mis-kickings<!--QuoteEnd--></div><!--QuoteEEnd-->
I have the same problem that users id keep changing alot, I can barely use sv_switchteams because it always drag the wrong person :/
Hopefully this will be fixed in next patch.