Skip to content

Commit

Permalink
Resolves thijsvanloef#427
Browse files Browse the repository at this point in the history
  • Loading branch information
Dashboy1998 committed Feb 22, 2024
1 parent eb95014 commit 958ecc5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions scripts/helper_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/player_logging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down

0 comments on commit 958ecc5

Please sign in to comment.