SpongeAPI icon indicating copy to clipboard operation
SpongeAPI copied to clipboard

New & improved ban service proposal

Open KieronWiltshire opened this issue 7 years ago • 4 comments

This proposal is an attempt to currently improve the current ban service so that it may be extended further.

  • The current service assumes that there is only one ban per one game profile, what if I want to add multiple bans to a single game profile, this could be an example of where a moderator decides to ban a player for hacking, and later on this guy is using offensive language on the forums, I then want to add another ban on top of the previous one in order to extend his ban time. (Why not just change the time from the other ban? well I may want to keep the details for this ban, as well as append some meta data to that ban or whatever)
  • The current service assumes that there are only two types of bans (ip and profile), it would be better if types could be added and manipulated by other plugins, for example a ban should be considered a punishment for committing an offence, well what if there were other types of punishments? a terrible example in this case would be a mute
  • The source/commandsource for banning a player is to specific, currently it assumes it was either the "server" or the "player" that issued the ban, what if I have some form of custom ai/anti-cheat that also triggers bans, and I would really like to know what type of cheat triggered this automatic ban etc... My suggestion for this would be to have a BanSource that sources like an anti-cheat can implement so that plugins can check against, or even use as search parameters for looking up previous bans or whatever.
  • The "reason" provided within bans is not a descriptive enough element for server operators. In my opinion, it would be nice for the ban service to allow server operators to provide "notes" so that the moderator may add notes onto a ban, so that when the punishment is disputed, other server operators could read the notes and make better educated decisions in regards to pardons

I do think this may be a bit too much as this kind of service was designed to think about small as well as larger servers. I do however feel that there may be a few things that you could possibly take from my proposal.

KieronWiltshire avatar Dec 06 '16 13:12 KieronWiltshire

  1. Bans are only designed to be used for the server itself. However, it is possible to make a ban service using an external service that stores bans for more than just the server.
  2. IP bans and player bans are not so much different types of bans as different types of targets. One ban applies to an account, the other applies to the IP address they log in from. Both ban types behave exactly the same otherwise. Generic punishments, on the other hand, would be different behavior.
  3. The ban service is already flexible enough to use any Text as the ban source. You can just set it to something indicating your AI banned them. A CommandSource is not required.
  4. How would notes be different from the ban reason?

JBYoshi avatar Dec 06 '16 13:12 JBYoshi

@JBYoshi I know all of this already, I was asked to propose this by @me4502

1, 2: I already know. 3: I didn't know that. 4: Notes wouldn't be used instead of a reason, but essentially what I'm proposing is ban meta data, so that something like "notes" could be applied.

In regards to bans only being designed for the server itself, I get that Sponge is implementing it that way, but this is what the proposal is about, moving away from that strict design, and opening up to more options.

KieronWiltshire avatar Dec 06 '16 23:12 KieronWiltshire

My thoughts on this were to basically extend the bans service to technically support multiple bans per profile, but have the default implementation just understand a single ban per profile.

This would involve adding new methods that are aware of multiple bans per profile. Behaviour of the single ban methods would either get all bans, remove all bans, etc, based on what the method does.

me4502 avatar Dec 07 '16 03:12 me4502

@me4502 I think that's exactly what should be done 😂

KieronWiltshire avatar Dec 07 '16 12:12 KieronWiltshire