ich777 / docker-steamcmd-server

Simple Dockerfile that installs steamcmd and a selected game server
119 stars 95 forks source link

[Suggestion] ASA Branch - Compatibility for ServerAPI #67

Closed Jadiction closed 3 months ago

Jadiction commented 3 months ago

Currently the script for ASA only runs ArkAscendedServer.exe. My suggestion is compatibility for ServerAPI at https://gameservershub.com/forums/resources/ark-survival-ascended-serverapi-crossplay-supported.683/ which runs AsaApiLoader.exe with the same parameters. If I'm correct, this should just be a quick if statement that checks for an environment variable.

For example:

ENV SERVERAPI=True

Then within the sh scripts, it checks if SERVERAPI is True then use AsaApiLoader.exe instead to start/stop the process.

ich777 commented 3 months ago

My suggestion is compatibility for ServerAPI at https://gameservershub.com/forums/resources/ark-survival-ascended-serverapi-crossplay-supported.683/ which runs AsaApiLoader.exe with the same parameters.

I did a quick search on that, I'm not sure if I want to integrate that because I can't automate the download of the tool itself easily because their GitHub repository (at least I think that's their GitHub) doesn't reflect the current version which is available on gameserversub.com (which I never heard before) what I really don't like, even if they say that it's open source there is no link available where I can see the code.

Usually I don't include 3rd party apps since my philosophy is that modding is always up to the user.

Then within the sh scripts, it checks if SERVERAPI is True then use AsaApiLoader.exe instead to start/stop the process.

You could always do that yourself since all my containers support a short bash script that you can mount into /opt/scripts/user.sh which will be executed on every start before everything else which modifies /opt/scripts/start-server.sh and replace wine64 ArkAscendedServer.exe with wine64 AsaApiLoader.exe for example with sed. This should be only two lines of code in user.sh:

#!/bin/bash
sed -i 's/wine64 ArkAscendedServer.exe/wine64 AsaApiLoader.exe/' /opt/scripts/start-server.sh

Of course you also have to place AsaApiLoader.exe in the same directory as ArkAscendedServer.exe manually.

Jadiction commented 3 months ago

Usually I don't include 3rd party apps since my philosophy is that modding is always up to the user.

Totally fair, I understand.

You could always do that yourself since all my containers support a short bash script that you can mount into /opt/scripts/user.sh

This works perfectly for my case. I appreciate you for bringing this to my attention. I ended up replacing all cases where the ArkAscendedServer.exe were used in the scripts and it works great.

For anyone potentially finding this in the future and want to accomplish this, I did as follows:

  1. Map /opt/custom/ -> ARK_DIRECTORY/scripts/ (Or any directory of your choosing, I have serverfiles in ARK_DIRECTORY/Server, so this path isn't already mounted)
  2. In ARK_DIRECTORY/scripts/ create user.sh with the content:
    #!/bin/bash
    sed -i 's/wine64 ArkAscendedServer.exe/wine64 AsaApiLoader.exe/' /opt/scripts/start-server.sh
    sed -i 's/ArkAscendedServer.exe/AsaApiLoader.exe/' /opt/scripts/start.sh
    sed -i 's/ArkAscendedServer.exe/AsaApiLoader.exe/' /opt/scripts/start-watchdog.sh