J-Tanzanite / Little-Anti-Cheat

Anti-Cheat for Source Games
286 stars 69 forks source link

Some rewrited code and new forwards on cheat detection #155

Closed NaathySz closed 1 year ago

NaathySz commented 1 year ago

Based on https://github.com/J-Tanzanite/Little-Anti-Cheat/issues/154.

I have did this changes to my server a long time ago, but seems other peoples also want this. Not alway staffs will have access to the logs in real time, so i think it will be a good thing to add, not only for Discord, but other plugins too.

Its working good, 0 errors.

Please, merge it so i release plugin public.

J-Tanzanite commented 1 year ago

I unfortunately cannot take this patch for several reasons.

Instead of listing out the issues with these code changes, I'll skip straight to the main problem (which has nothing to do with this PR): Perhaps there is a better solution than sending out a forward with the line log.

There already are forwards in Lilac, one for blocking a detection, another to inform a detection did happen (and nothing blocked it) and the last one that a player is getting banned. In all three of these forwards, there are only two arguments passed: The client and the cheat number.

I'm not sure if updating these forwards to include detection details in the arguments would cause issues for existing plugins without those arguments, so I've been hesitant to do so. Plus it would be wasteful for plugins that don't need those details.

Adding a fourth forward with details would be wasteful, as some plugins may want to block a detection based on such details, and others may want the forward (when nothing is blocked) with those arguments too, which would mean adding two new forwards if we wanted to cover both cases. Which would mean we'd have 4 forwards created on a detection, this would just be ridiculous.

Currently, when something is detected, Lilac doesn't provide specific details on what was detected to other plugins, and it would be nice if it did. Since adding forwards would be silly, and I'm unsure about updating existing forwards, perhaps adding a native function to Lilac would be ideal. That way, plugins that need more details about a detection, whether it be in blocking or in non blocking forwards, can call the native function to get those details.

Last time I checked, there were more than one Discord API for sourcemod plugins, and so having Discord alerts be its own plugin makes sense, and calling a Native Lilac function to get specific details about a detection (if need be) might be the best solution.


PrintToChat(client, "\x01 \x07[DontCry] \x01%T", "welcome_msg", client, PLUGIN_VERSION);

This made me cry a little \j

NaathySz commented 1 year ago

Nothing to comment at the moment, ima bit busy, come to fix this tag. Sorry, i did not notice that when i open PR. Already fixed.

When i have time i will see your ideas. Btw i think an include file like that would be better for readibility and easy understanding, following the "default" that most plugins do.

Rushaway commented 1 year ago

Could you rebase this PR on dev branch ?

J-Tanzanite commented 1 year ago

Could you rebase this PR on dev branch ?

There wouldn't be any need, because I can't take this patch anyway.

When I said I unfortunately cannot take this patch for several reasons, some of the reasons were that the patch itself is unusable, the other being that it goes about this the wrong way. Rebasing isn't going to fix that. It's just way easier if I handle this myself, I'm going to merge the dev version into the public release, as it's ready. Discord support comes in a later version.