diff options
author | feildmaster <admin@feildmaster.com> | 2012-12-19 22:03:52 -0600 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-12-20 10:43:00 -0600 |
commit | 23b67643741d5754af4de020a29d557078f9f81d (patch) | |
tree | 90e1a32f7eb94af49a381cb6bc34bf6247f0efe6 /src/main/java/net/minecraft/server/NetworkManager.java | |
parent | 9f1bf124eec7c20f16b2034fd9fba55f70c805fd (diff) | |
download | craftbukkit-23b67643741d5754af4de020a29d557078f9f81d.tar craftbukkit-23b67643741d5754af4de020a29d557078f9f81d.tar.gz craftbukkit-23b67643741d5754af4de020a29d557078f9f81d.tar.lz craftbukkit-23b67643741d5754af4de020a29d557078f9f81d.tar.xz craftbukkit-23b67643741d5754af4de020a29d557078f9f81d.zip |
Update CraftBukkit to Minecraft 1.4.6
Diffstat (limited to 'src/main/java/net/minecraft/server/NetworkManager.java')
-rw-r--r-- | src/main/java/net/minecraft/server/NetworkManager.java | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java index 25c27665..7c64e9bb 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -31,7 +31,7 @@ public class NetworkManager implements INetworkManager { private java.util.Queue inboundQueue = new java.util.concurrent.ConcurrentLinkedQueue(); // CraftBukkit - Concurrent linked queue private List highPriorityQueue = Collections.synchronizedList(new ArrayList()); private List lowPriorityQueue = Collections.synchronizedList(new ArrayList()); - private NetHandler packetListener; + private Connection connection; private boolean s = false; private Thread t; private Thread u; @@ -48,11 +48,11 @@ public class NetworkManager implements INetworkManager { private PrivateKey A = null; private int lowPriorityQueueDelay = 50; - public NetworkManager(Socket socket, String s, NetHandler nethandler, PrivateKey privatekey) throws IOException { // CraftBukkit - throws IOException + public NetworkManager(Socket socket, String s, Connection connection, PrivateKey privatekey) throws IOException { // CraftBukkit - throws IOException this.A = privatekey; this.socket = socket; this.j = socket.getRemoteSocketAddress(); - this.packetListener = nethandler; + this.connection = connection; try { socket.setSoTimeout(30000); @@ -69,8 +69,8 @@ public class NetworkManager implements INetworkManager { this.t.start(); } - public void a(NetHandler nethandler) { - this.packetListener = nethandler; + public void a(Connection connection) { + this.connection = connection; } public void queue(Packet packet) { @@ -97,7 +97,7 @@ public class NetworkManager implements INetworkManager { if (packet != null) { Packet.a(packet, this.output); if (packet instanceof Packet252KeyResponse && !this.g) { - if (!this.packetListener.a()) { + if (!this.connection.a()) { this.z = ((Packet252KeyResponse) packet).d(); } @@ -187,11 +187,11 @@ public class NetworkManager implements INetworkManager { boolean flag = false; try { - Packet packet = Packet.a(this.input, this.packetListener.a(), this.socket); + Packet packet = Packet.a(this.input, this.connection.a(), this.socket); if (packet != null) { if (packet instanceof Packet252KeyResponse && !this.f) { - if (this.packetListener.a()) { + if (this.connection.a()) { this.z = ((Packet252KeyResponse) packet).a(this.A); } @@ -203,9 +203,9 @@ public class NetworkManager implements INetworkManager { aint[i] += packet.a() + 1; if (!this.s) { - if (packet.a_() && this.packetListener.b()) { + if (packet.a_() && this.connection.b()) { this.x = 0; - packet.handle(this.packetListener); + packet.handle(this.connection); } else { this.inboundQueue.add(packet); } @@ -282,17 +282,17 @@ public class NetworkManager implements INetworkManager { Packet packet = (Packet) this.inboundQueue.poll(); // CraftBukkit - remove -> poll // CraftBukkit start - if (this.packetListener instanceof NetLoginHandler ? ((NetLoginHandler) this.packetListener).c : ((NetServerHandler) this.packetListener).disconnected) { + if (this.connection instanceof PendingConnection ? ((PendingConnection) this.connection).c : ((PlayerConnection) this.connection).disconnected) { continue; } // CraftBukkit end - packet.handle(this.packetListener); + packet.handle(this.connection); } this.a(); if (this.n && this.inboundQueue.isEmpty()) { - this.packetListener.a(this.v, this.w); + this.connection.a(this.v, this.w); } } |