D12-Dev / OpenWorld

A Free Multiplayer Mod For Rimworld
Other
96 stars 17 forks source link

Linux/Docker support #27

Closed Breakingx closed 2 years ago

Breakingx commented 2 years ago

Hey TastyLollipop, thank you very much for this project it runs great on a windows 10 vm. Do you think there will be an alternative for Linux/Docker?

I'm currently running the server as a vm but the power consumption is too high for my taste. Secondly I have a generel question. Would it be possible to sync the mods to the client? I don't like it, that I have to select all the mods manually.

Appreciate your efforts, you are awesome!

pioneer898 commented 2 years ago

FWIW, I have a docker image all set up and ready that I'd love to support, but I can't get the server to launch properly in Linux. I'm getting a null reference exception immediately after "Network Line Started" and I'm not quite sure where to go from there. I'm wondering if I am missing a dependency.

open-world_1 | [5/11/2022 1:08:01 PM] │ Server Startup: open-world_1 | [5/11/2022 1:08:01 PM] │ Using Culture Info: [en-US] open-world_1 | [5/11/2022 1:08:01 PM] │ Base Directory At: [/rimworld/] open-world_1 | [5/11/2022 1:08:02 PM] │ Running Latest Version open-world_1 | [5/11/2022 1:08:02 PM] │ Loaded Settings File open-world_1 | [5/11/2022 1:08:02 PM] │ No Mods Folder Found, Generating open-world_1 | [5/11/2022 1:08:02 PM] │ No Whitelisted Mods Folder Found, Generating open-world_1 | [5/11/2022 1:08:02 PM] │ No Players Folder Found, Generating open-world_1 | [5/11/2022 1:08:02 PM] │ No Bans File Found, Ignoring open-world_1 | [5/11/2022 1:08:02 PM] │ No Whitelisted Players Found, Ignoring open-world_1 | [5/11/2022 1:08:02 PM] │ Loaded World File open-world_1 | [5/11/2022 1:08:02 PM] │ Server Started open-world_1 | [5/11/2022 1:08:02 PM] │ Type 'Help' To See Available Commands open-world_1 | [5/11/2022 1:08:02 PM] │ Network Line Started open-world_1 | open-world_1 | Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object. open-world_1 | at Open_World_Server.MainProgram.ListenForCommands() open-world_1 | at Open_World_Server.MainProgram.Main()

ghost commented 2 years ago

@Breakingx Hello there!

A version for both Linux and Linux ARM distros already exists and can be downloaded from the releases tab, each server release has a variant of it. Docker support is not native by default, but there are people out there that have been able to setup it for easy use.

ghost commented 2 years ago

@pioneer898 Could you please check if you are allowing your docker to listen to server commands? The console is failing to listen to any user input (writing commands on the console, like "help, status, etc."), therefore it crashes

thomas-maurice commented 2 years ago

@pioneer898 @TastyLollipop for what it's worth I managed to run it on docker using the following Dockerfile

FROM debian:latest

RUN apt-get update && \
    apt-get -y upgrade && \
    apt-get install wget curl unzip libicu67 -y && \
    useradd -m openworldserver && \
    cd /home/openworldserver && \
    wget https://github.com/TastyLollipop/OpenWorld/releases/download/1.3.9/LinuxX64_SelfContained.zip && \
    unzip LinuxX64_SelfContained.zip && \
    rm LinuxX64_SelfContained.zip && \
    chmod +x Open\ World\ Server && \
    mv Open\ World\ Server OpenWorldServer && \
    chown -R openworldserver:openworldserver /home/openworldserver 
USER openworldserver
WORKDIR /home/openworldserver
ENTRYPOINT ./OpenWorldServer

And run it like so

$   docker build -t open-rimworld .
$  docker run -dt open-rimworld
1ad27223eab425633979db06fe8403afffb4688b29c3281a99bba814f49a2231
$ docker logs -f 1ad27223eab425633979db06fe8403afffb4688b29c3281a99bba814f49a2231
[5/27/2022 1:57:54 PM] │ Server Startup:
[5/27/2022 1:57:54 PM] │ Using Culture Info: [en-US]
[5/27/2022 1:57:54 PM] │ Base Directory At: [/home/openworldserver/]
[5/27/2022 1:57:54 PM] │ Running Latest Version
[5/27/2022 1:57:54 PM] │ Generating Settings File
[5/27/2022 1:57:54 PM] │ Loaded Settings File
[5/27/2022 1:57:54 PM] │ No Mods Folder Found, Generating
[5/27/2022 1:57:54 PM] │ No Whitelisted Mods Folder Found, Generating
[5/27/2022 1:57:54 PM] │ No Players Folder Found, Generating
[5/27/2022 1:57:54 PM] │ No Bans File Found, Ignoring
[5/27/2022 1:57:54 PM] │ No Whitelisted Players File Found, Generating
[5/27/2022 1:57:54 PM] │ Generating World File
[5/27/2022 1:57:54 PM] │ Loaded World File
[5/27/2022 1:57:54 PM] │ Server Started
[5/27/2022 1:57:54 PM] │ Type 'Help' To See Available Commands
[5/27/2022 1:57:54 PM] │ Network Line Started

^C

Note that it is important to pass the -t flag to allocate a TTY to the container otherwise it will panic because it needs a TTY to be able to run commands.

Hope it helps !

pioneer898 commented 2 years ago

@thomas-maurice

That is exactly what the issue was, thanks!