Package com.kraken.api.core.packet
Class PacketInterceptor
- java.lang.Object
-
- com.kraken.api.core.packet.PacketInterceptor
-
@Singleton public class PacketInterceptor extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPacketInterceptor.PacketHookAdviceThe Advice class.
-
Field Summary
Fields Modifier and Type Field Description net.runelite.api.Clientclientstatic net.runelite.client.eventbus.EventBuseventBusbooleaninjectedstatic PacketInterceptorinstance
-
Constructor Summary
Constructors Constructor Description PacketInterceptor(net.runelite.api.Client client)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinjectHook()Modifies the bytecode of the "addNode" method within the client at runtime to invoke thePacketInterceptor.PacketHookAdviceclass whenever the method is called.
-
-
-
Field Detail
-
eventBus
public static final net.runelite.client.eventbus.EventBus eventBus
-
instance
public static PacketInterceptor instance
-
injected
public boolean injected
-
client
public net.runelite.api.Client client
-
-
Method Detail
-
injectHook
public void injectHook() throws java.lang.ExceptionModifies the bytecode of the "addNode" method within the client at runtime to invoke thePacketInterceptor.PacketHookAdviceclass whenever the method is called. This will publish thePacketSentevent to the eventbus which can beSubscribeto 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.
-
-