Devidian / docker-spaceengineers

A Docker for Space Engineers Dedicated Server
87 stars 21 forks source link

Plugin Support? #49

Closed draconb closed 3 months ago

draconb commented 1 year ago

I was wondering if this supports the plugins offered now by the new official client? Just getting into SE and finally got the dedicated server working, thanks for your work on this made it pretty easy once I got it setup locally.

draconb commented 1 year ago

FYI for anyone wondering, I was able to get 3 to load up, all 3 were ones created by viktor-ferenczi:

performance-improvements

se-bugfixes

multigrid-projector

I updated the compose to have another line for plugins, but you could just put them in another sub folder if wanted.

      - /mnt/data/docker-volumes/space-engineers/plugins:/appdata/space-engineers/plugins
      - /mnt/data/docker-volumes/space-engineers/instances:/appdata/space-engineers/instances

I then updated the SpaceEngineers-Dedicated.cfg file to update the path to

 <Plugins>
    <string>Z:\\appdata\\space-engineers\\plugins\\Bugfixes.dll</string>
    <string>Z:\\appdata\\space-engineers\\plugins\\MultigridProjectorDedicated.dll</string>
    <string>Z:\\appdata\\space-engineers\\plugins\\PerformanceImprovements.dll</string>
  </Plugins>

And that appears to have loaded them onto the server properly according to the logs, haven't had time to try it out yet myself.

Devidian commented 1 year ago

Hey man, thanks for sharing your findings. That is really good to know i think. I will update the README to include that information.

draconb commented 1 year ago

You could update it automatically similar to how the world gets updated here

sed -i "s=<LoadWorld>.*</LoadWorld>=<LoadWorld>${SAVE_PATH}</LoadWorld>=g" ${CONFIG_PATH}

https://github.com/Devidian/docker-spaceengineers/blob/3c24b5a33e79f9e117dfd0b16bb654bf9f3f00a4/entrypoint.sh#LL19C1-L19C90

I noticed that was how it was handled in the other repo:

https://github.com/mmmaxwwwell/space-engineers-dedicated-docker-linux/blob/174d1a8772008b7797bd6dff5e07cfa9e42c135e/entrypoint.bash#L30

Devidian commented 1 year ago

Oh yeha, that might be a good addition, i will have a look into that.

Devidian commented 1 year ago

I have made a new push to the staging branch, maybe you can try it out and give me some feedback, then i will merge those changes into master as well. ( you can just use devidian/spaceengineers:winestaging, as soon as dockerhub has build it - still in progress while i write this)

Devidian commented 1 year ago

New staging release in progress, there was a bug in the closing string tag.

Devidian commented 1 year ago

Seems to work.

2023-06-02 05:53:34.065 - Thread:   1 ->  MySandboxGame.Initialize() - END
2023-06-02 05:53:34.092 - Thread:   1 ->  Plugin Init: DedicatedPlugin.Plugin
2023-06-02 05:53:34.096 - Thread:   1 ->  Info: PerformanceImprovements: Loading
2023-06-02 05:53:34.098 - Thread:   1 ->  Info: PerformanceImprovements: Writing default configuration file: Z:\appdata\space-engineers\instances\Debian\PerformanceImprovements.cfg
2023-06-02 05:53:34.152 - Thread:   1 ->  Debug: PerformanceImprovements: Scanning for conflicting code changes
2023-06-02 05:53:35.561 - Thread:   1 ->  Debug: PerformanceImprovements: Applying Harmony patches
2023-06-02 05:53:37.288 - Thread:   1 ->  Timer Frequency: 10000000
2023-06-02 05:53:37.288 - Thread:   1 ->  Ticks per frame: 166667
2023-06-02 05:53:37.358 - Thread:   1 ->  Updating continues.
2023-06-02 05:53:38.316 - Thread:   7 ->  Warning: Sound on different thread , PlaySound
2023-06-02 05:53:38.407 - Thread:   7 ->  Initialized large grid MFB - Alpha 10199 PCU
2023-06-02 05:53:38.844 - Thread:   1 ->  Info: Stargate: Loading saved mod configuration from World: Stargate.cfg
draconb commented 1 year ago

Great I'll try it out when I spin up a new server soon :)

draconb commented 1 year ago

Yep seems to work and auto add them :)


"@sSteamCmdForcePlatformType" = "windows"

Success! App '298740' already up to date.

---------------------------------UPDATE CONFIG-------------------------------

---------------------------------UPDATE PLUGINS------------------------------

Found 3 plugins in /appdata/space-engineers/plugins
-----------------------------CURRENT CONFIGURATION---------------------------

GAME_DIR=/appdata/space-engineers/SpaceEngineersDedicated

CONFIG_PATH=/appdata/space-engineers/instances/AssertiveCombat/SpaceEngineers-Dedicated.cfg

INSTANCE_IP=XXXXXXXX

CURRENT_IP=XXXXXXX (these are set)

CURRENT_WORLDNAME=Assertive Combat - Survival Dedicated

SAVE_PATH=Z:\\appdata\\space-engineers\\instances\\AssertiveCombat\\Saves\\Assertive Combat - Survival Dedicated

wine-8.0

----------------------------------START GAME---------------------------------

2023-06-10 07:15:23.118: App Version: 01_202_119

2023-06-10 07:15:23.129: Is official: True [NO][NIS][NAMP]

2023-06-10 07:15:23.131: Environment.ProcessorCount: 12

2023-06-10 07:15:23.134: Environment.OSVersion: Microsoft Windows 7 Professional (Microsoft Windows NT 6.1.7601 Service Pack 1)

2023-06-10 07:15:23.134: Environment.CommandLine: "Z:\appdata\space-engineers\SpaceEngineersDedicated\DedicatedServer64\SpaceEngineersDedicated.exe" -noconsole -ignorelastsession -path Z:\appdata\space-engineers\instances\AssertiveCombat

2023-06-10 07:15:23.134: Environment.Is64BitProcess: True

2023-06-10 07:15:23.134: Environment.Is64BitOperatingSystem: True

2023-06-10 07:15:23.134: Environment.Version: .NET Framework 4.8.3761.0

2023-06-10 07:15:23.134: Environment.CurrentDirectory: Z:\appdata\space-engineers\SpaceEngineersDedicated\DedicatedServer64

2023-06-10 07:15:23.135: CPU Info: Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz

-----------------------------------END GAME----------------------------------

-----------------------------------BYE !!!!----------------------------------

However, it does appear to be instantly crashing the server and looping restarting it

Removing the plugins the server loads up fine so not sure whats going on and will do some more testing tomorrow... tried a bunch tonight including changing the plugin path to use the z:\appdata\ etc instead but that didn't work either, even though my other server is working just fine with the path set that way.

draconb commented 1 year ago

@Devidian hmm I can't even get my old server to work after stopping and restarting it, so not sure what broke, there any logs I should be looking at or way to have it log more?

Devidian commented 1 year ago

You are using stable branch when i see that correctly. I only tested staging branch and had no problems. Maybe you try staging image? If thats working i'll test main branch when i have some time by myself.

draconb commented 1 year ago

Omg I'm a dummy, I'd removed the 0Harmony.dll forgetting that its referenced by the other dlls even when its not directly called. So it was failing to find it during reflection and thus crashing.