Skip to content

Commit

Permalink
Merge pull request #4 from kadrim/improve-docker-setup-and-allow-runn…
Browse files Browse the repository at this point in the history
…ing-on-linux

Improve docker setup and allow running on linux
  • Loading branch information
kadrim authored Dec 26, 2024
2 parents 75001e9 + 93a3636 commit 67ae662
Show file tree
Hide file tree
Showing 12 changed files with 143 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
Thumbs.db
ME3Server_WV/bin/Debug/logs/
/data/
/compose.override.yaml
10 changes: 7 additions & 3 deletions Docker/SSLv3Proxy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
FROM ubuntu:trusty

WORKDIR /sslv3-proxy
FROM ubuntu:14.04

RUN apt-get update && apt-get install -y nodejs && apt-get clean

RUN useradd -ms /bin/bash appuser

USER appuser

WORKDIR /sslv3-proxy

COPY SSLv3Proxy/. .

ENV LOCAL_FQDN=false
Expand Down
27 changes: 27 additions & 0 deletions Docker/Syndicate2012PSE/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM ubuntu:20.04

RUN dpkg --add-architecture i386 && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y wine32 winetricks xvfb && apt-get clean

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y net-tools && apt-get clean

RUN useradd -ms /bin/bash appuser

WORKDIR /syndicate2012-pse

RUN chown -R appuser:appuser .

USER appuser

RUN winetricks -q dotnet452

COPY --chown=appuser Docker/Syndicate2012PSE/startup.sh .

RUN chmod +x startup.sh

COPY --chown=appuser ./ ./

ENV HEADLESS=true

EXPOSE 14219 42130

CMD [ "./startup.sh" ]
27 changes: 27 additions & 0 deletions Docker/Syndicate2012PSE/Dockerfile.debug
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM ubuntu:20.04

RUN dpkg --add-architecture i386 && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y wine32 winetricks xvfb && apt-get clean

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y net-tools && apt-get clean

RUN useradd -ms /bin/bash appuser

WORKDIR /syndicate2012-pse

RUN chown -R appuser:appuser .

USER appuser

RUN winetricks -q dotnet452

COPY --chown=appuser Docker/Syndicate2012PSE/startup.sh .

RUN chmod +x startup.sh

COPY --chown=appuser ME3Server_WV/bin/Debug/ ./

ENV HEADLESS=true

EXPOSE 14219 42130

CMD [ "./startup.sh" ]
20 changes: 20 additions & 0 deletions Docker/Syndicate2012PSE/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
services:
syndicate2012-pse:
build:
context: ../..
dockerfile: Docker/Syndicate2012PSE/Dockerfile.debug
environment:
HEADLESS: true
DISPLAY: $DISPLAY
WAYLAND_DISPLAY: $WAYLAND_DISPLAY
XDG_RUNTIME_DIR: $XDG_RUNTIME_DIR
network_mode: host
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
- '../../ME3Server_WV/bin/Debug/cert:/syndicate2012-pse/cert'
- '../../ME3Server_WV/bin/Debug/conf:/syndicate2012-pse/conf'
- '../../ME3Server_WV/bin/Debug/http:/syndicate2012-pse/http'
- '../../ME3Server_WV/bin/Debug/logs:/syndicate2012-pse/logs'
- '../../ME3Server_WV/bin/Debug/patch:/syndicate2012-pse/patch'
- '../../ME3Server_WV/bin/Debug/player:/syndicate2012-pse/player'
- '../../ME3Server_WV/bin/Debug/replay:/syndicate2012-pse/replay'
10 changes: 10 additions & 0 deletions Docker/Syndicate2012PSE/startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

if [ "$HEADLESS" == "true" ]
then
echo "Running in headless mode"
xvfb-run wine Syndicate2012Server.exe
else
echo "Running in GUI mode"
wine Syndicate2012Server.exe
fi
10 changes: 7 additions & 3 deletions Docker/Xenia-WebServices/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
FROM node:20-alpine

RUN addgroup -S appgroup && adduser -S appuser -G appgroup

WORKDIR /xenia-web-service

COPY submodules/Xenia-WebServices/package*.json ./
COPY submodules/Xenia-WebServices/. .

