mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 19:15:32 +01:00
Adding NetworkWriterThread for diff visibility
This commit is contained in:
parent
8be14b5bb3
commit
c07d4fffb0
68
src/main/java/net/minecraft/server/NetworkWriterThread.java
Normal file
68
src/main/java/net/minecraft/server/NetworkWriterThread.java
Normal file
@ -0,0 +1,68 @@
|
||||
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() {
|
||||
Object object = NetworkManager.a;
|
||||
|
||||
synchronized (NetworkManager.a) {
|
||||
++NetworkManager.c;
|
||||
}
|
||||
|
||||
while (true) {
|
||||
boolean flag = false;
|
||||
|
||||
try {
|
||||
flag = true;
|
||||
if (!NetworkManager.a(this.a)) {
|
||||
flag = false;
|
||||
break;
|
||||
}
|
||||
|
||||
while (NetworkManager.d(this.a)) {
|
||||
;
|
||||
}
|
||||
|
||||
try {
|
||||
if (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();
|
||||
}
|
||||
|
||||
try {
|
||||
sleep(2L);
|
||||
} catch (InterruptedException interruptedexception) {
|
||||
;
|
||||
}
|
||||
} finally {
|
||||
if (flag) {
|
||||
Object object1 = NetworkManager.a;
|
||||
|
||||
synchronized (NetworkManager.a) {
|
||||
--NetworkManager.c;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
object = NetworkManager.a;
|
||||
synchronized (NetworkManager.a) {
|
||||
--NetworkManager.c;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user