Skip to content

Commit

Permalink
Throw an exception the caller can handle instead of a warning message.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aadnk committed Jan 17, 2013
1 parent d23a450 commit 95438c1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ public void sendServerPacket(Player reciever, PacketContainer packet, boolean fi
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()
));
Expand All @@ -507,7 +507,7 @@ public void processPacket(Player player, Object mcPacket) throws IllegalAccessEx
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()
));
Expand Down

0 comments on commit 95438c1

Please sign in to comment.