Skip to content

Commit 5448b12

Browse files
authored
Merge pull request #115 from Diyagi/main
Add activateallcontent flag, revert #114 and some fixes
2 parents f12e0e2 + 2fbdcf8 commit 5448b12

6 files changed

Lines changed: 46 additions & 31 deletions

File tree

Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,14 @@ RUN set -x \
3636
jq \
3737
gettext-base \
3838
unzip \
39-
libatomic1 \
40-
libpulse0 \
41-
wget \
39+
wget \
4240
&& rm -rf /var/lib/apt/lists/*
4341

4442
RUN case "${TARGETARCH}" in \
45-
"arm64") apt-get update \
43+
"arm64") dpkg --add-architecture amd64 \
44+
&& apt-get update \
4645
&& apt-get install -y --no-install-recommends --no-install-suggests \
47-
libmonosgen-2.0-1 \
46+
libmonosgen-2.0-dev:amd64 \
4847
libdbus-1-3 \
4948
libxcursor1 \
5049
libxinerama1 \
@@ -108,6 +107,7 @@ ENV PUID=1000 \
108107
SERVER_IP="" \
109108
SERVER_PORT="" \
110109
PASSWORD="" \
110+
ACTIVATE_ALL_CONTENT=false \
111111
ALLOW_ONLY_PLATFORM="" \
112112
DISCORD_WEBHOOK_URL="" \
113113
# Player Join

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ These are the arguments you can use to customize server behavior with default va
101101
| SERVER_IP | No Default | Only used if port is set. Sets the address that the server will bind to. Supports ipv4 and ipv6 addresses. If not set, default value 0.0.0.0 is used, which will accept connections from any internal ip. |
102102
| SERVER_PORT | No Default | Port used for direct connection mode. **Setting an value to this will cause the server behaviour to change!** [See Network Mode](#network-mode) |
103103
| PASSWORD | No Default | Password players should use when trying to join using direct connections. Maximum length password can be 28 characters. If omitted or invalid, a random password will be generated.|
104+
| ACTIVATE_CONTENT | "" | Comma separated list to turn on biomes for worlds created prior to v1.1. Valid values are `GiantCicadaBossDungeon`, `NatureBiomeCicadas`, `GuaranteedOases`, `BiomeStatues`, and `AbioticFactor`. Once enabled, they cannot be disabled! |
105+
| ACTIVATE_ALL_CONTENT | false | Same as `ACTIVATE_CONTENT` but activates all content bundles. |
104106
| ALLOW_ONLY_PLATFORM | No Default | Allow only players from given platform. If not set all platforms are allowed. Has no effect unless -port is also set enabling Direct Connections. Can be Steam (1), Epic (2), Microsoft (3), GOG (4). |
105107
| DISCORD_WEBHOOK_URL | "" | Webhook url (Edit channel > Integrations > Create Webhook). |
106108
| DISCORD_PLAYER_JOIN_ENABLED | true | Enable/Disable message on player join |
@@ -123,8 +125,6 @@ These are the arguments you can use to customize server behavior with default va
123125
| MODIO_API_KEY | "" | mod.io API key |
124126
| MODIO_API_URL | "" | mod.io API path |
125127
| MODS | "" | List of mods to install |
126-
| ACTIVATE_CONTENT | "" | Comma separated list to turn on biomes for worlds created prior to v1.1. Valid values are `GiantCicadaBossDungeon`, `NatureBiomeCicadas`, `GuaranteedOases`, and `AbioticFactor`. Once enabled, they cannot be disabled! |
127-
128128
## Mod Support
129129

130130
The container supports automatically installing mods from [mod.io](https://mod.io/g/corekeeper).

docker-compose-example/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ SERVER_IP=""
1313
# Port and Password are only needed if using direct connect mode
1414
#SERVER_PORT="27015"
1515
#PASSWORD=""
16+
ACTIVATE_ALL_CONTENT=false
1617
DISCORD_WEBHOOK_URL=""
1718
# Player Join
1819
DISCORD_PLAYER_JOIN_ENABLED=true

scripts/compile-parameters.sh

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,39 @@ add_param() {
1414
fi
1515
}
1616

17+
# Function to add flags to parameter array
18+
# usage: add_flag <name> <$env_value>
19+
add_flag() {
20+
local flag_name="$1"
21+
local flag_value="$2"
22+
23+
if [ "${flag_value,,}" = "true" ]; then
24+
params+=("$flag_name")
25+
fi
26+
}
27+
1728
# Makes log file avaliable for other uses.
1829
logfile="${STEAMAPPDIR}/logs/$(date '+%Y-%m-%d_%H-%M-%S').log"
1930
params=(
2031
"-batchmode"
2132
"-logfile" "$logfile"
2233
)
2334

24-
add_param "-world" "${WORLD_INDEX}"
25-
add_param "-worldname" "${WORLD_NAME}"
26-
add_param "-worldseed" "${WORLD_SEED}"
27-
add_param "-worldmode" "${WORLD_MODE}"
28-
add_param "-hashedworldseed" "${HASHED_WORLD_SEED}"
29-
add_param "-gameid" "${GAME_ID}"
30-
add_param "-datapath" "${DATA_PATH:-${STEAMAPPDATADIR}}"
31-
add_param "-maxplayers" "${MAX_PLAYERS}"
32-
add_param "-season" "${SEASON}"
33-
add_param "-ip" "${SERVER_IP}"
34-
add_param "-port" "${SERVER_PORT}"
35-
add_param "-activatecontent" "${ACTIVATE_CONTENT}"
36-
add_param "-password" "${PASSWORD}"
37-
add_param "-allowonlyplatform" "${ALLOW_ONLY_PLATFORM}"
35+
add_param "-world" "${WORLD_INDEX}"
36+
add_param "-worldname" "${WORLD_NAME}"
37+
add_param "-worldseed" "${WORLD_SEED}"
38+
add_param "-worldmode" "${WORLD_MODE}"
39+
add_param "-hashedworldseed" "${HASHED_WORLD_SEED}"
40+
add_param "-gameid" "${GAME_ID}"
41+
add_param "-datapath" "${DATA_PATH:-${STEAMAPPDATADIR}}"
42+
add_param "-maxplayers" "${MAX_PLAYERS}"
43+
add_param "-season" "${SEASON}"
44+
add_param "-ip" "${SERVER_IP}"
45+
add_param "-port" "${SERVER_PORT}"
46+
add_param "-activatecontent" "${ACTIVATE_CONTENT}"
47+
add_param "-password" "${PASSWORD}"
48+
add_param "-allowonlyplatform" "${ALLOW_ONLY_PLATFORM}"
49+
50+
add_flag "-activateallcontent" "${ACTIVATE_ALL_CONTENT}"
3851

3952
echo "${params[@]}"

scripts/helper-functions.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ SendDiscordMessage() {
5252
# shellcheck disable=SC2059
5353
"${SCRIPTSDIR}"/discord.sh "$title" "$(printf "$message")" "$color" &
5454
waitpid=$!
55-
fi
5655

57-
if [[ "${wait,,}" == true ]]; then
58-
wait "$waitpid"
56+
if [[ "${wait,,}" == true ]]; then
57+
wait "$waitpid"
58+
fi
5959
fi
6060
}

scripts/launch.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ cd "${STEAMAPPDIR}" || exit
66

77
### Function for gracefully shutdown
88
function kill_corekeeperserver {
9-
if [[ -n "$ckpid" ]]; then
10-
kill $ckpid
11-
wait $ckpid
9+
if [[ -n "$ckpid" ]] && kill -0 "$ckpid" 2>/dev/null; then
10+
kill "$ckpid"
11+
wait "$ckpid"
1212
fi
13-
if [[ -n "$xvfbpid" ]]; then
14-
kill $xvfbpid
15-
wait $xvfbpid
13+
14+
if [[ -n "$xvfbpid" ]] && kill -0 "$xvfbpid" 2>/dev/null; then
15+
kill "$xvfbpid"
16+
wait "$xvfbpid"
1617
fi
1718

1819
# Sends stop message
@@ -45,7 +46,7 @@ architecture=$(dpkg --print-architecture)
4546

4647
# Start Core Keeper Server
4748
if [ "$architecture" == "arm64" ]; then
48-
DISPLAY=:99 LD_LIBRARY_PATH="${STEAMCMDDIR}/linux64:${BOX64_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}" /usr/local/bin/box64 ./CoreKeeperServer "${params[@]}" &
49+
DISPLAY=:99 LD_LIBRARY_PATH="${STEAMCMDDIR}/linux64:/usr/lib:${LD_LIBRARY_PATH#:}" /usr/local/bin/box64 ./CoreKeeperServer "${params[@]}" &
4950
else
5051
DISPLAY=:99 LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${STEAMCMDDIR}/linux64/" ./CoreKeeperServer "${params[@]}" &
5152
fi

0 commit comments

Comments
 (0)