Fixed #5519
This commit is contained in:
@@ -391,15 +391,7 @@ public class ArcNetProvider implements NetProvider{
|
||||
//no compression, copy over buffer
|
||||
if(compression == 0){
|
||||
buffer.position(0).limit(length);
|
||||
if(byteBuffer.hasArray()){
|
||||
buffer.put(byteBuffer.array(), byteBuffer.position(), length);
|
||||
}else{
|
||||
byte[] readcopy = new byte[length];
|
||||
int pos = byteBuffer.position();
|
||||
byteBuffer.get(readcopy);
|
||||
byteBuffer.position(pos);
|
||||
buffer.put(readcopy);
|
||||
}
|
||||
buffer.put(byteBuffer.array(), byteBuffer.position(), length);
|
||||
buffer.position(0);
|
||||
packet.read(reads.get(), length);
|
||||
//move read packets forward
|
||||
|
||||
@@ -9,6 +9,7 @@ import arc.util.async.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.net.Packets.*;
|
||||
import mindustry.net.Streamable.*;
|
||||
import net.jpountz.lz4.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.*;
|
||||
@@ -97,7 +98,7 @@ public class Net{
|
||||
|
||||
if(e instanceof BufferUnderflowException || e instanceof BufferOverflowException){
|
||||
error = Core.bundle.get("error.io");
|
||||
}else if(error.equals("mismatch") || (e instanceof IndexOutOfBoundsException && e.getStackTrace()[0].getClassName().contains("java.nio"))){
|
||||
}else if(error.equals("mismatch") || e instanceof LZ4Exception || (e instanceof IndexOutOfBoundsException && e.getStackTrace()[0].getClassName().contains("java.nio"))){
|
||||
error = Core.bundle.get("error.mismatch");
|
||||
}else if(error.contains("port out of range") || error.contains("invalid argument") || (error.contains("invalid") && error.contains("address")) || Strings.neatError(e).contains("address associated")){
|
||||
error = Core.bundle.get("error.invalidaddress");
|
||||
|
||||
Reference in New Issue
Block a user