Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(newserver): DayZ #3557

Merged
merged 16 commits into from
Dec 20, 2021
Merged

feat(newserver): DayZ #3557

merged 16 commits into from
Dec 20, 2021

Conversation

Marcin648
Copy link
Contributor

@Marcin648 Marcin648 commented Sep 14, 2021

Description

This PR add support for DayZ.
For now only DayZ Experimental supports linux.
DayZ Experimental server it self it's not fully stable for now, can crash time to time.

Linux support is added in DayZ Experimental v1.14. This does not mean it will be included in next release. When that happens appid need to be change to stable version.

Fixes #3556

Type of change

  • Bug fix (a change which fixes an issue).
  • New feature (change which adds functionality).
  • New Server (new server added).
  • Refactor (restructures existing code).
  • Comment update (typo, spelling, explanation, examples, etc).

Checklist

PR will not be merged until all steps are complete.

  • This pull request links to an issue.
  • This pull request uses the develop branch as its base.
  • This pull request Subject follows the Conventional Commits standard.
  • This code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • I have checked that this code is commented where required.
  • I have provided a detailed with enough description of this PR.
  • I have checked If documentation needs updating.

Documentation

Documentation should to be updated. DayZ share the same mods installation process then Arma 3.
https://github.com/GameServerManagers/LinuxGSM-Docs/blob/master/game-servers/arma-3.md#mod-support

If documentation does need updating either update it by creating a PR (preferred) or request a documentation update.

Thank you for your Pull Request!

Copy link
Member

@h3o66 h3o66 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few nits to check from my perspective

@Marcin648
Copy link
Contributor Author

Marcin648 commented Sep 15, 2021

Status for now.
Server installs correctly, configure, starts and *stops. Network ports are parsed correct. Monitor feature fully work.
Details commands shows all informations correct.

Known issues:
DayZ crash if logFile is defined in game config. Need to be commented. (DayZ Bug)
*DayZ throw SIGSEGV and create core dump while closing is in progress (server stop command). LGSM report it as FAIL but it's normal for now. (DayZ Bug)
DayZ mods are broken if are use debug command. #3409 (comment)

This PR is draft for now. Any comments are welcome :)

@Marcin648
Copy link
Contributor Author

Marcin648 commented Sep 16, 2021

Debug command issue

Some games like Arma3 or DayZ use special characters in argument line, that need to be escape. For some reason the start command works fine as opposed to debug command. To find out what went wrong I wrote simple script that prints all process arguments. They are my conclusions.
https://gist.github.com/Marcin648/0074f322b3af8df76a2bf8e444999187

My dayzserver.cfg file looks like this below. It's the same pattern, that Arma 3 configuration looks like. That tries to load two mods @cf and @cj187_immersive_map.

ip="0.0.0.0"
port="2302"

## DayZ Modules
# Add mods with relative paths:
# mods/@cf
# To load the "Community framework for DayZ SA" module found in the
# directory serverfiles/mods/@cf.  Load several mods as:
# mods="mods/@cf\;mods/@dayz-expansion\;mods/@deerisle"
mods="mods/@cf\;mods/@cj187_immersive_map\;"

## Server-side Mods
servermods=""

## Path to BattlEye
# Leave empty for default
bepath=""

## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
startparameters="-ip=${ip} -port=${port} -config=${servercfgfullpath} -mod=${mods} -servermod=${servermods} -bepath=${bepath} -limitFPS=60 -dologs -adminlog -freezeCheck"

The problem

This is what args looks like when run with start command (output from check_args.py)

...
argv[3] = -config=/home/linuxgsm/srv/serverfiles/cfg/dayzserver.server.cfg
argv[4] = -mod=mods/@cf;mods/@cj187_immersive_map;
argv[5] = -servermod=
...

and that looks with debug command

...
argv[3] = -config=/home/linuxgsm/srv/serverfiles/cfg/dayzserver.server.cfg
argv[4] = -mod=mods/@cf\;mods/@cj187_immersive_map\;
argv[5] = -servermod=
...

So when we use debug, arguments are not unescaped. (\;)
The reason for this is that command line is passed as argument in "" to tmux, unlike using debug, command line is call directly.

https://github.com/Marcin648/LinuxGSM/blob/d9367755097f14834bf91492db64dabb6e9aea54/lgsm/functions/command_start.sh#L82
https://github.com/Marcin648/LinuxGSM/blob/d9367755097f14834bf91492db64dabb6e9aea54/lgsm/functions/command_debug.sh#L125

Solution

In my opinion best and easiest solution to that is call command line by eval when debug is using.
That do unescape parameters the same way that happend when we use tmux.
In this PR, I made elif for DayZ because this is feature/dayz-server branch, but in my opinion every game should be use eval in this case. This change also can solves the same problem in Arma3 server.

@Marcin648 Marcin648 marked this pull request as ready for review September 16, 2021 20:51
@Marcin648 Marcin648 requested a review from h3o66 September 16, 2021 20:55
@h3o66 h3o66 added the branch conflicts Branch of pr has conflicts that need to be worked on label Sep 21, 2021
@dgibbs64 dgibbs64 linked an issue Sep 23, 2021 that may be closed by this pull request
2 tasks
@dgibbs64
Copy link
Member

@Marcin648 that issue relates to #3409 I will consider using eval as it may resolve simular issues. Thank you for the research

@dgibbs64
Copy link
Member

I have merged the use of eval in to the develop branch. so that should resolve the debug issues.

@BlueSky-fur
Copy link

Looking forward to this!

@johnoclockdk johnoclockdk removed the branch conflicts Branch of pr has conflicts that need to be worked on label Nov 18, 2021
@BlueSky-fur
Copy link

Any Updates on this?

@Marcin648
Copy link
Contributor Author

Updated for new features that be added in latest LGSM release.
Ready to merge.

@BlueSky-fur
Copy link

We should add a note that its only Experimental DayZ Branch servers, stable is yet to come sadly :/

@dgibbs64 dgibbs64 added this to the v21.5.0 milestone Dec 10, 2021
@PhilPhonic
Copy link
Contributor

Suggestion: merge this as is "DayZ Experimental Server" and as soon as "DayZ Server" is available create another PR.
That way we'd be able to run normal and experimantal servers with linuxgsm.

@Marcin648
Copy link
Contributor Author

Marcin648 commented Dec 15, 2021

I suggested exactly this on discord. But after discussion users said that instead of create two entry of servers in LGSM better is simple change appid in config. The same way that beta branch change.

@dgibbs64 dgibbs64 merged commit 54bf332 into GameServerManagers:develop Dec 20, 2021
jusito pushed a commit to jusito/LinuxGSM that referenced this pull request Aug 24, 2022
* feat(dayzserver): add base dayz support

* feat(dayzserver): add game info support

* fix(dayzserver): fix dayz mods if run in debug

* feat(dayzserver): add install game config

* fix(dayzserver): fix shortname in install_config

* feat(dayzserver): download config from  remote

* fix(dayzserver): fix default server cfg file

* fix(dayzserver): temporarily use default debug cmd

* fix(dayzserver): fix DayZ info game ports

* feat(dayzserver): add change port config location

* refactor(dayzserver): cleaner reading of server variables

* fix(dayzserver): fix DayZ debug parameters.

* fix(dayzserver): add dayz to dependency files

* fix(dayzserver): add gotify allerts to dayz config
@github-actions
Copy link
Contributor

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

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Server Request]DayZ-(Experimental )Server since native Linux support is added
6 participants