2012-07-22 08:18:00 +02:00
|
|
|
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-22 08:18:00 +02:00
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
try {
|
|
|
|
while (NetworkManager.a(this.a)) {
|
|
|
|
boolean flag;
|
2012-07-22 08:18:00 +02:00
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
for (flag = false; NetworkManager.d(this.a); flag = true) {
|
2012-07-22 08:18:00 +02:00
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
2012-07-29 09:33:13 +02:00
|
|
|
if (flag && NetworkManager.e(this.a) != null) {
|
2012-07-22 08:18:00 +02:00
|
|
|
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();
|
2012-07-22 08:18:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|