From 2fff61f41a6ad0e0540d06db82e33c50b02a5145 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 19 Jan 2024 18:44:34 +0000 Subject: [PATCH] feat(cs2): update parameters and add workshop support (#4405) * feat(cs2): update config and parameter settings * remove serverlogging * add authkey for workshop * add cs2 label --- .github/labeler.yml | 6 ++-- .../config-lgsm/cs2server/_default.cfg | 32 ++----------------- lgsm/modules/info_game.sh | 8 ++--- 3 files changed, 9 insertions(+), 37 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 3da0d47ee..34ffd66f1 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -74,6 +74,8 @@ - "/(Barotrauma)/i" "game: Counter-Strike: Global Offensive": - "/(Counter-Strike: Global Offensive|CS:GO|csgo)/i" +"game: Counter-Strike 2": + - "/(Counter-Strike 2|CS2)/i" "game: Counter-Strike: Source": - "/(Counter-Strike: Source|CS:S)/i" "game: Counter-Strike 1.6": @@ -95,13 +97,13 @@ "game: Left 4 Dead 2": - "/(Left 4 Dead 2|L4D2)/i" "game: Minecraft": - - "/(minecraft)((?!bedrock).)*$/i" + - "/(Minecraft)((?!bedrock).)*$/i" "game: Minecraft Bedrock": - "/(Bedrock)/i" "game: Mumble": - "/(Mumble)/i" "game: Project Zomboid": - - "/(Project Zomboid)/i" + - "/(Project Zomboid|PZ)/i" "game: Quake 3": - "/(Quake 3|Q3A|q3)/i" "game: Rising World": diff --git a/lgsm/config-default/config-lgsm/cs2server/_default.cfg b/lgsm/config-default/config-lgsm/cs2server/_default.cfg index 4eca78e35..84679da01 100644 --- a/lgsm/config-default/config-lgsm/cs2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/cs2server/_default.cfg @@ -10,41 +10,13 @@ ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters # https://docs.linuxgsm.com/game-servers/counter-strike-2 -# [Game Modes] gametype gamemode gamemodeflags skirmishid mapgroup (you can mix these across all Game Modes except Danger Zone, but use only one) -# Arms Race 1 0 0 0 mg_armsrace -# Boom! Headshot! 1 2 0 6 mg_skirmish_headshots -# Classic Casual 0 0 0 0 mg_casualsigma, mg_casualdelta -# Classic Competitive (Default) 0 1 0 0 mg_active, mg_reserves, mg_hostage, mg_de_dust2, ... -# Classic Competitive (Short Match) 0 1 32 0 mg_active, mg_reserves, mg_hostage, mg_de_dust2, ... -# Danger Zone 6 0 0 0 mg_dz_blacksite (map: dz_blacksite), mg_dz_sirocco (map: dz_sirocco) -# Deathmatch (Default) 1 2 0 0 mg_deathmatch -# Deathmatch (Free For All) 1 2 32 0 mg_deathmatch -# Deathmatch (Team vs Team) 1 2 4 0 mg_deathmatch -# Demolition 1 1 0 0 mg_demolition -# Flying Scoutsman 0 0 0 3 mg_skirmish_flyingscoutsman -# Hunter-Gatherers 1 2 0 7 mg_skirmish_huntergatherers -# Retakes 0 0 0 12 mg_skirmish_retakes -# Stab Stab Zap 0 0 0 1 mg_skirmish_stabstabzap -# Trigger Discipline 0 0 0 4 mg_skirmish_triggerdiscipline -# Wingman 0 2 0 0 mg_de_prime, mg_de_blagai, mg_de_vertigo, mg_de_inferno, mg_de_overpass, mg_de_cbble, mg_de_train, mg_de_shortnuke, mg_de_shortdust, mg_de_lake -gametype="0" -gamemode="1" -gamemodeflags="0" -skirmishid="0" -mapgroup="mg_active" ip="0.0.0.0" port="27015" -defaultmap="de_dust2" maxplayers="16" -tickrate="64" - -## Game Server Login Token (GSLT): Required -# GSLT is required for running a public server. -# More info: https://docs.linuxgsm.com/steamcmd/gslt -gslt="" +wsapikey="" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="-dedicated -ip ${ip} -port ${port} -maxplayers ${maxplayers} -tickrate ${tickrate} -serverlogging +sv_setsteamaccount ${gslt} +map ${defaultmap} +game_type ${gametype} +game_mode ${gamemode} +sv_game_mode_flags ${gamemodeflags} +sv_skirmish_id ${skirmishid} +sv_logfile 1 +exec ${selfname}.cfg" +startparameters="-dedicated -ip ${ip} -port ${port} -maxplayers ${maxplayers} -authkey ${wsapikey} +exec ${selfname}.cfg" #### LinuxGSM Settings #### diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 418949678..200e5fdad 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -1159,14 +1159,12 @@ fn_info_game_col() { fn_info_game_cs2() { if [ -f "${servercfgfullpath}" ]; then fn_info_game_valve_keyvalues "servername" "hostname" - fi - # Steamport can be between 26901-26910 and is normally automatically set. - # Some servers might support -steamport parameter to set - if [ "${steamport}" == "0" ] || [ -v "${steamport}" ]; then - steamport="$(echo "${ssinfo}" | grep "${srcdslinuxpid}" | awk '{print $5}' | grep ":269" | cut -d ":" -f2)" + fn_info_game_valve_keyvalues "defaultmap" "map" + fn_info_game_valve_keyvalues "password" "sv_password" fi defaultmap="${defaultmap:-"NOT SET"}" maxplayers="${maxplayers:-"0"}" + password="${password:-"NOT SET"}" port="${port:-"0"}" queryport="${port:-"0"}" servername="${servername:-"NOT SET"}"