Skip to content

Commit

Permalink
Update player_logging.sh to replace ${player_name} properly
Browse files Browse the repository at this point in the history
  • Loading branch information
xHyperElectric authored Mar 3, 2024
1 parent 4f50f83 commit 9d4f499
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/player_logging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,19 @@ while true; do
player_name=$( get_playername "${player}" )
LogInfo "${player_name} has left"
broadcast_command "${player_name} has left"
DiscordMessage "Player Left" "${DISCORD_PLAYER_LEAVE_MESSAGE}" "failure"

# Replace ${player_name} with actual player's name
DiscordMessage "Player Left" "${DISCORD_PLAYER_LEAVE_MESSAGE//\$\{player_name\}/${player_name}}" "failure"
done

# Notify Discord and log all players who have joined
for player in "${players_who_joined_list[@]}"; do
player_name=$( get_playername "${player}" )
LogInfo "${player_name} has joined"
broadcast_command "${player_name} has joined"
DiscordMessage "Player Joined" "${DISCORD_PLAYER_JOIN_MESSAGE}" "success"

# Replace ${player_name} with actual player's name
DiscordMessage "Player Joined" "${DISCORD_PLAYER_JOIN_MESSAGE//\$\{player_name\}/${player_name}}" "success"
done

old_player_list=("${current_player_list[@]}")
Expand Down

0 comments on commit 9d4f499

Please sign in to comment.