Class PingHandler

java.lang.Object
crow.game.ha0.proto.PingHandler
All Implemented Interfaces:
PacketHandler<Ping>

public class PingHandler extends Object implements PacketHandler<Ping>
  • Constructor Details

    • PingHandler

      public PingHandler()
  • Method Details

    • fromPacket

      public Ping fromPacket(Context ctx, PacketReader buffer) throws Exception
      Description copied from interface: PacketHandler
      Convert the given buffer to the type.
      Specified by:
      fromPacket in interface PacketHandler<Ping>
      Parameters:
      ctx - The calling context.
      buffer - The input buffer stream reader.
      Returns:
      The POJO object
      Throws:
      Exception - on errors
    • toPacket

      public void toPacket(Context ctx, io.netty.buffer.ByteBuf buffer, Ping src) throws Exception
      Description copied from interface: PacketHandler
      Writes the object of type T to the byte buffer.
      Specified by:
      toPacket in interface PacketHandler<Ping>
      Parameters:
      ctx - The calling context.
      buffer - The destination buffer.
      src - The source object we are converting.
      Throws:
      Exception - on errors
    • rule

      public PacketRule rule(Context ctx)
      Specified by:
      rule in interface PacketHandler<Ping>
      Parameters:
      ctx - The calling context.
      Returns:
      The packet rule object which specifies when this packet handler should be called.
      See Also: