Skip to content

Commit 22de0ae

Browse files
authored
fix: correctly replace placeholders in syncproxy tablist (#1254)
### 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.
1 parent 999655f commit 22de0ae

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/syncproxy/src/main/java/eu/cloudnetservice/modules/syncproxy/platform/PlatformSyncProxyManagement.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,11 @@ public boolean checkPlayerMaintenance(@NonNull P player) {
290290
int onlinePlayers,
291291
int maxPlayers
292292
) {
293-
input = BridgeServiceHelper.fillCommonPlaceholders(input, null, this.serviceInfoHolder.serviceInfo())
294-
.replace("%time%", TIME_FORMATTER.format(LocalTime.now()))
295-
.replace("%online_players%", String.valueOf(onlinePlayers))
296-
.replace("%max_players%", String.valueOf(maxPlayers))
293+
input = input.replace("%time%", TIME_FORMATTER.format(LocalTime.now()))
294+
.replace("%syncproxy_online_players%", String.valueOf(onlinePlayers))
295+
.replace("%syncproxy_max_players%", String.valueOf(maxPlayers))
297296
.replace("%player_name%", this.playerName(player));
297+
input = BridgeServiceHelper.fillCommonPlaceholders(input, null, this.serviceInfoHolder.serviceInfo());
298298

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

0 commit comments

Comments
 (0)