[GH-ISSUE #994] Re-organise script Variables #788

Closed
opened 2026-02-27 02:53:30 +03:00 by kerem · 4 comments
Owner

Originally created by @dgibbs64 on GitHub (Aug 10, 2016).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/994

I have been having a look over the script files and think they require sort re-organising and a tidy up. The aim is to make it easier for end users to understand and get info on the settings and to help developers keep them consistent.

I have come up with a mock up of how I think they should look. You will notice there are several links to wiki pages. The idea is that its easier to explain the settings in the wiki pages that in a comment.

Feedback welcome

#### LGSM Settings ####

# Notification Alerts
# https://gameservermanagers.com/alerts

## Email
emailalert="off"
email="email@example.com"

## Pushbullet
pushbulletalert="off"
pushbullettoken="accesstoken"

# Steam login
# https://gameservermanagers.com/steamcmd-login
steamuser="anonymous"
steampass=""

# Logging
logdays="7"
consolelogging="on"

# IP Address
# https://gameservermanagers.com/ip
ip="0.0.0.0"

# Update
# https://gameservermanagers.com/update
updateonstart="off"

#### Game Server Settings ####

# Ports
# https://gameservermanagers.com/ports
port="27015"
clientport="27005"
sourcetvport="27020"

# Start Parameters
# https://gameservermanagers.com/start-parameters
defaultmap="de_dust2"
mapgroup="random_classic"
maxplayers="16"
tickrate="64"

## Game Modes
## https://gameservermanagers.com/csgo-gamemodes
## [Game Modes]           gametype    gamemode
## Arms Race                  1            0
## Classic Casual             0            0
## Classic Competitive        0            1
## Demolition                 1            1
## Deathmatch                 1            2
gametype="0"
gamemode="0"

## Game Server Login Token
## https://gameservermanagers.com/gslt
gslt=""

## Workshop Settings
## https://gameservermanagers.com/workshop
authkey=""
ws_collection_id=""
ws_start_map=""

# Custom Start Parameters
# https://gameservermanagers.com/custom-start-parameters
customparms=""

# Pre-defined Start Parameters
fn_parms(){
parms="-game csgo -usercon -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers_override ${maxplayers} +mapgroup ${mapgroup} +game_mode ${gamemode} +game_type ${gametype} +host_workshop_collection ${ws_collection_id} +workshop_start_map ${ws_start_map} -authkey ${authkey}"
}

#### Advanced LGSM Settings ####

# Server Details
servicename="csgo-server"
gamename="Counter Strike: Global Offensive"
engine="source"

# Github Branch Select
# Allows for the use of different function files
# from a different repo and/or branch.
githubuser="dgibbs64"
githubrepo="linuxgsm"
githubbranch="master"

# SteamCMD
appid="740"

## Steam App Branch Select
## Allows to opt into the various Steam app branches. Default branch is "".
## Example: "-beta 1.35.4.4"
branch=""

# Directories
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
lockselfname=".${servicename}.lock"
## Server files
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/csgo"
## LGSM Dir
lgsmdir="${rootdir}/lgsm"
functionsdir="${lgsmdir}/functions"
libdir="${lgsmdir}/lib"
## Executable
executabledir="${filesdir}"
executable="./srcds_run"
## Backup
backupdir="${rootdir}/backups"
## Config
servercfg="${servicename}.cfg"
servercfgdir="${systemdir}/cfg"
servercfgfullpath="${servercfgdir}/${servercfg}"
servercfgdefault="${servercfgdir}/lgsm-default.cfg"
## Logs Dir
gamelogdir="${systemdir}/logs"
scriptlogdir="${rootdir}/log/script"
consolelogdir="${rootdir}/log/console"
scriptlog="${scriptlogdir}/${servicename}-script.log"
consolelog="${consolelogdir}/${servicename}-console.log"
emaillog="${scriptlogdir}/${servicename}-email.log"
scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log"
Originally created by @dgibbs64 on GitHub (Aug 10, 2016). Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/994 I have been having a look over the script files and think they require sort re-organising and a tidy up. The aim is to make it easier for end users to understand and get info on the settings and to help developers keep them consistent. I have come up with a mock up of how I think they should look. You will notice there are several links to wiki pages. The idea is that its easier to explain the settings in the wiki pages that in a comment. Feedback welcome ``` #### LGSM Settings #### # Notification Alerts # https://gameservermanagers.com/alerts ## Email emailalert="off" email="email@example.com" ## Pushbullet pushbulletalert="off" pushbullettoken="accesstoken" # Steam login # https://gameservermanagers.com/steamcmd-login steamuser="anonymous" steampass="" # Logging logdays="7" consolelogging="on" # IP Address # https://gameservermanagers.com/ip ip="0.0.0.0" # Update # https://gameservermanagers.com/update updateonstart="off" #### Game Server Settings #### # Ports # https://gameservermanagers.com/ports port="27015" clientport="27005" sourcetvport="27020" # Start Parameters # https://gameservermanagers.com/start-parameters defaultmap="de_dust2" mapgroup="random_classic" maxplayers="16" tickrate="64" ## Game Modes ## https://gameservermanagers.com/csgo-gamemodes ## [Game Modes] gametype gamemode ## Arms Race 1 0 ## Classic Casual 0 0 ## Classic Competitive 0 1 ## Demolition 1 1 ## Deathmatch 1 2 gametype="0" gamemode="0" ## Game Server Login Token ## https://gameservermanagers.com/gslt gslt="" ## Workshop Settings ## https://gameservermanagers.com/workshop authkey="" ws_collection_id="" ws_start_map="" # Custom Start Parameters # https://gameservermanagers.com/custom-start-parameters customparms="" # Pre-defined Start Parameters fn_parms(){ parms="-game csgo -usercon -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers_override ${maxplayers} +mapgroup ${mapgroup} +game_mode ${gamemode} +game_type ${gametype} +host_workshop_collection ${ws_collection_id} +workshop_start_map ${ws_start_map} -authkey ${authkey}" } #### Advanced LGSM Settings #### # Server Details servicename="csgo-server" gamename="Counter Strike: Global Offensive" engine="source" # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. githubuser="dgibbs64" githubrepo="linuxgsm" githubbranch="master" # SteamCMD appid="740" ## Steam App Branch Select ## Allows to opt into the various Steam app branches. Default branch is "". ## Example: "-beta 1.35.4.4" branch="" # Directories rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" ## Server files filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/csgo" ## LGSM Dir lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" libdir="${lgsmdir}/lib" ## Executable executabledir="${filesdir}" executable="./srcds_run" ## Backup backupdir="${rootdir}/backups" ## Config servercfg="${servicename}.cfg" servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" servercfgdefault="${servercfgdir}/lgsm-default.cfg" ## Logs Dir gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" emaillog="${scriptlogdir}/${servicename}-email.log" scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" ```
kerem 2026-02-27 02:53:30 +03:00
Author
Owner

@UltimateByte commented on GitHub (Aug 10, 2016):

I like that.
As we're in there, we could maybe remove the steam login for anonymous games, unless there is a good reason i don't know yet for it being there.

<!-- gh-comment-id:239003611 --> @UltimateByte commented on GitHub (Aug 10, 2016): I like that. As we're in there, we could maybe remove the steam login for anonymous games, unless there is a good reason i don't know yet for it being there.
Author
Owner

@jaredballou commented on GitHub (Aug 17, 2016):

Well, removing it means the steamcmd handler for anonymous games will be different than the ones that have authentication. Which strikes me as a distinction without a valid difference. My thinking is that it should be one function to handle anonymous or Auth, that way we only have to work with one piece of code instead of two.

<!-- gh-comment-id:240521963 --> @jaredballou commented on GitHub (Aug 17, 2016): Well, removing it means the steamcmd handler for anonymous games will be different than the ones that have authentication. Which strikes me as a distinction without a valid difference. My thinking is that it should be one function to handle anonymous or Auth, that way we only have to work with one piece of code instead of two.
Author
Owner

@UltimateByte commented on GitHub (Nov 9, 2016):

I think this is it: https://github.com/GameServerManagers/LinuxGSM/issues/1151

<!-- gh-comment-id:259310639 --> @UltimateByte commented on GitHub (Nov 9, 2016): I think this is it: https://github.com/GameServerManagers/LinuxGSM/issues/1151
Author
Owner

@lock[bot] commented on GitHub (Jul 19, 2018):

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

<!-- gh-comment-id:406138567 --> @lock[bot] commented on GitHub (Jul 19, 2018): This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Sign in to join this conversation.
No labels
Atomic
Epic
cannot reproduce
command: backup
command: console
command: debug
command: details
command: fast-dl
command: install
command: mods
command: monitor
command: post-details
command: restart
command: send
command: start
command: stop
command: update
command: update-lgsm
command: validate
command: wipe
distro: AlmaLinux
distro: Arch Linux
distro: CentOS
distro: Debian
distro: Fedora
distro: RedHat
distro: Rocky Linux
distro: Ubuntu
distro: openSUSE
engine: goldsrc
engine: source
game: 7 Days to Die
game: ARMA 3
game: Ark: Survival Evolved
game: Assetto Corsa
game: Avorion
game: BATTALION: Legacy
game: Barotrauma
game: Battalion 1944
game: Battlefield 1942
game: Black Mesa: Deathmatch
game: Blade Symphony
game: Call of Duty 2
game: Call of Duty 4
game: Call of Duty: United Offensive
game: Counter-Strike 1.6
game: Counter-Strike 2
game: Counter-Strike: Global Offensive
game: Counter-Strike: Source
game: Day of Infamy
game: Dayz
game: Death Match Classic
game: Don't Starve Together
game: ET: Legacy
game: Eco
game: Factorio
game: Factorio
game: Garry's Mod
game: Half-Life
game: Hurtword
game: Insurgecy
game: Insurgecy
game: Insurgency: Sandstorm
game: Just Cause 3
game: Killing Floor
game: Killing Floor 2
game: Left 4 Dead 2
game: Minecraft
game: Minecraft Bedrock
game: Mordhau
game: Multi Theft Auto
game: Mumble
game: Natural Selection 2
game: No More Room in Hell
game: Pavlov VR
game: Post Scriptum
game: Project Zomboid
game: Quake 3
game: QuakeWorld
game: Red Orchestra: Ostfront 41-45
game: Return to Castle Wolfenstein
game: Rising World
game: Rust
game: San Andreas Multiplayer
game: Satisfactory
game: Soldat
game: Soldier of Fortune 2
game: Squad
game: Squad 44
game: Starbound
game: Stationeers
game: Sven Co-op
game: Team Fortress 2
game: Teamspeak 3
game: Teeworlds
game: Terraria
game: The Front
game: Unreal Tournament 2004
game: Unreal Tournament 3
game: Unreal Tournament 99
game: Unturned
game: Valheim
game: Wurm Unlimited
game: Zombie Master Reborn
game: label missing
good first issue
help wanted
info: alerts
info: dependency
info: docker
info: docs
info: email
info: query
info: steamcmd
info: systemd
info: tmux
info: website
info: website
needs more info
outcome: duplicate
outcome: issue resolved
outcome: issue resolved
outcome: issue unresolved
outcome: pr accepted
outcome: pr rejected
outcome: unconfirmed
outcome: wontfix
outcome: wrong forum
potential-duplicate
priority
pull-request
type: bug
type: feature
type: feature
type: feature request
type: game server request
type: refactor
waiting response
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/LinuxGSM#788
No description provided.