Running a Server

From Tronwiki
(Difference between revisions)
Jump to: navigation, search
Line 2: Line 2:
 
Php is the language used by most, but bash, perl, python, anything that can read text from standard input and write to a text file should work.
 
Php is the language used by most, but bash, perl, python, anything that can read text from standard input and write to a text file should work.
  
 +
== Running a Scripted Server in one screen session ==
 
To start the server, which will read the file edlog.txt, feed that into the parser script, then write the output of that into arma server, which will use tee to display the console log, use something like this shell script:  
 
To start the server, which will read the file edlog.txt, feed that into the parser script, then write the output of that into arma server, which will use tee to display the console log, use something like this shell script:  
  
Line 14: Line 15:
 
  tail -n0 -f -s 0.01 $edlog | $parser | $tron --userconfigdir $userconfigdir --vardir $var | tee -a $log
 
  tail -n0 -f -s 0.01 $edlog | $parser | $tron --userconfigdir $userconfigdir --vardir $var | tee -a $log
  
== Running a Scripted Server in one screen session ==
+
== Running a Scripted Server on 2 screen sessions for more flexibility ==
Alternativey, for debugging, you might want to write the cmds to a seperate text file for reading. This allows you to modify the parser as the server is running and restart it.
+
Alternativey, for debugging, you might want to write the cmds to a seperate text file for reading. This allows you to modify and restart the parser as the server is running it.
  
 
  tail -f -n0 -s 0.01 /path/to/edlog.txt | /path/to/parser.php | tee -a /path/to/cmds.txt
 
  tail -f -n0 -s 0.01 /path/to/edlog.txt | /path/to/parser.php | tee -a /path/to/cmds.txt

Revision as of 11:32, 3 October 2007

How to use all these new features on a server. Scripts. Php is the language used by most, but bash, perl, python, anything that can read text from standard input and write to a text file should work.

Running a Scripted Server in one screen session

To start the server, which will read the file edlog.txt, feed that into the parser script, then write the output of that into arma server, which will use tee to display the console log, use something like this shell script:

#!/bin/sh
tron="/path/to/bin/armagetronad-dedicated"
var="/path/to/var/"
log="${var}console_log.txt"
userconfigdir="/path/to/config/"
parser="/path/to/parser.php"
edlog="${var}edlog.txt"

tail -n0 -f -s 0.01 $edlog | $parser | $tron --userconfigdir $userconfigdir --vardir $var | tee -a $log

Running a Scripted Server on 2 screen sessions for more flexibility

Alternativey, for debugging, you might want to write the cmds to a seperate text file for reading. This allows you to modify and restart the parser as the server is running it.

tail -f -n0 -s 0.01 /path/to/edlog.txt | /path/to/parser.php | tee -a /path/to/cmds.txt

Then run the server on a separate screen session with:

#!/bin/sh
tron="/path/to/bin/armagetronad-dedicated"
var="/path/to/var/"
log="${var}console_log.txt"
userconfigdir="/path/to/config/"
parser="/path/to/parser.php"
edlog="${var}edlog.txt"
cmds="${var}cmds.txt"
tail -n0 -f -s 0.01 $cmds | $tron --userconfigdir $userconfigdir --vardir $var | tee -a $log
Personal tools