#!/bin/bash
# LGSM fn_install function
# Author: Daniel Gibbs
# Website: http://gameservermanagers.com
lgsm_version="201215"

fn_check_root
fn_install_header
fn_install_serverdir

# Download and install
if [ "${gamename}" == "Unreal Tournament 2004" ]; then
	fn_install_ut2k4filesdl
	fn_install_ut2k4
	fn_install_ut2k4key
elif [ "${gamename}" == "Unreal Tournament 99" ]; then
	fn_install_ut99filesdl
	fn_install_ut99
elif [ "${gamename}" == "Teamspeak 3" ]; then
	fn_install_ts3
elif [ ! -z "${appid}" ]; then
	fn_install_steamcmd
	fn_install_serverfiles
	fn_install_steamfix
fi

# Configuration
fn_install_glibcfix
fn_install_logs
fn_install_gsquery
fn_install_config
if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then
	fn_install_gslt
	fn_csgofix
elif [ "${gamename}" == "Team Fortress 2" ]; then
	fn_install_gslt
elif [ "${gamename}" == "Killing Floor" ]; then
	fn_install_kffix
elif [ "${gamename}" == "Red Orchestra: Ostfront 41-45" ]; then
	fn_install_rofix
elif [ "${gamename}" == "Unreal Tournament 2004" ]; then
	fn_install_ut2k4fix
elif [ "${gamename}" == "Unreal Tournament 99" ]; then
	fn_install_ut99fix
fi
fn_install_complete