mirror of
https://github.com/Quackster/Havana.git
synced 2025-07-02 04:37:47 +00:00
Charset changes (#67)
* Update EncryptionDecoder.java [skip ci] * Update EncryptionEncoder.java
This commit is contained in:
parent
1fbf1a3d1c
commit
687f3aa448
2 changed files with 8 additions and 8 deletions
|
@ -39,7 +39,7 @@ public class EncryptionDecoder extends ByteToMessageDecoder {
|
|||
byte[] tHeaderMsg = new byte[6];
|
||||
buffer.readBytes(tHeaderMsg);
|
||||
|
||||
tHeader = new String(tHeaderMsg);
|
||||
tHeader = new String(tHeaderMsg, StringUtil.getCharset());
|
||||
tHeader = this.pHeaderDecoder.kg4R6Jo5xjlqtFGs1klMrK4ZTzb3R(tHeader);
|
||||
|
||||
int tByte1 = ((int) tHeader.charAt(3)) & 63;
|
||||
|
@ -60,16 +60,16 @@ public class EncryptionDecoder extends ByteToMessageDecoder {
|
|||
byte[] tBodyMsg = new byte[pMsgSize];
|
||||
buffer.readBytes(tBodyMsg);
|
||||
|
||||
tBody = new String(tBodyMsg);
|
||||
tBody = new String(tBodyMsg, StringUtil.getCharset());
|
||||
tBody = this.pDecoder.kg4R6Jo5xjlqtFGs1klMrK4ZTzb3R(tBody);
|
||||
tBody = NettyPlayerNetwork.removePadding(tBody, player.getNetwork().getTx() % 5);
|
||||
|
||||
ByteBuf result = Unpooled.buffer();
|
||||
|
||||
result.writeBytes(Base64Encoding.encode(tBody.length(), 3));
|
||||
result.writeBytes(tBody.getBytes());
|
||||
result.writeBytes(tBody.getBytes(StringUtil.getCharset()));
|
||||
|
||||
out.add(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ public class EncryptionEncoder extends MessageToMessageEncoder<ByteBuf> {
|
|||
byte[] tOriginalMsgBytes = new byte[buffer.readableBytes()];
|
||||
buffer.readBytes(tOriginalMsgBytes);
|
||||
|
||||
String tOriginalMsg = new String(tOriginalMsgBytes);
|
||||
String tOriginalMsg = new String(tOriginalMsgBytes, StringUtil.getCharset());
|
||||
|
||||
String tHeader;
|
||||
String tMsg;
|
||||
|
@ -57,9 +57,9 @@ public class EncryptionEncoder extends MessageToMessageEncoder<ByteBuf> {
|
|||
|
||||
var tEncryptedMsg = Unpooled.buffer();
|
||||
|
||||
tEncryptedMsg.writeBytes(tHeader.getBytes());
|
||||
tEncryptedMsg.writeBytes(tMsg.getBytes());
|
||||
tEncryptedMsg.writeBytes(tHeader.getBytes(StringUtil.getCharset()));
|
||||
tEncryptedMsg.writeBytes(tMsg.getBytes(StringUtil.getCharset()));
|
||||
|
||||
out.add(tEncryptedMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue