Fix crash when bot message is empty, increase max packet length.

This commit is contained in:
Mike 2020-05-10 01:04:26 +02:00
parent 46ff22f720
commit ec3a7d8f58
2 changed files with 5 additions and 1 deletions

View File

@ -3809,6 +3809,10 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
} }
public void botChat(ServerMessage message) { public void botChat(ServerMessage message) {
if (message == null) {
return;
}
message.retain(); message.retain();
try { try {

View File

@ -6,7 +6,7 @@ import io.netty.handler.codec.LengthFieldBasedFrameDecoder;
public class GameByteFrameDecoder extends LengthFieldBasedFrameDecoder { public class GameByteFrameDecoder extends LengthFieldBasedFrameDecoder {
private static final int MAX_PACKET_LENGTH = 8192 * 4; private static final int MAX_PACKET_LENGTH = 8192 * 16;
private static final int LENGTH_FIELD_OFFSET = 0; private static final int LENGTH_FIELD_OFFSET = 0;
private static final int LENGTH_FIELD_LENGTH = 4; private static final int LENGTH_FIELD_LENGTH = 4;
private static final int LENGTH_FIELD_ADJUSTMENT = 0; private static final int LENGTH_FIELD_ADJUSTMENT = 0;