GrimAnticheat / Grim

Fully async, multithreaded, predictive, open source, 3.01 reach, 1.005 timer, 0.01% speed, 99.99% antikb, "bypassable" 1.8-1.20 anticheat.
GNU General Public License v3.0
1.09k stars 325 forks source link

Potential performance issue #1435

Open Symmettry opened 6 months ago

Symmettry commented 6 months ago

Feature description

I've noticed that for stuff like BadPacketsM, they exempt 1.7, but they are still being added to packet listeners.

Since the version won't change (until ofc they rejoin, but that creates a new grimplayer class anyway), then it should just straight up not add BadPacketsM to the player listeners entirely, because it will just waste resources calling the function and checking stuff.

ManInMyVan commented 6 months ago

Feature description

I've noticed that for stuff like BadPacketsM, they exempt 1.7, but they are still being added to packet listeners.

Since the version won't change (until ofc they rejoin, but that creates a new grimplayer class anyway), then it should just straight up not add BadPacketsM to the player listeners entirely, because it will just waste resources calling the function and checking stuff.

Instead of not adding it, we could probably just not call the packet listeners if the player is exempt, or the check isn't enabled (experimental).

A possible way we could do this is having an isEnabled function, which by default returns true. We should have the experimental check elsewhere, so it isn't overwritten when the function is implemented in checks.

Symmettry commented 6 months ago

Not adding it will do the same thing and improve performance more, as no checks will have to be implemented for checking if it's enabled & no memory is wasted with the extra class being made.

If the config is reloaded, it can just add the experimental checks to online players, which should work just fine. (assuming we're not going to add experimental checks when it's disabled at the time the player joins)

ManInMyVan commented 6 months ago

duplicate of #830 btw

DanilGnedin commented 6 months ago

Если не добавлять его, это приведет к тому же и еще больше повысит производительность, поскольку не нужно будет реализовывать проверки, включено ли оно, и память не будет потрачена впустую при создании дополнительного класса.

Если конфигурация перезагружена, она может просто добавить экспериментальные проверки онлайн-игрокам, что должно работать просто отлично. (предполагая, что мы не собираемся добавлять экспериментальные проверки, когда они отключены на момент присоединения игрока)

You can change all in grim.Its is open src project.You can create fork and change used checks.Its easy.

Symmettry commented 6 months ago

Not adding it will do the same thing and improve performance more, as no checks will have to be implemented for checking if it's enabled & no memory is wasted with the extra class being made. If the config is reloaded, it can just add the experimental checks to online players, which should work just fine. (assuming we're not going to add experimental checks when it's disabled at the time the player joins)

You can change all in grim.Its is open src project.You can create fork and change used checks.Its easy.

Sure, go do that.