Thursday, August 31, 2006

Changing map rotation without a server restart

One thing I've noticed is that you can modify the maprotation.cfg file on the fly and the tremded server will follow it accordingly, so the server apparently doesn't cache it, which is good. It means that a cron job could be created that modifies the file for certain events (like BetaMapFest :) ) or just copies differing versions over it. Late night beta's anyone?

Tremulous Init Script

edit: to have a cron job restart the deamon, I had to specify the whole path to the start-stop-daemon.


I modified an init script from http://wiki.splitbrain.org/q3aserver

Setting it up to chroot shouldn't be to difficult, I just haven't taken the time to wrap my head around the path insanity that follows :)

I've named it tremded.x86 and it is placed in /etc/init.d/ as an executable (chmod u+x should do)



#! /bin/sh
set -e

BASEPATH="/usr/local/tremulous/.tremulous"
BINARY="tremded.x86"
DAEMON="$BASEPATH/$BINARY"
OPTIONS="2>>./tuplestestserver.log +set dedicated 2 +set fs_game base2 +exec server.cfg"
RUNAS="tremulous:tremulous"
PIDFILE="$BASEPATH/$BINARY.pid"

test -x $DAEMON || exit 0

#export HOME=$BASEPATH
export HOME=/usr/local/tremulous

case "$1" in
start)
echo -n "Starting Tremulous Server"
cd $BASEPATH
start-stop-daemon --start --quiet -c $RUNAS --pidfile $PIDFILE \
-N -2 -m -b -d $BASEPATH --exec $DAEMON -- $OPTIONS
echo "."
;;
stop)
echo -n "Stopping Tremulous Server"
start-stop-daemon --stop --quiet --pidfile $PIDFILE \
--exec $DAEMON
echo "."
;;
restart|force-reload)
echo -n "Cycling Tremulous Server - "
$0 stop
sleep 3
$0 start
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
exit 1
;;
esac

exit 0

Server.cfg

I started witht the server.cfg from downloads at tremulous.info and add variables as I learn them.

Much of this info concerns TJW's most excellent admin mod for tremulous. I highly recommend it, admins won't need the rcon password!



set sv_hostname "Name in the Server List - Color codes work" // server name in server list

set g_motd "Message in map loading screen. Color codes work" // message at connection screen


// server password

set g_needpass 0 // toggle password needed to join the server
set g_password "" // server password


// reserved slots

set sv_privatepassword "PrivateSlotPassword" // set password test -> at client to use slot
set sv_privateclients 1 // number of private slots, substracted from
// sv_maxclients

// remote control

set rconpassword "test" // set rconpassword test -> at client to log in

// Admin stuff
//See tjw info below
set g_admin ./admin.dat
set g_adminTempBan 300



// main configuration

set sv_maxclients 13 // maximum number of clients
set sv_pure 1 // disallow clients with modified content
set sv_allowdownload 0 // allow downloads from the server
set sv_minrate 5000 // Minumum rate for connected clients
set sv_maxrate 25000 // Maximum rate for connected clients
set sv_minsnaps 10 // Minumum snapshots for connected clients
set sv_minping 0 // Minumum latency for connected clients
set sv_maxping 250 // Maximum latency for connected clients
// prevents connection of clients with higher ping
set g_antilag 1 // serverside antilag feature
set g_initialmaprotation rotation1 // following the first map, start this rotation
set g_mincommandperiod 1000
set pmove_fixed 0
set sv_cheats 0 // Allow cheats on the server, numerous commands and var changes
#set net_ip 66.92.134.200
set hostname tremulous.nelson-techonline.com

// gameplay specific configuration

set timelimit 45 // after 60 minutes, the game will end as a draw
set g_suddendeathtime 30 // after 55 minutes, all build points are removed
set g_teamforcebalance 1 // forces each team to have a similar number of players
set g_friendlyfire 1 // teammates may damage each other
set g_friendlybuildablefire 1 // teammates may damage buildings
//set g_friendlyFireAliens 0 //not tested yet, alien specific friendly fire ?
//set g_frienlyFireHumans 0 //not tested yet, Human specific friendly fire ?
set g_humanBuildPoints 100 // Number of buildpoints for human team, default 100
set g_humanMaxStage 2 // Maximum human stage (s1=0, s2=1, s3=2)
set g_humanStage2Threshold 20 // threshold for humans to reach stage 2, default 20
set g_humanStage3Threshold 30 // threshold for humans to reach stage 3, default 40
set g_alienBuildPoints 100 // Number of buildpoints for alien team, default 100
set g_alienMaxStage 2 // Maximum alien stage (s1=0, s2=1, s3=2)
set g_alienStage2Threshold 20 // threshold for aliens to reach stage 2, default 20
set g_alienStage3Threshold 30 // threshold for aliens to reach stage 3, default 40
set g_gravity 800 // gravity setting, default 800
set g_dretchPunt 0


//TJW Specific Configs
//set g_Admin ./admin.dat //file containing admin configs and kick/bans, default is listed
//set g_adminlog //location of admin logfile
//set g_allowvote //Wether to allow voting
//set g_votelimit //limit how many votes are allowed
//set g_AdminParseSay 1/0 //allow/disallow tjw commands in chat window
//set g_AdminNameProtect //Disallow use of admin names
//set g_adminTempBan //Length of tjw !kick command in seconds
//set g_privateMessages //Allow private messages
//set g_admin ./admin.dat //Admin config file
//set g_maxNameChanges 4 /Max name changes, prevents name change spam
//set g_chatTeamPrefix 1 /prefix chat with A, H or S


//start this map first

map niveus

Sunday, August 27, 2006

Saturday, August 26, 2006