Commit Graph

283 Commits

Author SHA1 Message Date
games647 18bd778b7e General minor code clean up and typo fixes 2022-06-18 16:09:44 +02:00
Enginecrafter77 5abd864fa5 fix: Typo in config.yml comment about useProxyAgnosticResolver 2022-06-10 11:55:31 +02:00
Enginecrafter77 d7d0caf6e7 style: Re-phrasing of config.yml comment for useProxyAgnosticResolver
The comment for useProxyAgnosticResolver in config.yml was re-phrased and supplied with additional information regarding its effective context and its relation to the prevent-proxy setting in server.properties.
2022-06-10 11:40:21 +02:00
Enginecrafter77 edd82f7978 style: ProxyAgnosticMojangResolver: Extracted the URL into a constant
The URL of the mojang session server call in ProxyAgnosticMojangResolver was extracted into a constant in order to mitigate the "magic constants" problem.

Additionally, the 204 in the response code check was replaced by a constant from HttpURLConnection, again, in order to not use any magic numbers.
2022-06-10 11:38:22 +02:00
Enginecrafter77 5f494e5a04 feat: Config option to enable ProxyAgnosticMojangResolver
A config option was added to allow users to use the ProxyAgnosticMojangResolver if they feel the need to do so. This setting won't affect existing users since it's disabled by default.
2022-06-09 19:24:53 +02:00
Enginecrafter77 5d4483224d refactor: ProxyAgnosticMojangResolver
ProxyAgnosticMojangResolver serves as a cleaner implementation of the hasJoined static method from previous commit. All the reflection involved was removed due to no longer being necessary. This way, a lot cleaner code could be made. All the inner workings remained the same. For more information on how it works, check out ProxyAgnosticMojangResolver.java.
2022-06-09 19:04:49 +02:00
games647 82d8b4d2be Fix typo in messages for invalid-request 2022-06-07 18:18:28 +02:00
games647 fc50c997ba Dump craftapi for updated GSON version and allow . in legit usernames 2022-05-21 14:02:37 +02:00
games647 0105c29710 Reduce memory consumption of anti bot feature 2022-03-30 16:02:52 +02:00
games647 55270702a5 Document event behavior that is platform specific 2022-03-30 16:02:52 +02:00
games647 9d2c346235 Use platform scheduler to reuse threads between plugins
The platforms usually use a caching thread executor. It makes to use
this executor to reuse threads as they are expensive to create.
2022-03-30 16:02:51 +02:00
games647 1d3fcb9929 Use custom repository settings for faster fetching
Order of repository seems to indicate maven priority fetching
2022-03-30 16:02:51 +02:00
games647 35b044651c Update dependencies
diff --git a/bukkit/pom.xml b/bukkit/pom.xml
index e57b9d2..939697a 100644
--- a/bukkit/pom.xml
+++ b/bukkit/pom.xml
@@ -272,7 +272,7 @@
         <dependency>
             <groupId>com.lenis0012.bukkit</groupId>
             <artifactId>loginsecurity</artifactId>
-            <version>3.0.2</version>
+            <version>3.1</version>
             <scope>provided</scope>
             <optional>true</optional>
             <exclusions>
diff --git a/core/pom.xml b/core/pom.xml
index 15a1eb7..3738e9d 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -179,7 +179,7 @@
         <dependency>
             <groupId>com.google.code.gson</groupId>
             <artifactId>gson</artifactId>
-            <version>2.8.9</version>
+            <version>2.9.0</version>
         </dependency>
     </dependencies>
 </project>
