This PR creates a new interface AbstractPlaform that is implemented on every supported platform. This new interface allows for writing abstract logic in the common package. Using this interface, the plugin messaging logic, as well as the punishment events logic has been re-written, and re-implemented in the common package. This allows for the ease of maintainability, and much more readable code.
Additionally, this PR makes the plugin:
Less vocal.
Adds support for the Paper-Velocity only modern forwarding configuration option. (For detecting if the server is proxied.)
Spam less plugin messages. A global Set<UUID> has been implemented, which keeps track of plugin messages per player. The entry is removed from the set when a response to the plugin message has been received, and there is a global task to clear it periodically. The reason for this implementation, is that because the cache check that determines whether the player issuing the MicrophonePacketEvent is in the cache, is inside the event body, and there is a scenario where the event is called again (and hence a new plugin message is sent) before the response is received, resulting in a wave of "pointless" plugin messages. The set ensures that only one plugin message is sent per player. In the long term I plan to change this implementation by instead using Caffeine's LoadingCache.
Use Paper as a dependency instead of Spigot to add support for checking the Velocity modern forwarding config option.
Moves the messages used by the plugin to the common package.
This PR creates a new interface
AbstractPlaform
that is implemented on every supported platform. This new interface allows for writing abstract logic in the common package. Using this interface, the plugin messaging logic, as well as the punishment events logic has been re-written, and re-implemented in the common package. This allows for the ease of maintainability, and much more readable code.Additionally, this PR makes the plugin:
Set<UUID>
has been implemented, which keeps track of plugin messages per player. The entry is removed from the set when a response to the plugin message has been received, and there is a global task to clear it periodically. The reason for this implementation, is that because the cache check that determines whether the player issuing theMicrophonePacketEvent
is in the cache, is inside the event body, and there is a scenario where the event is called again (and hence a new plugin message is sent) before the response is received, resulting in a wave of "pointless" plugin messages. The set ensures that only one plugin message is sent per player. In the long term I plan to change this implementation by instead using Caffeine's LoadingCache.