From f9843057badf67b595b543d7307aa6c139b2f2b2 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Tue, 11 Dec 2018 01:50:29 -0500 Subject: [PATCH] Anonymize all exception/connection-related errors from the user. We still print these out in the logs. --- .../proxy/connection/client/ConnectedPlayer.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java index 9a7e32e8f..d6bcb58f7 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java @@ -306,20 +306,17 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player { wrapped = cause; } } - String error = ThrowableUtils.briefDescription(wrapped); String userMessage; if (connectedServer != null && connectedServer.getServerInfo().equals(server.getServerInfo())) { - userMessage = "Exception in server " + server.getServerInfo().getName(); + userMessage = "Your connection to " + server.getServerInfo().getName() + " encountered an " + + " error."; } else { logger.error("{}: unable to connect to server {}", this, server.getServerInfo().getName(), wrapped); - userMessage = "Can't connect to server " + server.getServerInfo().getName(); + userMessage = "Unable to connect to " + server.getServerInfo().getName() + ". Try again " + + "later."; } - handleConnectionException(server, null, TextComponent.builder() - .content(userMessage + ": ") - .color(TextColor.RED) - .append(TextComponent.of(error, TextColor.WHITE)) - .build()); + handleConnectionException(server, null, TextComponent.of(userMessage, TextColor.RED)); } public void handleConnectionException(RegisteredServer server, Disconnect disconnect) {