Warzone / mars

All-in-one plugin for PGM servers
GNU Affero General Public License v3.0
9 stars 3 forks source link

Simultaneous punishment prevention (Mars-8) #18

Closed GrowlyX closed 2 years ago

GrowlyX commented 2 years ago

Fixes the following issue: Prevent repeat / simultaneous / accidental punishments against a single user

jellz commented 2 years ago

I think, for less complexity and latency, it would be better to handle double punishment prevention completely on the plugin side, as that is just one client of the API. The new endpoint would likely not be used by other clients, so it doesn't make sense for an API request-response to be required before issuing a punishment on the Minecraft server.

GrowlyX commented 2 years ago

Sounds good. I initially went ahead with this design as I assumed this feature would need to be available network-wide, not just the server which the punishment was issued on.

The request solution was also done to make use of redis as a network-wide K/V cache, which wasn't available from the plugin itself. I personally think this isn't the best design either, and could be simplified by allowing the client itself to handle all the redis functionality for this feature. Let me know your thoughts and whether I should change this to act as a local feature or not.

jellz commented 2 years ago

If a player needs to be banned or muted for breaking gameplay or chat rules, the moderators and player will all be on the same server. The only time network-wide double pun prevention would be necessary (in my eyes) is if two moderators are handling the same asynchronous reports (ie. submitted on the forum) at the same time, and they are not on the same MC server (which would be highly unusual). I think this feature should be implemented through a local cache on the plugin. It does not need to interface with the API or Redis.

GrowlyX commented 2 years ago

If a player needs to be banned or muted for breaking gameplay or chat rules, the moderators and player will all be on the same server. The only time network-wide double pun prevention would be necessary (in my eyes) is if two moderators are handling the same asynchronous reports (ie. submitted on the forum) at the same time, and they are not on the same MC server (which would be highly unusual). I think this feature should be implemented through a local cache on the plugin. It does not need to interface with the API or Redis.

Cool. I'll change the logic to cache it locally.