Commit Graph

349 Commits

Author SHA1 Message Date
Smart123s 8e6221d846 Fix delayed force login for Floodgate players
Login checks are done by bungee, so Bukkit doesn't have to do anything.
The session is set for them by the plugin messages, however, force login
may be delayed. In that case, the player should be logged in at
the onPlayerJoin event.
However, FloodgateAuthTask was run at onPlayerJoin, even if the player
allready had a valid login session. And FloodgateAuthTask always deffers
force login if bungee is present.
As a result, the Floodgate player will never get logged in, if the force
login was delayed by the plugin message.

Co-authored-by: BOT-Neil <neilbooth125@gmail.com>
2022-02-07 17:30:51 +01:00
Smart123s 7951c4c893 Fix plugin startup without ProtocolLib installed
Referencing `ProtocolLibrary` in FastLoginBukkit (even in an unreachable
code block) causes Bukkit servers to throw a NoClassDefFoundError on
startup.
Fix based on commit 0082cc6536
2022-01-29 10:48:27 +01:00
games647 b351338e0b Allow disabling anti bot completely 2022-01-14 14:13:43 +01:00
games647 0e935e3ad0 Fail safe if command is not specified in plugin.yml 2022-01-14 12:53:51 +01:00
games647 52d778afb1 Clean up 2022-01-14 12:52:46 +01:00
games647 aa51e98fe2 Declare nullable variants using jetbrains annotations 2022-01-14 12:16:30 +01:00
games647 35b493a708 Typo fixes 2022-01-14 12:12:47 +01:00
Smart123s 03850ae4f2 Only add Floodgate prefixes if they are needed
Without this patch, Java players would also get a prefix.
2021-12-09 19:40:46 +01:00
Smart123s b92911bf26 Made floodgatePrefixWorkaround configurable 2021-12-09 18:03:29 +01:00
Smart123s 8859ebb454 Manually append Floodgate Prefixes
This can be used as a workaround for #493
This will leave
https://github.com/GeyserMC/Floodgate/blob/821be02bdb179f7d4ba7b0ec79bbc721c28105f5/spigot/src/main/java/org/geysermc/floodgate/addon/data/SpigotDataHandler.java
in a limbo state, but it shouldn't have a noticable impact on neither
performance nor stability.
This commit will try append prefixes to every player, even if it's not
needed of if Floodgate isn't installed.
2021-12-09 18:01:58 +01:00
Smart123s 8c33813e45 Update to Geyser 2.0 API 2021-12-06 19:22:54 +01:00
games647 e1c1da199e Search SL4J JDK provider in our own classpath
Using the previous behavior it would look for the service file and provider
in the server jar. First it requires relocating the service file to our JDK
provider and let the service only be queryable from our plugin jar.

Fixes #668

Search SL4J JDK provider in our own classpath

Using the previous behavior it would look for the service file and provider
in the server jar. First it requires relocating the service file to our JDK
provider and let the service only be queryable from our plugin jar.

