NoCheatPlus / Issues

Issues managment for the NoCheatPlus project.
13 stars 9 forks source link

New Event for NoCheatPlus #299

Open grzegorz2047 opened 7 years ago

grzegorz2047 commented 7 years ago

Is it possible to add event like this: https://github.com/grzegorz2047/NoCheatPlus/commit/b3002eec2a3ad43d9da68c8e92719e290e80fbb9 and called here: https://github.com/grzegorz2047/NoCheatPlus/commit/1db4b3dcfd28e855c26237b98fc5e11e8a072c2c Of course, it doesn't has to be exacly this probable naive code, but the same functionality. It shouldn't impact on performance too much.

asofold commented 7 years ago

Thought i had answered back then - might've slipped past or it got lost otherwise - that's possible in general.

Alternative (?) that works if added by another plugin: If it is about the notifications generated by the logging system only (mostly violations), you could use rflection (...) to attach a ContentLogger to the Streams.NOTIFY_INGAME stream (https://github.com/NoCheatPlus/NoCheatPlus/blob/master/NCPCommons/src/main/java/fr/neatmonster/nocheatplus/logging/details/AbstractLogManager.java#L352, https://github.com/NoCheatPlus/NoCheatPlus/blob/master/NCPCommons/src/main/java/fr/neatmonster/nocheatplus/logging/details/AbstractLogManager.java#L410). Those methods would have to be set accessible (currently: protected visibility).

You'd receive ingame messages after they have been processed normally for the primary thread, but before they have been scheduled for off-primary-thread. And you'd not receive if another plugin called the sendAdminNotify... methods.

Not sure this is worth it on your side - an event stating the stored players (and subscriptions) would be totally ok to add from my side.