From 958ecc5443efaace481813a88f094eb705e5f9a5 Mon Sep 17 00:00:00 2001 From: "Carlos M. Martinez" Date: Thu, 22 Feb 2024 08:12:06 -0500 Subject: [PATCH] Resolves #427 --- scripts/helper_functions.sh | 3 +-- scripts/player_logging.sh | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/helper_functions.sh b/scripts/helper_functions.sh index 769a174bb..8e5f36a03 100644 --- a/scripts/helper_functions.sh +++ b/scripts/helper_functions.sh @@ -85,8 +85,7 @@ get_players_list() { return_val=1 fi - # tail -n +2 removes the header "name,playeruid,steamid" - RCON "ShowPlayers" | tail -n +2 + RCON "ShowPlayers" return "$return_val" } diff --git a/scripts/player_logging.sh b/scripts/player_logging.sh index a3a0ea2c8..371229300 100644 --- a/scripts/player_logging.sh +++ b/scripts/player_logging.sh @@ -18,7 +18,7 @@ while true; do if [ "${#server_pids[@]}" -ne 0 ]; then # Player IDs are usally 9 or 10 digits however when a player joins for the first time for a given boot their ID is temporary 00000000 (8x zeros) while loading # Player ID is also 00000000 (8x zeros) when in character creation - mapfile -t new_player_list < <( get_players_list | sed '/,00000000,[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/d' ) + mapfile -t new_player_list < <( get_players_list | tail -n +2 | sed '/,00000000,[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/d' ) # See players whose states have changed mapfile -t players_change_list < <( printf '%s\n' "${old_player_list[@]}" "${new_player_list[@]}" | sort | uniq -u )