From 4ae99ba9d5511281489cb6f938664fb0bc3d1b4e Mon Sep 17 00:00:00 2001 From: Jitse Boonstra Date: Wed, 15 Apr 2020 22:04:31 +0200 Subject: [PATCH] Some testing code I'd like to keep. --- api/pom.xml | 6 ------ .../comphenix/tinyprotocol/TinyProtocol.java | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index 74058b3..13d1c9b 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -31,12 +31,6 @@ 1.15.2-R0.1-SNAPSHOT provided - - org.spigotmc - spigot - 1.15.2-R0.1-SNAPSHOT - provided - com.mojang authlib diff --git a/api/src/main/java/com/comphenix/tinyprotocol/TinyProtocol.java b/api/src/main/java/com/comphenix/tinyprotocol/TinyProtocol.java index 04fdb02..5038fda 100644 --- a/api/src/main/java/com/comphenix/tinyprotocol/TinyProtocol.java +++ b/api/src/main/java/com/comphenix/tinyprotocol/TinyProtocol.java @@ -291,6 +291,11 @@ public abstract class TinyProtocol { } } + // Keeping this here for testing purposes: +// public Object onPacketOutAsync(Player receiver, Channel channel, Object packet) { +// return packet; +// } + private final class PacketInterceptor extends ChannelDuplexHandler { // Updated by the login event public volatile Player player; @@ -312,6 +317,20 @@ public abstract class TinyProtocol { } } + // Keeping this here for testing purposes: +// @Override +// public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { +// try { +// msg = onPacketOutAsync(player, ctx.channel(), msg); +// } catch (Exception e) { +// instance.getLogger().severe("Error in onPacketOutAsync().", e); +// } +// +// if (msg != null) { +// super.write(ctx, msg, promise); +// } +// } + private void handleLoginStart(Channel channel, Object packet) { if (PACKET_LOGIN_IN_START.isInstance(packet)) { GameProfile profile = getGameProfile.get(packet);