Paper/src/main/java/net/minecraft/server/NetworkWriterThread.java

48 Zeilen
1.3 KiB
Java

package net.minecraft.server;
import java.io.IOException;
class NetworkWriterThread extends Thread {
final NetworkManager a;
NetworkWriterThread(NetworkManager networkmanager, String s) {
super(s);
this.a = networkmanager;
}
public void run() {
2012-07-29 09:33:13 +02:00
NetworkManager.b.getAndIncrement();
2012-07-29 09:33:13 +02:00
try {
while (NetworkManager.a(this.a)) {
boolean flag;
2012-07-29 09:33:13 +02:00
for (flag = false; NetworkManager.d(this.a); flag = true) {
;
}
try {
2012-07-29 09:33:13 +02:00
if (flag && NetworkManager.e(this.a) != null) {
NetworkManager.e(this.a).flush();
}
} catch (IOException ioexception) {
if (!NetworkManager.f(this.a)) {
NetworkManager.a(this.a, (Exception) ioexception);
}
// ioexception.printStackTrace(); // CraftBukkit - Don't spam console on unexpected disconnect
}
try {
sleep(2L);
} catch (InterruptedException interruptedexception) {
;
}
}
2012-07-29 09:33:13 +02:00
} finally {
NetworkManager.b.getAndDecrement();
}
}
}