geforkt von Mirrors/Velocity
Obfuscate exceptions from user connection.
Dieser Commit ist enthalten in:
Ursprung
b6944bbec2
Commit
21b20d5dc3
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren