Ascension icon indicating copy to clipboard operation
Ascension copied to clipboard

Fix ban sync module + add option to sync to role

Open Dinty1 opened this issue 11 months ago • 3 comments

  • Fixed Paper/Bukkit ban listeners
  • Fixed NPE causing resync to silently fail
  • Made .gitignore properly ignore the files generated by runServer (for me at least)
  • Rearranged ban sync config
  • Added option to add a role when a player is banned

There still needs to be a solution to detect unbans/bans of offline players but this will likely require a bit of a refactor so some thinking is required and I'm just going to put it on the project board for now.

Implements https://github.com/DiscordSRV/DiscordSRV/issues/334

Dinty1 avatar Jan 16 '25 11:01 Dinty1

Further todo:

  • [x] Config option for whether gaining the role means you are "banned" for the purposes of discord->minecraft sync and vice versa
  • [x] Listen to role add/remove to cause resync (if the above is enabled)
  • [x] Improve logging of ban sync causes
  • [x] Verify that banning on discord with role enabled doesn't cause errors
  • [ added to board ] Ensure that timed resync also affects offline players - necessary since we've no reliable way of detecting offline players being banned
  • [x] Fix order annotations
  • [x] Test everything again with new config options
  • [x] Fix punisher format
  • [x] Banned Role: Fix banning a user in game causing a verbose error when member not in server
  • [ Added to board ] Discord to minecraft sync messed up (cache??)

Dinty1 avatar Jan 21 '25 21:01 Dinty1

Placeholders seem to not be replaced at all in the punisher format for discord bans. Unsure what's causing it as I'm not too familiar with how the PlaceholderService works.

Dinty1 avatar Feb 09 '25 11:02 Dinty1

https://github.com/DiscordSRV/Ascension/blob/3bff3610c905ded29f394ac7af9aaa3140181bc9/common/src/main/java/com/discordsrv/common/feature/bansync/BanSyncModule.java#L190 https://github.com/DiscordSRV/Ascension/blob/3bff3610c905ded29f394ac7af9aaa3140181bc9/common/src/main/java/com/discordsrv/common/feature/bansync/BanSyncModule.java#L391

It's used in two different places, with two entirely different sets of contexts

Vankka avatar Feb 09 '25 12:02 Vankka