Space engineers dedicated server linux

CoffeePirate / se_server_linux.md

You’ll have to change the tag so it point to the correct directory.

If the Save folder is located in

~/.wine/drive_c/users/$(whoami)/Application\ Data/SpaceEngineersDedicated/Saves/Created 2015-03-30 2331 

the tag must look like this, where is the same as $(whoami)

C:\Users\\Application Data\SpaceEngineersDedicated\Default\Saves\Created 2015-03-30 2331 

You still need to use windows paths.

  1. Go to the directory where you have the dedicated server files
  2. wine SpaceEngineersDedicated.exe -console
  • There will be a lot of messages regarding xserver, ignore them
  • Errors like fixme:shell:URL_ParseUrl failed to parse L»System.Core» are okay, ignore them.
  • Be sure to run 32bit, wine doesn’t like the 64bit one.
  • There is a small bug where after stopping the server you will no longer see what you’re typing into the console.
  • This guide is based on the guide I found over at Keen Software House Forums created by AdamAnt

I wasn’t getting that many errors, but I was getting the «Error starting Steam dedicated server» error you get at the end. I spent several hours trying to get it working with wine5.0, then several more hours trying to get it working with a re-installed wine1.6 to no avail.

In the end, I simply installed a windows virtual machine and am running the server from there. Seems to work fine — if not better!

The latest proton (5.0 at the time) can run the client, with a tweak to pulseaudio. The wine it’s based on may work.

by following @tvwenger ‘s post I got the most recent SEdedicatedServer 64bit 1.195 running on Debian 10:

Requirements (older versions did not work for me):

  • latest wine from winehq wine-staging branch
  • latest winetricks from git repo (at time of writing: https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks )
  • xvfb when you later want to use the prefix on an headless server
  • create fresh 64bit prefix
  • install dotnet48 (you probably need a working xserver not xvfb to click through the installer dialog)
  • install vcrun2013 (same as above)
  • install vcrun2015 (same as above)
Читайте также:  BEEF HACKING

and ignore all occuring error messages 😄 , especially for dotnet48 there will be many.

copy the common/SpaceEngineersDedicatedServer directory from your Windows machine into the wineprefix

launch once with while beeing in the . /drive_c/. /Steam/steamapps/common/SpaceEngineersDedicatedServer directory !important!
and make sure that enviroment variable WINEPREFIX is set correctly.
/usr/bin/xvfb-run /usr/bin/wine ./DedicatedServer64/SpaceEngineersDedicated.exe
so that
~/.wine/drive_c/users/$(whoami)/Application\ Data/SpaceEngineersDedicated
is created

copy the stuff from your windows machine over to the folder, and launch
/usr/bin/xvfb-run /usr/bin/wine ./DedicatedServer64/SpaceEngineersDedicated.exe -console
after you verified that the enviroment variable WINEPREFIX is set correctly.
With another terminal you can check that cpu usage is ~25% on all cores and that the program starts consuming memory.
A log file with the current date will be created in the Application\ Data/SpaceEngineersDedicated directory.

There will be many error messages from wine, but as long as you get a «game ready» somewhere inside the mess after about 30sec you should be fine.

The only thing I could not get working is terminating the server so that it saves the world automatically when launched with systemctl.
In the systemctl service file I call a bash file, because the windows path with Progamm Files (x86) can’t be escaped properly in systemctl.
The bash file (change the cd depending on your wineprefix location):

#!/bin/bash export WINEPREFIX=/opt/spaceeng/winePrefix cd '/opt/spaceeng/winePrefix/drive_c/Program Files (x86)/Steam/steamapps/common/SpaceEngineersDedicatedServer' /usr/bin/xvfb-run /usr/bin/wineconsole ./DedicatedServer64/SpaceEngineersDedicated.exe -console 

Some updates:
Using wine-staging, forcing the installation of dotnet48, usine winecfg and setting os to windows 7 and starting the server with
wineconsole ./DedicatedServer64/SpaceEngineersDedicated.exe -noconsole
the remote management api port 8080 was opened, according to the log.

The following problems persist:

  • the server does not respond to any requests on the management port, even though netstat reports a listening port
  • quitting the server with CTRL+C or any other way will produce an autosave entry in the log, but the FileWriterThread seems to crash prematurely, therefore the autosave on shutdown is lost.
Читайте также:  Plugins for linux samp

I experimented with the remote management api and managed to remotely initiate a save over the network when running nativeley on windows with an http PATCH request to the remote management api, by slightly modifying this git project: https://github.com/chris007de/pyvrageremoteapi .

In this line https://github.com/chris007de/pyvrageremoteapi/blob/b6c48468d12c5739f9b5a1b4a4f9b47aaed10a27/pyvrageremoteapi.py#L89 GET must be changed to PATCH and then calling
python pyvrageremoteapi.py —url http://localhost:8080 —key XKb8xk7vrKaq+BpallYnGA== —resource session
will trigger an autosave.

