Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-25 02:20:07 +01:00
/me is an idiot and forgot that WECUI packets don't have the string length in them (string length == packet length)
Dieser Commit ist enthalten in:
Ursprung
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);
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren