New ServerConfig.json file and defining the location of these server files
MurphyIdiot
NS2 programmer Join Date: 2008-04-17 Member: 64095Members, Super Administrators, NS2 Developer, Subnautica Developer, Pistachionauts, Future Perfect Developer
Hey server admins!
With 1.0 coming up so soon, we want to try to fix as many of the server admin issues as we can.
So here are a couple of new things you should all be aware of (and maybe one of you can document this on the wiki for me).
First of all, there is a new ServerConfig.json file in patch 220. We are going be removing the existing server.xml file eventually (not sure when, maybe not until right after 1.0) so this new file will take over some of the roles of server.xml.
For now, the only thing in this new file is going to be "newbie_friendly". This will set the server to be in newbie mode which is something that will be explained in more detail when we are done implementing it (should be in 220). But soon the optional auto-team balance system will be configured through this new file as well. Perhaps other options like player counts, password, etc too.
Here is what it looks like:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->{
"settings":
{
"newbie_friendly": true,
"auto_team_balance": true,
"unbalance_count": 2
},
"tags": [ "newbie" ]
}<!--c2--></div><!--ec2-->
Just an example. The team balance stuff isn't used yet. Another thing to notice here are the tags. So if you want your server to be in newbie mode, you need to also have a "newbie" tag. These tags are a Steam feature that other games use too but basically, the server browser will be able to use these tags to filter servers later. You can add whatever tags you want but please be aware there is a 128 character limit on ALL tags combined (this is just a normal Steam limitation).
The second thing to be aware of is that we are implementing an often requested feature: configurable server admin files location.
So here is an example of how that works:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->server.exe -config_path "C:\server1\config"<!--c2--></div><!--ec2-->
All of the server files such as bans, admin, map cycle, and this new config file will all read and write to this directory. It defaults to %appdata%\Natural Selection 2\
All these changes will be in 220.
Thanks!
With 1.0 coming up so soon, we want to try to fix as many of the server admin issues as we can.
So here are a couple of new things you should all be aware of (and maybe one of you can document this on the wiki for me).
First of all, there is a new ServerConfig.json file in patch 220. We are going be removing the existing server.xml file eventually (not sure when, maybe not until right after 1.0) so this new file will take over some of the roles of server.xml.
For now, the only thing in this new file is going to be "newbie_friendly". This will set the server to be in newbie mode which is something that will be explained in more detail when we are done implementing it (should be in 220). But soon the optional auto-team balance system will be configured through this new file as well. Perhaps other options like player counts, password, etc too.
Here is what it looks like:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->{
"settings":
{
"newbie_friendly": true,
"auto_team_balance": true,
"unbalance_count": 2
},
"tags": [ "newbie" ]
}<!--c2--></div><!--ec2-->
Just an example. The team balance stuff isn't used yet. Another thing to notice here are the tags. So if you want your server to be in newbie mode, you need to also have a "newbie" tag. These tags are a Steam feature that other games use too but basically, the server browser will be able to use these tags to filter servers later. You can add whatever tags you want but please be aware there is a 128 character limit on ALL tags combined (this is just a normal Steam limitation).
The second thing to be aware of is that we are implementing an often requested feature: configurable server admin files location.
So here is an example of how that works:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->server.exe -config_path "C:\server1\config"<!--c2--></div><!--ec2-->
All of the server files such as bans, admin, map cycle, and this new config file will all read and write to this directory. It defaults to %appdata%\Natural Selection 2\
All these changes will be in 220.
Thanks!
Comments
So here is an example of how that works:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->server.exe -config_path "C:\server1\config"<!--c2--></div><!--ec2-->
All of the server files such as bans, admin, map cycle, and this new config file will all read and write to this directory. It defaults to %appdata%\Natural Selection 2\
All these changes will be in 220.
Thanks!<!--QuoteEnd--></div><!--QuoteEEnd-->
YAY FINALLY, I'm so happy for this feature. I'm been waiting for this for sooooooooo looooooong <3 <3 <3 <3
Great job guys :D
As in before the client fully connects and gets a slot on the server, it would be nice if the server could refuse their connection. This would allow for some nice customization on servers for things like reserved slots.
It would also be nice if a hook existed to modify the way the engine handles responding to the Steam gamelist server.
I'll try to get it sorted out soon.
I don't understand why you would want to hook into the steam master server stuff. A lot of that is configurable already through the new keyvalue things in 219 (ent_count and tickrate) and now tags in 220.
Basically if you wanted a 16 player server, you would make an 18 slot server, and report only 16 of those slots to the master game list. The game list would only let 16 player in, but if you connected to the server via console, the server would let you in. Once the player was in the server would check to see if it needed to kick some one to make room for the new player, or if the new player needed to be kicked because he didn't have a reserved slot.
The hook to refuse incoming connections, or kick players to make room for incoming connections is preferable. If we have hope of getting that feature, don't worry about the query responder. :)
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->Default: &defaults
user: u
password: p
host: 192.168.1.5
port: 5432
database: h
poolsize: 10
Development:
<<: *defaults
Testing:
database: h_test
<<: *defaults
Staging:
database: b_staging
poolsize: 100
<<: *defaults
Production:
database: b_production
poolsize: 100
<<: *default<!--c2--></div><!--ec2-->
You can have one setting and use it as reference. You could have 1 server.yaml file and start server.exe with -instance "a" "b" or whatever and it'd use different one but inherit same defaults. Inheritance was my biggest problem with JSON-like scripts that Source engine has. There is already a YAML library for C++.
<a href="http://en.wikipedia.org/wiki/YAML" target="_blank">http://en.wikipedia.org/wiki/YAML</a>
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->The server can be configured to cycle through a list of maps by creating a file
called MapCycle.json in your server config directory.
This file defines the amount of time (in minutes) to wait before switching maps.
It will only switch maps after a round completes.
It also defines a mode which can be either "order" or "random".
It then defines a list of maps to cycle.
Avoid listing the same map twice in "order" mode.
Here is an example map cycle file:
{
"time": 30,
"mode": "order",
"maps":
[
"ns2_summit",
"ns2_mineshaft",
"ns2_tram"
]
}<!--c2--></div><!--ec2-->
sorry for the feature request spam :)
So here is an example of how that works:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->server.exe -config_path "C:\server1\config"<!--c2--></div><!--ec2-->
All of the server files such as bans, admin, map cycle, and this new config file will all read and write to this directory. It defaults to %appdata%\Natural Selection 2\<!--QuoteEnd--></div><!--QuoteEEnd-->
Nice feature!
Eventhough as of 220, the server wouldn't find/use the default location (%appdata%\Natural Selection 2\) for me anymore, so I was forced to set -config_path (to the default location) manually.
Was this intended?
<b>However:</b>
In the versions before, the json-files were in a subfolder "config". This has changed now, the json files have to be on the 1st level, respectively "%appdata%\Natural Selection 2\".
In the versions before, the json-files were in a subfolder "config". This has changed now, the json files have to be on the 1st level, respectively "%appdata%\Natural Selection 2\".<!--QuoteEnd--></div><!--QuoteEEnd-->
Alright, that might be it then.
Edit: Indeed, that was the problem.
Here is how it works:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->{
"settings":
{
"auto_team_balance":
{
"enabled_on_unbalance_amount": 2,
"enabled_after_seconds": 10
}
},
"tags": [ ]
}<!--c2--></div><!--ec2-->
Simply having "auto_team_balance" in the settings table there will enable auto team balance mode.
enabled_on_unbalance_amount is how many player over perfect team balance there needs to be on one team for the system to kick in.
For example, with 2, there would have to be 10 players on one team and 8 on the other for the system to turn on.
enabled_after_seconds is how long to wait after the enabled_on_unbalance_amount condition is met before the system is turned on. This allows there to be a little buffer in case another player joins the server soon or people are switching teams before the system is turned on. You can set this to 0 if you don't want any delay.
Players will NOT automatically be switched teams with this system. Instead, the game will try to maintain the same number of players on the field when teams are unbalance.
So if the Marines have 10 players and the Aliens have 8, when a Marine player dies, they will be in a special spectator mode until there are only 7 players alive. At which point, the player who has waited the longest in this mode will be spawned like normal.
A player in this mode can also choose to switch teams without penalty.
There is also a server admin command that can be used to control this system: sv_autobalance <true/false> <num players> <seconds>
Thanks
there was a discusion about something like that a few(actualy pretty many) month back on how to implement autobalance into an already startet round.
your system sounds better than everything we could come up with. ;)
Here is how it works:<!--QuoteEnd--></div><!--QuoteEEnd-->
Great to see progress on this issue, but a couple of thoughts come to mind:
<ul><li>It will probably be necessary to set a time threshold of several minutes to get around the issue of end-game ragequits. Often in the last few minutes of a game, half the loosing team will f4 or just leave the server. Without some flexibility there, a round could be unnecessarily dragged out.</li><li>How will players in that mode be informed when they are under the effect of auto-balance? A specific help widget should do the trick. Without that, we'll be getting lots of questions and accusations that spawn queues are bugged etc.</li></ul>
There is a big text on the screen now that explains what is going on.
<!--quoteo(post=1980550:date=Sep 19 2012, 07:39 PM:name=Katana-)--><div class='quotetop'>QUOTE (Katana- @ Sep 19 2012, 07:39 PM) <a href="index.php?act=findpost&pid=1980550"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->A related feature would be the option to disqualify a team if they have half the number of players the opposing team does (provided the game has started, and one team has more then 4 players). NS1 did this, and it makes it so f4ing to end the game works as long as the majority of the players on a team f4.<!--QuoteEnd--></div><!--QuoteEEnd-->
Somebody mentioned this to me a couple days ago. I think it is a good idea as an option and should be easy to add. Of course, ideally this wouldn't be necessary.
That's a solution to a different problem
A file called ConsistencyConfig.json will automatically be generated in the server config directory when you first start the server. It can be edited to change what type of files are checked on the client.
A client that has modified files will automatically be disconnected from the server.
You can disable consistency checking on your server by editing ConsistencyConfig.json from this:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->[ "*.lua", "*.fx", "*.screenfx", "*.surface_shader", "*.fxh", "*.render_setup", "*.shader_template" ]<!--c2--></div><!--ec2-->
To this:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->[ ]<!--c2--></div><!--ec2-->
E.g.:
Imagine i would add "*.dds" files to check, but i want to allow ppl to have custom crosshairs and exclude those files? (crosshairs, crosshairs-hit, exo1234...)
Or is this further down the pipe?
edit:
Will it also check if files are missing, i'm pretty sure that some ppl remove ambient sound files, which is REALLY annoying.
(e.g. if i would add "*.fsb")
F4 pretty much is a vote.
Also 10 seconds is way too short, maybe 60 would be better.
....
A player in this mode can also choose to switch teams without penalty.<!--QuoteEnd--></div><!--QuoteEEnd-->
Sounds great! However, a minor gripe: Since marines currently gain pres faster, a marine switching to aliens is likely to have the top pres of the new team. Should this maybe be adjusted somehow? Maybe give the team switcher the average pres of the new team or maybe just cap max pres at the previous team top pres number?
This goes the other way around too: Aliens switching to marines are likely to hold less pres than the marine team on average.
So if a server has consistency checking enabled for all lua files and for example ns2stats mod installed. Does this mean that the clients also need to have this mod installed? If they don't have it installed will they get an error and be disconnected from the server or will they automatically download the correct files from the server?
Auto downloading isn't in yet. If you're running a server side mod, you either need to disable consistency checking or make sure all the clients have it.
Not currently. Maybe eventually.
In the short term, you can't do consistency checks on textures or sounds as those don't exist on the server. We will figure out something for this soon.
<!--quoteo(post=1981268:date=Sep 21 2012, 02:45 AM:name=Zeikko)--><div class='quotetop'>QUOTE (Zeikko @ Sep 21 2012, 02:45 AM) <a href="index.php?act=findpost&pid=1981268"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->So if a server has consistency checking enabled for all lua files and for example ns2stats mod installed. Does this mean that the clients also need to have this mod installed?
If they don't have it installed will they get an error and be disconnected from the server or will they automatically download the correct files from the server?<!--QuoteEnd--></div><!--QuoteEEnd-->
Yes, clients need to have it installed.
We are going to fix up the Steam Workshop support for 221 this weekend so it will all be automatic (like how maps hosted on Steam Workshop work now but even better).
So it will all be automatic from the Client's point of view.
<!--quoteo(post=1981551:date=Sep 21 2012, 01:57 PM:name=devicenull)--><div class='quotetop'>QUOTE (devicenull @ Sep 21 2012, 01:57 PM) <a href="index.php?act=findpost&pid=1981551"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Auto downloading isn't in yet. If you're running a server side mod, you either need to disable consistency checking or make sure all the clients have it.<!--QuoteEnd--></div><!--QuoteEEnd-->
Yeah, another option for 221 if you don't want to setup your server to use the Steam Workshop is to simply disable consistency checking (at least for *.lua). Auto download should be ready for 221 though :)
BRING ON THE MODS!
As always, nice to see that you are aware of the problems we players have.
I use DAK+some stuff of Dghelneshi and customize it a bit for my needs.
Did the clients have to download a server-admin mod?