# Make sure our executable has execute permissions
# Also usefull to have this script executable for later
chmod +x ./runserver.sh
chmod +x './xRC Simulator.x86_64'

# Save log file relevant activity
grep -a "[0-9]" log.txt >> log_old.txt

# Note: due to the memory leaks and/or physics issues over time, best to restart game every 24h.
# do that by running: crontab -e
# and then adding the following entry (example below runs at 12noon everyday, make sure to check server's date/time to compare to your time zone)
# 0 12 * * * /home/ubuntu/runserver.sh  

# Kill any other xRC Games, required if you want this script to restart the game
kill $(pgrep xRC)

# Run out game with our options
nohup './xRC Simulator.x86_64' \
	-batchmode -nographics \
	RouterPort=11115 \
	Port=11115 \
	game=13 \
	FrameRate=60 \
	tmode=On \
	register=On \
	Spectators=2 \
	minplayers=2 \
	updatetime=20 \
	maxdata=99000 \
	startwhenready=On \
	comment="Charged Up" \
	admin=Admin \
	> log.txt &