So the idea was to launch this python script before the systemctl service goes down, but unfortunately the dedicated server’s remote management port does not work.

So If someone get’s the remote management port to work please share it here.

I found a kind of hacky solution. By checking the directory where the savefiles go for new files one can time the termination of the server with a upcoming autosave. The disadvantage is that this can take a while, depending on the autosave intervall. (You can force a save as admin with /save in the chat 😄 )
Here the systemctl user files, in case someone might find them helpfull:
spaceeng.service at ~/.config/systemd/user/spaceeng.service

[Unit] Description="Space Engineers wine server" Requires=xvfb.service After=xvfb.service [Service] Environment=DISPLAY=:1.0 Environment=WINEPREFIX=/opt/spaceeng/winePrefix Type=simple WorkingDirectory=/opt/spaceeng/winePrefix/drive_c/Program Files (x86)/Steam/steamapps/common/SpaceEngineersDedicatedServer KillMode=control-group KillSignal=SIGKILL ExecStart=/usr/bin/wineconsole ./DedicatedServer64/SpaceEngineersDedicated.exe -noconsole ExecStop=/opt/spaceeng/checkSaveUpdate.sh TimeoutSec=0 TimeoutStopSec=700 RemainAfterExit=yes [Install] WantedBy=multi-user.target 

The checkSaveUpdate.sh located at /opt/spaceeng/checkSaveUpdate.sh

#!/bin/bash path='/opt/spaceeng/winePrefix/drive_c/users/yourUsername/Application Data/SpaceEngineersDedicated/Saves' i="" while [ -z "$i" ] do i=$(find "$path" -mmin 0.2) sleep 1 done sleep 15 

And the xvfb file at ~/.config/systemd/user/xvfb.service , if you plan to run headless:

[Unit] Description=X Virtual Frame Buffer Service After=network.target [Service] ExecStart=/usr/bin/Xvfb :1 -screen 0 1024x768x16 [Install] WantedBy=multi-user.target 

To avoid that the user service gets killed when leaving the console which is logged in as that user execute
loginctl enable-linger

Читайте также:  Dr web enterprise security suite astra linux

To shutdown the server just
systemctl —user stop spaceeng
to force a save an Admin on the server can force a save by sending
/save
in the chat, if you don’t want to wait for the next autosave.

Also a note, if it starts and crashes with the following message in the log:

MyDefinitionManager.GetSessionPreloadDefinitions() - START 2020-12-19 20:53:07.557 - Thread: 1 -> World Sandbox.sbc not found. 2020-12-19 20:53:07.557 - Thread: 1 -> Creating new one with same name 2020-12-19 20:53:07.567 - Thread: 1 -> Cannot start new world - Premade world not found 2020-12-19 20:53:07.568 - Thread: 1 -> MySandboxGame.Initialize() - END 2020-12-19 20:53:07.601 - Thread: 1 -> Exception occurred: System.ApplicationException: Session can not start. Save is corrupted or not valid. See log file for more information. at Sandbox.MySandboxGame.Run(Boolean customRenderLoop, Action disposeSplashScreen) at VRage.Dedicated.DedicatedServer.RunInternal(String instanceName) at VRage.Dedicated.DedicatedServer.RunMain(String instanceName, String customPath, Boolean isService, Boolean showConsole, Boolean checkAlive) at VRage.Dedicated.DedicatedServer.ProcessArgs(String[] args) at VRage.Dedicated.DedicatedServer.Run(String[] args, Action`1 initializeServices) at SpaceEngineersDedicated.MyProgram.Main(String[] args) 

Then you need to edit the file in Application Data/SpaceEngineersDedicated/Saves/LastSession.sbl
and change the line from
C:\Users\myUsername\AppData\Roaming\SpaceEngineersDedicated\Saves\Star System
to
C:\Users\myUsername\Application Data\SpaceEngineersDedicated\Saves\Star System

Further convinience, an automatic update service that finally works:

[Unit] Description="Space Engineers Updater" [Service] Type=simple WorkingDirectory=/home/userName ExecStart=/usr/games/steamcmd +@sSteamCmdForcePlatformType windows +force_install_dir /opt/spaceeng/winePrefix/drive_c/Steamdir/steamapps/common/SpaceEngineersDedicatedServer/ +login anonymous +app_update 298740 +quit RemainAfterExit=yes [Install] WantedBy=multi-user.target 

But you need to create the softlink /opt/spaceeng/winePrefix/drive_c/Steamdir which points to /opt/spaceeng/winePrefix/drive_c/Program Filex (x86)/Steam, because steamcmd seems to choke on spaces in the path.

Источник

Оцените статью
Adblock
detector