Running a Server

From Tronwiki
Revision as of 11:23, 3 October 2007 by Ed (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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.

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
base_dir="/home/ed"
tron="$base_dir/binary/armahacktop-021007/bin/armagetronad-dedicated"
var="$base_dir/var/rubber/"
log="${var}console_log.txt"
userconfigdir="$base_dir/config/rubber"
autoresourcedir="$base_dir/resource"
parser="$base_dir/scripts/rubber/rubber_parser.php"
edlog="${var}edlog.txt"

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

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.

tail -f -n0 -s0.1 ../../var/dzfort/edlog.txt | parser.php | tee -a /home/ed/var/dzfort/cmds.txt

Then run the server with:

tail -n0 -f -s 0.01 $cmds | $tron --userconfigdir $userconfigdir --vardir $var --autoresourcedir $autoresourcedir | tee -a $log
Personal tools