Browse Source

feat(newserver): add Counter-Strike WON2 server (#5105)

* feat(hlwon): add native Half-Life WON2 server

* fix(hlwon): satisfy Python lint conventions

* fix(hlwon): match hlds_i686 process and hide fastdl

The WON server runs as hlds_i686 rather than hlds_linux, so the details
port command and the HLDS PID lookup now match that binary for hlwon.

FastDL is no longer offered for hlwon: protocol 46 clients predate
sv_downloadurl, so the generated HTTP download setup would never be used.

* refactor(hlwon): install from a single linuxgsm.download archive

The WON2 server is a fixed legacy release, so it now installs like the
other archived servers through fn_install_server_files. The archive bundles
HLDS 3.1.1.1 with the 3.1.1.1e update, the patched hlds_run, the WON2
protection libraries and valvecomm.lst.

This removes install_hlwon.sh, which carved a tarball out of a Wayback
Machine copy of the 4Players installer and pulled six files from a
third-party repository, and the unused WON query test script.

* feat(cswon): add native Counter-Strike WON2 server

Adds Counter-Strike 1.5 on the WON2 protocol 46 stack used by hlwonserver.
It installs from a single linuxgsm.download archive containing the
HLDS 3.1.1.1e WON2 base plus the cstrike folder from Valve's
cs_15_full.tar.gz, keeping the newer cs_i386.so from the 3111e update.

The hlwon shortname checks for the update, check-update and fastdl
commands, the hlds_i686 PID and port command and the UDP query port
now match querytype protocol-valve-won so both WON servers share them.
Daniel Gibbs 5 giờ trước cách đây
mục cha
commit
3d43749102

+ 202 - 0
lgsm/config-default/config-lgsm/cswonserver/_default.cfg

@@ -0,0 +1,202 @@
+##################################
+######## Default Settings ########
+##################################
+# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN!
+# Copy settings from here and use them in either:
+# common.cfg - applies settings to every instance.
+# [instance].cfg - applies settings to a specific instance.
+
+#### Game Server Settings ####
+
+## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters
+ip="0.0.0.0"
+port="27015"
+clientport="27005"
+defaultmap="de_dust2"
+maxplayers="16"
+
+## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
+startparameters="-game cstrike -binary ./hlds_i686 -noipx -insecure +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}"
+
+#### LinuxGSM Settings ####
+
+## LinuxGSM Stats
+# Send useful stats to LinuxGSM developers.
+# https://docs.linuxgsm.com/configuration/linuxgsm-stats
+# (on|off)
+stats="off"
+
+## Notification Alerts
+# (on|off)
+
+# Display IP | https://docs.linuxgsm.com/alerts#display-ip
+displayip=""
+
+# More info | https://docs.linuxgsm.com/alerts#more-info
+postalert="off"
+
+# Alert on Start/Stop/Restart
+statusalert="off"
+
+# Discord Alerts | https://docs.linuxgsm.com/alerts/discord
+discordalert="off"
+discordwebhook="webhook"
+
+# Email Alerts | https://docs.linuxgsm.com/alerts/email
+emailalert="off"
+email="email@example.com"
+emailfrom=""
+
+# Gotify Alerts | https://docs.linuxgsm.com/alerts/gotify
+gotifyalert="off"
+gotifytoken="token"
+gotifywebhook="webhook"
+
+# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt
+iftttalert="off"
+ifttttoken="accesstoken"
+iftttevent="linuxgsm_alert"
+
+# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy
+ntfyalert="off"
+ntfytopic="LinuxGSM"
+ntfyserver="https://ntfy.sh"
+ntfytoken=""
+ntfyusername=""
+ntfypassword=""
+ntfypriority=""
+ntfytags=""
+
+# Matrix Alerts | https://docs.linuxgsm.com/alerts/matrix
+matrixalert="off"
+matrixhomeserver="matrix.org"
+matrixtoken="accesstoken"
+matrixroom=""
+
+# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+channeltag=""
+
+# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover
+pushoveralert="off"
+pushovertoken="accesstoken"
+pushoveruserkey="userkey"
+
+# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat
+rocketchatalert="off"
+rocketchatwebhook="webhook"
+
+# Slack Alerts | https://docs.linuxgsm.com/alerts/slack
+slackalert="off"
+slackwebhook="webhook"
+
+# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram
+# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring".
+# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help all".
+telegramapi="api.telegram.org"
+telegramalert="off"
+telegramtoken="accesstoken"
+telegramchatid=""
+telegramthreadid=""
+telegramsilentnotification="false"
+curlcustomstring=""
+
+## Stop | https://docs.linuxgsm.com/commands/start-stop-restart
+stoponlyifnoplayers="off"
+stoponlyifnoplayersallcommands="on"
+
+## Player Warnings | https://docs.linuxgsm.com/features/player-warnings
+# Minutes to warn players in-game before a stop, restart or update. 0 to disable.
+# e.g. 15 warns at 15, 10, 5, 3 and 1 minutes.
+warnplayerstimer="0"
+
+## Updating | https://docs.linuxgsm.com/commands/update
+updateonstart="off"
+
+## Backup | https://docs.linuxgsm.com/commands/backup
+maxbackups="4"
+maxbackupdays="30"
+stoponbackup="on"
+
+## Logging | https://docs.linuxgsm.com/features/logging
+consolelogging="on"
+logdays="7"
+
+## Monitor | https://docs.linuxgsm.com/commands/monitor
+# Query delay time
+querydelay="1"
+
+## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors
+ansi="on"
+
+#### Advanced Settings ####
+
+## Message Display Time | https://docs.linuxgsm.com/features/message-display-time
+sleeptime="0.5"
+
+## Stop Mode | https://docs.linuxgsm.com/features/stop-mode
+# 1: tmux kill
+# 2: CTRL+c
+# 3: quit
+# 4: quit 120s
+# 5: stop
+# 6: q
+# 7: exit
+# 8: 7 Days to Die
+# 9: GoldSrc
+# 10: Avorion
+# 11: end
+stopmode="9"
+
+## Query mode
+# 1: session only
+# 2: gamedig (gsquery fallback)
+# 3: gamedig
+# 4: gsquery
+# 5: tcp
+querymode="4"
+querytype="protocol-valve-won"
+
+## Console type
+consoleverbose="yes"
+consoleinteract="yes"
+
+## Game Server Details
+# Do not edit
+gamename="Counter-Strike: WON2"
+engine="goldsrc"
+glibc="2.0"
+
+#### Directories ####
+# Edit with care
+
+## Game Server Directories
+systemdir="${serverfiles}/cstrike"
+executabledir="${serverfiles}"
+executable="./hlds_run"
+servercfgdir="${systemdir}"
+servercfg="${selfname}.cfg"
+servercfgdefault="server.cfg"
+servercfgfullpath="${servercfgdir}/${servercfg}"
+
+## Backup Directory
+backupdir="${lgsmdir}/backup"
+
+## Logging Directories
+[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log"
+gamelogdir="${systemdir}/logs"
+lgsmlogdir="${logdir}/script"
+consolelogdir="${logdir}/console"
+lgsmlog="${lgsmlogdir}/${selfname}-script.log"
+consolelog="${consolelogdir}/${selfname}-console.log"
+alertlog="${lgsmlogdir}/${selfname}-alert.log"
+postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log"
+
+## Logs Naming
+lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log"
+consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log"
+
+## Log Parameters
+logtimestamp="off"
+logtimestampformat="%Y-%m-%d %H:%M:%S"

+ 1 - 0
lgsm/data/almalinux-8.csv

@@ -33,6 +33,7 @@ cs2
 cscz
 csgo
 css,ncurses-libs.i686
+cswon
 ct
 dab
 dayz

+ 1 - 0
lgsm/data/almalinux-9.csv

@@ -33,6 +33,7 @@ cs2
 cscz
 csgo
 css,ncurses-libs.i686
+cswon
 ct
 dab
 dayz

+ 1 - 0
lgsm/data/centos-7.csv

@@ -33,6 +33,7 @@ cs2
 cscz
 csgo
 css,ncurses-libs.i686
+cswon
 ct
 dab
 dayz

+ 1 - 0
lgsm/data/centos-8.csv

@@ -33,6 +33,7 @@ cs2
 cscz
 csgo
 css,ncurses-libs.i686
+cswon
 ct
 dab
 dayz

+ 1 - 0
lgsm/data/centos-9.csv

@@ -33,6 +33,7 @@ cs2
 cscz
 csgo
 css,ncurses-libs.i686
+cswon
 ct
 dab
 dayz

+ 1 - 0
lgsm/data/debian-10.csv

@@ -32,6 +32,7 @@ cs2
 cscz
 csgo
 css,libtinfo5:i386
+cswon,libc6:i386
 ct
 dab
 dayz

+ 1 - 0
lgsm/data/debian-11.csv

@@ -33,6 +33,7 @@ cs2
 cscz
 csgo
 css,libtinfo5:i386
+cswon,libc6:i386
 ct
 dab
 dayz

+ 1 - 0
lgsm/data/debian-12.csv

@@ -33,6 +33,7 @@ cs2
 cscz
 csgo
 css,libtinfo5:i386
+cswon,libc6:i386
 ct
 dab
 dayz

+ 1 - 0
lgsm/data/debian-13.csv

@@ -33,6 +33,7 @@ cs2
 cscz
 csgo
 css
+cswon,libc6:i386
 ct
 dab
 dayz

+ 1 - 0
lgsm/data/debian-9.csv

@@ -33,6 +33,7 @@ cs2
 cscz
 csgo
 css,libtinfo5:i386
+cswon,libc6:i386
 ct
 dab
 dayz

BIN
lgsm/data/gameicons/cswon-icon.png


+ 1 - 0
lgsm/data/rhel-7.csv

@@ -34,6 +34,7 @@ cs2
 cscz
 csgo
 css,ncurses-libs.i686
+cswon
 ct
 dab
 dayz

+ 1 - 0
lgsm/data/rhel-8.csv

@@ -33,6 +33,7 @@ cs2
 cscz
 csgo
 css,ncurses-libs.i686
+cswon
 ct
 dab
 dayz

+ 1 - 0
lgsm/data/rhel-9.csv

@@ -33,6 +33,7 @@ cs2
 cscz
 csgo
 css,ncurses-libs.i686
+cswon
 ct
 dab
 dayz

+ 1 - 0
lgsm/data/rocky-8.csv

@@ -33,6 +33,7 @@ cs2
 cscz
 csgo
 css,ncurses-libs.i686
+cswon
 ct
 dab
 dayz

+ 1 - 0
lgsm/data/rocky-9.csv

@@ -33,6 +33,7 @@ cs2
 cscz
 csgo
 css,ncurses-libs.i686
+cswon
 ct
 dab
 dayz

+ 1 - 0
lgsm/data/serverlist.csv

@@ -32,6 +32,7 @@ cs2,cs2server,Counter-Strike 2,ubuntu-26.04
 cscz,csczserver,Counter-Strike: Condition Zero,ubuntu-26.04
 csgo,csgoserver,Counter-Strike: Global Offensive,ubuntu-26.04
 css,cssserver,Counter-Strike: Source,ubuntu-26.04
+cswon,cswonserver,Counter-Strike: WON2,ubuntu-26.04
 ct,ctserver,Craftopia,ubuntu-26.04
 dab,dabserver,Double Action: Boogaloo,ubuntu-26.04
 dayz,dayzserver,DayZ,ubuntu-26.04

+ 1 - 0
lgsm/data/ubuntu-16.04.csv

@@ -34,6 +34,7 @@ cs2
 cscz
 csgo
 css,libtinfo5:i386
+cswon,libc6:i386
 ct
 dab
 dayz

+ 1 - 0
lgsm/data/ubuntu-18.04.csv

@@ -34,6 +34,7 @@ cs2
 cscz
 csgo
 css,libtinfo5:i386
+cswon,libc6:i386
 ct
 dab
 dayz

+ 1 - 0
lgsm/data/ubuntu-20.04.csv

@@ -33,6 +33,7 @@ cs2
 cscz
 csgo
 css,libtinfo5:i386
+cswon,libc6:i386
 ct
 dab
 dayz

+ 1 - 0
lgsm/data/ubuntu-22.04.csv

@@ -33,6 +33,7 @@ cs2
 cscz
 csgo
 css,libtinfo5:i386
+cswon,libc6:i386
 ct
 dab
 dayz

+ 1 - 0
lgsm/data/ubuntu-23.04.csv

@@ -33,6 +33,7 @@ cs2
 cscz
 csgo
 css,libtinfo5:i386
+cswon,libc6:i386
 ct
 dab
 dayz

+ 1 - 0
lgsm/data/ubuntu-23.10.csv

@@ -33,6 +33,7 @@ cs2
 cscz
 csgo
 css,libtinfo5:i386
+cswon,libc6:i386
 ct
 dab
 dayz

+ 1 - 0
lgsm/data/ubuntu-24.04.csv

@@ -33,6 +33,7 @@ cs2
 cscz
 csgo
 css
+cswon,libc6:i386
 ct
 dab
 dayz

+ 1 - 0
lgsm/data/ubuntu-26.04.csv

@@ -33,6 +33,7 @@ cs2
 cscz
 csgo
 css
+cswon,libc6:i386
 ct
 dab
 dayz

+ 2 - 2
lgsm/modules/core_getopt.sh

@@ -69,7 +69,7 @@ currentopt+=("${cmd_update_linuxgsm[@]}")
 
 # Exclude noupdate games here.
 if [ "${shortname}" == "jk2" ] || [ "${shortname}" == "jk3" ] || [ "${shortname}" == "etl" ] || [ "${engine}" != "idtech3" ]; then
-	if [ "${shortname}" != "hlwon" ] && [ "${shortname}" != "bf1942" ] && [ "${shortname}" != "bfv" ] && [ "${engine}" != "idtech2" ] && [ "${engine}" != "iw2.0" ] && [ "${engine}" != "iw3.0" ] && [ "${engine}" != "quake" ] && [ "${shortname}" != "samp" ] && [ "${shortname}" != "ut2k4" ]; then
+	if [ "${querytype}" != "protocol-valve-won" ] && [ "${shortname}" != "bf1942" ] && [ "${shortname}" != "bfv" ] && [ "${engine}" != "idtech2" ] && [ "${engine}" != "iw2.0" ] && [ "${engine}" != "iw3.0" ] && [ "${engine}" != "quake" ] && [ "${shortname}" != "samp" ] && [ "${shortname}" != "ut2k4" ]; then
 		currentopt+=("${cmd_update[@]}" "${cmd_check_update[@]}")
 		# force update for SteamCMD, Multi Theft Auto or Hytale only.
 		if [ "${appid}" ] || [ "${shortname}" == "mta" ] || [ "${shortname}" == "hyt" ]; then
@@ -97,7 +97,7 @@ fi
 ## Game server exclusive commands.
 
 # FastDL command.
-if { [ "${engine}" == "source" ] || [ "${engine}" == "goldsrc" ]; } && [ "${shortname}" != "hlwon" ]; then
+if { [ "${engine}" == "source" ] || [ "${engine}" == "goldsrc" ]; } && [ "${querytype}" != "protocol-valve-won" ]; then
 	currentopt+=("${cmd_fastdl[@]}")
 fi
 

+ 1 - 1
lgsm/modules/info_distro.sh

@@ -14,7 +14,7 @@ if [ "${status}" == "1" ]; then
 	gameserverpid="$(TERM=screen tmux -L "${socketname}" list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $NF}')"
 	if [ "${engine}" == "source" ]; then
 		srcdslinuxpid="$(pgrep -P "${gameserverpid}" -x srcds_linux 2> /dev/null | head -n 1)"
-	elif [ "${shortname}" == "hlwon" ]; then
+	elif [ "${querytype}" == "protocol-valve-won" ]; then
 		hldslinuxpid="$(pgrep -P "${gameserverpid}" -x hlds_i686 2> /dev/null | head -n 1)"
 	elif [ "${engine}" == "goldsrc" ]; then
 		hldslinuxpid="$(pgrep -P "${gameserverpid}" -x hlds_linux 2> /dev/null | head -n 1)"

+ 2 - 2
lgsm/modules/info_messages.sh

@@ -771,7 +771,7 @@ fn_info_messages_ports() {
 		portcommand="ss -tuplwn | grep Main"
 	elif [ "${shortname}" == "sm" ]; then
 		portcommand="ss -tuplwn | grep WSServer-Linux"
-	elif [ "${shortname}" == "hlwon" ]; then
+	elif [ "${querytype}" == "protocol-valve-won" ]; then
 		portcommand="ss -tuplwn | grep hlds_i686"
 	elif [ "${engine}" == "source" ]; then
 		portcommand="ss -tuplwn | grep srcds_linux"
@@ -1123,7 +1123,7 @@ fn_info_messages_goldsrc() {
 	{
 		fn_port "header"
 		fn_port "Game" port udp
-		if [ "${shortname}" == "hlwon" ]; then
+		if [ "${querytype}" == "protocol-valve-won" ]; then
 			fn_port "Query" queryport udp
 		else
 			fn_port "Query" queryport tcp

+ 1 - 1
lgsm/modules/install_config.sh

@@ -492,7 +492,7 @@ elif [ "${shortname}" == "gmod" ]; then
 	fn_default_config_remote
 	fn_set_config_vars
 	fn_list_config_locations
-elif [ "${shortname}" == "hldm" ] || [ "${shortname}" == "hlwon" ]; then
+elif [ "${shortname}" == "hldm" ] || [ "${shortname}" == "hlwon" ] || [ "${shortname}" == "cswon" ]; then
 	array_configs+=(server.cfg)
 	fn_default_config_remote
 	fn_set_config_vars

+ 8 - 0
lgsm/modules/install_server_files.sh

@@ -73,6 +73,14 @@ fn_install_server_files() {
 		run="norun"
 		force="noforce"
 		md5="2c6be1bb66ea631b9b2e7ae6216c6680"
+	elif [ "${shortname}" == "cswon" ]; then
+		remote_fileurl="https://linuxgsm.download/CounterStrikeWON2/hlds_l-3111e-cs15-won2-linuxgsm.tar.xz"
+		local_filedir="${tmpdir}"
+		local_filename="hlds_l-3111e-cs15-won2-linuxgsm.tar.xz"
+		chmodx="nochmodx"
+		run="norun"
+		force="noforce"
+		md5="8109a66e2e906ff2c309e3a6b412132a"
 	elif [ "${shortname}" == "hlwon" ]; then
 		remote_fileurl="https://linuxgsm.download/HalfLifeWON2/hlds_l-3111e-won2-linuxgsm.tar.xz"
 		local_filedir="${tmpdir}"