RUN npm install
RUN chown -R appuser:appgroup .

COPY submodules/Xenia-WebServices/. .
USER appuser

RUN npm install

RUN npm run build

Expand Down
4 changes: 2 additions & 2 deletions ME3Server_WV/ME3Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@ public static void threadHttpListener(object objs)
{
string IP = Config.FindEntry("IP");
if (IP == "")
HttpListener = new TcpListener(IPAddress.Parse("127.0.0.1"), 80);
HttpListener = new TcpListener(IPAddress.Parse("127.0.0.1"), 8088);
else
HttpListener = new TcpListener(IPAddress.Parse(IP), 80);
HttpListener = new TcpListener(IPAddress.Parse(IP), 8088);
HttpListener.Start();
Logger.Log("[Http Listener] Started listening on " + EndpointToString(HttpListener.LocalEndpoint), Color.Black);
int counter = 0;
Expand Down
6 changes: 3 additions & 3 deletions ME3Server_WV/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Syndicate2012Server")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.0.0")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyVersion("0.2.0.0")]
[assembly: AssemblyFileVersion("0.2.0.0")]
11 changes: 4 additions & 7 deletions ME3Server_WV/bin/Debug/cleanup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@ del ME3PlayerDataEditor.pdb
del ME3PlayerDataEditor.xml
del PLAYER_FILES.txt
del ME3Server_WV.pdb
del ME3Server_WV.vshost.exe
del ME3Server_WV.vshost.exe.config
del ME3Server_WV.vshost.exe.manifest
del Syndicate2012Server.exe
del Syndicate2012Server.exe.config
del Syndicate2012Server.manifest
del Syndicate2012Server.pdb
del zlib.net.pdb
cd logs
del *.* /F /Q
cd ..
cd player
del *.* /F /Q
cd gaw
del *.* /F /Q
15 changes: 15 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ Edit `docker-compose.yml` again and set the value of `LOCAL_FQDN` to `true`. Sto

#### Known Issues

For help visit the official [Discord-Channel](https://discord.gg/6SmVQy8T)

##### Timeout on Server and In-Game

If you see the In-Game message `The request timed out. You are being returned to the main menu.` and also in the Server-Log the message: `[Main Server Handler #] Player Timed Out`, this is most likely due to an existing silentLogin in your game-client.
Expand All @@ -93,6 +95,19 @@ Then open the file `player/tester.txt` and replace `UID` and `PID` with the Hex-
- Edit the file `xenia-canary-netplay.config.toml` and set the value of `api_address` to `api_address = "<YOUR-IP-ADDRESS>:36000/"`, i.e. `api_address = "192.168.1.100:36000/"`
- Then start xenia again and launch the game

### Linux Support

The game itself runs pretty decent on `SteamOS` and `Ubuntu` using [Steam](https://store.steampowered.com/about/) (add Syndicate as a non-steam game) and by turning on the compatibility using `Proton` (i.e. Proton 9.0-4).

To use the Server on a Linux machine you simply have to copy the file `linux/compose.override.yaml` to the root directory of this project (so one directory up). If you are running this on a desktop with GUI you can enable the GUI by editing the copied file and setting `HEADLESS` to `false`.

Afterwards rebuild and rerun the services by executing:

```
docker compose build
docker compose up
```

## Todos

- Fix Coop / Multiplayer for Xbox360
Expand Down
20 changes: 20 additions & 0 deletions linux/compose.override.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
services:
syndicate2012-pse:
build:
context: .
dockerfile: Docker/Syndicate2012PSE/Dockerfile
environment:
HEADLESS: true
DISPLAY: $DISPLAY
WAYLAND_DISPLAY: $WAYLAND_DISPLAY
XDG_RUNTIME_DIR: $XDG_RUNTIME_DIR
network_mode: host
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
- './cert:/syndicate2012-pse/cert'
- './conf:/syndicate2012-pse/conf'
- './http:/syndicate2012-pse/http'
- './logs:/syndicate2012-pse/logs'
- './patch:/syndicate2012-pse/patch'
- './player:/syndicate2012-pse/player'
- './replay:/syndicate2012-pse/replay'

0 comments on commit 67ae662

Please sign in to comment.