Set 0.7 protocol for ddnet7 client in CI

This commit is contained in:
ChillerDragon 2024-01-22 21:55:36 +08:00
parent 741ed69337
commit 17af3e3770

View file

@ -6,9 +6,10 @@ tw_srv_bin=teeworlds_srv
logdir=logs logdir=logs
tmpdir=tmp tmpdir=tmp
kill_marker=kill_me_d5af0410 kill_marker=kill_me_d5af0410
srvcfg="sv_rcon_password rcon;sv_port 8377;$kill_marker" server_port=8377
srvcfg="sv_rcon_password rcon;sv_port $server_port;$kill_marker"
cl_fifo="$tmpdir/client.fifo" cl_fifo="$tmpdir/client.fifo"
clcfg="cl_input_fifo $cl_fifo;connect 127.0.0.1:8377;$kill_marker" clcfg="cl_input_fifo $cl_fifo;connect 127.0.0.1:$server_port;$kill_marker"
tw_srv_running=0 tw_srv_running=0
ruby_logfile=ruby_client.txt ruby_logfile=ruby_client.txt
@ -53,12 +54,14 @@ function connect_tw_client() {
} }
function connect_ddnet7_client() { function connect_ddnet7_client() {
local clcfg_dd7
clcfg_dd7="$(echo "$clcfg" | sed 's/127.0.0.1/tw-0.7+udp:\/\/127.0.0.1/')"
if [[ -x "$(command -v DDNet7-headless)" ]] if [[ -x "$(command -v DDNet7-headless)" ]]
then then
DDNet7-headless "$clcfg" DDNet7-headless "$clcfg_dd7"
elif [[ -x "$(command -v /usr/local/bin/DDNet7-headless)" ]] elif [[ -x "$(command -v /usr/local/bin/DDNet7-headless)" ]]
then then
/usr/local/bin/DDNet7-headless "$clcfg" /usr/local/bin/DDNet7-headless "$clcfg_dd7"
else else
echo "Error: please install a DDNet7-headless" echo "Error: please install a DDNet7-headless"
exit 1 exit 1