#!/bin/sh

# Root directory where steamcmd should be placed
export STEAMCMD_ROOT=/home/sdtd/steamcmd
export STEAM_USER=
export STEAM_PASS=

# Root directory of the engine
export SDTD_ROOT=/home/sdtd/7dtd
export SDTD_SERVERCONFIG=$SDTD_ROOT/../serverconfig.xml

# Root directory for backups
export SDTD_BACKUP_ROOT=/home/sdtd/backup

# User account and group to run the server
export SDTD_USER=sdtd
export SDTD_GROUP=sdtd

# World to load
export SDTD_WORLD=Navezgane

# Name of savegame to load
export SDTD_SAVE=a7

# Base port to use for networking
# Note that baseport (UDP) and base+1 up to base+3 (each TCP) will be used
export SDTD_PORT=25000

# Set this to a reasonable value to get notified if the engine uses up too much RAM
# Value in mebibytes (MiB)
# For a server only used for 7dtd this should be ~500 MiB lower than the machines total RAM
export MEM_NOTIFY_MAX_RAM=2500

# If limit exceeded notify someone by email?
export MEM_NOTIFY_MAIL=no

# If limit exceeded notify someone by XMPP (aka Jabber)?
export MEM_NOTIFY_XMPP=yes

# XMPP user to use for sending
export XMPP_USER=
# XMPP server for sending
export XMPP_SERVER=
# XMPP account password
export XMPP_PASSWORD=
# Receiver of message
export XMPP_TARGET=

# Mail from field
export MAIL_FROM=
# Mail receiver
export MAIL_TO=
# Subject of mail
export MAIL_SUBJECT=7dtd memory usage
# SMTP server to use for sending
export MAIL_SMTP=
# SMTP user (not used if empty)
export MAIL_USER=
# SMTP password (not used if empty)
export MAIL_PASS=

# Paths to binaries. Use "which BINARYNAME" to find the path of a single binary
export CP=/bin/cp
export RSYNC=/usr/bin/rsync
export DU=/usr/bin/du
export FREE=/usr/bin/free
export AWK=/usr/bin/awk
export PIDOF=/bin/pidof
export WINE=/usr/bin/wine

if [ -e $SDTD_SERVERCONFIG ]; then
	export SDTD_TELNET_ENABLED=`xmllint --xpath "string(/ServerSettings/property[@name='TelnetEnabled']/@value)" $SDTD_SERVERCONFIG`
	export SDTD_TELNET_PORT=`xmllint --xpath "string(/ServerSettings/property[@name='TelnetPort']/@value)" $SDTD_SERVERCONFIG`
	export SDTD_TELNET_PASSWORD=`xmllint --xpath "string(/ServerSettings/property[@name='TelnetPassword']/@value)" $SDTD_SERVERCONFIG`
fi
