Interface Packet

All Known Subinterfaces:
StreamPacket
All Known Implementing Classes:
ClajMessagePacket, ClajPackets.Connect, ClajPackets.Disconnect, ClajPackets.Idle, ClajPopupPacket, ClajTextMessagePacket, ConnectionClosedPacket, ConnectionIdlingPacket, ConnectionJoinPacket, ConnectionPayloadPacket, ConnectionWrapperPacket, RawPacket, RoomClosedPacket, RoomClosureRequestPacket, RoomConfigPacket, RoomCreationRequestPacket, RoomInfoDeniedPacket, RoomInfoPacket, RoomInfoRequestPacket, RoomJoinAcceptedPacket, RoomJoinDeniedPacket, RoomJoinPacket, RoomJoinRequestPacket, RoomLinkPacket, RoomListPacket, RoomListRequestPacket, RoomStatePacket, RoomStateRequestPacket, ServerInfoPacket, StreamChunk, StreamHead

public interface Packet
Base packet of CLaJ protocol.
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    allow(boolean isServer)
     
    default void
    Called when the client handle this packet.
    default void
    handleServer(arc.net.Connection con)
    Called when the server handle this packet.
    default <T extends Packet>
    T
    r(arc.util.io.ByteBufferInput read)
     
    default void
    read(arc.util.io.ByteBufferInput read)
     
    default <T extends Packet>
    T
    w(arc.util.io.ByteBufferOutput write)
     
    default void
    write(arc.util.io.ByteBufferOutput write)
     
  • Method Details

    • read

      default void read(arc.util.io.ByteBufferInput read)
    • write

      default void write(arc.util.io.ByteBufferOutput write)
    • r

      default <T extends Packet> T r(arc.util.io.ByteBufferInput read)
    • w

      default <T extends Packet> T w(arc.util.io.ByteBufferOutput write)
    • allow

      default boolean allow(boolean isServer)
      Returns:
      whether this packet should be allowed or ignored, for the type of endpoint.
    • handleClient

      default void handleClient()
      Called when the client handle this packet. Only called when no listener is defined for this packet.
    • handleServer

      default void handleServer(arc.net.Connection con)
      Called when the server handle this packet. Only called when no listener is defined for this packet.