CrashProofing?

DepotDepot The ModFather Join Date: 2002-11-09 Member: 7956Members
Finally succeeded in installing an NS2 server. My question regards 'crashproofing' your server.

There used to be a couple of programs (ServerDoc?) that would restart your server if it crashed. Anyone know if such programs exist for NS2 servers?

TIA!

Comments

  • invTempestinvTempest Join Date: 2003-03-02 Member: 14223Members, Constellation, Squad Five Blue
    All you need is a simple batch script to restart the server when the process dies:

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->@echo off
    title NS2 Server Monitor
    cd "c:\servers\pub1\"
    :NS2
    echo (%time%) Server started.
    start /wait server.exe -file c:\servers\pub1\server.xml -adminpath pub1/
    echo (%time%) WARNING: NS2 closed or crashed, restarting.
    goto NS2<!--c2--></div><!--ec2-->
  • DepotDepot The ModFather Join Date: 2002-11-09 Member: 7956Members
    Thanks, kinda.... I've never had to create a batch file. How do I do this, and where does it go?
  • invTempestinvTempest Join Date: 2003-03-02 Member: 14223Members, Constellation, Squad Five Blue
    To create a batch file first make a new text document and copy in the contents below (make sure to change all variables below to fit your server setup)

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->@echo off
    title NS2 Server Monitor
    cd "$ServerDirectory"
    :NS2
    echo (%time%) Server started.
    start /wait server.exe $CommandLineArg1 $CommandLineArg2
    echo (%time%) WARNING: NS2 closed or crashed, restarting.
    goto NS2<!--c2--></div><!--ec2-->

    Then simply save the file with the extension .bat and call it something like NS2server.bat.

    Place this file on your desktop for easy access as this will be how you start the server from now on.
  • DepotDepot The ModFather Join Date: 2002-11-09 Member: 7956Members
    Thanks, I'll set this up later when I get on my PC.
Sign In or Register to comment.