Compare commits

...

2 Commits

Author SHA1 Message Date
PeytonPlayz595
39b23c9949 Compile server JAR 2024-04-26 19:39:07 -04:00
PeytonPlayz595
4a8dc72374 Fix more server-side bugs 2024-04-26 19:38:00 -04:00
2 changed files with 14 additions and 6 deletions

Binary file not shown.

View File

@ -94,7 +94,9 @@ public class NetworkManager {
Packet.writePacket(var2, yee);
yee.flush();
try {
socketOutputStream.write(sendBuffer.toByteArray());
if(this.isConnectionOpen()) {
socketOutputStream.write(sendBuffer.toByteArray());
}
} catch(SocketException e) {
if (e.getMessage().contains("connection abort") || e.getMessage().contains("connection reset")) {
this.networkShutdown("Connection reset");
@ -105,7 +107,9 @@ public class NetworkManager {
}
}
sendBuffer.flush();
socketOutputStream.flush();
if(this.isConnectionOpen()) {
socketOutputStream.flush();
}
} catch(Exception e) {
e.printStackTrace();
this.sendQueueByteLength = oldSendQueue;
@ -128,7 +132,9 @@ public class NetworkManager {
Packet.writePacket(var2, yee);
yee.flush();
try {
socketOutputStream.write(sendBuffer.toByteArray());
if(this.isConnectionOpen()) {
socketOutputStream.write(sendBuffer.toByteArray());
}
} catch(SocketException e) {
if (e.getMessage().contains("connection abort") || e.getMessage().contains("connection reset")) {
this.networkShutdown("Connection reset");
@ -139,7 +145,9 @@ public class NetworkManager {
}
}
sendBuffer.flush();
socketOutputStream.flush();
if(this.isConnectionOpen()) {
socketOutputStream.flush();
}
this.chunkDataSendCounter = 50;
} catch(Exception e) {
e.printStackTrace();
@ -317,7 +325,7 @@ public class NetworkManager {
}
boolean isConnectionOpen() {
return networkSocket.isConnected();
return networkSocket != null && networkSocket.isConnected();
}
static Thread getReadThread(NetworkManager var0) {
@ -336,7 +344,7 @@ public class NetworkManager {
byte[] data = bytesRead == buffer.length ? buffer : new byte[bytesRead];
System.arraycopy(buffer, 0, data, 0, data.length);
return new ByteArrayInputStream(data);
} catch (Exception e) {
} catch (Throwable e) {
return null;
}
}