From 95438c18619d9823874b520817ef8ef3d2742981 Mon Sep 17 00:00:00 2001 From: "Kristian S. Stangeland" Date: Thu, 17 Jan 2013 12:26:39 +0100 Subject: [PATCH] Throw an exception the caller can handle instead of a warning message. This should prevent possible spam by plugins that are not aware that a player has either logged out, or is not injected due to a bug in ProtocolLib. --- .../protocol/injector/player/PlayerInjectionHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/PlayerInjectionHandler.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/PlayerInjectionHandler.java index 3722e4f5..afe058eb 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/PlayerInjectionHandler.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/PlayerInjectionHandler.java @@ -486,7 +486,7 @@ public class PlayerInjectionHandler { if (injector != null) injector.sendServerPacket(packet.getHandle(), filters); else - reporter.reportWarning(this, String.format( + throw new PlayerLoggedOutException(String.format( "Unable to send packet %s (%s): Player %s has logged out.", packet.getID(), packet, reciever.getName() )); @@ -507,7 +507,7 @@ public class PlayerInjectionHandler { if (injector != null) injector.processPacket(mcPacket); else - reporter.reportWarning(this, String.format( + throw new PlayerLoggedOutException(String.format( "Unable to receieve packet %s. Player %s has logged out.", mcPacket, player.getName() ));