Skip to content

Commit

Permalink
fix: correctly replace placeholders in syncproxy tablist (#1254)
Browse files Browse the repository at this point in the history
### Motivation
Due to recent changes in syncproxy placeholders the wrong replacements
were used.

### Modification
Replaced `max_players` and `online_players` before giving it into the
common replacer as it might use wrong values.

### Result
The replacements are correct and the displayed values too.
  • Loading branch information
0utplay authored Jul 9, 2023
1 parent 999655f commit 22de0ae
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,11 @@ public boolean checkPlayerMaintenance(@NonNull P player) {
int onlinePlayers,
int maxPlayers
) {
input = BridgeServiceHelper.fillCommonPlaceholders(input, null, this.serviceInfoHolder.serviceInfo())
.replace("%time%", TIME_FORMATTER.format(LocalTime.now()))
.replace("%online_players%", String.valueOf(onlinePlayers))
.replace("%max_players%", String.valueOf(maxPlayers))
input = input.replace("%time%", TIME_FORMATTER.format(LocalTime.now()))
.replace("%syncproxy_online_players%", String.valueOf(onlinePlayers))
.replace("%syncproxy_max_players%", String.valueOf(maxPlayers))
.replace("%player_name%", this.playerName(player));
input = BridgeServiceHelper.fillCommonPlaceholders(input, null, this.serviceInfoHolder.serviceInfo());

if (SyncProxyConstants.CLOUD_PERMS_ENABLED) {
var permissionUser = this.permissionManagement.user(this.playerUniqueId(player));
Expand Down

0 comments on commit 22de0ae

Please sign in to comment.