mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-14 01:48:04 -04:00
fix packet queue bug, name threads
This commit is contained in:
parent
1b13b4981b
commit
6d1a7052ae
@ -69,6 +69,7 @@ public class Log {
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
logThread.setName("Log-Thread");
|
||||||
logThread.start();
|
logThread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ public class Connection {
|
|||||||
|
|
||||||
private void startHandlingThread() {
|
private void startHandlingThread() {
|
||||||
handleThread = new Thread(() -> {
|
handleThread = new Thread(() -> {
|
||||||
while (getConnectionState() != ConnectionState.DISCONNECTED) {
|
while (getConnectionState() != ConnectionState.DISCONNECTING) {
|
||||||
while (handlingQueue.size() > 0) {
|
while (handlingQueue.size() > 0) {
|
||||||
try {
|
try {
|
||||||
handlingQueue.get(0).log();
|
handlingQueue.get(0).log();
|
||||||
@ -182,6 +182,7 @@ public class Connection {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
handleThread.setName("Handle-Thread");
|
||||||
handleThread.start();
|
handleThread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,6 +119,7 @@ public class Network {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
socketThread.setName("Socket-Thread");
|
||||||
socketThread.start();
|
socketThread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,7 +130,7 @@ public class Network {
|
|||||||
// sleep 1 ms
|
// sleep 1 ms
|
||||||
packetThread = new Thread(() -> {
|
packetThread = new Thread(() -> {
|
||||||
// compressed data, makes packets to binary data
|
// compressed data, makes packets to binary data
|
||||||
while (connection.getConnectionState() != ConnectionState.DISCONNECTED) {
|
while (connection.getConnectionState() != ConnectionState.DISCONNECTING) {
|
||||||
|
|
||||||
while (queue.size() > 0) {
|
while (queue.size() > 0) {
|
||||||
ServerboundPacket p = queue.get(0);
|
ServerboundPacket p = queue.get(0);
|
||||||
@ -242,6 +243,7 @@ public class Network {
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
packetThread.setName("Packet-Thread");
|
||||||
packetThread.start();
|
packetThread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user