How to create a NS2 Dedicated Server

12467

Comments

  • MartinMartin Join Date: 2010-07-27 Member: 73229Members
    edited November 2010
    Wolf what you can do is watch the log file for changes and if the disconnect happens then kill the process and restart it, I have a utility that does something like this but only when the server crashes. Below is the C# code I just whipped up to do this, I haven't tested it but it should work.


    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->    
    Code was removed since I will be releasing a utility to restart the server very soon.<!--c2--></div><!--ec2-->
  • fofofofo Join Date: 2010-11-14 Member: 74932Members
    hehe,,This is not being run on my gaming machine but on our clan's dedicated Win2K server box (via RDP).

    Any suggestions?

    cheers
    OldFart


    --------------------
    <a href="http://www.shoppanjewellery.com/" target="_blank">pandora beads</a>
    <a href="http://www.shoppanjewellery.com/" target="_blank">pandora bracelet</a>
  • AngeluszAngelusz Harmonic entropist Join Date: 2003-07-10 Member: 18072Members, Forum Moderators, Constellation, NS2 Playtester
    This thread needs an update. I've been at it for a while now, trying to get my server working. It's working, but only barely. Had to change a lot of settings differently from what this thread sais. Anyone with inside knowledge able to enlighten us?

    Currently, I can't get the webAdmin to work, and I'm having trouble finding out what I can do in a server.xml - what are the available commands and parameters?
  • antacidantacid Join Date: 2007-08-07 Member: 61821Members, NS2 Playtester
    I tried making a server but I am pretty sure it was LAN only.
  • EnceladusEnceladus Join Date: 2004-01-18 Member: 25442Members
    I set up a dedicated today, and it's basically the same way as described in the wiki entry <a href="http://www.unknownworlds.com/ns2/wiki/index.php/Dedicated_Server" target="_blank">http://www.unknownworlds.com/ns2/wiki/inde...edicated_Server</a>

    The steps to get it working was..

    1. Create new folders somewhere on your harddrive

    D:\nsserver\
    D:\webadmin\

    2. Inside D:\nsserver\ create a new textfile and rename it to server.xml

    3. Open the server.xml with notepad and fill it with:

    <options>
    <lanGame>false</lanGame>
    <mapName>ns2_rockdown</mapName>
    <password></password>
    <port>27015</port>
    <serverName>Your preferred Servername</serverName>
    <address></address>
    <playerLimit>6</playerLimit>
    <webadminActive>true</webadminActive>
    <webadminDomain>localhost</webadminDomain>
    <webadminDirectory>d:\webadmin</webadminDirectory>
    </options>

    4. Edit the serverName to your liking.
    4a. If you want to use the webadmin, change the webadminDirectory to the correct path.
    4b. If you don't want to use the webadmin, remove the lines with webadminActive, webadminDomain, webadminDirectory

    5. Set the map to the preferred map, and save the file.

    6. Goto your ns2 directoy e.g. D:\Steam\SteamApps\common\natural selection 2

    7. create a shortcut to the server.exe

    8. Edit the shortcut so it points to (adapt to your specs)
    "D:\Steam\SteamApps\common\natural selection 2\Server.exe" -file D:\nsserver\server.xml

    10. If you are behind a Router, Firewall etc. configure it, so the UDP ports 27015 and 27016 are being forwarded to the computer running the server.

    11. If you want to use the webadmin, open the shortcut to your server again, and copy your execution line and paste it into your run prompt (windows key + r) and remove the file parameter. Now add the parameters -webadduser admin -webpass admin -webdir "d:\webadmin" -webdomain localhost to it so it looks like:
    "D:\Steam\SteamApps\common\natural selection 2\Server.exe" -webadduser admin -webpass admin -webdir "d:\webadmin" -webdomain localhost
    Ofcourse you can change the username and password to your liking.
    Execute it once, and the webadmin user will be created.

    12. Use the shortcut you created in (8) to launch the server.

    The Server console will state a few errors, like missing models etc, but in the end there will be a line stating "Local Server active." while with webadmin enabled it will state "Starting web administration server...-ok" after the active server message.

    13. To check if the server if reachable, open up NS2 and check the server browser. When everything is working properly, it should appear there with the name you set in the xml. If you lanuched ns2 on the same machine as your server is running at, you should see two entries of the server, one with the suffix (lan).
    If only the (lan) one is showing up, then there is a problem with the server not being able to send and recieve data on port 27016. Check the firewall and router settings.

    14. To acces the webadmin console, open up a browser, go to in <a href="http://localhost:8080" target="_blank">http://localhost:8080</a> and authenticate with the username and password you set in step 11.
  • antacidantacid Join Date: 2007-08-07 Member: 61821Members, NS2 Playtester
    edited November 2010
    Hmm I forwarded ports 27000-27500
    I did exactly as you said for the other stuff
    But when I host a server it is still only LAN, I check windows firewall but it wasn't blocking anything. Am I missing something?
  • SgtBarlowSgtBarlow Level Designer Join Date: 2003-11-13 Member: 22749Members, NS2 Developer
    are you running a listen server by doing "Create Game" from in NS"?
  • FehaFeha Join Date: 2006-11-16 Member: 58633Members
    I sucefully got a server on my own computer now (same I play on). After alot of troubles.
    Apparently forwarding isnt enough, you had to do "static natting on outgoing port 27015 and 27016".

    Credits to my dad for helping me ;).
  • EnceladusEnceladus Join Date: 2004-01-18 Member: 25442Members
    Just wondering.. anyone tried setting up a dedicated NS2 on EC2 yet?
  • PlasmaPlasma Join Date: 2003-04-26 Member: 15855Members, Constellation, Squad Five Blue
    There's a bug at the moment that prevents multiple servers running, the query port always tries to bind to 27016 (regardless of join port) so multiple servers on the same machine are not possible right now :(
  • MartinMartin Join Date: 2010-07-27 Member: 73229Members
    edited November 2010
    That is incorrect. You can bind to separate ip addresses.
  • w0dk4w0dk4 Join Date: 2008-04-22 Member: 64129Members, Constellation, Reinforced - Shadow
    Well, the first part is correct at least. Multiple servers per IP do not work.
  • PlasmaPlasma Join Date: 2003-04-26 Member: 15855Members, Constellation, Squad Five Blue
    <!--quoteo(post=1809492:date=Nov 23 2010, 06:14 PM:name=Martin)--><div class='quotetop'>QUOTE (Martin @ Nov 23 2010, 06:14 PM) <a href="index.php?act=findpost&pid=1809492"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->That is incorrect. You can bind to separate ip addresses.<!--QuoteEnd--></div><!--QuoteEEnd-->
    You cannot run more than one server per IP address, that is a problem.
  • OmNomNom!OmNomNom! Join Date: 2010-11-25 Member: 75266Members
    Can any server admins / hosts please give me a few quick pointers on hosting a UK NS2 server?

    info here <a href="http://www.unknownworlds.com/ns2/forums/index.php?showtopic=111647" target="_blank">http://www.unknownworlds.com/ns2/forums/in...howtopic=111647</a>
  • SgtBarlowSgtBarlow Level Designer Join Date: 2003-11-13 Member: 22749Members, NS2 Developer
    You need a pertty beefy server to host the current closed beta.

    My Alpha Test servers where hosted by RackSrv, I do maintain their website as well as do work for other game hosting companies and Jon is probably the most dedicated guy I have ever met towards his business.
    Pretty much provides services to many game hosting companies.

    <a href="http://www.racksrv.com/virtual-private-servers/xen-pv" target="_blank">http://www.racksrv.com/virtual-private-servers/xen-pv</a> - If you want to run a server Xen #1 would be the cheapest option.

    Currently the CPU damand gets high so if you want to run more than one server, i would get a windows2000 x64 dedicated server from there or wherever.
    You will get remote Desktop Access to both the VPS & Dedicated services so no goofing around with shell command

    There is a bug currently so even with more than one instance running on the same machine, first instance started will show up in the server lists because of a query port confilct.
  • OmNomNom!OmNomNom! Join Date: 2010-11-25 Member: 75266Members
    Thanks for the response, I'm surprised 512mb ram would cut it though?
  • SgtBarlowSgtBarlow Level Designer Join Date: 2003-11-13 Member: 22749Members, NS2 Developer
    It only has to load geometry nothing else
  • OmNomNom!OmNomNom! Join Date: 2010-11-25 Member: 75266Members
    Well the price sounds good anyway, when are the servers likely to be ready?
  • SgtBarlowSgtBarlow Level Designer Join Date: 2003-11-13 Member: 22749Members, NS2 Developer
    Rumoured for this week the Xen ones, otherwise setup is either instant or within 24hrs, some of its automated. Best dropping a message to ask when they will be ready.
  • OmNomNom!OmNomNom! Join Date: 2010-11-25 Member: 75266Members
    ok thanks for the help :)
  • TyphonTyphon Join Date: 2002-11-01 Member: 1899Members
    Got my server up and running, i think, can someone connect to "Typhon's server" and confirm?
  • FehaFeha Join Date: 2006-11-16 Member: 58633Members
    I cant find that server in the list.
  • EnceladusEnceladus Join Date: 2004-01-18 Member: 25442Members
    <!--quoteo(post=1810962:date=Nov 27 2010, 12:20 AM:name=Typhon)--><div class='quotetop'>QUOTE (Typhon @ Nov 27 2010, 12:20 AM) <a href="index.php?act=findpost&pid=1810962"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Got my server up and running, i think, can someone connect to "Typhon's server" and confirm?<!--QuoteEnd--></div><!--QuoteEEnd-->
    Found it and was able to connect
  • FehaFeha Join Date: 2006-11-16 Member: 58633Members
    Checked again now, and this time I can see it. For some reason I see 2 instances of it in server browser though.

    I could join both, but in both cases the serverbrowser showed that both the servers had a player in it, making me think it is the same server, just that it adds itself to the masterlist twice.
  • TyphonTyphon Join Date: 2002-11-01 Member: 1899Members
    Yeah there is definitely only one server, but I see two instances as well (actually three since I can see the lan instance too).

    Weird.
  • BricksolidBricksolid Join Date: 2009-10-02 Member: 68929Members
    edited December 2010
    Anyone able to get this working on 64bit centos 5 using wine 1.2?

    Also anyone know why it spams :
    Network variable 'teamCarbon' has value 1450 which is outside the range that can be sent using 10 bits

    Using 32bit centos 5 using wine 2.0.
  • PaiSandPaiSand Join Date: 2005-01-07 Member: 33487Members
    Latest stable release: Wine 1.2.2
    Latest development release: Wine 1.3.8
    Try the stable for production or development if you want to try it (as far as I know there is no 2.0).

    And of course, Steam for the upgrades. The best way is to install it using winetricks, this way you are sure all the dependencies are installed within it.
  • woodywoody SoCal Woody56 Join Date: 2004-02-14 Member: 26541Members
    edited December 2010
    ANyone see this server running ?
    FIXED-----Changed from :27016 to: '69.90.189.30:27015 and all is well.
  • MobyMoby Join Date: 2009-08-13 Member: 68450Members, Constellation, Reinforced - Shadow
    I would really like to see a Server Hosting Sub Forum here.
    Where U can open new topics with server issues only.

    And I also hope, that the team is looking for to get a proper dedicated server program.
    Nowadays it seems like they always start a listening server with the full featured client program in background, well thats not good, since it uses tons of resources, not used for an dedicated server normally.
    If U compare that SERVER.EXE (funny name too, would be nice to rename that to some more proper naming, like NS2-Server.exe, or something like that) with HLDS (a proper DEDICATED server program) and the differences on used resources, U will receive an shock.

    I know, we are closed beta now, but pls. for server hosters that "rundown" full featured client solution (just graphics and sound goes to nil, so it seems) is not good.

    Also I heard a rumor, that not all servers are reported of the master server, and so not shown on the client server list, is that true, is that intentionally, is it just a rumor?
  • SN.WolfSN.Wolf Join Date: 2010-03-29 Member: 71115Members
    The server listing may be just a rumor, I ran my server from work and home and it always shows in the listing.


    When will we see additional ports open up for multiple servers from one IP? Maybe open beta?

    I would like to run my normal NS2 server while i rum my level test server at the same time.
Sign In or Register to comment.