mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-11-02 10:57:11 +00:00
/me is an idiot and forgot that WECUI packets don't have the string length in them (string length == packet length)
This commit is contained in:
parent
fe445a7ec9
commit
853bc53e21
@ -39,15 +39,14 @@ public class WorldEditCUICodec extends MessageCodec<WorldEditCUIMessage> impleme
|
||||
public ChannelBuffer encode(WorldEditCUIMessage message) {
|
||||
byte[] data = message.getMessage().getBytes(UTF_8_CHARSET);
|
||||
|
||||
ChannelBuffer buffer = ChannelBuffers.buffer(data.length + 2);
|
||||
buffer.writeShort(data.length);
|
||||
ChannelBuffer buffer = ChannelBuffers.buffer(data.length);
|
||||
buffer.writeBytes(data);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorldEditCUIMessage decode(ChannelBuffer buffer) {
|
||||
byte[] data = new byte[buffer.readShort()];
|
||||
byte[] data = new byte[buffer.readableBytes()];
|
||||
buffer.readBytes(data);
|
||||
String message = new String(data, UTF_8_CHARSET);
|
||||
return new WorldEditCUIMessage(message);
|
||||
|
Loading…
Reference in New Issue
Block a user