Browse Source

Moved gamedata to live under cfg so even in non-lgsmdir installs it doesn't get messy

pull/525/head
Jared Ballou 9 years ago
parent
commit
c64f393deb
  1. 3
      functions/game_settings.sh
  2. 26
      gamedata/_default
  3. 52
      gamedata/_srcds
  4. 39
      gamedata/csgoserver
  5. 17
      gamedata/insserver

3
functions/game_settings.sh

@ -101,8 +101,9 @@ fn_flush_game_settings(){
fn_import_game_settings(){
import="${gamedatadir}/${1}"
importdir=$(echo "${gamedatadir}" | sed -e "s|${lgsmdir}/||g")
if [ ! -e $import ]; then
fn_getgithubfile "gamedata/${1}"
fn_getgithubfile "${importdir}/${1}" 1 "gamedata/${1}"
fi
source $import
}

26
gamedata/_default

@ -0,0 +1,26 @@
# Game Settings File
# _default
# Base defaults for all games
# Set the default settings for the script
fn_set_game_params settings "email" "[email protected]" "Email address for notification"
fn_set_game_params settings "emailnotification" "off" "Email notification (on|off)"
fn_set_game_params settings "ip" "0.0.0.0" "IP Address to bind for server"
fn_set_game_params settings "lgsm_version" "${version}" "Version of LGSM that created this config"
fn_set_game_params settings "logdays" "7" "Number of days to retain logs"
fn_set_game_params settings "updateonstart" "off" "Update game on start"
fn_set_game_params settings "lockselfname" "\${lgsmdir}/.\${servicename}.lock" "LGSM Lock File"
fn_set_game_params settings "filesdir" "\${rootdir}/serverfiles" "Server Files Directory"
fn_set_game_params settings "backupdir" "\${lgsmdir}/backups" "Backup Directory"
fn_set_game_params settings "scriptlogdir" "\${lgsmdir}/log/script" "Script Log Dir"
fn_set_game_params settings "consolelogdir" "\${lgsmdir}/log/console" "Console Log Dir"
fn_set_game_params settings "scriptlog" "\${scriptlogdir}/\${servicename}-script.log" "Script Log"
fn_set_game_params settings "consolelog" "\${consolelogdir}/\${servicename}-console.log" "Console Log"
fn_set_game_params settings "emaillog" "\${scriptlogdir}/\${servicename}-email.log" "Email Log"
fn_set_game_params settings "scriptlogdate" "\${scriptlogdir}/\${servicename}-script-\$(date '+%d-%m-%Y-%H-%M-%S').log" "Script Log Rotation Filename"
fn_set_game_params settings "consolelogdate" "\${consolelogdir}/\${servicename}-console-\$(date '+%d-%m-%Y-%H-%M-%S').log" "Console Log Rotation Filename"
# Default fn_parms does nothing right now, gets overridden by later instances
fn_parms(){
parms=""
}

52
gamedata/_srcds

@ -0,0 +1,52 @@
# Game Settings File
# _srcds
# Base SRCDS Game
# Import default settings
fn_import_game_settings _default
# This is the way we create a script that collates and parses the parameters
fn_parms(){
parms="$(echo $(sed -e 's/=\"/ /g' -e 's/\"$//g' ${settingsdir}/parms_minus)) ${srcds_parms} $(echo $(sed -e 's/=\"/ /g' -e 's/\"$//g' ${settingsdir}/parms_plus))"
}
# The parms that start with - go first
fn_set_game_params parms_minus "-game" "\${game}"
fn_set_game_params parms_minus "-strictportbind" "--EMPTY--"
fn_set_game_params parms_minus "-ip" "\${ip}"
fn_set_game_params parms_minus "-port" "\${port}"
fn_set_game_params parms_minus "-maxplayers" "\${maxplayers}"
# Then the parms that start with +
fn_set_game_params parms_plus "+clientport" "\${clientport}"
fn_set_game_params parms_plus "+tv_port" "\${sourcetvport}"
fn_set_game_params parms_plus "+mapcyclefile" "\${mapcyclefile}"
fn_set_game_params parms_plus "+servercfgfile" "\${servercfg}"
fn_set_game_params parms_plus "+map" "\${defaultmap}"
# And the settings for defaults
fn_set_game_params settings "appid" "204" "Steam App ID"
fn_set_game_params settings "clientport" "27005" "Client Port"
fn_set_game_params settings "defaultmap" "dm_lockdown" "Default map to load"
fn_set_game_params settings "engine" "source" "Game Engine"
fn_set_game_params settings "game" "hl2mp" "Name of game to pass to srcds"
fn_set_game_params settings "gamename" "HalfLife2Deathmatch" "Name for subdirectory in GitHub repo"
fn_set_game_params settings "mapcyclefile" "mapcycle.txt" "Map Cycle File"
fn_set_game_params settings "maxplayers" "64" "Maximum player count"
fn_set_game_params settings "playlist" "custom" "Playlist"
fn_set_game_params settings "port" "27015" "Port to bind for server"
fn_set_game_params settings "servercfg" "${selfname}.cfg" "Server Config file"
fn_set_game_params settings "sourcetvport" "27020" "SourceTV Port"
fn_set_game_params settings "srcds_parms" "--EMPTY--" "Additional SRCDS Parameters. Put the parameters that start with \"-\" first, then \"+\" parameters after"
fn_set_game_params settings "steampass" "--EMPTY--" "Steam Password"
fn_set_game_params settings "steamuser" "anonymous" "Steam Username"
fn_set_game_params settings "systemdir" "\${filesdir}/\${game}"
fn_set_game_params settings "gamelogdir" "\${systemdir}/logs"
fn_set_game_params settings "executabledir" "\${filesdir}"
fn_set_game_params settings "executable" "./srcds_linux"
fn_set_game_params settings "servercfg" "\${servicename}.cfg"
fn_set_game_params settings "servercfgdir" "\${systemdir}/cfg"
fn_set_game_params settings "servercfgfullpath" "\${servercfgdir}/\${servercfg}"
fn_set_game_params settings "servercfgdefault" "\${servercfgdir}/lgsm-default.cfg"

39
gamedata/csgoserver

@ -0,0 +1,39 @@
# Game Settings File
# csgoserver
# Counter-Strike: Global Offensive Dedicated Server
# Import SRCDS
fn_import_game_settings _srcds
# Add playlist parameter
fn_set_game_params parms_plus "+sv_playlist" "\${playlist}"
# Override some server settings
fn_set_game_params settings "appid" "740"
fn_set_game_params settings "defaultmap" "de_dust2"
fn_set_game_params settings "game" "csgo"
fn_set_game_params settings "mapcyclefile" "--UNSET--"
fn_set_game_params settings "gamename" "Counter Strike: Global Offensive"
fn_set_game_params settings "mapgroup" "random_classic" "Map Group. See https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers#Starting_the_Server"
fn_set_game_params settings "tickrate" "64" "Server Tick Rate"
fn_set_game_params settings "gametype" "0" "Game Type. Set to: Arms Race 1 Classic Casual 0 Classic Competitive 0 Demolition 1 Deathmatch 1"
fn_set_game_params settings "gamemode" "0" "Game Mode. Set to: Arms Race 0 Classic Casual 0 Classic Competitive 1 Demolition 1 Deathmatch 2"
fn_set_game_params settings "gslt" "--EMPTY--" "Required: Game Server Login Token. GSLT is required for running a public server. More info: http://gameservermanagers.com/gslt"
fn_set_game_params settings "authkey" "--EMPTY--" "Optional key for Workshop Content. See https://developer.valvesoftware.com/wiki/CSGO_Workshop_For_Server_Operators - To get an authkey visit - http://steamcommunity.com/dev/apikey"
fn_set_game_params settings "ws_collection_id" "--EMPTY--" "Workshop Collection ID"
fn_set_game_params settings "ws_start_map" "--EMPTY--" "Workshop Start Map"
# The parms that start with - go first
fn_set_game_params parms_minus "-usercon" "--EMPTY--"
fn_set_game_params parms_minus "-tickrate" "\${tickrate}"
fn_set_game_params parms_minus "-maxplayers_override" "\${maxplayers}"
fn_set_game_params parms_minus "-authkey" "\${authkey}"
# Then the parms that start with +
fn_set_game_params parms_plus "+sv_setsteamaccount" "\${gslt}"
fn_set_game_params parms_plus "+mapgroup" "\${mapgroup}"
fn_set_game_params parms_plus "+game_mode" "\${gamemode}"
fn_set_game_params parms_plus "+game_type" "\${gametype}"
fn_set_game_params parms_plus "+host_workshop_collection" "\${ws_collection_id}"
fn_set_game_params parms_plus "+workshop_start_map" "\${ws_start_map}"

17
gamedata/insserver

@ -0,0 +1,17 @@
# Game Settings File
# insserver
# Insurgency Dedicated Server
# Import SRCDS
fn_import_game_settings _srcds
# Add playlist parameter
fn_set_game_params parms_plus "+sv_playlist" "\${playlist}"
# Override some server settings
fn_set_game_params settings "appid" "237410"
fn_set_game_params settings "defaultmap" "ministry checkpoint"
fn_set_game_params settings "game" "insurgency"
fn_set_game_params settings "mapcyclefile" "mapcycle_cooperative.txt"
fn_set_game_params settings "playlist" "custom" "Server Playlist"
fn_set_game_params settings "gamename" "Insurgency"
Loading…
Cancel
Save