Anuken / Mindustry

The automation tower defense RTS
https://mindustrygame.github.io
GNU General Public License v3.0
22.69k stars 2.98k forks source link

PlayerBanEvent doesnt trigger when an admin bans in game. #4956

Closed TranquillyUnpleasant closed 3 years ago

TranquillyUnpleasant commented 3 years ago

Platform: Linux (server)

Build: 126.1

Issue: It doesnt trigger on player bans when you do: Events.on(PlayerBanEvent.class, event -> { // insert code });

Steps to reproduce:

Link(s) to mod(s) used: https://github.com/TranquillyUnpleasant/ExamplePlugin variant of the example plugin with the PlayerBanEvent


Place an X (no spaces) between the brackets to confirm that you have read the line below.

Anuken commented 3 years ago

In-game player bans are IP-based; ID-based bans don't trigger, as the ID is already implicitly banned. Listen to PlayerIpBanEvent.

TranquillyUnpleasant commented 3 years ago

Shouldnt the event still trigger? Since the id is being banned, even if implicitly.

Anuken commented 3 years ago

After the IP ban, the player is already considered banned, so no further events are fired.

I can reorder the in-game ban order to make ID-ban events slightly more reliable, but that doesn't really change how the events work for other cases.