Class PacketInterceptor


  • @Singleton
    public class PacketInterceptor
    extends java.lang.Object
    • Field Detail

      • eventBus

        public static final net.runelite.client.eventbus.EventBus eventBus
      • injected

        public boolean injected
      • client

        public net.runelite.api.Client client
    • Constructor Detail

      • PacketInterceptor

        @Inject
        public PacketInterceptor​(net.runelite.api.Client client)
    • Method Detail

      • injectHook

        public void injectHook()
                        throws java.lang.Exception
        Modifies the bytecode of the "addNode" method within the client at runtime to invoke the PacketInterceptor.PacketHookAdvice class whenever the method is called. This will publish the PacketSent event to the eventbus which can be Subscribe to within plugins who need access to low level packets.
        Throws:
        java.lang.Exception - Throws an Illegal state exception if the hook is not able to be injected.