Setting up dedicated server; issue or two...

StrikeS12StrikeS12 Join Date: 2007-10-13 Member: 62631Members
edited September 2012 in Server Discussion
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.

Comments

  • WhosatWhosat Singapore Join Date: 2006-11-03 Member: 58301Members, Reinforced - Shadow
    edited September 2012
    To get server.xml created, add the "<i>-save true</i>" parameter on your Server.exe.

    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.
  • oldassgamersoldassgamers Join Date: 2011-02-02 Member: 80033Members, Squad Five Blue, Reinforced - Shadow
    <a href="http://www.unknownworlds.com/ns2/forums/index.php?showtopic=119224" target="_blank">http://www.unknownworlds.com/ns2/forums/in...howtopic=119224</a>
  • StrikeS12StrikeS12 Join Date: 2007-10-13 Member: 62631Members
    Thanks y'all - Was a big help.
  • StrikeS12StrikeS12 Join Date: 2007-10-13 Member: 62631Members
    Made some good headway but then hit another wall with the Web Admin Interface; I've got one that kind of works like this NS2 one for DayZ so there were some 'like' things.

    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.
  • WhosatWhosat Singapore Join Date: 2006-11-03 Member: 58301Members, Reinforced - Shadow
    edited September 2012
    Ah I see the misunderstanding.

    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.)
  • eLboteLbot Join Date: 2012-09-13 Member: 159229Members
    edited September 2012
    <!--quoteo(post=1984011:date=Sep 27 2012, 05:51 PM:name=Whosat)--><div class='quotetop'>QUOTE (Whosat @ Sep 27 2012, 05:51 PM) <a href="index.php?act=findpost&pid=1984011"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->EDIT2: May I also suggest you install ns2stats<!--QuoteEnd--></div><!--QuoteEEnd-->

    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.
  • WhosatWhosat Singapore Join Date: 2006-11-03 Member: 58301Members, Reinforced - Shadow
    :)

    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.
  • StrikeS12StrikeS12 Join Date: 2007-10-13 Member: 62631Members
    Alright; thanks for all the excellent information - I have to agree that the community is very helpful, and awesome; I think it's a Generation thing probably.
  • StrikeS12StrikeS12 Join Date: 2007-10-13 Member: 62631Members
    edited September 2012
    To be clear... I took the ns2stats folder and set it up inside my c:\ns2server\ folder

    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.
  • StrikeS12StrikeS12 Join Date: 2007-10-13 Member: 62631Members
    Hrm - Now I'm getting Client and Server differ when I try and join the server.
  • MaxMax Technical Director, Unknown Worlds Entertainment Join Date: 2002-03-15 Member: 318Super Administrators, Retired Developer, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, Subnautica Developer, Pistachionauts, Future Perfect Developer
    <!--quoteo(post=1984843:date=Sep 29 2012, 02:42 PM:name=StrikeS12)--><div class='quotetop'>QUOTE (StrikeS12 @ Sep 29 2012, 02:42 PM) <a href="index.php?act=findpost&pid=1984843"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Hrm - Now I'm getting Client and Server differ when I try and join the server.<!--QuoteEnd--></div><!--QuoteEEnd-->
    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.
  • StrikeS12StrikeS12 Join Date: 2007-10-13 Member: 62631Members
    Being on a dedicated box that I remote into... does that mean I'll have to have Steam running at all time on said box?
  • StrikeS12StrikeS12 Join Date: 2007-10-13 Member: 62631Members
    edited September 2012
    This is entirely frustrating....

    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.
  • StrikeS12StrikeS12 Join Date: 2007-10-13 Member: 62631Members
    Well, I just have to disable it for now because I can't get my 'Server' account to log into the ns2stats page to Subscribe.
  • WhosatWhosat Singapore Join Date: 2006-11-03 Member: 58301Members, Reinforced - Shadow
    Yes there are issues/huge confusions with the installation of ns2stats. Until a guide is released, you should skip the use of ns2stats first. Sorry for not informing you earlier when I encountered the same issue myself.

    Have fun with your newly set-up server! :)
  • StrikeS12StrikeS12 Join Date: 2007-10-13 Member: 62631Members
    Thanks for the assistance Whosat and all
  • WhosatWhosat Singapore Join Date: 2006-11-03 Member: 58301Members, Reinforced - Shadow
    edited October 2012
    To help manage/allow your server to be self-run, do check out <a href="http://www.unknownworlds.com/ns2/forums/index.php?showtopic=120542" target="_blank">DAK Server Admin Mod</a>.
    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
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    Nice guide, i had been meaning to type something like this up to add to the readme.
  • StrikeS12StrikeS12 Join Date: 2007-10-13 Member: 62631Members
    edited October 2012
    Perhaps that's the reason why I couldn't get my Admin Steam account to access the ns2stats Workshop... I need to get it into the beta somehow and that might fix the issue with ns2stats?

    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.
  • WhosatWhosat Singapore Join Date: 2006-11-03 Member: 58301Members, Reinforced - Shadow
    I do believe that is the exact reason why you couldn't access the NS2 Steam Workshop using your admin account.

    Do let us know how it goes! :)
  • ZeikkoZeikko Join Date: 2007-12-16 Member: 63179Members, Squad Five Blue, NS2 Map Tester
    There's a new version of NS2Stats which works even if your server admin steam admin account doesn't have acces to Steam Workshop. You can find it at the same place as always: <a href="http://ns2stats.org/server/admin" target="_blank">http://ns2stats.org/server/admin</a>
Sign In or Register to comment.