Skip to content

Commit

Permalink
Merge pull request #10 from jsknnr/dev
Browse files Browse the repository at this point in the history
add ability to specify backup and saving intervals
  • Loading branch information
jsknnr authored Jul 12, 2024
2 parents 7288d83 + 44fb5a9 commit d1eb976
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 12 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Game ports are arbitrary. You can use which ever values you want above 1000. Mak
| GAME_PORT | Port for server connections | 27050 | False |
| QUERY_PORT | Port for steam query of server | 27051 | False |
| SERVER_SLOTS | Number of slots for connections (Max 70) | 50 | False |
| BACKUP | Specifies the interval for writing the game database to disk (unit: seconds) | 900 | False |
| SAVING | Specifies the interval for writing game objects to the database (unit: seconds) | 600 | False |
| LISTEN_ADDRESS | IP address for server to listen on | 0.0.0.0 | False |

### Docker
Expand Down Expand Up @@ -99,6 +101,8 @@ GAME_PORT="27050"
QUERY_PORT="27051"
SERVER_SLOTS="50"
LISTEN_ADDRESS="0.0.0.0"
BACKUP=900
SAVING=600
```

### Podman
Expand Down
24 changes: 13 additions & 11 deletions container/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@ ARG MAINTAINER="https://github.com/jsknnr/soulmask-dedicated-server"
ARG CONTAINER_GID=10000
ARG CONTAINER_UID=10000

ENV DEBIAN_FRONTEND "noninteractive"
ENV SOULMASK_PATH "/home/steam/soulmask"
ENV STEAMCMD_PATH "/home/steam/steamcmd"
ENV STEAM_SDK64_PATH "/home/steam/.steam/sdk64"
ENV STEAM_APP_ID "3017300"

ENV GAME_PORT "27050"
ENV QUERY_PORT "27051"
ENV SERVER_SLOTS "50"
ENV LISTEN_ADDRESS "0.0.0.0"
ENV SERVER_LEVEL "Level01_Main"
ENV DEBIAN_FRONTEND="noninteractive"
ENV SOULMASK_PATH="/home/steam/soulmask"
ENV STEAMCMD_PATH="/home/steam/steamcmd"
ENV STEAM_SDK64_PATH="/home/steam/.steam/sdk64"
ENV STEAM_APP_ID="3017300"

ENV GAME_PORT="27050"
ENV QUERY_PORT="27051"
ENV SERVER_SLOTS="50"
ENV LISTEN_ADDRESS="0.0.0.0"
ENV SERVER_LEVEL="Level01_Main"
ENV BACKUP=900
ENV SAVING=600

RUN groupadd -g ${CONTAINER_GID} steam \
&& useradd -g ${CONTAINER_GID} -u ${CONTAINER_UID} -m steam \
Expand Down
2 changes: 2 additions & 0 deletions container/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ GAME_PORT="27050"
QUERY_PORT="27051"
SERVER_SLOTS="50"
LISTEN_ADDRESS="0.0.0.0"
BACKUP=900
SAVING=600
4 changes: 3 additions & 1 deletion container/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ fi

# Build launch arguments
echo "$(timestamp) INFO: Constructing launch arguments"
LAUNCH_ARGS="${SERVER_LEVEL} -server -SILENT -SteamServerName=${SERVER_NAME} -${GAME_MODE} -MaxPlayers=${SERVER_SLOTS} -backup=900 -saving=600 -log -UTF8Output -MULTIHOME=${LISTEN_ADDRESS} -Port=${GAME_PORT} -QueryPort=${QUERY_PORT} -online=Steam -forcepassthrough -adminpsw=${ADMIN_PASSWORD}"
LAUNCH_ARGS="${SERVER_LEVEL} -server -SILENT -SteamServerName=${SERVER_NAME} -${GAME_MODE} -MaxPlayers=${SERVER_SLOTS} -backup=${BACKUP} -saving=${SAVING} -log -UTF8Output -MULTIHOME=${LISTEN_ADDRESS} -Port=${GAME_PORT} -QueryPort=${QUERY_PORT} -online=Steam -forcepassthrough -adminpsw=${ADMIN_PASSWORD}"

if [ -n "${SERVER_PASSWORD}" ]; then
LAUNCH_ARGS="${LAUNCH_ARGS} -PSW=${SERVER_PASSWORD}"
Expand Down Expand Up @@ -108,6 +108,8 @@ echo "Game Port: ${GAME_PORT}"
echo "Query Port: ${QUERY_PORT}"
echo "Server Slots: ${SERVER_SLOTS}"
echo "Listen Address: ${LISTEN_ADDRESS}"
echo "Database Backup (seconds): ${BACKUP}"
echo "World Save (seconds): ${SAVING}"
echo "Container Image Version: ${IMAGE_VERSION} "
echo "--------------------------------------------------------------------------------"
echo ""
Expand Down
4 changes: 4 additions & 0 deletions helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ spec:
value: {{ .Values.config.listenAddress | quote }}
- name: SERVER_SLOTS
value: {{ .Values.config.serverSlots | quote }}
- name: BACKUP
value: {{ .Values.config.backup }}
- name: SAVING
value: {{ .Values.config.saving }}
ports:
- name: game-port
containerPort: {{ .Values.config.gamePort | int }}
Expand Down
2 changes: 2 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ config:
queryPort: 27051
serverSlots: 50
listenAddress: 0.0.0.0
backup: 900
saving: 600

0 comments on commit d1eb976

Please sign in to comment.