Package org.spout.vanilla.protocol.msg

Examples of org.spout.vanilla.protocol.msg.ServerPluginMessage


  @SuppressWarnings ("unchecked")
  public <T extends Message> Message getWrappedMessage(T dynamicMessage) throws IOException {
    MessageCodec<T> codec = (MessageCodec<T>) getCodecLookupService().find(dynamicMessage.getClass());
    ByteBuf buffer = codec.encode(Spout.getPlatform() == Platform.CLIENT, dynamicMessage);

    return new ServerPluginMessage(getName(codec), buffer.array());
  }
View Full Code Here


  public ServerPluginMessage decode(ByteBuf buffer) throws IOException {
    String type = VanillaByteBufUtils.readString(buffer);
    int length = buffer.readUnsignedShort();
    byte[] data = new byte[length];
    buffer.readBytes(data);
    return new ServerPluginMessage(type, data);
  }
View Full Code Here

TOP

Related Classes of org.spout.vanilla.protocol.msg.ServerPluginMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.