summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server
diff options
context:
space:
mode:
authorTony <tony@bzextreme.com>2011-04-05 18:56:45 -0500
committerEvilSeph <evilseph@unaligned.org>2011-04-07 09:52:04 -0400
commit4525d168422f829fd2379daa61b7541d99bfd9da (patch)
treeee03122d5469a5b57410e285615b389751f99060 /src/main/java/net/minecraft/server
parentc99dc239174cbc9d80acba230c9ea0c54c126bf1 (diff)
downloadcraftbukkit-4525d168422f829fd2379daa61b7541d99bfd9da.tar
craftbukkit-4525d168422f829fd2379daa61b7541d99bfd9da.tar.gz
craftbukkit-4525d168422f829fd2379daa61b7541d99bfd9da.tar.lz
craftbukkit-4525d168422f829fd2379daa61b7541d99bfd9da.tar.xz
craftbukkit-4525d168422f829fd2379daa61b7541d99bfd9da.zip
Prevent nasty connection errors from hitting the console.
Diffstat (limited to 'src/main/java/net/minecraft/server')
-rw-r--r--src/main/java/net/minecraft/server/Packet.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/Packet.java b/src/main/java/net/minecraft/server/Packet.java
index 0045b1f6..1e6cdc14 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) {