Ban Management

Ban Management

193k Downloads

Listening to events

7rory768 opened this issue ยท 14 comments

commented

I want to listen to any event in which a player is (or could potentially be) banned. I notice that you have events that seem to be very similar except some are past tense and some are present tense, I'd like to know the difference so I don't listen to both if needed or the wrong set of events. Also I do know after a certain amount of warns a (temp)ban could be issued. Would that launch a ban event or should I listen to the warn events?

commented

Present tense events e.g. PlayerBanEvent are mutable, and can be cancelled. Past tense events, e.g. PlayerBannedEvent are immutable, final, and executed once the ban has entered the database, and in memory.

Warnings would issue a ban event, as they're just commands ran via the console. However, there isn't an easy way to determine whether the ban is due to reaching a warning limit or not.

commented

I don't need to know the source of the ban so as long as it launched a banned event that's great. Thank you!

commented

Just another quick question since I don't want to create another issue for something as simple as this. What does the actor variable in the NameBanData class represent? The PlayerData of the player that was banned or the PlayerData of the player that banned the other player?

commented

actor = issuer of punishment

commented

Ensure your plugin SimpleFreeze contains the following in the plugin.yml file

depend: [ BanManager ]
commented

[22:41:18 ERROR]: [SimpleFreeze] Plugin SimpleFreeze v3.0.0 has failed to register events for class org.plugins.simplefreeze.hooks.BanManagerHook because me/confuser/banmanager/events/IpBanEvent does not exist.

commented

softdepend: [Vault, EssentialsX, Essentials, LiteBans, BanManager]
Maybe I should just delay the event registry?

commented

Strange, silly question, is the BanManager jar definitely in your plugins folder? If you've set the dependency in the plugin.yml file, everything should be working fine.

commented

Wow... sorry to both you. No wonder the error only started showing after I cleaned out my test servers plugins folder.

commented

Actually... I added BanManager and the error still occurs

commented

Where is your BanManagerHook being instantiated? Within your plugin's onEnable?

commented

Also a silly question: are you sure your filesystem permissions are correct ? The errors don't directly imply a permission error, though. On a NIX system you need, at the minimum, execute permission (I think it was just x, otherwise read-execute) on all folders and read permission on the JARs (they don't need execution permission since they're not executed, they're imported/called). On Window$ I imagine you need the read-execute permission on folders and read on files; never tried it on Window$ so I don't know.

commented

I am initializing and registering the events in the onEnable method

@rautamiekka From what you said all I could understand that you were telling me to do is maybe check "Read only" in the BanManager.jar properties, that didn't fix it.

Would it be a bad idea to try and shade the BanManager.jar into my plugin?

commented

I wouldn't recommend shading it in. Is BanManager enabled? What version are you using?