Make packet charset configurable

Better support for different language clients such as Thai or Korean
This commit is contained in:
P0nk
2021-09-08 08:24:52 +02:00
parent abb0a55ac9
commit 41cb6749c8
8 changed files with 62 additions and 46 deletions

View File

@@ -1,5 +1,6 @@
package net.packet;
import constants.string.CharsetConstants;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufUtil;
@@ -49,7 +50,7 @@ public class ByteBufInPacket implements InPacket {
short length = readShort();
byte[] stringBytes = new byte[length];
byteBuf.readBytes(stringBytes);
return new String(stringBytes, STRING_CHARSET);
return new String(stringBytes, CharsetConstants.PACKET_CHARSET);
}
@Override