Class PlayerPackets


  • public class PlayerPackets
    extends java.lang.Object
    Utility class for creating and queuing player packets.
    • Constructor Summary

      Constructors 
      Constructor Description
      PlayerPackets()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static RSPacketBufferNode createEighthAction​(int id, boolean ctrlDown)
      Creates a packet buffer node for sending the eighth player action.
      static RSPacketBufferNode createFifthAction​(int id, boolean ctrlDown)
      Creates a packet buffer node for the fifth action.
      static RSPacketBufferNode createFirstAction​(int id, boolean ctrlDown)
      Creates a packet buffer node for the first action with the given ID and control key input.
      static RSPacketBufferNode createFourthAction​(int id, boolean ctrlDown)
      Creates a packet buffer node for the fourth action with the given ID and ctrlDown flag.
      static RSPacketBufferNode createItemOnPlayerPacket​(int playerIndex, int itemId, int itemSlot, int itemWidgetId, boolean ctrlDown)
      Creates a packet buffer node for creating an item on a player.
      static RSPacketBufferNode createSecondAction​(int id, boolean ctrlDown)
      Creates a second action packet buffer node.
      static RSPacketBufferNode createSeventhAction​(int id, boolean ctrlDown)
      Creates and prepares a RSPacketBufferNode for the seventh action with the given id and ctrlDown value.
      static RSPacketBufferNode createSixthAction​(int id, boolean ctrlDown)
      Creates a packet buffer node for the sixth action with the given id and ctrlDown value.
      static RSPacketBufferNode createSpellOnPlayer​(int id, int spellWidgetId, boolean ctrlDown)
      Creates a RSPacketBufferNode for casting a spell on a player.
      static RSPacketBufferNode createThirdAction​(int id, boolean ctrlDown)
      Creates a third action packet buffer node.
      static RSPacketBufferNode createWidgetOnPlayer​(int id, int sourceItemId, int sourceSlot, int sourceWidgetId, boolean ctrlDown)
      Creates a packet buffer node for creating a widget on a player.
      static void queueItemUseOnPlayerPacket​(int playerIndex, int itemId, int itemSlot, int itemWidgetId, boolean ctrlDown)
      Sends a packet to use an item on a player.
      static void queuePlayerAction1Packet​(int playerIndex, boolean ctrlDown)
      Queues a player's action packet and sends it.
      static void queuePlayerAction2Packet​(int playerIndex, boolean ctrlDown)
      Queues a player action and sends it as a packet.
      static void queuePlayerAction3Packet​(int playerIndex, boolean ctrlDown)
      Queues a player action packet with the specified player index and control key state.
      static void queuePlayerAction4Packet​(int playerIndex, boolean ctrlDown)
      Sends the fourth player action packet.
      static void queuePlayerAction5Packet​(int playerIndex, boolean ctrlDown)
      Queues the 5th action packet for a player.
      static void queuePlayerAction6Packet​(int playerIndex, boolean ctrlDown)
      Queues and sends a player action packet with the specified player index and control status.
      static void queuePlayerAction7Packet​(int playerIndex, boolean ctrlDown)
      Queues the 7th player action packet and sends it.
      static void queuePlayerAction8Packet​(int playerIndex, boolean ctrlDown)
      Queues the player's eighth action packet with the specified player index and control key state.
      static void queueSpellOnPlayerPacket​(int playerIndex, int spellWidgetId, boolean ctrlDown)
      Queues a spell packet to be sent to a player.
      • Methods inherited from class java.lang.Object

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

      • PlayerPackets

        public PlayerPackets()
    • Method Detail

      • queueItemUseOnPlayerPacket

        public static void queueItemUseOnPlayerPacket​(int playerIndex,
                                                      int itemId,
                                                      int itemSlot,
                                                      int itemWidgetId,
                                                      boolean ctrlDown)
        Sends a packet to use an item on a player.
        Parameters:
        playerIndex - the index of the player to use the item on
        itemId - the ID of the item to be used
        itemSlot - the slot of the item in the player's inventory
        itemWidgetId - the widget ID of the item
        ctrlDown - true if the control key is being held down, false otherwise
      • queueSpellOnPlayerPacket

        public static void queueSpellOnPlayerPacket​(int playerIndex,
                                                    int spellWidgetId,
                                                    boolean ctrlDown)
        Queues a spell packet to be sent to a player.
        Parameters:
        playerIndex - the index of the player
        spellWidgetId - the widget ID of the spell
        ctrlDown - indicates if the control key is being held down
      • queuePlayerAction1Packet

        public static void queuePlayerAction1Packet​(int playerIndex,
                                                    boolean ctrlDown)
        Queues a player's action packet and sends it.
        Parameters:
        playerIndex - the index of the player
        ctrlDown - true if the control key is down, false otherwise
      • queuePlayerAction2Packet

        public static void queuePlayerAction2Packet​(int playerIndex,
                                                    boolean ctrlDown)
        Queues a player action and sends it as a packet.
        Parameters:
        playerIndex - the index of the player
        ctrlDown - true if the control key is down, false otherwise
      • queuePlayerAction3Packet

        public static void queuePlayerAction3Packet​(int playerIndex,
                                                    boolean ctrlDown)
        Queues a player action packet with the specified player index and control key state.
        Parameters:
        playerIndex - the index of the player
        ctrlDown - true if the control key is pressed, false otherwise
      • queuePlayerAction4Packet

        public static void queuePlayerAction4Packet​(int playerIndex,
                                                    boolean ctrlDown)
        Sends the fourth player action packet.
        Parameters:
        playerIndex - the index of the player
        ctrlDown - true if the control key is down, false otherwise
      • queuePlayerAction5Packet

        public static void queuePlayerAction5Packet​(int playerIndex,
                                                    boolean ctrlDown)
        Queues the 5th action packet for a player.
        Parameters:
        playerIndex - the index of the player
        ctrlDown - true if the control key is down, false otherwise
      • queuePlayerAction6Packet

        public static void queuePlayerAction6Packet​(int playerIndex,
                                                    boolean ctrlDown)
        Queues and sends a player action packet with the specified player index and control status.
        Parameters:
        playerIndex - the index of the player
        ctrlDown - true if the control key is down, false otherwise
      • queuePlayerAction7Packet

        public static void queuePlayerAction7Packet​(int playerIndex,
                                                    boolean ctrlDown)
        Queues the 7th player action packet and sends it.
        Parameters:
        playerIndex - the index of the player
        ctrlDown - the flag indicating whether the CTRL key is down or not
      • queuePlayerAction8Packet

        public static void queuePlayerAction8Packet​(int playerIndex,
                                                    boolean ctrlDown)
        Queues the player's eighth action packet with the specified player index and control key state.
        Parameters:
        playerIndex - the index of the player
        ctrlDown - true if the control key is down, false otherwise
      • createItemOnPlayerPacket

        public static RSPacketBufferNode createItemOnPlayerPacket​(int playerIndex,
                                                                  int itemId,
                                                                  int itemSlot,
                                                                  int itemWidgetId,
                                                                  boolean ctrlDown)
        Creates a packet buffer node for creating an item on a player.
        Parameters:
        playerIndex - the index of the player to create the item on
        itemId - the id of the item to create
        itemSlot - the slot of the item to create
        itemWidgetId - the widget id of the item to create
        ctrlDown - true if the control key is pressed while creating the item, false otherwise
        Returns:
        the created RSPacketBufferNode
      • createWidgetOnPlayer

        public static RSPacketBufferNode createWidgetOnPlayer​(int id,
                                                              int sourceItemId,
                                                              int sourceSlot,
                                                              int sourceWidgetId,
                                                              boolean ctrlDown)
        Creates a packet buffer node for creating a widget on a player.
        Parameters:
        id - the widget id
        sourceItemId - the source item id
        sourceSlot - the source slot
        sourceWidgetId - the source widget id
        ctrlDown - true if the control key is down, false otherwise
        Returns:
        the created packet buffer node
      • createSpellOnPlayer

        public static RSPacketBufferNode createSpellOnPlayer​(int id,
                                                             int spellWidgetId,
                                                             boolean ctrlDown)
        Creates a RSPacketBufferNode for casting a spell on a player.
        Parameters:
        id - the ID of the spell
        spellWidgetId - the ID of the spell widget
        ctrlDown - true if the control key is pressed, false otherwise
        Returns:
        the created RSPacketBufferNode
      • createFirstAction

        public static RSPacketBufferNode createFirstAction​(int id,
                                                           boolean ctrlDown)
        Creates a packet buffer node for the first action with the given ID and control key input.
        Parameters:
        id - the ID of the action
        ctrlDown - true if control key is down, false otherwise
        Returns:
        the packet buffer node for the first action
      • createSecondAction

        public static RSPacketBufferNode createSecondAction​(int id,
                                                            boolean ctrlDown)
        Creates a second action packet buffer node.
        Parameters:
        id - the ID of the action
        ctrlDown - a boolean indicating whether the control key is pressed
        Returns:
        the packet buffer node with the specified ID and control key status
      • createThirdAction

        public static RSPacketBufferNode createThirdAction​(int id,
                                                           boolean ctrlDown)
        Creates a third action packet buffer node.
        Parameters:
        id - the ID of the action
        ctrlDown - a boolean indicating if the control key is pressed down
        Returns:
        the created packet buffer node
      • createFourthAction

        public static RSPacketBufferNode createFourthAction​(int id,
                                                            boolean ctrlDown)
        Creates a packet buffer node for the fourth action with the given ID and ctrlDown flag.
        Parameters:
        id - the ID for the action
        ctrlDown - true if the Ctrl key is down, false otherwise
        Returns:
        the created RSPacketBufferNode
      • createFifthAction

        public static RSPacketBufferNode createFifthAction​(int id,
                                                           boolean ctrlDown)
        Creates a packet buffer node for the fifth action.
        Parameters:
        id - the id of the action
        ctrlDown - indicates if the control key is pressed
        Returns:
        the created packet buffer node
      • createSixthAction

        public static RSPacketBufferNode createSixthAction​(int id,
                                                           boolean ctrlDown)
        Creates a packet buffer node for the sixth action with the given id and ctrlDown value.
        Parameters:
        id - the id of the sixth action
        ctrlDown - true if the ctrl key is pressed, false otherwise
        Returns:
        the created RSPacketBufferNode
      • createSeventhAction

        public static RSPacketBufferNode createSeventhAction​(int id,
                                                             boolean ctrlDown)
        Creates and prepares a RSPacketBufferNode for the seventh action with the given id and ctrlDown value.
        Parameters:
        id - the id of the action
        ctrlDown - true if the control key is pressed, false otherwise
        Returns:
        the prepared RSPacketBufferNode
      • createEighthAction

        public static RSPacketBufferNode createEighthAction​(int id,
                                                            boolean ctrlDown)
        Creates a packet buffer node for sending the eighth player action.
        Parameters:
        id - the id of the action
        ctrlDown - whether the control key is down
        Returns:
        the created packet buffer node