2022-03-30 16:02:51 +02:00
dependabot[bot] 5d49c497b5 Bump slf4j-jdk14 from 2.0.0-alpha6 to 2.0.0-alpha7 (#756)
Bumps [slf4j-jdk14](https://github.com/qos-ch/slf4j) from 2.0.0-alpha6 to 2.0.0-alpha7.
- [Release notes](https://github.com/qos-ch/slf4j/releases)
- [Commits](https://github.com/qos-ch/slf4j/compare/v_2.0.0-alpha6...v_2.0.0-alpha7)

---
updated-dependencies:
- dependency-name: org.slf4j:slf4j-jdk14
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-28 13:16:30 +02:00
Smart123s a856356c49 Update license headers to 02db104
Done using `mvn license:format`
2022-03-13 10:08:57 +01:00
Smart123s 7e9bd1639b Move similar config checks to a common function
'autoRegisterFloodgate' and 'autoLoginFloodgate' have the same possible
options, and they are checked against the player in the exact same way.
For example, if either one of them is set to isLinked, linked status is
checked in the same way, regardless of wether it's checked for login or
for registering.
2022-02-25 18:14:25 +01:00
Smart123s 817eedd4ac Move autoLoginFloodgate check to a common function
Reduces duplicate code.
Added missing check for "no-conflict".
2022-02-25 18:13:44 +01:00
games647 d581b34005 Use mariadb protocol if using its connector
MariaDB enforces this to ensure the selection of the correct driver.

Fixes #724
2022-02-09 12:57:14 +01:00
games647 3665e15920 Add velocity driver hint
Related #723
2022-02-09 12:57:14 +01:00
games647 8de1546e7b Update craftapi to fix broken prevent-proxy api
Related #718
2022-02-04 16:37:13 +01:00
games647 3bcc6c2e94 Differentiate between rate limit and IOExceptions
(Related #698)
2022-01-14 14:22:11 +01:00
games647 b351338e0b Allow disabling anti bot completely 2022-01-14 14:13:43 +01:00
games647 36c9ae2465 Fix rate limiter
Time reported by nanoTime is arbitrarily and could include negative numbers
2022-01-14 14:03:14 +01:00
games647 e0f823cbe4 Fix rate limiter blocking the first requests
If the server just started, expireTime can become negative. Therefore, the first uninitialized values will not be made available.
2022-01-14 13:20:44 +01:00
games647 17234a791b Update logging dependency 2022-01-14 12:56:22 +01:00
games647 e6eb4939b4 Document generics 2022-01-14 12:50:53 +01:00
games647 36337f7feb Fix potential thread-safety issues in storing the profile 2022-01-14 12:50:07 +01:00
games647 35b493a708 Typo fixes 2022-01-14 12:12:47 +01:00
Smart123s b92911bf26 Made floodgatePrefixWorkaround configurable 2021-12-09 18:03:29 +01:00
Smart123s 8c33813e45 Update to Geyser 2.0 API 2021-12-06 19:22:54 +01:00
games647 95251b611a Initialize logger factory by doing a first call to it
Related #670
2021-12-03 10:22:33 +01:00
games647 7439a95e16 Reduce the amount of necessary dependencies by dropping transitive ones 2021-12-02 14:40:29 +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
games647 1dd27ff529 Restore 1.8 compatibility by shading guava in Spigot versions 2021-12-01 16:29:37 +01:00
Alberto Migliorato 2cdfdcb5c5 Added latest Guava and SLF4J compatibility
(1.18+ breaks support to older guava methods)
2021-12-01 01:12:38 +01:00
Smart123s 2f61a8f8ad Add packet level checks for Geyser
If AuthType == ONLINE, players will be treated as if they were Java
players
If AuthType == OFFLINE, name conflicts will be checked the same way it's
done with Floodgate
Updated config.yml to infrom about the changes.
2021-11-28 13:45:23 +01:00
Smart123s 2ac638f3f9 Merge bedrock packet checks into a single function
Floodgate and Geyser specific checks can now be modified without
changing JoinManagement.
Added the ability to resume Java specific checks for Bedrock players.
This will be neccessary for Geyser `auth-type=online` players
2021-11-28 13:44:57 +01:00
Smart123s af0bc34255 Use local Floodgate instance
Shortens code and fixes an unused warning
2021-11-28 13:44:57 +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 5612ca744b Fix relocating mariadb driver in Velocity
Fixes #643
2021-11-04 10:29:57 +01:00
Smart123s 9978fe69d5 Fix Floodgate detection for buggy ProtocolLib 2021-10-23 15:56:16 +02:00
Smart123s 94299d2547 Prefixed names for packet level Floodgate checks 2021-10-23 13:24:40 +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
BOT-Neil 8490ff628c Update JoinManagement.java 2021-10-01 17:15:05 +02:00
BOT-Neil 0d7b8e237d Update JoinManagement.java
dont check for empty prefixes
2021-10-01 13:29:02 +02:00
games647 8b4d4586a7 Fix compiling 2021-09-23 14:56:30 +02:00