Closed
Issue #31 · created by Matthew Messinger · ·

PluginChannels has duplicated listeners

Every time I join a server, the plugin channel listeners get loaded and start to receive plugin channels. When I leave and join a server again (without shutting down the game), they get loaded again without the old ones being removed.

I made a test mod to see.

    @Override
    public void onJoinGame(INetHandler netHandler, SPacketJoinGame joinGamePacket, ServerData serverData, RealmsServer realmsServer) {
        try {
            Field f = PluginChannels.class.getDeclaredField("pluginChannels");
            f.setAccessible(true);
            System.out.println(f.get(LiteLoader.getClientPluginChannels()));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

That map (pluginChannels) increases in size every time

After further investigation, the cause may be that PostLoginListener is never fired.

2 participants
liteloader/LiteLoader#31