Anti-VPN
Anti-VPN copied to clipboard
Add configurable delay for command execution for MCLeaks detection
Is your feature request related to a problem? Please describe. My problem is that if a player joins with MCLeaks, a conditional command plugin I am using won't work because although the connection has been processed, they are not actually on the server yet.
Describe the solution you'd like Add a configurable delay to the command execution
Describe alternatives you've considered I have not considered any alternatives
That's generally due to performance concerns. If a player using a VPN is detected, then it's better to kick them on the async pre-login event rather than the login event or the join event.
Here's my understanding of the login events (although they change between CB/Spigot/Paper, Bungee/Waterfall, and Velocity):
The async pre-login event happens before Mojang's API is contacted (and a UUID is verified) and only provides the player's assumed name, and sometimes a UUID (depending on the implementation). This is, as the name implies, run off the main thread.
Then, the Mojang API is contacted (using a credit) and player information is loaded from both the server and other plugins such as LuckPerms (whose default handling seems to be to load players on login, although a permission check or API call prior to this point will still load data). The player login event is fired at this stage.
Finally, the world is loaded (for the player), more information is loaded about the player- their inventory, etc. Yet more plugins are contacted about information about them, such as EssentialsX. Messages are sent (MOTDs, updates), etc. This is the player join event.
Anti-VPN detects (and if using LuckPerms or vault) kicks the player and runs commands as early as possible in the chain to prevent unnecessary information being loaded.
This behavior was requested in #67, touched on in #60, and #33 has more information on that system.
Essentially, this behavior is what prevents a well-executed botnet from absolutely crushing your server.
I can certainly add this feature, but I'm not sure you really want it. If you need a player to be in the physical world before you kick them you're quite far down the chain.