SkyHanni icon indicating copy to clipboard operation
SkyHanni copied to clipboard

Backend: Banned Classes

Open hannibal002 opened this issue 11 months ago • 3 comments

What

Added a list of banned classes per mod versions in the repo that either hide events or listener classes. Useful for hot fixing bugs, illegal features, or other Hypixel things.

How to test

Test Tutorial

Create the repo file BannedClasses.json, and write this inside:

{
    "banned_classes": {
        "0.24.Beta.20": [
            "at.hannibal2.skyhanni.features.garden.composter.ComposterDisplay",
            "at.hannibal2.skyhanni.events.LorenzChatEvent"
        ]
    }
}

Notice how both all chat filters no longer work, and the composter display does no longer show.

Changelog Technical Details

  • Added banned classes. - hannibal2
    • Stop banned event classes from getting fired.
    • Stop banned listener classes from accepting events.

hannibal002 avatar Mar 24 '24 19:03 hannibal002

I'm unhappy about the performance impact. The isBanned call takes up 3% of the runtime, I'm aware that some calls are async therefore it isn't a direct 3% performance impact, but still it takes up not an unsignification amount of processing time.

I don't really know how to fix that. Since the problem is that we have a stupid amount of event listener and therefore call this function a lot. Test Spark For both Test and Spark I used the example for the bannedClasses.

How is the perf impact with an empty list tho? Because the case with banned classes is going to be fairly rare.

nea89o avatar Mar 26 '24 19:03 nea89o

Caching. for events we could add a boolean blocked as member in LorenzEvent and this gets changed on repo load, and for listeners we could ditch the whole check and simply unregister/register the classes on demand?

hannibal002 avatar Mar 26 '24 19:03 hannibal002

This pull request has conflicts with the base branch "beta". Please resolve those so we can test out your changes.

github-actions[bot] avatar Apr 13 '24 06:04 github-actions[bot]

#2008 implemented this

CalMWolfs avatar Jun 08 '24 04:06 CalMWolfs