The online racing simulator
Searching in All forums
(2 results)
[Linux/Shell]Little Start Script
TampaPowers
S2 licensed
This is a little startscript i made for handling multiple server configs.
By no means fail prove, if you have any improvements let me know!

Change the USERNAME to the Username you are logged in with.

Usage example:

bash lfs.sh start "setup"

USERNAME='lfs'

ME=`whoami`
as_user() {
if [ $ME == $USERNAME ] ; then
bash -c "$1"
else
su - $USERNAME -c "$1"
fi
}
lfs_start() {
if [ "$1" ]
then
command="$1";
if screen -list | grep -q "$command"
then
echo "Screen session with this config file already running!"
else
if [ -f "$command.cfg" ]
then
as_user "screen -dmS $command"
sleep 3
as_user "screen -p 0 -S $command -X eval 'stuff \"wine LFS.exe /cfg=$command.cfg\"\015'"
if screen -list | grep -q "$command"
then
echo "$command started!"
else
echo "Couldn't start $command"
fi
else
echo "Couldn't find Config File!"
fi
fi
fi
}
lfs_stop() {
if [ "$1" ]
then
command="$1";
if screen -list | grep -q "$command"
then
if [ -f "$command.cfg" ]
then
as_user "screen -p 0 -S $command -X eval 'stuff \"^C\"\015'"
sleep 3
as_user "screen -p 0 -S $command -X eval 'stuff \"exit\"\015'"
sleep 3
if screen -list | grep -q "$command"
then
echo "Couldn't stop screen session!"
else
echo "$command is stoppped!"
fi
else
echo "No Config File with this name exists! Stopping anyway!"
as_user "screen -p 0 -S $command -X eval 'stuff \"^C\"\015'"
sleep 3
as_user "screen -p 0 -S $command -X eval 'stuff \"exit\"\015'"
sleep 3
if screen -list | grep -q "$command"
then
echo "Couldn't stop screen session!"
else
echo "$command is stoppped!"
fi
fi
else
echo "No Screen Session with this Config File Found!"
fi
fi
}

case "$1" in
start)
lfs_start "$2"
;;
stop)
lfs_stop "$2"
;;

*)
echo "Usage: bash lfs.sh stop|start \"configfile\"}"
exit 1
;;
esac

Server not showing up in List
TampaPowers
S2 licensed
I setup a server on my dedicated server(in an actual datacenter, so no pesky NAT to fiddle with) and for some reason it won't show up in the Server List, but I can connect to it manually just fine.

The log does not show any error concerning a failed connection to the master servers and my network monitor tells me its using its assigned ports just fine.

The Server is called Bolderbay.net Server1 and the passowrd is bolderbay.net
Its running a modified 0.6E to allow for modified clients to connect. I have used the standard software before, wouldn't show up either.

I cannot run in the nogfx mode since my server is command line only, so i set its dedicated setting to invisible. Does this mean it will be invisible to the master server?

What could I do to make my server show on the server list?

// Example host configuration file
// How to use: LFS /cfg=setup.cfg
// Lines starting with // are ignored

// host name
/host=Bolderbay.net Server1

//modified
/modified=yes

// optional: password
/pass=bolderbay.net

// optional: admin password
/admin=----------

// optional: InSim port
/insim=29999

// optional: local specified ip address
/ip=85.25.119.21

// a high number below 65536
/port=63395

// demo/s1/s2
/mode=s2

// no/yes/hidden
/usemaster=yes

// BL1/BL1R/BL2, SO1/SO1R/SO2, etc
/track=BL1

// weather
/weather=1

// cars allowed - see README.txt
/cars=ALL

// max guests that can join host
/maxguests=32

// slots reserved for admins (0 to 8)
/adminslots=2

// max cars in a race
/carsmax=32

// max cars (real+ai) per guest pc
/carsguest=1

// smoothness (3-6) number of car updates per second
/pps=6

// qualifying minutes, 0 for no qualifying
/qual=0

// number of laps, 0 for practice
/laps=0

// if laps not specified: hours
//hours=24

// 0=no/1=low/2=high
/wind=0

// nogfx/invisible
/dedicated=invisible

// no/yes: can guests vote to kick or ban
/vote=no

// no/yes: can guests select track
/select=yes

// no/kick/ban/spec: wrong way drivers
/autokick=no

// no restart within X seconds of race start
/rstmin=30

// no restart within X seconds of race finish
/rstend=30

// no/yes: allow join during race
/midrace=yes

// no/yes: pit stop required
/mustpit=no

// no/yes: allow car reset
/canreset=yes

// no/yes: force cockpit view
/fcv=no

// no/yes: allow wrong way driving
/cruise=yes

// fixed/finish/reverse/random: race start order
/start=finish

// optional: use the specified player name
//player=host

// optional: welcome message up to 200 chars
//welcome=welcome.txt

// optional: text file listing allowed tracks
//tracks=tracks.txt

// optional: message log file
/log=deb.log

// no/yes: network debug
/ndebug=no

// MPR autosave (0=off / 1=manual / 2=auto)
/autosave=0

// MPR folder
/mprdir=mpr

// LYT folder
/lytdir=layout

FGED GREDG RDFGDR GSFDG