From 4525d168422f829fd2379daa61b7541d99bfd9da Mon Sep 17 00:00:00 2001 From: Tony Date: Tue, 5 Apr 2011 18:56:45 -0500 Subject: [PATCH] Prevent nasty connection errors from hitting the console. --- src/main/java/net/minecraft/server/Packet.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/net/minecraft/server/Packet.java b/src/main/java/net/minecraft/server/Packet.java index 0045b1f6cd..1e6cdc14ae 100644 --- a/src/main/java/net/minecraft/server/Packet.java +++ b/src/main/java/net/minecraft/server/Packet.java @@ -6,6 +6,10 @@ import java.io.EOFException; import java.io.IOException; import java.util.HashMap; import java.util.Map; +// Craftbukkit start +import java.net.SocketException; +import java.net.SocketTimeoutException; +// Craftbukkit end public abstract class Packet { @@ -86,6 +90,16 @@ public abstract class Packet { return null; } + // Craftbukkit start + catch (SocketTimeoutException exception) { + System.out.println("Read timed out"); + return null; + } catch (SocketException exception) { + System.out.println("Connection reset"); + return null; + } + // Craftbukkit end + PacketCounter packetcounter = (PacketCounter) c.get(Integer.valueOf(i)); if (packetcounter == null) {