LibertyBans
LibertyBans copied to clipboard
Change database and API to allow unlimited custom punishment types
Adopting this initiative would significantly improve our code quality, as well as database normalization.
Pros:
- Can add any number of new punishment types, like notes (#266 ), very easily
- Custom punishment types become first-class citizens. E.g., Technofield on Discord has a plugin that creates a deportation punishment type, whose enforcement is handled by that plugin; right now warnings are used as a substitute.
- Better code quality, remove abstraction over table objects and fields
- Better database normalization
Cons:
- Can't enforce ban exclusivity at the database level. However, this con is mitigated by the fact that any player can already have different victim types who are banned (IP address, UUID address, etc.). So, having multiple bans per player is something that de facto exists.
- Have to update the API, changing PunishmentType to a non-enum. This is a breaking change, but we can still provide the constants
BAN,MUTE, etc. We should keep supporting identity equality (==) by using a factory for PunishmentType.