diff options
author | Erik Broes <erikbroes@grum.nl> | 2011-04-20 22:47:26 +0200 |
---|---|---|
committer | EvilSeph <evilseph@unaligned.org> | 2011-04-21 04:25:46 -0400 |
commit | a6c8a36dcea9c976d8b48f8b942608248db8cb4f (patch) | |
tree | 9b4039d8f0a9969abf5110a94d75925c4ad52524 /src/main/java/net/minecraft/server/NetworkManager.java | |
parent | 2fd3f8d299fdee827de90a999c5a4c9fd6eefeb9 (diff) | |
download | craftbukkit-a6c8a36dcea9c976d8b48f8b942608248db8cb4f.tar craftbukkit-a6c8a36dcea9c976d8b48f8b942608248db8cb4f.tar.gz craftbukkit-a6c8a36dcea9c976d8b48f8b942608248db8cb4f.tar.lz craftbukkit-a6c8a36dcea9c976d8b48f8b942608248db8cb4f.tar.xz craftbukkit-a6c8a36dcea9c976d8b48f8b942608248db8cb4f.zip |
Update for 1.5_02.
Diffstat (limited to 'src/main/java/net/minecraft/server/NetworkManager.java')
-rw-r--r-- | src/main/java/net/minecraft/server/NetworkManager.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java index 6fd24057..7a85b1d2 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -1,15 +1,16 @@ package net.minecraft.server; +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.net.Socket; import java.net.SocketAddress; +import java.io.IOException; // CraftBukkit -- instead of SocketException import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.io.IOException; // CraftBukkit - public class NetworkManager { public static final Object a = new Object(); @@ -42,10 +43,13 @@ public class NetworkManager { this.n = nethandler; try { - socket.setSoTimeout(30000); // Craftbukkit start + socket.setSoTimeout(30000); socket.setTrafficClass(24); + + // CraftBukkit start -- cant compile these outside the try this.input = new DataInputStream(socket.getInputStream()); this.output = new DataOutputStream(socket.getOutputStream()); + // CraftBukkit end } catch (IOException socketexception) { System.err.println(socketexception.getMessage()); } @@ -106,6 +110,8 @@ public class NetworkManager { if (flag) { Thread.sleep(10L); + } else { + this.output.flush(); } } catch (InterruptedException interruptedexception) { ; @@ -118,7 +124,7 @@ public class NetworkManager { private void f() { try { - Packet packet = Packet.b(this.input); + Packet packet = Packet.a(this.input, this.n.c()); if (packet != null) { this.k.add(packet); |