GameServerManagers / LinuxGSM

The command-line tool for quick, simple deployment and management of Linux dedicated game servers.
https://linuxgsm.com
MIT License
4.31k stars 821 forks source link

Investigation in to quotes tmux and debug #3416

Open dgibbs64 opened 3 years ago

dgibbs64 commented 3 years ago

With the recent issues relating to quotes in start parameters I want to better investigate quotes and how to correctly use them. I want to achieve more consistent results across both tmux and debug mode and across game servers.

Examples of issues

Currently, tmux uses quotes when it starts a new session

tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${preexecutable} ${executable} ${startparameters}"

When it was removed it caused a massive issue for many game servers

tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" ${preexecutable} ${executable} ${startparameters}

However, removing the quotes might actually be the correct way to do things. edit: tested using the sed command keeping quotes for tmux is definitely required

More research is needed and I would welcome any experts with tmux and quoting to give pointers on this one

dgibbs64 commented 3 years ago

I have just tested startparameters like so:

startparameters="\"-ip=${ip} -port=${port} -cfg=${networkcfgfullpath} -config=${servercfgfullpath} -mod=${mods} -servermod=${servermods} -bepath=${bepath} -autoinit -loadmissiontomemory\""

with very good results for arma3 as is resolved the multi mods issue and worked consistently in both debug and tmux. Might be worth investigating this further

dgibbs64 commented 3 years ago

Look at using eval