Wingman/wingman

Events fail to fire in gamepack_5936841

Closed this issue · 2 comments

Attached the relevant code and logs below, event does not fire at all.

22:32:52.891 [main] INFO uk.org.lidalia.sysoutslf4j.context.SysOutOverSLF4J - Replaced standard System.out and System.err PrintStreams with SLF4JPrintStreams
22:32:52.907 [main] INFO uk.org.lidalia.sysoutslf4j.context.SysOutOverSLF4J - Redirected System.out and System.err to SLF4J for this context
22:32:54.031 [SwingWorker-pool-1-thread-1] INFO com.wingman.client.rs.GameDownloader - Attempting to load world 301
22:32:54.661 [SwingWorker-pool-1-thread-1] INFO com.wingman.client.rs.GameDownloader - Updating the gamepack, remote size: 1,670,939, remote archive name: gamepack_5936841.jar
22:33:26.162 [SwingWorker-pool-1-thread-2] INFO com.wingman.client.plugin.PluginManager - Finding and setting up plugins
22:33:28.309 [SwingWorker-pool-1-thread-2] INFO org.reflections.Reflections - Reflections took 2092 ms to scan 41 urls, producing 6782 keys and 33969 values 
22:33:28.338 [SwingWorker-pool-1-thread-2] INFO com.github.chnkr.wingman.heatmap.HeatMap - @setup
22:33:28.356 [SwingWorker-pool-1-thread-2] INFO com.wingman.client.rs.GameLoader - Loading the game
22:33:28.823 [SwingWorker-pool-1-thread-2] INFO com.wingman.client.rs.GameAppletStub - Loading applet parameters
22:33:28.978 [SwingWorker-pool-1-thread-2] INFO com.github.chnkr.wingman.heatmap.HeatMap - @activate
22:33:28.978 [SwingWorker-pool-1-thread-2] INFO com.wingman.client.plugin.PluginManager - Activated plugin heat (heat 1.0.0)
package com.github.chnkr.wingman.heatmap;

import com.wingman.client.api.event.EventCallback;
import com.wingman.client.api.events.ExternalPlayerMovedEvent;
import com.wingman.client.api.plugin.Plugin;
import com.wingman.client.plugin.PluginManager;

@Plugin(
        id = "heat",
        name = "heat",
        version = "1.0.0",
        description = ""
)
public class HeatMap {

    @Plugin.Activate
    public void activate() {
        System.out.println("@activate");
    }

    @Plugin.Setup
    public void setup() {
        System.out.println("@setup");
        PluginManager.registerEventClass(this);
    }

    @EventCallback
    public void onExternalPlayerMovedEvent(ExternalPlayerMovedEvent event) {

        System.out.println("ExternalPlayerMovedEvent{" +
                "playerId=" + event.playerId +
                ", type=" + event.type +
                ", oldX=" + event.oldX +
                ", oldY=" + event.oldY +
                ", oldPlane=" + event.oldPlane +
                ", newX=" + event.newX +
                ", newY=" + event.newY +
                ", newPlane=" + event.newPlane +
                '}');
    }

}

Event does fire for me using your code:

22:45:32.025 [Thread-6] INFO com.github.chnkr.wingman.heatmap.HeatMap - ExternalPlayerMovedEvent{playerId=1629, type=ADJACENT_REGION, oldX=45, oldY=49, oldPlane=0, newX=46, newY=49, newPlane=0}

Please check if you have new ExternalPlayerMovedTransformer() in com.wingman.client.api.transformer as in https://git.io/v63l5.

Check if you have the latest generated API too (https://git.io/v63lH).

YEP! I had gradle set to compile 'com.github.Wingman:wingman:-SNAPSHOT just had to force a re-download, works fine now.

Thanks 👍