Fixes #668
2021-12-02 14:40:26 +01:00
Oldřich Jedlička 15fee92937 Detect enabled Velocity support in server 2021-11-29 13:12:19 +01:00
Smart123s fcd2aa95f0 Use BedrockService in JoinManagement
Since the code only needs to interact with Geyser, if Floodgate is not
installed, and perform similar things with both, it's reasonable, to
merge their code.
This commit breaks premium checking with `auth-type=online` in Geyser
2021-11-28 13:44:57 +01:00
Smart123s f76c7bd62f Create generalized BedrockService class 2021-11-28 13:44:57 +01:00
Smart123s f570474fa3 Detect Geyser connections at packet level
It is possible to use Geyser without Floodgate by configuring Geyser to
use auth-type= 'online' or 'offline'. In that scenario, floodgateService
will be either unavailable or empty.
2021-11-28 13:44:57 +01:00
Smart123s 3ee6cb2ada Create stub GeyserService
The FloodgateService and GeyserService classes are not merged,
because Geyser can work without Floodgate.
Added Geyser as 'softdepends' in plugin.yml and bungee.yml
to make it load before FastLogin.
Also made Floodgate a soft dependency in bungee.yml.
2021-11-28 13:44:56 +01:00
games647 ef6f0fc436 Fix detecting floodgate on plugin name
Floodgate's name is lowercase
Related #630
2021-10-11 16:09:24 +02:00
Krakenied d7e0a4469f Fix #627 - skip Floodgate config validation if there's no Floodgate installed
Fix BungeeManager NPE
2021-10-09 19:52:26 +02:00
games647 28480a0f01 Add floodgate service to Bungee 2021-10-05 15:42:40 +02:00
games647 a3bf875976 Encapsulate floodgate hooks
Related #619
Related #620
2021-10-05 15:35:43 +02:00
games647 6e0272d92c Fix receiving login packet twice with ProtocolLib
Fixes #578
Commit that introduces the bug:
1f4757669c
2021-07-16 14:24:17 +02:00
games647 758ccb9bf2 Clean up 2021-07-14 16:33:31 +02:00
games647 0515ac193d Extract protocollib method detection 2021-07-14 16:33:18 +02:00
games647 864e551a88 Disable verbose verification output
NameChange fix is resolved
2021-07-14 16:32:32 +02:00
games647 cde045d6fd Only build for main branches to fix duplicate actions with dependabot 2021-06-29 12:55:37 +02:00
games647 ccdc455ce9 Clarify naming and structure 2021-06-22 14:07:47 +02:00
games647 1f4757669c Allow packet modifications by other plugins
If we disable filters, other plugins are advised to only monitor
packets. Potential modifications can be allowed by enabling the filtering again, but adding our meta data to prevent duplicate
processing.
2021-06-22 11:15:21 +02:00
games647 daf6f06a00 Name anti-bot feature explicitly for own rate limiting 2021-06-21 17:33:38 +02:00
games647 9f89756820 Disable plugin if dependencies not available
Related #554
2021-06-21 17:08:20 +02:00
Smart123s fd3da28bec Use Override for non core code in FloodgateAuthTas 2021-06-20 13:35:31 +02:00
Smart123s 8f43cc0978 Partially move FloodgateAuthTask to Core
The moved code can be used in a BungeeCord implementation
2021-06-20 11:26:13 +02:00
games647 b9011b6141 Add support for 1.17
Fixes #552
2021-06-15 20:46:25 +02:00
Smart123s fb8780d006 Prevent duplicate name check API call
Previously: If allowFloodgateNameConflict = false or linked and either autoLoginFloodgate or
autoRegisterFloodgate is set to no-conflict and a player with a non-conflicting name
connects then there will be a double check.
2021-06-14 19:16:40 +02:00
Smart123s 4c0797d5ea No longer treat linked Floodgate players as conflicting names
Since linked players inherit the name of the Java player, it'll always conflict a Java player 's name
2021-06-14 19:16:04 +02:00
Smart123s 235d7f8d80 Add 'no-conflict' as an option to config.yml value checking 2021-06-14 19:16:04 +02:00
Smart123s dbf10f4767 Remove unnecessary whitespaces 2021-06-14 19:16:02 +02:00
Smart123s 165e5fe856 Add 'no-conflict' option to some Floodgate config entries 2021-06-14 19:09:43 +02:00
games647 4cf660559e Merge pull request #532 from Smart123s/fg-bk-ncshare
Share Floodgate name conflict check between Protocol Plugins
2021-06-14 10:37:11 +02:00
Smart123s 9656aadb35 Remove unused imports 2021-06-13 16:50:36 +02:00
Smart123s d51335c6de Don't store 'ultraAuthPlugin' 2021-06-13 16:36:04 +02:00
Smart123s 2fdcc34575 Don't store 'plugin' in BukkitScheduler 2021-06-13 16:33:47 +02:00
Smart123s 66a51a8e13 Remove unused 'serverId' from BukkitLoginSession 2021-06-13 16:31:39 +02:00
Smart123s 411148b560 No longer reference 'Floodgate' in JoinManagement
Referencing 'FloodgatePlayer' in JoinManagement.java and it's subclasses
has cause ProtocolLib to fail to register an event when Floodgate was not
installed.
2021-06-13 14:24:14 +02:00
Smart123s af0ef2aed9 Stop ProtocolSupport from crying
If I ever tried to either cast or use FloodgatePlayer as a return type
when Floodgate was not installed in the server, I got this error:

[19:37:46 ERROR]: [FastLogin] Plugin FastLogin v1.11-SNAPSHOT-744264d has failed to
register events for class
com.github.games647.fastlogin.bukkit.listener.protocolsupport.ProtocolSupportListener
because org/geysermc/floodgate/api/player/FloodgatePlayer does not exist.

ProtocolLib doen't have this problem.
2021-06-12 19:57:32 +02:00
Smart123s ee2b3a37f8 Move Floodgate name conflict check to Core 2021-06-12 19:57:31 +02:00
Smart123s 0e8ad6e318 Add license header to FloodgateHook.java 2021-06-12 19:56:36 +02:00
Péter Tombor bc8fffe063 Add license header to FloodgateAuthTask.java 2021-06-12 19:51:15 +02:00
Smart123s 757d0ef991 Fix & Move allowFloodgateNameConflict=linked 2021-06-05 18:43:23 +02:00
Smart123s 2d5a53a2f9 Kick player if Floodgate name conflict checking fails
Rebased on  Sat May 22 13:48:29 2021 +0200
Fixed typos in strings
2021-06-05 18:43:23 +02:00