Class PacketDispatcher


  • @Singleton
    public class PacketDispatcher
    extends java.lang.Object
    Packet-only dispatch through revisioned reflection hooks. Every claim made here is command-level: a true return means the client accepted the built packet into its queue — server observation is a P7 concern.
    • Constructor Summary

      Constructors 
      Constructor Description
      PacketDispatcher​(net.runelite.api.Client client, Hooks hooks)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean available()
      True only when hooks loaded AND bind-time verification succeeded.
      boolean cipherReady()
      True once the Isaac cipher is seeded (i.e.
      java.lang.String dryRunAll()
      Dry-run EVERY packet that carries a layout.
      java.lang.String dryRunById​(int id, java.lang.Object... values)
      Replay one packet's VERIFIED layout against a STANDALONE scratch buffer and report the exact byte count written.
      boolean send​(java.lang.String packetName, java.lang.Object... values)
      Send a packet by semantic name.
      boolean sendById​(int id, java.lang.Object... values)
      Send a packet by opcode when a revision table has no semantic name.
      java.lang.String verifyBind()
      Force the reflection bind now and return a diagnostic summary.
      • Methods inherited from class java.lang.Object

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

      • PacketDispatcher

        @Inject
        public PacketDispatcher​(net.runelite.api.Client client,
                                Hooks hooks)
    • Method Detail

      • available

        public boolean available()
        True only when hooks loaded AND bind-time verification succeeded.
      • cipherReady

        public boolean cipherReady()
        True once the Isaac cipher is seeded (i.e. we are logged in).
      • verifyBind

        public java.lang.String verifyBind()
        Force the reflection bind now and return a diagnostic summary. Runs the full structural gate against the LIVE client classes.
        Throws:
        java.lang.IllegalStateException - when any gate fails (tier self-disables)
      • dryRunById

        public java.lang.String dryRunById​(int id,
                                           java.lang.Object... values)
        Replay one packet's VERIFIED layout against a STANDALONE scratch buffer and report the exact byte count written. CRITICAL SAFETY NOTE (learned live 2026-08-26): we intentionally do NOT call the real node factory here. The factory writes the cipher-encrypted packet header, consuming one ISAAC keystream value per call; burning keystream without transmitting desyncs the client from the server and causes a disconnect. Scratch buffers are fully isolated: no pool, no writer, no cipher, no network. The layout width sum is the hard proof. The injected client may store the public offset through an obfuscation multiplier, so a raw reflective offset delta is diagnostic only and never revokes a structurally valid layout.
      • dryRunAll

        public java.lang.String dryRunAll()
        Dry-run EVERY packet that carries a layout. One login funds the whole table's verification: returns "ok=N fail=M" plus up to ten distinct failure signatures for offline fixing.
      • send

        public boolean send​(java.lang.String packetName,
                            java.lang.Object... values)
        Send a packet by semantic name. Values are supplied one-per-verified payload write operation; an arity mismatch is rejected before the node factory runs so it cannot consume an ISAAC value for an invalid request.
      • sendById

        public boolean sendById​(int id,
                                java.lang.Object... values)
        Send a packet by opcode when a revision table has no semantic name.