Increased world stream chunk size

This commit is contained in:
Anuken
2021-10-11 10:30:40 -04:00
parent 9f070323c2
commit 6abb458c27
2 changed files with 3 additions and 1 deletions

View File

@@ -132,6 +132,8 @@ public class Vars implements Loadable{
Color.valueOf("4b5ef1"), Color.valueOf("4b5ef1"),
Color.valueOf("2cabfe"), Color.valueOf("2cabfe"),
}; };
/** maximum TCP packet size */
public static final int maxTcpSize = 900;
/** default server port */ /** default server port */
public static final int port = 6567; public static final int port = 6567;
/** multicast discovery port.*/ /** multicast discovery port.*/

View File

@@ -90,7 +90,7 @@ public abstract class NetConnection{
cid = begin.id; cid = begin.id;
while(stream.stream.available() > 0){ while(stream.stream.available() > 0){
byte[] bytes = new byte[Math.min(512, stream.stream.available())]; byte[] bytes = new byte[Math.min(maxTcpSize, stream.stream.available())];
stream.stream.read(bytes); stream.stream.read(bytes);
StreamChunk chunk = new StreamChunk(); StreamChunk chunk = new StreamChunk();