How to create a NS2 Dedicated Server

24567

Comments

  • wdfstryfewdfstryfe Join Date: 2009-05-28 Member: 67532Members
  • w0dk4w0dk4 Join Date: 2008-04-22 Member: 64129Members, Constellation, Reinforced - Shadow
    edited July 2010
    Also note that no other port than 27015 is working. Im pretty sure its a client issue, the clients cannot connect to anything other than 27015.

    Additionally, the dedicated server is pretty unusable right now, because of a bug when players leave, they leave behind some kind of player artifact, effectively locking the server up after some time (it looks like the server is full, but actually its just full of not-disconnected timed-out players)

    It also doesnt seem to be possible to host more than one server on one ip, first due to the port issue and it also seems that only one server is listed per ip.
  • maessemaesse Join Date: 2010-04-08 Member: 71213Members
    Having looked a bit at the packets through Wireshark, I can tell you all that 27016 is used for transmitting serverinfo to clients refreshing their serverlist.
    It also seems that clients that hang on "Attempting connection" is sending connect-packets every 100ms, while the server seems to respond every 1000ms (but client keeps going)
  • ZylickZylick Join Date: 2005-08-04 Member: 57517Members
    edited July 2010
    [quote name='Luitjens' post='1785280' date='Jul 26 2010, 11:42 PM']Hey guys this guide is suppose to help you on setting up a server!
    For quick and ease of this guide, I will be using port 27015 (the standard port)

    1. First make sure your port 27015 is forward <a href="http://www.portforward.com" target="_blank">http://www.portforward.com</a> can help you with on forwarded ports.

    [\quote]

    I did not need to forward the port in windows vista. I just made sure the application was on my list of allowed applications.
  • TagertsweTagertswe Join Date: 2010-03-04 Member: 70825Members
    Is there any log stored somewhere regarding the NS2 Server?
    Because after taking my server down I can't bring it up again.
    The command prompt window just flashes and closes on me.
  • LuitjensLuitjens Join Date: 2010-07-26 Member: 73034Members, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, Subnautica Playtester
    You can launch command prompt, type cmd.exe in start > run or start (win 7), and then just drag/drop the shortcut to the server.exe into the cmd prompt, itll output the error and won't go away.
  • TagertsweTagertswe Join Date: 2010-03-04 Member: 70825Members
  • RothgarRothgar Join Date: 2009-11-13 Member: 69372Members
    <!--quoteo(post=1786633:date=Jul 28 2010, 05:35 AM:name=Tagertswe)--><div class='quotetop'>QUOTE (Tagertswe @ Jul 28 2010, 05:35 AM) <a href="index.php?act=findpost&pid=1786633"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Is there any log stored somewhere regarding the NS2 Server?
    Because after taking my server down I can't bring it up again.
    The command prompt window just flashes and closes on me.<!--QuoteEnd--></div><!--QuoteEEnd-->

    I believe there is also a log file generated for each console session in %USERPROFILE%\Application Data\Natural Selection 2
  • CPCheebsCPCheebs Join Date: 2010-07-15 Member: 72416Members
    <img src="http://img.photobucket.com/albums/v327/XLock/servererror.jpg" border="0" class="linked-image" />

    I keep getting this.

    Ports are forwarded, and it should be working.
    Here is my target code for server.exe:
    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>"C:\Program Files\Steam\steamapps\common\natural selection 2\Server.exe" -ip 74.195.244.xx -port 27015 -lan 0 -limit 6 -name "KeyStroker's Dedicated |6p|"</div>

    I don't see any problems here either, and the funny thing is that it will let me run a LAN game with my internal IP.
    Anyone know what it could be?
  • ShadowFaxShadowFax Join Date: 2003-02-23 Member: 13858Members
    You will get that error if you specify your external ip and you are using a router with a local ip being assigned to you... try not specifying the ip.
  • CPCheebsCPCheebs Join Date: 2010-07-15 Member: 72416Members
    edited July 2010
    <!--quoteo(post=1787179:date=Jul 27 2010, 08:29 PM:name=ShadowFax)--><div class='quotetop'>QUOTE (ShadowFax @ Jul 27 2010, 08:29 PM) <a href="index.php?act=findpost&pid=1787179"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->You will get that error if you specify your external ip and you are using a router with a local ip being assigned to you... try not specifying the ip.<!--QuoteEnd--></div><!--QuoteEEnd-->


    If I do this it creates a game in which no one else can join. (probably a LAN Game).


    ---------------------------------------------------------------------------------------------------
    <!--coloro:#FF8C00--><span style="color:#FF8C00"><!--/coloro-->EDIT:<!--colorc--></span><!--/colorc-->

    <!--coloro:#FF8C00--><span style="color:#FF8C00"><!--/coloro-->I think it is something bigger because now all it does is open up command, go through a few lines of code and then say, "BUILD 149". After this it errors. :(<!--colorc--></span><!--/colorc-->
  • RothgarRothgar Join Date: 2009-11-13 Member: 69372Members
    <!--quoteo(post=1787057:date=Jul 28 2010, 09:59 AM:name=CPCheebs)--><div class='quotetop'>QUOTE (CPCheebs @ Jul 28 2010, 09:59 AM) <a href="index.php?act=findpost&pid=1787057"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec--><img src="http://img.photobucket.com/albums/v327/XLock/servererror.jpg" border="0" class="linked-image" />

    I keep getting this.

    Ports are forwarded, and it should be working.
    Here is my target code for server.exe:
    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>"C:\Program Files\Steam\steamapps\common\natural selection 2\Server.exe" -ip 74.195.244.xx -port 27015 -lan 0 -limit 6 -name "KeyStroker's Dedicated |6p|"</div>

    I don't see any problems here either, and the funny thing is that it will let me run a LAN game with my internal IP.
    Anyone know what it could be?<!--QuoteEnd--></div><!--QuoteEEnd-->

    Fairly sure you should be using your LAN IP, then giving out your external IP for people to connect.

    The Server will need to bind to an address I assume and you do not have access to bind to the external IP if that is assigned to your router for example.

    If you are "Port forwarding" it sounds like NAT and you should use internal Ip on the commandline.
  • ShadowFaxShadowFax Join Date: 2003-02-23 Member: 13858Members
    I pass my internal IP to the server.exe and have people connecting to my server just fine. If you used the -save option at some point you may need to go edit the server.xml file manually before that error will go away... but passing the internal ip again with the -save switch will probably due the trick.
  • RothgarRothgar Join Date: 2009-11-13 Member: 69372Members
    <!--quoteo(post=1787245:date=Jul 28 2010, 12:04 PM:name=ShadowFax)--><div class='quotetop'>QUOTE (ShadowFax @ Jul 28 2010, 12:04 PM) <a href="index.php?act=findpost&pid=1787245"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I pass my internal IP to the server.exe and have people connecting to my server just fine. If you used the -save option at some point you may need to go edit the server.xml file manually before that error will go away... but passing the internal ip again with the -save switch will probably due the trick.<!--QuoteEnd--></div><!--QuoteEEnd-->

    As opposed to what they say I don't think it actually reads the server.xml

    I started my server with no options and it does not pick up the details from the file I believe.

    So maybe this isn't implemented yet? It definitely seems to be writing the file though.

    So at this point I would rely on the commandline options unless the -file option may work.
  • LuitjensLuitjens Join Date: 2010-07-26 Member: 73034Members, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, Subnautica Playtester
    I've had it read server.xml after I specified the IP address within the file, it does read the file for that atleast..
  • endarendar Join Date: 2010-07-27 Member: 73256Members, Squad Five Blue
    Had the server executable crash when someone with a funny character joined the game (I am guessing). Last line on the console was Bioman_ - µ
    Should this be posted somewhere else?

    <img src="http://img825.imageshack.us/img825/4729/ns2micro.png" border="0" class="linked-image" />
  • slayer.faithslayer.faith Join Date: 2007-12-10 Member: 63127Members, Constellation, Reinforced - Shadow
    edited July 2010
    (This is a 'help' not a 'flame'.... I <3 ns2 already! :-)

    Does anyone know *EXACTLY* what is needed to run a dedicated server? Our clan has a win server running dod/cs but the server.exe just quits with no output.

    I tested the setup on my machine before moving it over to the dedicated server. Ive worked out the following for sure:

    * You need steam (but you can just create a new account with no games, it does not need your full account or even have an ns2 key)

    * You need all the ns2 files (from an install you got with the key). This does not need to be in the steam tree.

    * Toss in server.exe

    Works on my game machine, quits with no output on our server (Win2003 server enterprise 64bit).

    What I suspect is wrong is:

    * some library is failing to start/be found (im a linux sysadmin, I miss ldd <filename>)
    * maybe you need some combination of PhysX/directx *on the server*! (just installing physx by itself is not enough).


    The lack of error/logging makes tracking almost impossible. (Yes, I looked for the log output but there is no directory there (there is one from launcher, which starts ok, but not for the game/server).

    MAX: pleeeeease 'printf' after a failed ldd load ;-)

    Im keen to fire up a dedicated ns2 server down in australia! ;-)

    (A dedicated server forum would be nice too! :-)
  • slayer.faithslayer.faith Join Date: 2007-12-10 Member: 63127Members, Constellation, Reinforced - Shadow
    There has been some discussion about what IP address to pass to the server.exe

    In the standard TCP/IP socket interface you need to pass an 'address' to the creation of a socket to tell it which network to connect to (incase your machine has more than one network interface). Usually you pass '' which means 'all' (you could pass 127.0.0.1 to only bind to your local network interface, or if you have more than 1 ip address you can force the game to just start on a specific ip).

    If that is the use of the ip argument by server.exe, then you'll need to leave it off by preference or pass an ip address that the server actually has. If you are running on an home broadband then you might want to try setting 'ip' to your servers LAN address (you might then need to port-forward on your modem to the lan server, so the lanserver just sees local traffic and the modem works out all the masquerading/nat stuff).

    (Grumpy old unix guy, so might not work the same for windows.)
  • LuitjensLuitjens Join Date: 2010-07-26 Member: 73034Members, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, Subnautica Playtester
    Did you set the IP correct?

    Toss server.exe through cmd and it will output the error to cmd and won't close.
  • endarendar Join Date: 2010-07-27 Member: 73256Members, Squad Five Blue
    I have it running on server 2003 x64, the only thing I needed to do was start the game once so that direct x would install. Before i did that, i got an error:

    Application popup: Server.exe - Unable To Locate Component : This application has failed to start because d3dx9_42.dll was not found. Re-installing the application may fix this problem.
  • LuitjensLuitjens Join Date: 2010-07-26 Member: 73034Members, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, Subnautica Playtester
    Yea, with DirectX errors you just need to navigate to \Steam\steamapps\common\natural selection 2\redist\DirectX and run DXSETUP.exe
  • slayer.faithslayer.faith Join Date: 2007-12-10 Member: 63127Members, Constellation, Reinforced - Shadow
    <!--quoteo(post=1787368:date=Jul 28 2010, 02:29 PM:name=Luitjens)--><div class='quotetop'>QUOTE (Luitjens @ Jul 28 2010, 02:29 PM) <a href="index.php?act=findpost&pid=1787368"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Did you set the IP correct?

    Toss server.exe through cmd and it will output the error to cmd and won't close.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Are you sure you need to pass the IP? I didnt set it (sockets should bind to all interfaces by default) and it worked on my home/lan system.

    I tried running in a cmd (rather than a cygwin shell) and I get the same result: no output and immediately returns to the cmd prompt.
  • slayer.faithslayer.faith Join Date: 2007-12-10 Member: 63127Members, Constellation, Reinforced - Shadow
    <!--quoteo(post=1787370:date=Jul 28 2010, 02:30 PM:name=endar)--><div class='quotetop'>QUOTE (endar @ Jul 28 2010, 02:30 PM) <a href="index.php?act=findpost&pid=1787370"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I have it running on server 2003 x64, the only thing I needed to do was start the game once so that direct x would install. Before i did that, i got an error:

    Application popup: Server.exe - Unable To Locate Component : This application has failed to start because d3dx9_42.dll was not found. Re-installing the application may fix this problem.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Thanks. I'll get someone more windows-ie to install directx and give it another try. (it is also our dod server, so i dont want to bork it)
  • CPCheebsCPCheebs Join Date: 2010-07-15 Member: 72416Members
    People can't connect to my servers, whats the deal?
  • LuitjensLuitjens Join Date: 2010-07-26 Member: 73034Members, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, Subnautica Playtester
    You probably didn't port forward correctly..

    www.portforward.com

    and check <a href="http://canyouseeme.org/" target="_blank">http://canyouseeme.org/</a> while your server is up

    (27015)
  • saintksaintk Join Date: 2010-07-27 Member: 73196Members
    Just posting this here as well so i'm sure everyone has seen it (only related to server ops)

    <a href="http://www.unknownworlds.com/ns/forums/index.php?showtopic=110581" target="_blank">http://www.unknownworlds.com/ns/forums/ind...howtopic=110581</a> - tool for rebooting NS2 servers at pre-set memory useage limit (due to memory leak)
  • MartinMartin Join Date: 2010-07-27 Member: 73229Members
    <!--quoteo(post=1787413:date=Jul 28 2010, 05:06 AM:name=slayer.faith)--><div class='quotetop'>QUOTE (slayer.faith @ Jul 28 2010, 05:06 AM) <a href="index.php?act=findpost&pid=1787413"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Thanks. I'll get someone more windows-ie to install directx and give it another try. (it is also our dod server, so i dont want to bork it)<!--QuoteEnd--></div><!--QuoteEEnd-->

    I got this working on a server 2003 box by copying d3dx9_42.dll to the NS2 directory where Server.exe is sitting. Also install physx. All should work fine from there.........untested yet of course. I just did this and currently am unable to connect because I don't have NS2 here at this current machine, I have it at home.

    <a href="http://img405.imageshack.us/i/screenshotqj.jpg/" target="_blank"><img src="http://img405.imageshack.us/img405/5066/screenshotqj.th.jpg" border="0" class="linked-image" /></a>
  • zimzumzimzum Join Date: 2004-09-02 Member: 31200Members, Reinforced - Shadow
    edited July 2010
    I didn't notice anything about linux dedicated server already posted, so..
    on opensuse v11.3 with the latest build of wine v1.2 I'm able to run a dedicated server and connect to it (make sure you open your pcs firewall for the traffic as well).

    don't forget to have steam running.
    wine Server.exe -ip <whatever> -name <whatever> -map ns2_tram -limit 8 -lan <whatever>

    <a href="http://img202.imageshack.us/img202/368/screenshotpls.png" target="_blank">http://img202.imageshack.us/img202/368/screenshotpls.png</a>
  • slayer.faithslayer.faith Join Date: 2007-12-10 Member: 63127Members, Constellation, Reinforced - Shadow
    <!--quoteo(post=1788046:date=Jul 29 2010, 08:01 AM:name=Martin)--><div class='quotetop'>QUOTE (Martin @ Jul 29 2010, 08:01 AM) <a href="index.php?act=findpost&pid=1788046"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I got this working on a server 2003 box by copying d3dx9_42.dll to the NS2 directory where Server.exe is sitting. Also install physx. All should work fine from there.........untested yet of course. I just did this and currently am unable to connect because I don't have NS2 here at this current machine, I have it at home.

    <a href="http://img405.imageshack.us/i/screenshotqj.jpg/" target="_blank"><img src="http://img405.imageshack.us/img405/5066/screenshotqj.th.jpg" border="0" class="linked-image" /></a><!--QuoteEnd--></div><!--QuoteEEnd-->

    Confirmed! Installing directX (and previously installed physx) worked like a charm and the server now runs. Neither directx or physx need a reboot (phew).
  • MartinMartin Join Date: 2010-07-27 Member: 73229Members
    edited July 2010
    <!--quoteo(post=1788247:date=Jul 29 2010, 02:43 AM:name=slayer.faith)--><div class='quotetop'>QUOTE (slayer.faith @ Jul 29 2010, 02:43 AM) <a href="index.php?act=findpost&pid=1788247"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Confirmed! Installing directX (and previously installed physx) worked like a charm and the server now runs. Neither directx or physx need a reboot (phew).<!--QuoteEnd--></div><!--QuoteEEnd-->

    Glad it worked out for you! :)


    Ok this is just a random thought but if anyone is going to post screenshots of people who have connected to your server, please blur out their IPs.

    I've noticed also that the server is running close to a 500MB in memory for 8 players. Just some food for thought.
Sign In or Register to comment.