Class Packets


  • public class Packets
    extends java.lang.Object
    Utility class for creating, queuing packets and converting a menu action into a packet.
    • Constructor Summary

      Constructors 
      Constructor Description
      Packets()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static RSPacketBufferNode fromMenuAction​(net.eternalclient.api.data.MenuAction menu)
      Creates an RSPacketBufferNode based on the provided MenuAction.
      static void queuePacket​(RSClientPacket clientPacket, java.lang.Object... data)
      Queues a packet to be sent by the RSClient.
      static void queuePacket​(RSPacketBufferNode packet)
      Queues a packet to be written by the packet writer on the client thread.
      static boolean supportsMenuAction​(net.eternalclient.api.data.MenuAction menu)
      Checks if the specified MenuAction is supported.
      • Methods inherited from class java.lang.Object

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

      • Packets

        public Packets()
    • Method Detail

      • queuePacket

        public static void queuePacket​(RSClientPacket clientPacket,
                                       java.lang.Object... data)
        Queues a packet to be sent by the RSClient. The packet contains data of varying types provided as arguments.
        Parameters:
        clientPacket - the RSClientPacket to be sent.
        data - the data to be included in the packet.
      • queuePacket

        public static void queuePacket​(RSPacketBufferNode packet)
        Queues a packet to be written by the packet writer on the client thread.
        Parameters:
        packet - the packet buffer node to be queued
      • supportsMenuAction

        public static boolean supportsMenuAction​(net.eternalclient.api.data.MenuAction menu)
        Checks if the specified MenuAction is supported.
        Parameters:
        menu - the MenuAction to check
        Returns:
        true if the MenuAction is supported, false otherwise
      • fromMenuAction

        public static RSPacketBufferNode fromMenuAction​(net.eternalclient.api.data.MenuAction menu)
        Creates an RSPacketBufferNode based on the provided MenuAction.
        Parameters:
        menu - the MenuAction to create the RSPacketBufferNode from
        Returns:
        an RSPacketBufferNode based on the provided MenuAction
        Throws:
        InteractionException - if the opcode is unsupported