13
0
geforkt von Mirrors/Velocity

Obfuscate exceptions from user connection.

Dieser Commit ist enthalten in:
Andrew Steinborn 2018-12-29 10:13:38 -05:00
Ursprung b6944bbec2
Commit 21b20d5dc3
3 geänderte Dateien mit 2 neuen und 18 gelöschten Zeilen

Datei anzeigen

@ -21,7 +21,6 @@ import com.velocitypowered.proxy.protocol.packet.TabCompleteRequest;
import com.velocitypowered.proxy.protocol.packet.TabCompleteResponse;
import com.velocitypowered.proxy.protocol.packet.TitlePacket;
import com.velocitypowered.proxy.protocol.util.PluginMessageUtil;
import com.velocitypowered.proxy.util.ThrowableUtils;
import io.netty.buffer.ByteBuf;
import java.util.ArrayDeque;
import java.util.ArrayList;
@ -246,11 +245,8 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
@Override
public void exception(Throwable throwable) {
player.disconnect(TextComponent.builder()
.content("An exception occurred in your connection: ")
.color(TextColor.RED)
.append(TextComponent.of(ThrowableUtils.briefDescription(throwable), TextColor.WHITE))
.build());
player.disconnect(TextComponent.of("Your connection has encountered an error. Try again later.",
TextColor.RED));
}
@Override

Datei anzeigen

@ -41,7 +41,6 @@ import com.velocitypowered.proxy.protocol.packet.PluginMessage;
import com.velocitypowered.proxy.protocol.packet.TitlePacket;
import com.velocitypowered.proxy.server.VelocityRegisteredServer;
import com.velocitypowered.proxy.tablist.VelocityTabList;
import com.velocitypowered.proxy.util.ThrowableUtils;
import java.net.InetSocketAddress;
import java.util.Collections;
import java.util.List;

Datei anzeigen

@ -1,11 +0,0 @@
package com.velocitypowered.proxy.util;
public class ThrowableUtils {
private ThrowableUtils() {
throw new AssertionError();
}
public static String briefDescription(Throwable throwable) {
return throwable.getClass().getSimpleName() + ": " + throwable.getMessage();
}
}