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.
This commit is contained in:
Kristian S. Stangeland 2013-01-17 12:26:39 +01:00
parent d23a45081a
commit 95438c1861

View File

@ -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()
));