Skip to content

Commit

Permalink
fix, use dev version
Browse files Browse the repository at this point in the history
  • Loading branch information
kimzuni committed Apr 21, 2024
1 parent f4f5ff2 commit a478336
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/developer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Developer image
on: # yamllint disable-line rule:truthy
push:
branches: [dev]
branches: [main]

jobs:
push:
Expand Down Expand Up @@ -46,3 +46,5 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
build-args: |
GIT_VERSION_TAG=dev
15 changes: 10 additions & 5 deletions scripts/helper_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,19 @@ container_version_check() {
current_version=$(cat /home/steam/server/GIT_VERSION_TAG)
latest_version=$(get_latest_version)

if [ "${current_version}" != "${latest_version}" ]; then
if [ "${current_version}" == "dev" ]; then
LogWarn "Currently using the dev version."
LogWarn "Recommended to use the latest version: ${latest_version}"
elif [ "${current_version}" != "${latest_version}" ]; then
LogWarn "New version available: ${latest_version}"
LogWarn "Learn how to update the container:"
LogWarn " - English : https://github.com/kimzuni/longvinter-docker-server/tree/main/docs/en/#update-the-container"
LogWarn " - 한국어 : https://github.com/kimzuni/longvinter-docker-server/tree/main/docs/kr/#컨테이너-업데이트-방법"
else
LogSuccess "The container is up to date!"
return
fi

LogWarn "Learn how to update the container:"
LogWarn " - English : https://github.com/kimzuni/longvinter-docker-server/tree/main/docs/en/#update-the-container"
LogWarn " - 한국어 : https://github.com/kimzuni/longvinter-docker-server/tree/main/docs/kr/#컨테이너-업데이트-방법"
}

# Get latest release version from kimzuni/longvinter-docker-server repository
Expand All @@ -218,7 +223,7 @@ get_latest_version() {

# Use it when you have to wait for it to be saved automatically because it does not support RCON.
wait_save() {
local spare="$1"
local spare="${1:-}"

LogAction "Waiting for the server to be saved..."
broadcast_command "Waiting for the server to be saved..." "in-progress"
Expand Down
9 changes: 4 additions & 5 deletions scripts/player_logging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ get_playername() {

LogInfo "Waiting for server start for show player logging..."

joins=()
# joins=()
last_line=0
while true; do
server_pid=$(pidof LongvinterServer-Linux-Shipping)
Expand All @@ -33,8 +33,8 @@ while true; do
*"Join succeeded"* )
# Notify Discord and log all players who have joined
player_name="$(awk -F "Join succeeded: " '{print $NF}' <<< "$log")"
eosid="$(get_eosid "$(grep -m 1 "?Name=$player_name userId:" "$SERVER_LOG_PATH")")"
joins+=("$eosid")
# eosid="$(get_eosid "$(grep -m 1 "?Name=$player_name userId:" "$SERVER_LOG_PATH")")"
# joins+=("$eosid")

LogInfo "${player_name} has joined"

Expand All @@ -45,8 +45,7 @@ while true; do
# Notify Discord and log all players who have left
eosid="$(get_eosid "$log")"
player_name="$(get_playername "$eosid")"
# shellcheck disable=SC2068
mapfile -t joins < <(tr ' ' '\n' <<< "${joins[@]/$eosid}" | grep -v ^$)
# mapfile -t joins < <(tr ' ' '\n' <<< "${joins[@]/$eosid}" | grep -v ^$)

LogInfo "${player_name} has left"

Expand Down

0 comments on commit a478336

Please sign in to comment.