games
UT2004 startup script
by iam8up on Oct.26, 2009, under games
#!/bin/bash
#
# Universal start/stop script
# -- small modifications made for Ut2k4
# ! IF you want to use it for other games REMOVE these lines
# -> cd ${basedir}/System
# NOT THESE cd ${basedir}
#
# Script Version: 0.3
#
# ! awk needs to be installed !
#
# !! WARNING !!
# I am not responsible for damage caused by misconfigurations
# to your installation or any other damage that may occure.
#
# Info:
# This script is made by SkuLLy
#
# Support:
# sign up on the dominating.nl forums
# http://www.dominating.nl/forum
#
# Read the INSTALL file for more info about this script and ways
# to install it in crontab.
#
# Script is universal for different linux distro.s
# this is done on purpose to make it easy to use
# and portable. We are NOT using start/stop daemon
# tools written for each distro e.g. start-stop-daemon
# on Debian.
#
# Vars
# basedir = game install directory without trailing slash!
# gamebin = name of the server executable
# gameopt = commandline options
# gamepid = process id file. Dont change it when not needed.
# gamelog = name and path of the logfile
#
# !! ONLY USE THIS WHEN YOU KNOW WHAT YOU ARE DOING !!
# s_enable = make use of screen when 1
# s_name = screen session name.
#
# Use different names for each session for easy use.
#
# Tested on:
# Debian
# CentOS 4.4
# Ubuntu
#
###################################################
#
#Config these setting according to your setup.
basedir="/ut2004/dedicated"
#below probably won't be necessary
gamename="Unreal Tournament 2004"
gamebin="System/ucc-bin"
gamepid="${basedir}/ut2k4.pid"
gamelog="server.log"
gameini="UT2004.ini"
gameopt="server DM-Rankin?Game=XGame.xDeathMatch?Mutator=AntiCamperv3.MutAntiCam per,Gibalicious2.MutGibaliciousII,UTSecure2K4-111.MutUTSecure,NoInvisCombo.MutNo Invis,XWeapons.MutNoSuperWeapon?GameStats=True -log=${gamelog} -ini=${gameini} -- -nohomedir"
#gameopt="server DM-Rankin?Game=XGame.xDeathMatch?Mutator=Gibalicious2.MutGibali ciousII,UTSecure2K4-111.MutUTSecure,NoInvisCombo.MutNoInvis,XWeapons.MutNoSuperW eapon?GameStats=True -log=${gamelog} -ini=${gameini} --nohomedir"
#
#Screen config
#
#ONLY USE SCREEN IF YOU KNOW HOW IT WORKS AND WANT IT.
#MAKE SURE SCREEN IS INSTALLED!!
s_enable=0
s_name="ut2k4_1"
##################################################
# NO CHANGES BELOW. ELSE ITS ON YOUR OWN RISK
#
#Checking the stuff
if [ ${s_enable} == 1 ] ; then
screen=`which screen`
fi
if [ -f "${basedir}/${gamebin}" ]; then
if [ ! -x "${basedir}/${gamebin}" ]; then
echo -e "${gamebin} file is not executable"
echo -e "Please fix this and try again"
exit 2
fi
else
echo "cannot find ${gamebin}!"
echo "If this is not correct edit the start script"
exit 2
fi
case "$1" in
start)
echo -n "Starting $gamename dedicated server: "
cd ${basedir}/System
if ps -ef |grep ${basedir}/${gamebin}|awk -F" " -v game=${basedir}/${gamebin} 'BEGIN {status=1} ; $8 == game {status=0} ; END {exit status}' ; then
echo -e "already active"
exit 3
else
if [ ${s_enable} == 1 ] ; then
cd ${basedir}
cp ${gamelog} ${gamelog}.crash
cd ${basedir}/System
${screen} -d -m -L -S ${s_name} $0 debug
else
cd ${basedir}
cp ${gamelog} ${gamelog}.crash
cd ${basedir}/System
if ${basedir}/${gamebin} ${gameopt} >> ${basedir}/${gamelog} & sleep 1 ; then
pid=`ps -ef |grep ${basedir}/${gamebin}|awk -F" " -v game=${basedir}/${gamebin} 'BEGIN {status=1} ; $8 == game { print $2 } ; EN D {exit status}'`
echo ${pid} > ${gamepid}
if [ -f "${gamepid}" ] && ps h `cat "${gamepid}" ` >/dev/null; then
echo -e "..Started!"
exit 0
else
echo -e "..Failed to start. Check logfile or run in debug!"
exit 1
fi
else
echo -e "Failed"
fi
fi
fi
;;
stop)
echo -n "Stopping $gamename dedicated server: "
if ! ps -ef |grep ${basedir}/${gamebin}|awk -F" " -v game=${basedir}/${gamebin} 'BEGIN {status=1} ; $8 == game {status=0} ; END {exit status}' ; then
echo -e "server not running or crashed."
else
pid=`ps -ef |grep ${basedir}/${gamebin}|awk -F" " -v game=${basedir}/${gamebin} 'BEGIN {status=1} ; $8 == game { print $2 } ; END {exit status}'`
echo ${pid} > ${gamepid}
kill -9 `cat ${gamepid}`
if ! ps -ef |grep ${basedir}/${gamebin}|awk -F" " -v game=${basedir}/${gamebin} 'BEGIN {status=1} ; $8 == game {status=0} ; END {exit st atus}' ; then
echo -e "stopped"
exit 0
else
echo -e "unable to stop server or server crashed "
fi
fi
;;
status)
echo -n "`date +"%Y-%m-%d %H:%M:%S"` Checking $gamename dedicated server status: "
if ! ps -ef |grep ${basedir}/${gamebin}|awk -F" " -v game=${basedir}/${gamebin} 'BEGIN {status=1} ; $8 == game {status=0} ; END {exit status}' ; then
echo -e "server not running or crashed. Restarting"
if [ ${s_enable} == 1 ] ; then
cd ${basedir}
${screen} -d -m -L -S ${s_name} $0 debug
else
$0 start
fi
else
echo -e "Server still running."
fi
;;
check)
echo -n "Checking $gamename dedicated server status: "
if ! ps -ef |grep ${basedir}/${gamebin}|awk -F" " -v game=${basedir}/${gamebin} 'BEGIN {status=1} ; $8 == game {status=0} ; END {exit status}' ; then
echo -e "offline"
else
echo -e "online"
fi
;;
restart)
echo -e "Restarting $gamename dedicated server. "
$0 stop && $0 start
;;
debug)
echo -n "Starting debug mode for $gamename dedicated server: "
cd ${basedir}
if ps -ef |grep ${basedir}/${gamebin}|awk -F" " -v game=${basedir}/${gamebin} 'BEGIN {status=1} ; $8 == game {status=0} ; END {exit status}' ; then
echo -e "already active"
exit 3
else
echo "--DEBUG will appear on screen!"
echo "--Hit CTRL+C to kill the server!"
cd ${basedir}
cp ${gamelog} ${gamelog}.crash
cd ${basedir}/System
${basedir}/${gamebin} ${gameopt}
fi
;;
*)
echo "Usage: $0 {start|stop|restart|status|check|debug}"
exit 1
esac
SRC: http://blog.molski.nl/2009/10/07/my-ut2004-statusstoprestart-script-for-centosredhatfedora/
Note you do NOT want to copy/paste from this site as the characters used are not the simple single and double quotes
Modern Warfare 2 dies before launch
by iam8up on Oct.25, 2009, under games
http://www.gossipgamers.com/infinity-wards-rob-bowling-explains-how-no-dedicated-server-is-not-crazy/
* Matchmaking & Smoother Gameplay
Smoother gameplay by having some porn torrenting 13 year old host a server on his 4 year old gaming PC with his 384kbps upstream connection. Right.
* Playlists and Private Matches
Can’t make playlists and private matches without dedicated servers? How are we doing it in Modern Warfare already? Oh! Dedicated servers!
* Party System and Friendslist
Can’t have a friends list system with dedicated servers? We’re doing it in Unreal Tournament 2004…
* Cheat / Hack Free Games
Not even going to touch this one.
Left 4 Dead 2 Trailer – Zombie Survival Guide
by iam8up on Oct.25, 2009, under games
