3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-17 05:20:14 +01:00

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