13
0
geforkt von Mirrors/Velocity

Merge pull request #161 from VelocityPowered/anonymize-user-disconnect-messages

Anonymize all exception/connection-related errors from the user.
Dieser Commit ist enthalten in:
Andrew Steinborn 2018-12-14 13:11:51 -05:00 committet von GitHub
Commit 9a15a80627
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -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) {