Class SubDataProtocol

java.lang.Object
net.ME1312.SubData.Client.DataProtocol
net.ME1312.SubData.Client.SubDataProtocol

public class SubDataProtocol extends DataProtocol
SubData Protocol Class
  • Field Details

  • Constructor Details

    • SubDataProtocol

      public SubDataProtocol()
      Create a new Protocol
  • Method Details

    • open

      public SubDataClient open(Consumer<Runnable> scheduler, Logger logger, InetAddress address, int port, ObjectMap<?> login) throws IOException
      Launch a SubData Client Instance
      Parameters:
      scheduler - Event Scheduler
      logger - Network Logger
      address - Bind Address (or null for all)
      port - Port Number
      login - Login Data
      Throws:
      IOException
    • open

      public SubDataClient open(Consumer<Runnable> scheduler, Logger logger, InetAddress address, int port) throws IOException
      Launch a SubData Client Instance
      Parameters:
      scheduler - Event Scheduler
      logger - Network Logger
      address - Bind Address (or null for all)
      port - Port Number
      Throws:
      IOException
    • open

      public SubDataClient open(Logger logger, InetAddress address, int port, ObjectMap<?> login) throws IOException
      Launch a SubData Client Instance
      Parameters:
      logger - Network Logger
      address - Bind Address (or null for all)
      port - Port Number
      login - Login Data
      Throws:
      IOException
    • open

      public SubDataClient open(Logger logger, InetAddress address, int port) throws IOException
      Launch a SubData Client Instance
      Parameters:
      logger - Network Logger
      address - Bind Address (or null for all)
      port - Port Number
      Throws:
      IOException
    • setName

      public void setName(String name)
      Set the Network Protocol Name (may only be called once)
      Parameters:
      name - Protocol Name
    • getName

      public String getName()
      Description copied from class: DataProtocol
      Get the Network Protocol Name
      Specified by:
      getName in class DataProtocol
      Returns:
      Protocol Name
    • addVersion

      public void addVersion(Version version)
      Add a Protocol Version to the Supported Versions List
      Parameters:
      version - Protocol Version
    • removeVersion

      public void removeVersion(Version version)
      Remove a Protocol Version from the Supported Versions List
      Parameters:
      version - Protocol Version
    • getVersion

      public Version[] getVersion()
      Description copied from class: DataProtocol
      Get the Supported Protocol Version List
      Specified by:
      getVersion in class DataProtocol
      Returns:
      Supported Protocol Versions
    • getBlockSize

      public int getBlockSize()
      Get SubData's Block Size
      Returns:
      Block Size
    • setBlockSize

      public void setBlockSize(int size)
      Set SubData's Block Size
      Parameters:
      size - Block Size
    • registerCipher

      public void registerCipher(String handle, Cipher cipher)
      Register a Cipher to SubData
      Parameters:
      cipher - Cipher to Add
      handle - Handle to Bind
    • unregisterCipher

      public void unregisterCipher(String handle)
      Unregister a Cipher from SubData
      Parameters:
      handle - Handle
    • registerPacket

      public void registerPacket(int id, PacketIn packet)
      Register PacketIn to the Network
      Parameters:
      id - Packet ID (as an unsigned 16-bit value)
      packet - PacketIn to register
    • unregisterPacket

      public void unregisterPacket(PacketIn packet)
      Unregister PacketIn from the Network
      Parameters:
      packet - PacketIn to unregister
    • registerPacket

      public void registerPacket(int id, Class<? extends PacketOut> packet)
      Register PacketOut to the Network
      Parameters:
      id - Packet ID (as an unsigned 16-bit value)
      packet - PacketOut to register
    • unregisterPacket

      public void unregisterPacket(Class<? extends PacketOut> packet)
      Unregister PacketOut to the Network
      Parameters:
      packet - PacketOut to unregister
    • getPacket

      public PacketIn getPacket(int id)
      Grab PacketIn Instance via ID
      Parameters:
      id - Packet ID (as an unsigned 16-bit value)
      Returns:
      PacketIn