GameServerManagers / LinuxGSM

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

[BUG] Ark Survival Evolved: Unable to display game details #4091

Open ajdergute opened 1 year ago

ajdergute commented 1 year ago

User Story

As a user, I want 'arkserver details' to output server name, password and admin password.

Basic info

Further Information

The details command always display "NOT SET" as follows:

Server name:      NOT SET
App ID:           376030
...
Server password:  NOT SET
Admin password:   NOT SET

To Reproduce

Steps to reproduce the behaviour:

  1. Install Ark as described on website
  2. Execute details command

Expected behaviour

I expect to see server name and admin password to be displayed.

Ark seems to store GameUserSettings.ini with UTF-16LE encoding. Even if this file is converted with iconv, ark seems to rewrite it on next start. As sed is unable to parse this file we are faced with NOT SET strings.

With additional convertion sed works again. See this for reference:

                iconv -f utf-16le -t utf-8 ${servercfgfullpath} -o ${servercfgfullpath}.utf8
                servername=$(sed -nr 's/^SessionName=(.*)/\1/p' "${servercfgfullpath}.utf8")
                adminpassword=$(sed -nr 's/^ServerAdminPassword=(.*)/\1/p' "${servercfgfullpath}.utf8")
                serverpassword=$(sed -nr 's/^ServerPassword=(.*)/\1/p' "${servercfgfullpath}.utf8")
dgibbs64 commented 1 year ago

Interesting problem. Something may have changed for the server as it has been working for several years at this point.

Claiyc commented 1 year ago

ark is incredibly weird regarding the encoding of the .ini files. I ran into multiple issues with that a few years back as well. Not quite sure if we want to do something against that on lgsm side (as it is clearly an issue with ark). Normally you can work around it by changing values or the order of parameters in the .ini and restarting the server.

dgibbs64 commented 1 year ago

Sounds like it may require a bunch of messing around on our end. Would be nice for us to have workarounds but it sounds very much like a trial and error issue.

Alternatively the ark Devs sort it out but since ark 2 is in full swing I doubt they will bother

Claiyc commented 1 year ago

yes, I don't really thinkt that something about this is gonna happen on arks side.. What makes it even more difficult to fix is that the issue is not really reproducable. At least I didn't find a scheme in which this issue occurs yet

ajdergute commented 1 year ago

As far as I understand, Ark reads the file on startup and re-encode it. If it contains characters which are not part of usascii it will encode the whole file with utf16le.

There are multiple sources out there, e.g.: https://github.com/arkmanager/ark-server-tools/issues/1025#issuecomment-670036388

This is basically what I experience. Du you experience something different? This seems to be stable and reproducible. Just create an config and add some umlauts. Start the game and see what happens.

I think it's the most convenient way to treat this file as utf16le encoded. As a result of this LGSM should do some post-processing to get sed and other tools working.