Setting up dedicated server; issue or two...
StrikeS12
Join Date: 2007-10-13 Member: 62631Members
I run a few dedicated servers; so I have some background in that regards. I'm starting to put up some NS2 Servers for my server community since they requested that I looked into it. I found the Wiki and I've been able to get a server up and online... however I have a few things still missing; or that I'm overlooking. (Running on a Dedicated Box)
I'm not able to find the server.xml file any where at all; nor even any of these config files are created upon server launch. For example; the first time the server was run... no files were created anywhere (that I could find right away via the Wiki/Post Information) yet the server is online and playable. (which was odd)
I pretty much did a search for *.json and *.xml files and came up with nothing; not a thing under APPDATA or anywhere...
No MapCycle... no ServerConfig... and so forth. I feel like I *have* to be missing something here since the server is online, running and playable... lol.
I've followed the Wiki on it as straight-forward as I can.. even tried a few things/tricks of the trade from just administrating servers in the past.
I spent the whole day/night getting prepared to run a few dedicated servers (we support them with forums and a website to build a community on the servers) for NS2; tomorrow I'm going to be looking into that WebAdmin part of it and who knows... maybe I just need to sleep on it and then look at it fresh.
-Forgot to add: When I launched the server for the first time... it did make an AppData\Roaming\Natural Selection 2 folder and the only file in it was log.txt which had only output what was in the console.
I'm not able to find the server.xml file any where at all; nor even any of these config files are created upon server launch. For example; the first time the server was run... no files were created anywhere (that I could find right away via the Wiki/Post Information) yet the server is online and playable. (which was odd)
I pretty much did a search for *.json and *.xml files and came up with nothing; not a thing under APPDATA or anywhere...
No MapCycle... no ServerConfig... and so forth. I feel like I *have* to be missing something here since the server is online, running and playable... lol.
I've followed the Wiki on it as straight-forward as I can.. even tried a few things/tricks of the trade from just administrating servers in the past.
I spent the whole day/night getting prepared to run a few dedicated servers (we support them with forums and a website to build a community on the servers) for NS2; tomorrow I'm going to be looking into that WebAdmin part of it and who knows... maybe I just need to sleep on it and then look at it fresh.
-Forgot to add: When I launched the server for the first time... it did make an AppData\Roaming\Natural Selection 2 folder and the only file in it was log.txt which had only output what was in the console.
Comments
The rest of the .json files have to be created manually. Sample content is available on the wiki. (:
Place those .json files in <i>AppData\Roaming\Natural Selection</i> 2 OR in wherever you pointed <i>-config_path</i> to.
The JSON files are not necessary for the server to run. The NS2 server will take its default settings if you do not supply these configuration files/variables.
EDIT: I've added a note onto the <a href="http://www.unknownworlds.com/ns2/wiki/index.php/Dedicated_Server#Requirements" target="_blank">Requirements</a> section. Do read it - it concerns the hardware you should be running your server on.
EDIT2: In short, the JSON files are not automatically created for you, and server.xml is created only if made to by using the command line parameter.
First - I've got it using a specific config file that I wanted it to use; and my Server.exe shortcut as -config_path "mypath" -file "mypath\config1.xml"
It launches and uses the settings from that file but my hang up right now is "Starting web administration server... -failed!"
I generated a .htpasswd file using the command line and it sits in c:\xampp\htdocs\ns2\.htpaswd
When I visit localhost:8080\ns2\index.html I get the pretty interface and such but no data (obviously because it failed to start previously, right?)
The Wiki mentions something about having your 'webadmin' directory within 'ns2' so that made me think that something needed to be in the c:\ns2server\ directory? But there's no more information regarding it.
Here's a Pastebin of my server.xml file: <a href="http://pastebin.com/QrJadBcB" target="_blank">http://pastebin.com/QrJadBcB</a>
What am I missing.. I feel like it's just one simple thing.
The NS2 Server runs its own web server. There is no need for you to run XAMPP or any standalone webserver on your part.
It is precisely because you are running XAMPP that NS2 Server cannot run its own webserver on the same port.
-webdir does not have to reside within your ns2 directory.
EDIT: Might want to note that the NS2 Server's webserver only serves static files and JSON data as its index (http://localhost:8080 should give you a JSON response).
Which is why ns2web uses HTML and JavaScript to handle dynamic data on the client-side.
EDIT2: May I also suggest you install ns2stats (http://ns2stats.org/ - create an account and go to "My Servers")
To do so, copy the ns2stats folder to the same directory as where your ns2 folder resides.
Then in server.xml, have this inside: <i><game>ns2stats</game></i>
NS2Stats contains some features which really every server should have (unstuck, votemap, etc.)
Couldn't agree with this more.
I'm in the awkward position of writing out a long helpful post, being sidetracked and thus being beaten to the submit, he covered everything I was going to say =P I love this commuity sometimes.
Update: As of Build 221, the *.json and server.xml files will be created for you if they do not exist on first launch.
I've updated the Dedicated Server Wiki page with most of B221 changes.
So within that ns2server\ folder I have:
c:\ns2server\ns2\
c:\ns2server\ns2stats\
When I run the server with ns2stats it's throwing back a TON of script errors about every quarter second. (Still looking into it to see if I goofed)
lua/ns2Gamerules.lua:510 - Attempt to call method 'gameReset' (a nil value)
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->function NS2Gamerules:UpdateScores()
if (self.timeToSendScores == nil or Shared.GetTime() > self.timeToSendScores) then
//MODIFY START
RBPS:oneSecondTimer()
if RBPS.startGame == true then
RBPS.startGame = false
self:ResetGame()
self:SetGameState(kGameState.Countdown)
self.countdownTime = kCountDownLength
self.lastCountdownPlayed = nil
end<!--c2--></div><!--ec2-->
Update: Fixed - Not exactly sure what I did but I reapplied/saved the key to the file, restarted, and that seems to have stopped that spam.
This is because of the way you've installed ns2stats. You should "install" it through the workshop. We'll be putting up a guide on this stuff soon, since it seems to be something a lot of people are (understandably) having difficulty with.
On my local/home PC I can visit: <a href="http://steamcommunity.com/sharedfiles/filedetails/?id=99799104" target="_blank">http://steamcommunity.com/sharedfiles/file...ls/?id=99799104</a> just FINE.
But if I go to my Dedicated Box under my Server/Admin account it get a "Sorry! That Item does not exist" page and there is NO way that I can figure out how to find/subscribe to ns2stats.
I'm going insane... if I log out and log into my other steam account I get:
Sorry!
An error was encountered while processing your request:
That item does not exist. It may have been removed by the author.
Here's a link to the Steam Community home page.
But if I log back into my personal Steam Account I can go there.... wtf steam.
Have fun with your newly set-up server! :)
It has some very useful features every server should have - votemap, vote random teams, etc.
Quick setup guide (assuming dedicated box with no Steam account which has NS2 Beta access):
1. Download the mod from <a href="https://github.com/xToken/DAK" target="_blank">Github</a>
2. Copy the entire contents (lua folder) into a folder named "m5f4f178_1349590654", then place that folder into a place where you would like to store all your mods. (I used "C:\ns2server\modstorage")
3. Add to your Server.exe command line: <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->-modstorage "C:\ns2server\modstorage" -mods "5f4f178"<!--c2--></div><!--ec2-->
4. Run your Server once and let it load a full map.
5. Quit your Server and check your config_path folder for a new JSON file called "DAKConfig.json".
6. Open that with your favorite text editor and refer to the GitHub readme for what each key/value pair means.
NOTE:
I haven't tested this with an account with no NS2 Beta access, but it seems like this has worked for some people.
If you do have an account with NS2 Beta access on your dedicated box, then download the Mod from the Steam Workshop using the game client (which appears in "%APPDATA%\Natural Selection 2\Workshop"), where you can copy out that folder mentioned in step 2 to your modstorage location or you can leave it there.
Cheers! Just trying to help the community get more useful servers to play on :)
EDIT: Updated to m5f4f178_1349590654
Regardless - I've fired up the server the DAK and it seems to be working well so far; we'll see how it goes tonight.
Do let us know how it goes! :)