Class GlowProtocol

java.lang.Object
com.flowpowered.network.protocol.AbstractProtocol
net.glowstone.net.protocol.GlowProtocol
All Implemented Interfaces:
com.flowpowered.network.protocol.Protocol
Direct Known Subclasses:
HandshakeProtocol, LoginProtocol, PlayProtocol, StatusProtocol

public abstract class GlowProtocol extends com.flowpowered.network.protocol.AbstractProtocol
  • Constructor Summary

    Constructors
    Constructor
    Description
    GlowProtocol​(String name, int highestOpcode)
    Creates an instance.
    GlowProtocol​(String name, int highestInboundOpcode, int highOutboundOpcode)
    Creates an instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    <M extends com.flowpowered.network.Message>
    com.flowpowered.network.Codec.CodecRegistration
     
    <M extends com.flowpowered.network.Message>
    com.flowpowered.network.MessageHandler<?,​M>
    getMessageHandle​(Class<M> clazz)
     
    protected <M extends com.flowpowered.network.Message,​ C extends com.flowpowered.network.Codec<? super M>,​ H extends com.flowpowered.network.MessageHandler<?,​ ? super M>>
    void
    inbound​(int opcode, Class<M> message, Class<C> codec, H handler)
     
    protected <M extends com.flowpowered.network.Message,​ C extends com.flowpowered.network.Codec<? super M>,​ H extends com.flowpowered.network.MessageHandler<?,​ ? super M>>
    void
    inbound​(int opcode, Class<M> message, Class<C> codec, Class<H> handler)
     
    com.flowpowered.network.Codec<?>
    newReadHeader​(io.netty.buffer.ByteBuf in)
     
    protected <M extends com.flowpowered.network.Message,​ C extends com.flowpowered.network.Codec<? super M>>
    void
    outbound​(int opcode, Class<M> message, Class<C> codec)
     
    com.flowpowered.network.Codec<?>
    readHeader​(io.netty.buffer.ByteBuf buf)
    Deprecated.
    io.netty.buffer.ByteBuf
    writeHeader​(io.netty.buffer.ByteBuf out, com.flowpowered.network.Codec.CodecRegistration codec, io.netty.buffer.ByteBuf data)
    Deprecated.

    Methods inherited from class com.flowpowered.network.protocol.AbstractProtocol

    getLogger, getName, getWrappedMessage

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GlowProtocol

      public GlowProtocol(String name, int highestInboundOpcode, int highOutboundOpcode)
      Creates an instance.
      Parameters:
      name - the name of the protocol
      highestInboundOpcode - the highest opcode the inbound protocol will use
      highOutboundOpcode - the highest opcode the outbound protocol will use
    • GlowProtocol

      public GlowProtocol(String name, int highestOpcode)
      Creates an instance.
      Parameters:
      name - the name of the protocol
      highestOpcode - the highest opcode this protocol will use
  • Method Details

    • inbound

      protected <M extends com.flowpowered.network.Message,​ C extends com.flowpowered.network.Codec<? super M>,​ H extends com.flowpowered.network.MessageHandler<?,​ ? super M>> void inbound(int opcode, Class<M> message, Class<C> codec, Class<H> handler)
    • inbound

      protected <M extends com.flowpowered.network.Message,​ C extends com.flowpowered.network.Codec<? super M>,​ H extends com.flowpowered.network.MessageHandler<?,​ ? super M>> void inbound(int opcode, Class<M> message, Class<C> codec, H handler)
    • outbound

      protected <M extends com.flowpowered.network.Message,​ C extends com.flowpowered.network.Codec<? super M>> void outbound(int opcode, Class<M> message, Class<C> codec)
    • getMessageHandle

      public <M extends com.flowpowered.network.Message> com.flowpowered.network.MessageHandler<?,​M> getMessageHandle(Class<M> clazz)
      Specified by:
      getMessageHandle in class com.flowpowered.network.protocol.AbstractProtocol
    • readHeader

      @Deprecated public com.flowpowered.network.Codec<?> readHeader(io.netty.buffer.ByteBuf buf) throws com.flowpowered.network.exception.UnknownPacketException
      Deprecated.
      Throws:
      com.flowpowered.network.exception.UnknownPacketException
    • getCodecRegistration

      public <M extends com.flowpowered.network.Message> com.flowpowered.network.Codec.CodecRegistration getCodecRegistration(Class<M> clazz)
    • writeHeader

      @Deprecated public io.netty.buffer.ByteBuf writeHeader(io.netty.buffer.ByteBuf out, com.flowpowered.network.Codec.CodecRegistration codec, io.netty.buffer.ByteBuf data)
      Deprecated.
    • newReadHeader

      public com.flowpowered.network.Codec<?> newReadHeader(io.netty.buffer.ByteBuf in) throws IOException, com.flowpowered.network.exception.IllegalOpcodeException
      Throws:
      IOException
      com.flowpowered.network.exception.IllegalOpcodeException