forked from TuxCoding/FastLogin
Compare commits
91 Commits
database-l
...
add-postgr
Author | SHA1 | Date | |
---|---|---|---|
31d9f3cb4a | |||
56e43fb146 | |||
a65a5f3020 | |||
8a729e069d | |||
d89d332273 | |||
cd3cfef6d4 | |||
6ec6e4844d | |||
60a65377b8 | |||
ffbf0ae3f4 | |||
4cf65cf7e5 | |||
dbf5ae2fae | |||
707572a007 | |||
108f5ad324 | |||
2112d06162 | |||
aece7f855d | |||
33b4ac8494 | |||
09161b86dd | |||
57833bb40b | |||
a1414a38ff | |||
0021bc476d | |||
4b1e08a2f8 | |||
dbf5b8907e | |||
e6dfa97e70 | |||
434a276d30 | |||
485af5e044 | |||
e566740dde | |||
db5b818a80 | |||
b0b998d1aa | |||
62ca46fe6a | |||
cd67797b5b | |||
48e8b45f1e | |||
1c9b8cb971 | |||
dcb9540a2f | |||
cacf3c23f1 | |||
67f170694f | |||
e15ea9ce85 | |||
70960661b4 | |||
ec657faaff | |||
51898b4b34 | |||
e30de1b700 | |||
ce17441edb | |||
3244b7a87a | |||
ecacd2a715 | |||
ea6d4cf2f6 | |||
91b05289ad | |||
4e0f8cfb65 | |||
d76690dcbe | |||
3559d067ad | |||
48a92ed35e | |||
a4eec19f53 | |||
32eda941ee | |||
92d88caf0a | |||
d2202d7a12 | |||
6a68e04c87 | |||
b702f48907 | |||
159a6ed37c | |||
b48dfed709 | |||
2db327ccc4 | |||
9d907983a6 | |||
4a3d7f448f | |||
31cbb2ff11 | |||
1715c08ee6 | |||
5682df9ad5 | |||
132b560130 | |||
e204c9c579 | |||
f92863e53a | |||
23fec56ecd | |||
5cd10fd795 | |||
ecbf07c0b2 | |||
053b51e96b | |||
44d365b15d | |||
610c49d62c | |||
dbd12742fa | |||
f2fd51d4e2 | |||
f9ca318775 | |||
f06ace2f5b | |||
ee465e381c | |||
6ab81b1a2f | |||
36ee52aa6e | |||
e5c70d8597 | |||
8b1485f0b1 | |||
c106089a72 | |||
41f83988fe | |||
dc4510aba3 | |||
dd0dd15200 | |||
5fc27f6c4a | |||
a182976207 | |||
e8811de62a | |||
0aedad8857 | |||
477ec06d55 | |||
73720277b3 |
8
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
8
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
@ -36,7 +36,7 @@ body:
|
|||||||
attributes:
|
attributes:
|
||||||
label: Server log
|
label: Server log
|
||||||
description: The error, stacktrace or link the complete log. You can use the links above for long versions.
|
description: The error, stacktrace or link the complete log. You can use the links above for long versions.
|
||||||
placeholder: https://hastebin.com/ / https://gist.github.com/
|
placeholder: https://www.toptal.com/developers/hastebin / https://gist.github.com/
|
||||||
- type: input
|
- type: input
|
||||||
attributes:
|
attributes:
|
||||||
label: Plugin version
|
label: Plugin version
|
||||||
@ -59,9 +59,11 @@ body:
|
|||||||
label: Relevance
|
label: Relevance
|
||||||
description: Check list for previous tickets
|
description: Check list for previous tickets
|
||||||
options:
|
options:
|
||||||
- label: I tried the latest build (build refers to development builds not necessary a release version)
|
- label: |
|
||||||
|
I tried the [latest build](https://ci.codemc.io/job/Games647/job/FastLogin/)
|
||||||
|
(build refers to development builds not necessary a release version; i.e. v1.10 is out of date)
|
||||||
required: true
|
required: true
|
||||||
- label: |
|
- label: |
|
||||||
I checked for existing tickets -
|
I checked for existing tickets -
|
||||||
If there are, please vote them with a thumps reaction and not create new ones
|
If there are, please vote them with a thumbs reaction and not create new ones
|
||||||
required: true
|
required: true
|
||||||
|
30
.github/ISSUE_TEMPLATE/enhancement_request.md
vendored
30
.github/ISSUE_TEMPLATE/enhancement_request.md
vendored
@ -1,30 +0,0 @@
|
|||||||
---
|
|
||||||
name: 💡 Enhancement request
|
|
||||||
about: New feature or change request
|
|
||||||
title: ''
|
|
||||||
labels: 'enhancement'
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
[//]: # (Lines in this format are considered as comments and will not be displayed.)
|
|
||||||
|
|
||||||
[//]: # (Before reporting make sure you're running the **latest build** of the plugin and checked for existing issues!)
|
|
||||||
|
|
||||||
[//]: # (This ticket is about suggestions for a feature or particular enhancement)
|
|
||||||
|
|
||||||
### Is your feature request related to a problem? Please describe.
|
|
||||||
|
|
||||||
[//]: # (A clear and concise description of what the problem is. Ex. I'm always frustrated when [...])
|
|
||||||
|
|
||||||
### Describe the solution you'd like
|
|
||||||
|
|
||||||
[//]: # (A clear and concise description of what you want to happen.)
|
|
||||||
|
|
||||||
### Describe alternatives you've considered
|
|
||||||
|
|
||||||
[//]: # (A clear and concise description of any alternative solutions or features you've considered.)
|
|
||||||
|
|
||||||
### Additional context
|
|
||||||
|
|
||||||
[//]: # (Add any other context or screenshots about the feature request here.)
|
|
43
.github/ISSUE_TEMPLATE/enhancement_request.yaml
vendored
Normal file
43
.github/ISSUE_TEMPLATE/enhancement_request.yaml
vendored
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
name: 💡 Enhancement request
|
||||||
|
description: New feature or change request
|
||||||
|
labels: [ enhancement ]
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
This ticket is about suggestions for a feature or particular enhancement.
|
||||||
|
Feedback about this form is appreciated.
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Is your feature request related to a problem? Please describe.
|
||||||
|
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Describe the solution you'd like
|
||||||
|
description: A clear and concise description of what you want to happen.
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Describe alternatives you've considered
|
||||||
|
description: A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Platform
|
||||||
|
description: Server software - choose your proxy software if you have multiple servers
|
||||||
|
options:
|
||||||
|
- Spigot
|
||||||
|
- BungeeCord
|
||||||
|
- Velocity
|
||||||
|
- All / Shared
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: checkboxes
|
||||||
|
attributes:
|
||||||
|
label: Relevance
|
||||||
|
description: Check list for previous tickets
|
||||||
|
options:
|
||||||
|
- label: |
|
||||||
|
I checked for existing tickets -
|
||||||
|
If there are, please vote them with a thumbs reaction and not create new ones
|
||||||
|
required: true
|
19
.github/dependabot.yml
vendored
19
.github/dependabot.yml
vendored
@ -14,3 +14,22 @@ updates:
|
|||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: weekly
|
interval: weekly
|
||||||
|
|
||||||
|
groups:
|
||||||
|
production-dependencies:
|
||||||
|
dependency-type: "production"
|
||||||
|
development-dependencies:
|
||||||
|
dependency-type: "development"
|
||||||
|
exclude-patterns:
|
||||||
|
# Create single PR for these
|
||||||
|
# Plugin require special evaluation about their compatibility
|
||||||
|
- "com.lenis0012.bukkit:loginsecurity"
|
||||||
|
- "com.comphenix.protocol:ProtocolLib"
|
||||||
|
|
||||||
|
ignore:
|
||||||
|
# HikariCP dropped Java 8 support with 5.0
|
||||||
|
- dependency-name: "com.zaxxer:HikariCP"
|
||||||
|
update-types: ["version-update:semver-major"]
|
||||||
|
# SnakeYAML has breaking changes with 2.0
|
||||||
|
- dependency-name: "org.yaml:snakeyaml"
|
||||||
|
update-types: ["version-update:semver-major"]
|
||||||
|
45
.github/workflows/codeql-analysis.yml
vendored
45
.github/workflows/codeql-analysis.yml
vendored
@ -4,11 +4,11 @@
|
|||||||
name: "CodeQL"
|
name: "CodeQL"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# Scan only for push on the primary branch for now
|
workflow_run:
|
||||||
push:
|
workflows: ["Maven Build"]
|
||||||
branches: [ main ]
|
branches: [main]
|
||||||
pull_request:
|
types:
|
||||||
branches: [ main ]
|
- completed
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# job i
|
# job i
|
||||||
@ -20,6 +20,10 @@ jobs:
|
|||||||
# Environment
|
# Environment
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
|
||||||
|
|
||||||
|
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
actions: read
|
actions: read
|
||||||
contents: read
|
contents: read
|
||||||
@ -33,28 +37,29 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# Setup Java
|
|
||||||
- name: Set up JDK
|
|
||||||
uses: actions/setup-java@v3
|
|
||||||
with:
|
|
||||||
distribution: 'temurin'
|
|
||||||
java-version: 19
|
|
||||||
cache: 'maven'
|
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v2
|
uses: github/codeql-action/init@v3
|
||||||
with:
|
with:
|
||||||
languages: ${{ matrix.language }}
|
languages: ${{ matrix.language }}
|
||||||
|
|
||||||
# Auto build attempts to build any compiled languages (C/C++, C#, or Java).
|
# Setup Java
|
||||||
# If this step fails, then you should remove it and run the build manually (see below)
|
- name: Set up JDK
|
||||||
- name: Autobuild
|
uses: actions/setup-java@v4
|
||||||
uses: github/codeql-action/autobuild@v2
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version-file: '.java-version'
|
||||||
|
cache: 'maven'
|
||||||
|
|
||||||
|
# Manually start the autobuild process, because autobuild always selects Java 8 as build toolchain, but
|
||||||
|
# we are doing cross-crompiling from a newer Java version
|
||||||
|
- name: Build with Maven
|
||||||
|
# Extracted from autobuild
|
||||||
|
run: mvn package -f "pom.xml" --batch-mode -V -e -Dfindbugs.skip -Dcheckstyle.skip -Dpmd.skip=true -Dspotbugs.skip -Denforcer.skip -Dmaven.javadoc.skip -DskipTests -Dmaven.test.skip.exec -Dlicense.skip=true -Drat.skip=true -Dspotless.check.skip=true -t /home/runner/.m2/toolchains.xml
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v2
|
uses: github/codeql-action/analyze@v3
|
||||||
with:
|
with:
|
||||||
category: "/language:${{matrix.language}}"
|
category: "/language:${{matrix.language}}"
|
||||||
|
12
.github/workflows/maven.yml
vendored
12
.github/workflows/maven.yml
vendored
@ -21,19 +21,19 @@ jobs:
|
|||||||
# Environment image - always use the newest OS
|
# Environment image - always use the newest OS
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: write
|
||||||
|
|
||||||
# Run steps
|
# Run steps
|
||||||
steps:
|
steps:
|
||||||
# Pull changes
|
# Pull changes
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
# Setup Java
|
# Setup Java
|
||||||
- name: Set up JDK
|
- name: Set up JDK
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: 19
|
java-version-file: '.java-version'
|
||||||
cache: 'maven'
|
cache: 'maven'
|
||||||
|
|
||||||
# Build and test (included in package)
|
# Build and test (included in package)
|
||||||
@ -41,3 +41,7 @@ jobs:
|
|||||||
# Run non-interactive, package (with compile+test),
|
# Run non-interactive, package (with compile+test),
|
||||||
# ignore snapshot updates, because they are likely to have breaking changes, enforce checksums
|
# ignore snapshot updates, because they are likely to have breaking changes, enforce checksums
|
||||||
run: mvn test --batch-mode --threads 2.0C --no-snapshot-updates --strict-checksums --file pom.xml
|
run: mvn test --batch-mode --threads 2.0C --no-snapshot-updates --strict-checksums --file pom.xml
|
||||||
|
|
||||||
|
- name: Update dependency graph
|
||||||
|
if: ${{ github.event_name == 'push' }}
|
||||||
|
uses: advanced-security/maven-dependency-submission-action@v4.0.0
|
||||||
|
2
.java-version
Normal file
2
.java-version
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# Latest GitHub Action java release that is installed on the runners
|
||||||
|
21
|
3
LICENSE
3
LICENSE
@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2015-2022 games647 and contributors
|
Copyright (c) 2015-2023 games647 and contributors
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
|
12
README.md
12
README.md
@ -60,13 +60,13 @@ Possible values: `Premium`, `Cracked`, `Unknown`
|
|||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
* Java 17+
|
* Java 17+ (Recommended)
|
||||||
* Server software in offlinemode:
|
* Server software in offlinemode:
|
||||||
* Spigot (or a fork e.g. Paper) 1.8.8+
|
* Spigot (or a fork e.g. Paper) 1.8.8+
|
||||||
* Protocol plugin:
|
* Protocol plugin:
|
||||||
* [ProtocolLib 5.0+](https://www.spigotmc.org/resources/protocollib.1997/) or
|
* [ProtocolLib 5.1+](https://www.spigotmc.org/resources/protocollib.1997/) or
|
||||||
* [ProtocolSupport](https://www.spigotmc.org/resources/protocolsupport.7201/)
|
* [ProtocolSupport](https://www.spigotmc.org/resources/protocolsupport.7201/)
|
||||||
* Latest BungeeCord (or a fork e.g. Waterfall)
|
* Latest BungeeCord (or a fork e.g. Waterfall) or Velocity
|
||||||
* An auth plugin.
|
* An auth plugin.
|
||||||
|
|
||||||
### Supported auth plugins
|
### Supported auth plugins
|
||||||
@ -117,10 +117,10 @@ Install the plugin on both platforms, that is proxy (BungeeCord or Velocity) and
|
|||||||
4. Activate ip forwarding in your proxy config
|
4. Activate ip forwarding in your proxy config
|
||||||
5. Check your database settings in the config of FastLogin on your proxy
|
5. Check your database settings in the config of FastLogin on your proxy
|
||||||
* The proxies only ship with a limited set of drivers where Spigot supports more. Therefore, these are supported:
|
* The proxies only ship with a limited set of drivers where Spigot supports more. Therefore, these are supported:
|
||||||
* BungeeCord: `com.mysql.jdbc.Driver` for MySQL/MariaDB
|
* BungeeCord: `com.mysql.jdbc.Driver` for MySQL/MariaDB/PostgreSQL
|
||||||
* Velocity: `fastlogin.mariadb.jdbc.Driver` for MySQL/MariaDB
|
* Velocity: `fastlogin.mariadb.jdbc.Driver` for MySQL/MariaDB/PostgreSQL
|
||||||
* Note the embedded file storage SQLite is not available
|
* Note the embedded file storage SQLite is not available
|
||||||
* MySQL/MariaDB requires an external database server running. Check your server provider if there is one available
|
* MySQL/MariaDB/PostgreSQL requires an external database server running. Check your server provider if there is one available
|
||||||
or install one.
|
or install one.
|
||||||
6. Set proxy and Spigot in offline mode by setting the value `onlinemode` in your `config.yml` to false
|
6. Set proxy and Spigot in offline mode by setting the value `onlinemode` in your `config.yml` to false
|
||||||
7. You should *always* configure the firewall for your Spigot server so that it's only accessible through your proxy
|
7. You should *always* configure the firewall for your Spigot server so that it's only accessible through your proxy
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2015-2022 games647 and contributors
|
Copyright (c) 2015-2023 games647 and contributors
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -50,11 +50,15 @@
|
|||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<version>3.4.1</version>
|
<version>3.5.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||||
<shadedArtifactAttached>false</shadedArtifactAttached>
|
<shadedArtifactAttached>false</shadedArtifactAttached>
|
||||||
<relocations>
|
<relocations>
|
||||||
|
<relocation>
|
||||||
|
<pattern>org.yaml.snakeyaml</pattern>
|
||||||
|
<shadedPattern>fastlogin.yaml</shadedPattern>
|
||||||
|
</relocation>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>com.zaxxer.hikari</pattern>
|
<pattern>com.zaxxer.hikari</pattern>
|
||||||
<shadedPattern>fastlogin.hikari</shadedPattern>
|
<shadedPattern>fastlogin.hikari</shadedPattern>
|
||||||
@ -123,6 +127,9 @@
|
|||||||
<repository>
|
<repository>
|
||||||
<id>dmulloy2-repo</id>
|
<id>dmulloy2-repo</id>
|
||||||
<url>https://repo.dmulloy2.net/repository/public/</url>
|
<url>https://repo.dmulloy2.net/repository/public/</url>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</snapshots>
|
||||||
</repository>
|
</repository>
|
||||||
|
|
||||||
<!-- AuthMe Reloaded, xAuth and LoginSecurity -->
|
<!-- AuthMe Reloaded, xAuth and LoginSecurity -->
|
||||||
@ -161,6 +168,13 @@
|
|||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.yaml</groupId>
|
||||||
|
<artifactId>snakeyaml</artifactId>
|
||||||
|
<version>1.33</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- PaperSpigot API for correcting user cache usage -->
|
<!-- PaperSpigot API for correcting user cache usage -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.papermc.paper</groupId>
|
<groupId>io.papermc.paper</groupId>
|
||||||
@ -176,13 +190,6 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- PaperLib for checking if server uses PaperSpigot -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.papermc</groupId>
|
|
||||||
<artifactId>paperlib</artifactId>
|
|
||||||
<version>1.0.8</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.mojang</groupId>
|
<groupId>com.mojang</groupId>
|
||||||
<artifactId>datafixerupper</artifactId>
|
<artifactId>datafixerupper</artifactId>
|
||||||
@ -200,7 +207,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.comphenix.protocol</groupId>
|
<groupId>com.comphenix.protocol</groupId>
|
||||||
<artifactId>ProtocolLib</artifactId>
|
<artifactId>ProtocolLib</artifactId>
|
||||||
<version>5.0.0-SNAPSHOT</version>
|
<version>5.1.0</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
@ -271,7 +278,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>me.clip</groupId>
|
<groupId>me.clip</groupId>
|
||||||
<artifactId>placeholderapi</artifactId>
|
<artifactId>placeholderapi</artifactId>
|
||||||
<version>2.11.3</version>
|
<version>2.11.5</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
@ -300,7 +307,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.lenis0012.bukkit</groupId>
|
<groupId>com.lenis0012.bukkit</groupId>
|
||||||
<artifactId>loginsecurity</artifactId>
|
<artifactId>loginsecurity</artifactId>
|
||||||
<version>3.1.1</version>
|
<version>3.3.0</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
@ -371,7 +378,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bouncycastle</groupId>
|
<groupId>org.bouncycastle</groupId>
|
||||||
<artifactId>bcprov-jdk18on</artifactId>
|
<artifactId>bcprov-jdk18on</artifactId>
|
||||||
<version>1.72</version>
|
<version>1.77</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -27,13 +27,12 @@ package com.github.games647.fastlogin.bukkit;
|
|||||||
|
|
||||||
import com.github.games647.craftapi.model.skin.SkinProperty;
|
import com.github.games647.craftapi.model.skin.SkinProperty;
|
||||||
import com.github.games647.fastlogin.bukkit.listener.protocollib.packet.ClientPublicKey;
|
import com.github.games647.fastlogin.bukkit.listener.protocollib.packet.ClientPublicKey;
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
import com.github.games647.fastlogin.core.shared.LoginSession;
|
import com.github.games647.fastlogin.core.shared.LoginSession;
|
||||||
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a client connecting to the server.
|
* Represents a client connecting to the server.
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -26,13 +26,12 @@
|
|||||||
package com.github.games647.fastlogin.bukkit;
|
package com.github.games647.fastlogin.bukkit;
|
||||||
|
|
||||||
import com.github.games647.fastlogin.core.AsyncScheduler;
|
import com.github.games647.fastlogin.core.AsyncScheduler;
|
||||||
|
|
||||||
import java.util.concurrent.Executor;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
|
import java.util.concurrent.Executor;
|
||||||
|
|
||||||
public class BukkitScheduler extends AsyncScheduler {
|
public class BukkitScheduler extends AsyncScheduler {
|
||||||
|
|
||||||
private final Executor syncExecutor;
|
private final Executor syncExecutor;
|
||||||
@ -40,7 +39,7 @@ public class BukkitScheduler extends AsyncScheduler {
|
|||||||
public BukkitScheduler(Plugin plugin, Logger logger) {
|
public BukkitScheduler(Plugin plugin, Logger logger) {
|
||||||
super(logger, command -> Bukkit.getScheduler().runTaskAsynchronously(plugin, command));
|
super(logger, command -> Bukkit.getScheduler().runTaskAsynchronously(plugin, command));
|
||||||
|
|
||||||
syncExecutor = r -> Bukkit.getScheduler().runTask(plugin, r);
|
syncExecutor = task -> Bukkit.getScheduler().runTask(plugin, task);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Executor getSyncExecutor() {
|
public Executor getSyncExecutor() {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -31,6 +31,10 @@ import com.github.games647.fastlogin.core.message.LoginActionMessage;
|
|||||||
import com.github.games647.fastlogin.core.message.NamespaceKey;
|
import com.github.games647.fastlogin.core.message.NamespaceKey;
|
||||||
import com.google.common.io.ByteArrayDataOutput;
|
import com.google.common.io.ByteArrayDataOutput;
|
||||||
import com.google.common.io.ByteStreams;
|
import com.google.common.io.ByteStreams;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Server;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.messaging.PluginMessageRecipient;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
@ -44,11 +48,6 @@ import java.util.Set;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Server;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.plugin.messaging.PluginMessageRecipient;
|
|
||||||
|
|
||||||
import static com.github.games647.fastlogin.core.message.ChangePremiumMessage.CHANGE_CHANNEL;
|
import static com.github.games647.fastlogin.core.message.ChangePremiumMessage.CHANGE_CHANNEL;
|
||||||
import static com.github.games647.fastlogin.core.message.SuccessMessage.SUCCESS_CHANNEL;
|
import static com.github.games647.fastlogin.core.message.SuccessMessage.SUCCESS_CHANNEL;
|
||||||
import static java.util.stream.Collectors.toSet;
|
import static java.util.stream.Collectors.toSet;
|
||||||
@ -94,6 +93,10 @@ public class BungeeManager {
|
|||||||
|
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
proxyIds = loadBungeeCordIds();
|
proxyIds = loadBungeeCordIds();
|
||||||
|
if (proxyIds.isEmpty()) {
|
||||||
|
plugin.getLog().info("No valid IDs found. Minecraft proxy support cannot work in the current state");
|
||||||
|
}
|
||||||
|
|
||||||
registerPluginChannels();
|
registerPluginChannels();
|
||||||
plugin.getLog().info("Found enabled proxy configuration");
|
plugin.getLog().info("Found enabled proxy configuration");
|
||||||
plugin.getLog().info("Remember to follow the proxy guide to complete your setup");
|
plugin.getLog().info("Remember to follow the proxy guide to complete your setup");
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -41,17 +41,6 @@ import com.github.games647.fastlogin.core.hooks.bedrock.FloodgateService;
|
|||||||
import com.github.games647.fastlogin.core.hooks.bedrock.GeyserService;
|
import com.github.games647.fastlogin.core.hooks.bedrock.GeyserService;
|
||||||
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
||||||
import com.github.games647.fastlogin.core.shared.PlatformPlugin;
|
import com.github.games647.fastlogin.core.shared.PlatformPlugin;
|
||||||
|
|
||||||
import io.papermc.lib.PaperLib;
|
|
||||||
|
|
||||||
import java.net.InetSocketAddress;
|
|
||||||
import java.nio.file.Path;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
import java.util.concurrent.ConcurrentMap;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -62,6 +51,14 @@ import org.geysermc.geyser.GeyserImpl;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
|
import java.net.InetSocketAddress;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import java.util.concurrent.ConcurrentMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This plugin checks if a player has a paid account and if so tries to skip offline mode authentication.
|
* This plugin checks if a player has a paid account and if so tries to skip offline mode authentication.
|
||||||
*/
|
*/
|
||||||
@ -120,7 +117,7 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin<Comman
|
|||||||
ProtocolLibListener.register(this, core.getAntiBot(), core.getConfig().getBoolean("verifyClientKeys"));
|
ProtocolLibListener.register(this, core.getAntiBot(), core.getConfig().getBoolean("verifyClientKeys"));
|
||||||
|
|
||||||
//if server is using paper - we need to set the skin at pre login anyway, so no need for this listener
|
//if server is using paper - we need to set the skin at pre login anyway, so no need for this listener
|
||||||
if (!PaperLib.isPaper() && getConfig().getBoolean("forwardSkin")) {
|
if (!isPaper() && getConfig().getBoolean("forwardSkin")) {
|
||||||
pluginManager.registerEvents(new SkinApplyListener(this), this);
|
pluginManager.registerEvents(new SkinApplyListener(this), this);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -136,7 +133,7 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin<Comman
|
|||||||
pluginManager.registerEvents(new ConnectionListener(this), this);
|
pluginManager.registerEvents(new ConnectionListener(this), this);
|
||||||
|
|
||||||
//if server is using paper - we need to add one more listener to correct the user cache usage
|
//if server is using paper - we need to add one more listener to correct the user cache usage
|
||||||
if (PaperLib.isPaper()) {
|
if (isPaper()) {
|
||||||
pluginManager.registerEvents(new PaperCacheListener(this), this);
|
pluginManager.registerEvents(new PaperCacheListener(this), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,6 +228,22 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin<Comman
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetches the premium status of an online player.
|
* Fetches the premium status of an online player.
|
||||||
|
* {@snippet :
|
||||||
|
* // Bukkit's players object after successful authentication i.e. PlayerJoinEvent
|
||||||
|
* // except for proxies like BungeeCord and Velocity where the details are sent delayed (1-2 seconds)
|
||||||
|
* Player player;
|
||||||
|
* PremiumStatus status = JavaPlugin.getPlugin(FastLoginBukkit.class).getStatus(player.getUniqueId());
|
||||||
|
* switch (status) {
|
||||||
|
* case CRACKED:
|
||||||
|
* // player is offline
|
||||||
|
* break;
|
||||||
|
* case PREMIUM:
|
||||||
|
* // account is premium and player passed the verification
|
||||||
|
* break;
|
||||||
|
* case UNKNOWN:
|
||||||
|
* // no record about this player
|
||||||
|
* }
|
||||||
|
* }
|
||||||
*
|
*
|
||||||
* @param onlinePlayer player that is currently online player (play state)
|
* @param onlinePlayer player that is currently online player (play state)
|
||||||
* @return the online status or unknown if an error happened, the player isn't online or BungeeCord doesn't send
|
* @return the online status or unknown if an error happened, the player isn't online or BungeeCord doesn't send
|
||||||
@ -305,4 +318,17 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin<Comman
|
|||||||
}
|
}
|
||||||
return geyserService;
|
return geyserService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isPaper() {
|
||||||
|
return isClassAvailable("com.destroystokyo.paper.PaperConfig").isPresent()
|
||||||
|
|| isClassAvailable("io.papermc.paper.configuration.Configuration").isPresent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Optional<Class<?>> isClassAvailable(String clazzName) {
|
||||||
|
try {
|
||||||
|
return Optional.of(Class.forName(clazzName));
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*/
|
||||||
|
package com.github.games647.fastlogin.bukkit;
|
||||||
|
|
||||||
|
import java.net.InetAddress;
|
||||||
|
|
||||||
|
public final class InetUtils {
|
||||||
|
|
||||||
|
private InetUtils() {
|
||||||
|
// Utility
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verifies if the given IP address is from the local network
|
||||||
|
*
|
||||||
|
* @param address IP address
|
||||||
|
* @return true if address is from local network or even from the device itself (loopback)
|
||||||
|
*/
|
||||||
|
public static boolean isLocalAddress(InetAddress address) {
|
||||||
|
// Loopback addresses like 127.0.* (IPv4) or [::1] (IPv6)
|
||||||
|
return address.isLoopbackAddress()
|
||||||
|
// Example: 10.0.0.0, 172.16.0.0, 192.168.0.0, fec0::/10 (deprecated)
|
||||||
|
// Ref: https://en.wikipedia.org/wiki/IP_address#Private_addresses
|
||||||
|
|| address.isSiteLocalAddress()
|
||||||
|
// Example: 169.254.0.0/16, fe80::/10
|
||||||
|
// Ref: https://en.wikipedia.org/wiki/IP_address#Address_autoconfiguration
|
||||||
|
|| address.isLinkLocalAddress()
|
||||||
|
// non deprecated unique site-local that java doesn't check yet -> fc00::/7
|
||||||
|
|| isIPv6UniqueSiteLocal(address);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isIPv6UniqueSiteLocal(InetAddress address) {
|
||||||
|
// ref: https://en.wikipedia.org/wiki/Unique_local_address
|
||||||
|
|
||||||
|
// currently undefined but could be used in the near future fc00::/8
|
||||||
|
return (address.getAddress()[0] & 0xFF) == 0xFC
|
||||||
|
// in use for unique site-local fd00::/8
|
||||||
|
|| (address.getAddress()[0] & 0xFF) == 0xFD;
|
||||||
|
}
|
||||||
|
}
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -25,14 +25,13 @@
|
|||||||
*/
|
*/
|
||||||
package com.github.games647.fastlogin.bukkit;
|
package com.github.games647.fastlogin.bukkit;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||||
|
|
||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class PremiumPlaceholder extends PlaceholderExpansion {
|
public class PremiumPlaceholder extends PlaceholderExpansion {
|
||||||
|
|
||||||
private static final String PLACEHOLDER_VARIABLE = "status";
|
private static final String PLACEHOLDER_VARIABLE = "status";
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -27,8 +27,7 @@ package com.github.games647.fastlogin.bukkit.command;
|
|||||||
|
|
||||||
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||||
import com.github.games647.fastlogin.bukkit.event.BukkitFastLoginPremiumToggleEvent;
|
import com.github.games647.fastlogin.bukkit.event.BukkitFastLoginPremiumToggleEvent;
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
|
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -27,16 +27,15 @@ package com.github.games647.fastlogin.bukkit.command;
|
|||||||
|
|
||||||
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||||
import com.github.games647.fastlogin.bukkit.event.BukkitFastLoginPremiumToggleEvent;
|
import com.github.games647.fastlogin.bukkit.event.BukkitFastLoginPremiumToggleEvent;
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
import com.github.games647.fastlogin.core.shared.event.FastLoginPremiumToggleEvent.PremiumToggleReason;
|
import com.github.games647.fastlogin.core.shared.event.FastLoginPremiumToggleEvent.PremiumToggleReason;
|
||||||
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Let users activate fast login by command. This only be accessible if
|
* Let users activate fast login by command. This only be accessible if
|
||||||
* the user has access to its account. So we can make sure that not another
|
* the user has access to its account. So we can make sure that not another
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -28,9 +28,6 @@ package com.github.games647.fastlogin.bukkit.command;
|
|||||||
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||||
import com.github.games647.fastlogin.core.message.ChangePremiumMessage;
|
import com.github.games647.fastlogin.core.message.ChangePremiumMessage;
|
||||||
import com.github.games647.fastlogin.core.message.ChannelMessage;
|
import com.github.games647.fastlogin.core.message.ChannelMessage;
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
@ -38,6 +35,8 @@ import org.bukkit.command.CommandSender;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.messaging.PluginMessageRecipient;
|
import org.bukkit.plugin.messaging.PluginMessageRecipient;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
public abstract class ToggleCommand implements CommandExecutor {
|
public abstract class ToggleCommand implements CommandExecutor {
|
||||||
|
|
||||||
protected final FastLoginBukkit plugin;
|
protected final FastLoginBukkit plugin;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -25,10 +25,9 @@
|
|||||||
*/
|
*/
|
||||||
package com.github.games647.fastlogin.bukkit.event;
|
package com.github.games647.fastlogin.bukkit.event;
|
||||||
|
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
import com.github.games647.fastlogin.core.shared.LoginSession;
|
import com.github.games647.fastlogin.core.shared.LoginSession;
|
||||||
import com.github.games647.fastlogin.core.shared.event.FastLoginAutoLoginEvent;
|
import com.github.games647.fastlogin.core.shared.event.FastLoginAutoLoginEvent;
|
||||||
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
import org.bukkit.event.Event;
|
import org.bukkit.event.Event;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -25,10 +25,9 @@
|
|||||||
*/
|
*/
|
||||||
package com.github.games647.fastlogin.bukkit.event;
|
package com.github.games647.fastlogin.bukkit.event;
|
||||||
|
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
import com.github.games647.fastlogin.core.shared.LoginSource;
|
import com.github.games647.fastlogin.core.shared.LoginSource;
|
||||||
import com.github.games647.fastlogin.core.shared.event.FastLoginPreLoginEvent;
|
import com.github.games647.fastlogin.core.shared.event.FastLoginPreLoginEvent;
|
||||||
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
import org.bukkit.event.Event;
|
import org.bukkit.event.Event;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -25,9 +25,8 @@
|
|||||||
*/
|
*/
|
||||||
package com.github.games647.fastlogin.bukkit.event;
|
package com.github.games647.fastlogin.bukkit.event;
|
||||||
|
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
import com.github.games647.fastlogin.core.shared.event.FastLoginPremiumToggleEvent;
|
import com.github.games647.fastlogin.core.shared.event.FastLoginPremiumToggleEvent;
|
||||||
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
import org.bukkit.event.Event;
|
import org.bukkit.event.Event;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -28,20 +28,18 @@ package com.github.games647.fastlogin.bukkit.hook;
|
|||||||
import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
||||||
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||||
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
||||||
|
|
||||||
import fr.xephi.authme.api.v3.AuthMeApi;
|
import fr.xephi.authme.api.v3.AuthMeApi;
|
||||||
import fr.xephi.authme.events.RestoreSessionEvent;
|
import fr.xephi.authme.events.RestoreSessionEvent;
|
||||||
import fr.xephi.authme.process.Management;
|
import fr.xephi.authme.process.Management;
|
||||||
import fr.xephi.authme.process.register.executors.ApiPasswordRegisterParams;
|
import fr.xephi.authme.process.register.executors.ApiPasswordRegisterParams;
|
||||||
import fr.xephi.authme.process.register.executors.RegistrationMethod;
|
import fr.xephi.authme.process.register.executors.RegistrationMethod;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GitHub: <a href="https://github.com/Xephi/AuthMeReloaded/">...</a>
|
* GitHub: <a href="https://github.com/Xephi/AuthMeReloaded/">...</a>
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -29,20 +29,18 @@ import com.comphenix.protocol.reflect.accessors.Accessors;
|
|||||||
import com.comphenix.protocol.reflect.accessors.FieldAccessor;
|
import com.comphenix.protocol.reflect.accessors.FieldAccessor;
|
||||||
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||||
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
||||||
|
|
||||||
import de.st_ddt.crazylogin.CrazyLogin;
|
import de.st_ddt.crazylogin.CrazyLogin;
|
||||||
import de.st_ddt.crazylogin.data.LoginPlayerData;
|
import de.st_ddt.crazylogin.data.LoginPlayerData;
|
||||||
import de.st_ddt.crazylogin.databases.CrazyLoginDataDatabase;
|
import de.st_ddt.crazylogin.databases.CrazyLoginDataDatabase;
|
||||||
import de.st_ddt.crazylogin.listener.PlayerListener;
|
import de.st_ddt.crazylogin.listener.PlayerListener;
|
||||||
import de.st_ddt.crazylogin.metadata.Authenticated;
|
import de.st_ddt.crazylogin.metadata.Authenticated;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GitHub: <a href="https://github.com/ST-DDT/CrazyLogin">...</a>
|
* GitHub: <a href="https://github.com/ST-DDT/CrazyLogin">...</a>
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -27,16 +27,14 @@ package com.github.games647.fastlogin.bukkit.hook;
|
|||||||
|
|
||||||
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||||
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
||||||
|
|
||||||
import io.github.lucaseasedup.logit.CancelledState;
|
import io.github.lucaseasedup.logit.CancelledState;
|
||||||
import io.github.lucaseasedup.logit.LogItCore;
|
import io.github.lucaseasedup.logit.LogItCore;
|
||||||
import io.github.lucaseasedup.logit.account.Account;
|
import io.github.lucaseasedup.logit.account.Account;
|
||||||
import io.github.lucaseasedup.logit.session.SessionManager;
|
import io.github.lucaseasedup.logit.session.SessionManager;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GitHub: <a href="https://github.com/XziomekX/LogIt">...</a>
|
* GitHub: <a href="https://github.com/XziomekX/LogIt">...</a>
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -32,7 +32,6 @@ import com.lenis0012.bukkit.loginsecurity.session.AuthService;
|
|||||||
import com.lenis0012.bukkit.loginsecurity.session.PlayerSession;
|
import com.lenis0012.bukkit.loginsecurity.session.PlayerSession;
|
||||||
import com.lenis0012.bukkit.loginsecurity.session.action.LoginAction;
|
import com.lenis0012.bukkit.loginsecurity.session.action.LoginAction;
|
||||||
import com.lenis0012.bukkit.loginsecurity.session.action.RegisterAction;
|
import com.lenis0012.bukkit.loginsecurity.session.action.RegisterAction;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -27,15 +27,14 @@ package com.github.games647.fastlogin.bukkit.hook;
|
|||||||
|
|
||||||
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||||
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
||||||
|
|
||||||
import java.util.concurrent.ExecutionException;
|
|
||||||
import java.util.concurrent.Future;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import ultraauth.api.UltraAuthAPI;
|
import ultraauth.api.UltraAuthAPI;
|
||||||
import ultraauth.managers.PlayerManager;
|
import ultraauth.managers.PlayerManager;
|
||||||
|
|
||||||
|
import java.util.concurrent.ExecutionException;
|
||||||
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Project page:
|
* Project page:
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -27,16 +27,14 @@ package com.github.games647.fastlogin.bukkit.hook;
|
|||||||
|
|
||||||
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||||
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
||||||
|
|
||||||
import de.luricos.bukkit.xAuth.xAuth;
|
import de.luricos.bukkit.xAuth.xAuth;
|
||||||
import de.luricos.bukkit.xAuth.xAuthPlayer;
|
import de.luricos.bukkit.xAuth.xAuthPlayer;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GitHub: <a href="https://github.com/LycanDevelopment/xAuth/">...</a>
|
* GitHub: <a href="https://github.com/LycanDevelopment/xAuth/">...</a>
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -34,15 +34,13 @@ import com.github.games647.fastlogin.core.message.LoginActionMessage;
|
|||||||
import com.github.games647.fastlogin.core.message.LoginActionMessage.Type;
|
import com.github.games647.fastlogin.core.message.LoginActionMessage.Type;
|
||||||
import com.google.common.io.ByteArrayDataInput;
|
import com.google.common.io.ByteArrayDataInput;
|
||||||
import com.google.common.io.ByteStreams;
|
import com.google.common.io.ByteStreams;
|
||||||
|
|
||||||
import java.net.InetSocketAddress;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.messaging.PluginMessageListener;
|
import org.bukkit.plugin.messaging.PluginMessageListener;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Responsible for receiving messages from a BungeeCord instance.
|
* Responsible for receiving messages from a BungeeCord instance.
|
||||||
* <p>
|
* <p>
|
||||||
@ -93,24 +91,23 @@ public class BungeeListener implements PluginMessageListener {
|
|||||||
String playerName = message.getPlayerName();
|
String playerName = message.getPlayerName();
|
||||||
Type type = message.getType();
|
Type type = message.getType();
|
||||||
|
|
||||||
InetSocketAddress address = player.getAddress();
|
|
||||||
plugin.getLog().info("Player info {} command for {} from proxy", type, playerName);
|
plugin.getLog().info("Player info {} command for {} from proxy", type, playerName);
|
||||||
if (type == Type.LOGIN) {
|
if (type == Type.LOGIN) {
|
||||||
onLoginMessage(player, playerName, address);
|
onLoginMessage(player, playerName);
|
||||||
} else if (type == Type.REGISTER) {
|
} else if (type == Type.REGISTER) {
|
||||||
onRegisterMessage(player, playerName, address);
|
onRegisterMessage(player, playerName);
|
||||||
} else if (type == Type.CRACKED) {
|
} else if (type == Type.CRACKED) {
|
||||||
//we don't start a force login task here so update it manually
|
//we don't start a force login task here so update it manually
|
||||||
plugin.getPremiumPlayers().put(player.getUniqueId(), PremiumStatus.CRACKED);
|
plugin.getPremiumPlayers().put(player.getUniqueId(), PremiumStatus.CRACKED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onLoginMessage(Player player, String playerName, InetSocketAddress address) {
|
private void onLoginMessage(Player player, String playerName) {
|
||||||
BukkitLoginSession playerSession = new BukkitLoginSession(playerName, true);
|
BukkitLoginSession playerSession = new BukkitLoginSession(playerName, true);
|
||||||
startLoginTaskIfReady(player, playerSession);
|
startLoginTaskIfReady(player, playerSession);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onRegisterMessage(Player player, String playerName, InetSocketAddress address) {
|
private void onRegisterMessage(Player player, String playerName) {
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||||
AuthPlugin<Player> authPlugin = plugin.getCore().getAuthPluginHook();
|
AuthPlugin<Player> authPlugin = plugin.getCore().getAuthPluginHook();
|
||||||
try {
|
try {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -30,7 +30,6 @@ import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
|||||||
import com.github.games647.fastlogin.bukkit.task.FloodgateAuthTask;
|
import com.github.games647.fastlogin.bukkit.task.FloodgateAuthTask;
|
||||||
import com.github.games647.fastlogin.bukkit.task.ForceLoginTask;
|
import com.github.games647.fastlogin.bukkit.task.ForceLoginTask;
|
||||||
import com.github.games647.fastlogin.core.hooks.bedrock.FloodgateService;
|
import com.github.games647.fastlogin.core.hooks.bedrock.FloodgateService;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -29,7 +29,6 @@ import com.destroystokyo.paper.profile.ProfileProperty;
|
|||||||
import com.github.games647.craftapi.model.skin.Textures;
|
import com.github.games647.craftapi.model.skin.Textures;
|
||||||
import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
||||||
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||||
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -31,7 +31,14 @@ import com.google.common.hash.Hasher;
|
|||||||
import com.google.common.hash.Hashing;
|
import com.google.common.hash.Hashing;
|
||||||
import com.google.common.io.Resources;
|
import com.google.common.io.Resources;
|
||||||
import com.google.common.primitives.Longs;
|
import com.google.common.primitives.Longs;
|
||||||
|
import lombok.val;
|
||||||
|
|
||||||
|
import javax.crypto.BadPaddingException;
|
||||||
|
import javax.crypto.Cipher;
|
||||||
|
import javax.crypto.IllegalBlockSizeException;
|
||||||
|
import javax.crypto.NoSuchPaddingException;
|
||||||
|
import javax.crypto.SecretKey;
|
||||||
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
@ -54,15 +61,6 @@ import java.util.Base64.Encoder;
|
|||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import javax.crypto.BadPaddingException;
|
|
||||||
import javax.crypto.Cipher;
|
|
||||||
import javax.crypto.IllegalBlockSizeException;
|
|
||||||
import javax.crypto.NoSuchPaddingException;
|
|
||||||
import javax.crypto.SecretKey;
|
|
||||||
import javax.crypto.spec.SecretKeySpec;
|
|
||||||
|
|
||||||
import lombok.val;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encryption and decryption minecraft util for connection between servers
|
* Encryption and decryption minecraft util for connection between servers
|
||||||
* and paid Minecraft account clients.
|
* and paid Minecraft account clients.
|
||||||
@ -72,7 +70,7 @@ final class EncryptionUtil {
|
|||||||
public static final int VERIFY_TOKEN_LENGTH = 4;
|
public static final int VERIFY_TOKEN_LENGTH = 4;
|
||||||
public static final String KEY_PAIR_ALGORITHM = "RSA";
|
public static final String KEY_PAIR_ALGORITHM = "RSA";
|
||||||
|
|
||||||
private static final int RSA_LENGTH = 1_024;
|
private static final int RSA_LENGTH = 2_048;
|
||||||
|
|
||||||
private static final PublicKey MOJANG_SESSION_KEY;
|
private static final PublicKey MOJANG_SESSION_KEY;
|
||||||
private static final int LINE_LENGTH = 76;
|
private static final int LINE_LENGTH = 76;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -31,16 +31,15 @@ import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
|||||||
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||||
import com.github.games647.fastlogin.bukkit.event.BukkitFastLoginPreLoginEvent;
|
import com.github.games647.fastlogin.bukkit.event.BukkitFastLoginPreLoginEvent;
|
||||||
import com.github.games647.fastlogin.bukkit.listener.protocollib.packet.ClientPublicKey;
|
import com.github.games647.fastlogin.bukkit.listener.protocollib.packet.ClientPublicKey;
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
import com.github.games647.fastlogin.core.shared.JoinManagement;
|
import com.github.games647.fastlogin.core.shared.JoinManagement;
|
||||||
import com.github.games647.fastlogin.core.shared.event.FastLoginPreLoginEvent;
|
import com.github.games647.fastlogin.core.shared.event.FastLoginPreLoginEvent;
|
||||||
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.security.PublicKey;
|
import java.security.PublicKey;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
public class NameCheckTask extends JoinManagement<Player, CommandSender, ProtocolLibLoginSource>
|
public class NameCheckTask extends JoinManagement<Player, CommandSender, ProtocolLibLoginSource>
|
||||||
implements Runnable {
|
implements Runnable {
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -45,11 +45,16 @@ import com.github.games647.fastlogin.bukkit.listener.protocollib.packet.ClientPu
|
|||||||
import com.github.games647.fastlogin.core.antibot.AntiBotService;
|
import com.github.games647.fastlogin.core.antibot.AntiBotService;
|
||||||
import com.github.games647.fastlogin.core.antibot.AntiBotService.Action;
|
import com.github.games647.fastlogin.core.antibot.AntiBotService.Action;
|
||||||
import com.mojang.datafixers.util.Either;
|
import com.mojang.datafixers.util.Either;
|
||||||
|
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
import io.netty.channel.ChannelHandler;
|
import io.netty.channel.ChannelHandler;
|
||||||
import io.netty.util.AttributeKey;
|
import io.netty.util.AttributeKey;
|
||||||
|
import lombok.val;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.geysermc.floodgate.api.player.FloodgatePlayer;
|
||||||
|
|
||||||
|
import javax.crypto.BadPaddingException;
|
||||||
|
import javax.crypto.IllegalBlockSizeException;
|
||||||
|
import javax.crypto.NoSuchPaddingException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.security.InvalidKeyException;
|
import java.security.InvalidKeyException;
|
||||||
import java.security.KeyPair;
|
import java.security.KeyPair;
|
||||||
@ -62,14 +67,6 @@ import java.util.Optional;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import javax.crypto.BadPaddingException;
|
|
||||||
import javax.crypto.IllegalBlockSizeException;
|
|
||||||
import javax.crypto.NoSuchPaddingException;
|
|
||||||
|
|
||||||
import lombok.val;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.geysermc.floodgate.api.player.FloodgatePlayer;
|
|
||||||
|
|
||||||
import static com.comphenix.protocol.PacketType.Login.Client.ENCRYPTION_BEGIN;
|
import static com.comphenix.protocol.PacketType.Login.Client.ENCRYPTION_BEGIN;
|
||||||
import static com.comphenix.protocol.PacketType.Login.Client.START;
|
import static com.comphenix.protocol.PacketType.Login.Client.START;
|
||||||
|
|
||||||
@ -180,7 +177,7 @@ public class ProtocolLibListener extends PacketAdapter {
|
|||||||
ClientPublicKey clientPublicKey, byte[] expectedToken) {
|
ClientPublicKey clientPublicKey, byte[] expectedToken) {
|
||||||
try {
|
try {
|
||||||
if (new MinecraftVersion(1, 19, 0).atOrAbove()
|
if (new MinecraftVersion(1, 19, 0).atOrAbove()
|
||||||
&& !(new MinecraftVersion(1, 19, 3).atOrAbove())) {
|
&& !new MinecraftVersion(1, 19, 3).atOrAbove()) {
|
||||||
Either<byte[], ?> either = packet.getSpecificModifier(Either.class).read(0);
|
Either<byte[], ?> either = packet.getSpecificModifier(Either.class).read(0);
|
||||||
if (clientPublicKey == null) {
|
if (clientPublicKey == null) {
|
||||||
Optional<byte[]> left = either.left();
|
Optional<byte[]> left = either.left();
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -32,14 +32,13 @@ import com.comphenix.protocol.reflect.StructureModifier;
|
|||||||
import com.comphenix.protocol.wrappers.WrappedChatComponent;
|
import com.comphenix.protocol.wrappers.WrappedChatComponent;
|
||||||
import com.github.games647.fastlogin.bukkit.listener.protocollib.packet.ClientPublicKey;
|
import com.github.games647.fastlogin.bukkit.listener.protocollib.packet.ClientPublicKey;
|
||||||
import com.github.games647.fastlogin.core.shared.LoginSource;
|
import com.github.games647.fastlogin.core.shared.LoginSource;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.security.PublicKey;
|
import java.security.PublicKey;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import static com.comphenix.protocol.PacketType.Login.Server.DISCONNECT;
|
import static com.comphenix.protocol.PacketType.Login.Server.DISCONNECT;
|
||||||
import static com.comphenix.protocol.PacketType.Login.Server.ENCRYPTION_BEGIN;
|
import static com.comphenix.protocol.PacketType.Login.Server.ENCRYPTION_BEGIN;
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -30,7 +30,6 @@ import com.comphenix.protocol.wrappers.WrappedSignedProperty;
|
|||||||
import com.github.games647.craftapi.model.skin.Textures;
|
import com.github.games647.craftapi.model.skin.Textures;
|
||||||
import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
||||||
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -38,6 +38,7 @@ import com.comphenix.protocol.reflect.accessors.FieldAccessor;
|
|||||||
import com.comphenix.protocol.utility.MinecraftReflection;
|
import com.comphenix.protocol.utility.MinecraftReflection;
|
||||||
import com.comphenix.protocol.utility.MinecraftVersion;
|
import com.comphenix.protocol.utility.MinecraftVersion;
|
||||||
import com.comphenix.protocol.wrappers.BukkitConverters;
|
import com.comphenix.protocol.wrappers.BukkitConverters;
|
||||||
|
import com.comphenix.protocol.wrappers.Converters;
|
||||||
import com.comphenix.protocol.wrappers.WrappedChatComponent;
|
import com.comphenix.protocol.wrappers.WrappedChatComponent;
|
||||||
import com.comphenix.protocol.wrappers.WrappedGameProfile;
|
import com.comphenix.protocol.wrappers.WrappedGameProfile;
|
||||||
import com.comphenix.protocol.wrappers.WrappedProfilePublicKey.WrappedProfileKeyData;
|
import com.comphenix.protocol.wrappers.WrappedProfilePublicKey.WrappedProfileKeyData;
|
||||||
@ -46,8 +47,13 @@ import com.github.games647.craftapi.model.skin.SkinProperty;
|
|||||||
import com.github.games647.craftapi.resolver.MojangResolver;
|
import com.github.games647.craftapi.resolver.MojangResolver;
|
||||||
import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
||||||
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||||
|
import com.github.games647.fastlogin.bukkit.InetUtils;
|
||||||
import com.github.games647.fastlogin.bukkit.listener.protocollib.packet.ClientPublicKey;
|
import com.github.games647.fastlogin.bukkit.listener.protocollib.packet.ClientPublicKey;
|
||||||
|
import lombok.val;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import javax.crypto.Cipher;
|
||||||
|
import javax.crypto.SecretKey;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
@ -60,12 +66,6 @@ import java.util.Arrays;
|
|||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import javax.crypto.Cipher;
|
|
||||||
import javax.crypto.SecretKey;
|
|
||||||
|
|
||||||
import lombok.val;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import static com.comphenix.protocol.PacketType.Login.Client.START;
|
import static com.comphenix.protocol.PacketType.Login.Client.START;
|
||||||
import static com.comphenix.protocol.PacketType.Login.Server.DISCONNECT;
|
import static com.comphenix.protocol.PacketType.Login.Server.DISCONNECT;
|
||||||
|
|
||||||
@ -73,6 +73,13 @@ public class VerifyResponseTask implements Runnable {
|
|||||||
|
|
||||||
private static final String ENCRYPTION_CLASS_NAME = "MinecraftEncryption";
|
private static final String ENCRYPTION_CLASS_NAME = "MinecraftEncryption";
|
||||||
private static final Class<?> ENCRYPTION_CLASS;
|
private static final Class<?> ENCRYPTION_CLASS;
|
||||||
|
private static final String ADDRESS_VERIFY_WARNING = "This indicates the use of reverse-proxy like HAProxy, "
|
||||||
|
+ "TCPShield, BungeeCord, Velocity, etc. "
|
||||||
|
+ "By default (configurable in the config) this plugin requests Mojang to verify the connecting IP "
|
||||||
|
+ "to this server with the one used to log into Minecraft to prevent MITM attacks. In "
|
||||||
|
+ "order to work this security feature, the actual client IP needs to be forwarding "
|
||||||
|
+ "(keyword IP forwarding). This process will also be useful for other server "
|
||||||
|
+ "features like IP banning, so that it doesn't ban the proxy IP.";
|
||||||
|
|
||||||
static {
|
static {
|
||||||
ENCRYPTION_CLASS = MinecraftReflection.getMinecraftClass(
|
ENCRYPTION_CLASS = MinecraftReflection.getMinecraftClass(
|
||||||
@ -152,9 +159,26 @@ public class VerifyResponseTask implements Runnable {
|
|||||||
//user tried to fake an authentication
|
//user tried to fake an authentication
|
||||||
disconnect(
|
disconnect(
|
||||||
"invalid-session",
|
"invalid-session",
|
||||||
"GameProfile {} ({}) tried to log in with an invalid session. ServerId: {}",
|
"Session server rejected incoming connection for GameProfile {} ({}). Possible reasons are"
|
||||||
session.getRequestUsername(), socketAddress, serverId
|
+ "1) Client IP address contacting Mojang and server during server join were different "
|
||||||
|
+ "(Do you use a reverse proxy? -> Enable IP forwarding, "
|
||||||
|
+ "or disable the feature in the config). "
|
||||||
|
+ "2) Player is offline, but tried to bypass the authentication"
|
||||||
|
+ "3) Client uses an outdated username for connecting (Fix: Restart client)",
|
||||||
|
requestedUsername, address
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (InetUtils.isLocalAddress(address)) {
|
||||||
|
plugin.getLog().warn(
|
||||||
|
"The incoming request for player {} uses a local IP address",
|
||||||
|
requestedUsername
|
||||||
|
);
|
||||||
|
plugin.getLog().warn(ADDRESS_VERIFY_WARNING);
|
||||||
|
} else {
|
||||||
|
plugin.getLog().warn("If you think this is an error, please verify that the incoming "
|
||||||
|
+ "IP address {} is not associated with a server hosting company.", address);
|
||||||
|
plugin.getLog().warn(ADDRESS_VERIFY_WARNING);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException ioEx) {
|
} catch (IOException ioEx) {
|
||||||
disconnect("error-kick", "Failed to connect to session server", ioEx);
|
disconnect("error-kick", "Failed to connect to session server", ioEx);
|
||||||
@ -179,7 +203,7 @@ public class VerifyResponseTask implements Runnable {
|
|||||||
session.setVerified(true);
|
session.setVerified(true);
|
||||||
|
|
||||||
setPremiumUUID(session.getUuid());
|
setPremiumUUID(session.getUuid());
|
||||||
receiveFakeStartPacket(realUsername, session.getClientPublicKey());
|
receiveFakeStartPacket(realUsername, session.getClientPublicKey(), session.getUuid());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setPremiumUUID(UUID premiumUUID) {
|
private void setPremiumUUID(UUID premiumUUID) {
|
||||||
@ -270,9 +294,17 @@ public class VerifyResponseTask implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//fake a new login packet in order to let the server handle all the other stuff
|
//fake a new login packet in order to let the server handle all the other stuff
|
||||||
private void receiveFakeStartPacket(String username, ClientPublicKey clientKey) {
|
private void receiveFakeStartPacket(String username, ClientPublicKey clientKey, UUID uuid) {
|
||||||
PacketContainer startPacket;
|
PacketContainer startPacket;
|
||||||
if (new MinecraftVersion(1, 19, 0).atOrAbove()) {
|
if (new MinecraftVersion(1, 20, 2).atOrAbove()) {
|
||||||
|
startPacket = new PacketContainer(START);
|
||||||
|
startPacket.getStrings().write(0, username);
|
||||||
|
startPacket.getUUIDs().write(0, uuid);
|
||||||
|
} else if (new MinecraftVersion(1, 19, 3).atOrAbove()) {
|
||||||
|
startPacket = new PacketContainer(START);
|
||||||
|
startPacket.getStrings().write(0, username);
|
||||||
|
startPacket.getOptionals(Converters.passthrough(UUID.class)).write(0, Optional.of(uuid));
|
||||||
|
} else if (new MinecraftVersion(1, 19, 0).atOrAbove()) {
|
||||||
startPacket = new PacketContainer(START);
|
startPacket = new PacketContainer(START);
|
||||||
startPacket.getStrings().write(0, username);
|
startPacket.getStrings().write(0, username);
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -25,14 +25,14 @@
|
|||||||
*/
|
*/
|
||||||
package com.github.games647.fastlogin.bukkit.listener.protocollib.packet;
|
package com.github.games647.fastlogin.bukkit.listener.protocollib.packet;
|
||||||
|
|
||||||
|
import lombok.Value;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.security.PublicKey;
|
import java.security.PublicKey;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
import java.util.StringJoiner;
|
import java.util.StringJoiner;
|
||||||
|
|
||||||
import lombok.Value;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
@Accessors(fluent = true)
|
@Accessors(fluent = true)
|
||||||
@Value(staticConstructor = "of")
|
@Value(staticConstructor = "of")
|
||||||
public class ClientPublicKey {
|
public class ClientPublicKey {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -26,11 +26,10 @@
|
|||||||
package com.github.games647.fastlogin.bukkit.listener.protocolsupport;
|
package com.github.games647.fastlogin.bukkit.listener.protocolsupport;
|
||||||
|
|
||||||
import com.github.games647.fastlogin.core.shared.LoginSource;
|
import com.github.games647.fastlogin.core.shared.LoginSource;
|
||||||
|
import protocolsupport.api.events.PlayerLoginStartEvent;
|
||||||
|
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
|
|
||||||
import protocolsupport.api.events.PlayerLoginStartEvent;
|
|
||||||
|
|
||||||
public class ProtocolLoginSource implements LoginSource {
|
public class ProtocolLoginSource implements LoginSource {
|
||||||
|
|
||||||
private final PlayerLoginStartEvent loginStartEvent;
|
private final PlayerLoginStartEvent loginStartEvent;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -29,15 +29,11 @@ import com.github.games647.craftapi.UUIDAdapter;
|
|||||||
import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
||||||
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||||
import com.github.games647.fastlogin.bukkit.event.BukkitFastLoginPreLoginEvent;
|
import com.github.games647.fastlogin.bukkit.event.BukkitFastLoginPreLoginEvent;
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
import com.github.games647.fastlogin.core.antibot.AntiBotService;
|
import com.github.games647.fastlogin.core.antibot.AntiBotService;
|
||||||
import com.github.games647.fastlogin.core.antibot.AntiBotService.Action;
|
import com.github.games647.fastlogin.core.antibot.AntiBotService.Action;
|
||||||
import com.github.games647.fastlogin.core.shared.JoinManagement;
|
import com.github.games647.fastlogin.core.shared.JoinManagement;
|
||||||
import com.github.games647.fastlogin.core.shared.event.FastLoginPreLoginEvent;
|
import com.github.games647.fastlogin.core.shared.event.FastLoginPreLoginEvent;
|
||||||
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
import java.net.InetSocketAddress;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -46,6 +42,9 @@ import protocolsupport.api.events.ConnectionCloseEvent;
|
|||||||
import protocolsupport.api.events.PlayerLoginStartEvent;
|
import protocolsupport.api.events.PlayerLoginStartEvent;
|
||||||
import protocolsupport.api.events.PlayerProfileCompleteEvent;
|
import protocolsupport.api.events.PlayerProfileCompleteEvent;
|
||||||
|
|
||||||
|
import java.net.InetSocketAddress;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
public class ProtocolSupportListener extends JoinManagement<Player, CommandSender, ProtocolLoginSource>
|
public class ProtocolSupportListener extends JoinManagement<Player, CommandSender, ProtocolLoginSource>
|
||||||
implements Listener {
|
implements Listener {
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -33,15 +33,14 @@ import com.github.games647.fastlogin.bukkit.hook.LoginSecurityHook;
|
|||||||
import com.github.games647.fastlogin.bukkit.hook.UltraAuthHook;
|
import com.github.games647.fastlogin.bukkit.hook.UltraAuthHook;
|
||||||
import com.github.games647.fastlogin.bukkit.hook.XAuthHook;
|
import com.github.games647.fastlogin.bukkit.hook.XAuthHook;
|
||||||
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.Listener;
|
|
||||||
|
|
||||||
public class DelayedAuthHook implements Runnable {
|
public class DelayedAuthHook implements Runnable {
|
||||||
|
|
||||||
private final FastLoginBukkit plugin;
|
private final FastLoginBukkit plugin;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -29,15 +29,14 @@ import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
|||||||
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||||
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
||||||
import com.github.games647.fastlogin.core.shared.FloodgateManagement;
|
import com.github.games647.fastlogin.core.shared.FloodgateManagement;
|
||||||
|
|
||||||
import java.net.InetSocketAddress;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.geysermc.floodgate.api.player.FloodgatePlayer;
|
import org.geysermc.floodgate.api.player.FloodgatePlayer;
|
||||||
|
|
||||||
|
import java.net.InetSocketAddress;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public class FloodgateAuthTask extends FloodgateManagement<Player, CommandSender, BukkitLoginSession, FastLoginBukkit> {
|
public class FloodgateAuthTask extends FloodgateManagement<Player, CommandSender, BukkitLoginSession, FastLoginBukkit> {
|
||||||
|
|
||||||
public FloodgateAuthTask(FastLoginCore<Player, CommandSender, FastLoginBukkit> core, Player player,
|
public FloodgateAuthTask(FastLoginCore<Player, CommandSender, FastLoginBukkit> core, Player player,
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -29,20 +29,19 @@ import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
|||||||
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||||
import com.github.games647.fastlogin.bukkit.event.BukkitFastLoginAutoLoginEvent;
|
import com.github.games647.fastlogin.bukkit.event.BukkitFastLoginAutoLoginEvent;
|
||||||
import com.github.games647.fastlogin.core.PremiumStatus;
|
import com.github.games647.fastlogin.core.PremiumStatus;
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
import com.github.games647.fastlogin.core.message.SuccessMessage;
|
import com.github.games647.fastlogin.core.message.SuccessMessage;
|
||||||
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
||||||
import com.github.games647.fastlogin.core.shared.ForceLoginManagement;
|
import com.github.games647.fastlogin.core.shared.ForceLoginManagement;
|
||||||
import com.github.games647.fastlogin.core.shared.LoginSession;
|
import com.github.games647.fastlogin.core.shared.LoginSession;
|
||||||
import com.github.games647.fastlogin.core.shared.event.FastLoginAutoLoginEvent;
|
import com.github.games647.fastlogin.core.shared.event.FastLoginAutoLoginEvent;
|
||||||
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
import java.util.concurrent.ExecutionException;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.metadata.FixedMetadataValue;
|
import org.bukkit.metadata.FixedMetadataValue;
|
||||||
|
|
||||||
|
import java.util.concurrent.ExecutionException;
|
||||||
|
|
||||||
public class ForceLoginTask extends ForceLoginManagement<Player, CommandSender, BukkitLoginSession, FastLoginBukkit> {
|
public class ForceLoginTask extends ForceLoginManagement<Player, CommandSender, BukkitLoginSession, FastLoginBukkit> {
|
||||||
|
|
||||||
public ForceLoginTask(FastLoginCore<Player, CommandSender, FastLoginBukkit> core, Player player,
|
public ForceLoginTask(FastLoginCore<Player, CommandSender, FastLoginBukkit> core, Player player,
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -26,11 +26,9 @@
|
|||||||
package com.github.games647.fastlogin.bukkit;
|
package com.github.games647.fastlogin.bukkit;
|
||||||
|
|
||||||
import com.github.games647.fastlogin.core.CommonUtil;
|
import com.github.games647.fastlogin.core.CommonUtil;
|
||||||
|
import lombok.val;
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
import net.md_5.bungee.chat.ComponentSerializer;
|
import net.md_5.bungee.chat.ComponentSerializer;
|
||||||
|
|
||||||
import lombok.val;
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -27,10 +27,8 @@ package com.github.games647.fastlogin.bukkit;
|
|||||||
|
|
||||||
import com.comphenix.protocol.reflect.accessors.Accessors;
|
import com.comphenix.protocol.reflect.accessors.Accessors;
|
||||||
import com.comphenix.protocol.reflect.accessors.FieldAccessor;
|
import com.comphenix.protocol.reflect.accessors.FieldAccessor;
|
||||||
|
|
||||||
import fr.xephi.authme.api.v3.AuthMeApi;
|
import fr.xephi.authme.api.v3.AuthMeApi;
|
||||||
import fr.xephi.authme.process.Management;
|
import fr.xephi.authme.process.Management;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -27,10 +27,8 @@ package com.github.games647.fastlogin.bukkit.hook;
|
|||||||
|
|
||||||
import com.comphenix.protocol.reflect.accessors.Accessors;
|
import com.comphenix.protocol.reflect.accessors.Accessors;
|
||||||
import com.comphenix.protocol.reflect.accessors.FieldAccessor;
|
import com.comphenix.protocol.reflect.accessors.FieldAccessor;
|
||||||
|
|
||||||
import de.st_ddt.crazylogin.CrazyLogin;
|
import de.st_ddt.crazylogin.CrazyLogin;
|
||||||
import de.st_ddt.crazylogin.listener.PlayerListener;
|
import de.st_ddt.crazylogin.listener.PlayerListener;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -28,12 +28,11 @@ package com.github.games647.fastlogin.bukkit.listener.protocollib;
|
|||||||
import com.google.gson.TypeAdapter;
|
import com.google.gson.TypeAdapter;
|
||||||
import com.google.gson.stream.JsonReader;
|
import com.google.gson.stream.JsonReader;
|
||||||
import com.google.gson.stream.JsonWriter;
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
import lombok.val;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
|
|
||||||
import lombok.val;
|
|
||||||
|
|
||||||
public class Base64Adapter extends TypeAdapter<byte[]> {
|
public class Base64Adapter extends TypeAdapter<byte[]> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -28,7 +28,17 @@ package com.github.games647.fastlogin.bukkit.listener.protocollib;
|
|||||||
import com.github.games647.fastlogin.bukkit.listener.protocollib.SignatureTestData.SignatureData;
|
import com.github.games647.fastlogin.bukkit.listener.protocollib.SignatureTestData.SignatureData;
|
||||||
import com.github.games647.fastlogin.bukkit.listener.protocollib.packet.ClientPublicKey;
|
import com.github.games647.fastlogin.bukkit.listener.protocollib.packet.ClientPublicKey;
|
||||||
import com.google.common.hash.Hashing;
|
import com.google.common.hash.Hashing;
|
||||||
|
import lombok.val;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.junit.jupiter.params.ParameterizedTest;
|
||||||
|
import org.junit.jupiter.params.provider.ValueSource;
|
||||||
|
|
||||||
|
import javax.crypto.BadPaddingException;
|
||||||
|
import javax.crypto.Cipher;
|
||||||
|
import javax.crypto.IllegalBlockSizeException;
|
||||||
|
import javax.crypto.NoSuchPaddingException;
|
||||||
|
import javax.crypto.SecretKey;
|
||||||
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.security.GeneralSecurityException;
|
import java.security.GeneralSecurityException;
|
||||||
@ -44,18 +54,6 @@ import java.time.temporal.ChronoUnit;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.ThreadLocalRandom;
|
import java.util.concurrent.ThreadLocalRandom;
|
||||||
|
|
||||||
import javax.crypto.BadPaddingException;
|
|
||||||
import javax.crypto.Cipher;
|
|
||||||
import javax.crypto.IllegalBlockSizeException;
|
|
||||||
import javax.crypto.NoSuchPaddingException;
|
|
||||||
import javax.crypto.SecretKey;
|
|
||||||
import javax.crypto.spec.SecretKeySpec;
|
|
||||||
|
|
||||||
import lombok.val;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.junit.jupiter.params.ParameterizedTest;
|
|
||||||
import org.junit.jupiter.params.provider.ValueSource;
|
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
class EncryptionUtilTest {
|
class EncryptionUtilTest {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -29,6 +29,8 @@ import com.github.games647.fastlogin.bukkit.listener.protocollib.packet.ClientPu
|
|||||||
import com.google.common.io.Resources;
|
import com.google.common.io.Resources;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
|
import org.bouncycastle.util.io.pem.PemObject;
|
||||||
|
import org.bouncycastle.util.io.pem.PemReader;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
@ -46,9 +48,6 @@ import java.security.spec.X509EncodedKeySpec;
|
|||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
|
|
||||||
import org.bouncycastle.util.io.pem.PemObject;
|
|
||||||
import org.bouncycastle.util.io.pem.PemReader;
|
|
||||||
|
|
||||||
public class ResourceLoader {
|
public class ResourceLoader {
|
||||||
|
|
||||||
public static RSAPrivateKey parsePrivateKey(String keySpec)
|
public static RSAPrivateKey parsePrivateKey(String keySpec)
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -28,12 +28,11 @@ package com.github.games647.fastlogin.bukkit.listener.protocollib;
|
|||||||
import com.google.common.io.Resources;
|
import com.google.common.io.Resources;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.annotations.JsonAdapter;
|
import com.google.gson.annotations.JsonAdapter;
|
||||||
|
import lombok.val;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import lombok.val;
|
|
||||||
|
|
||||||
public class SignatureTestData {
|
public class SignatureTestData {
|
||||||
|
|
||||||
public static SignatureTestData fromResource(String resourceName) throws IOException {
|
public static SignatureTestData fromResource(String resourceName) throws IOException {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -29,16 +29,14 @@ import com.comphenix.protocol.injector.packet.PacketRegistry;
|
|||||||
import com.comphenix.protocol.reflect.accessors.Accessors;
|
import com.comphenix.protocol.reflect.accessors.Accessors;
|
||||||
import com.comphenix.protocol.reflect.accessors.FieldAccessor;
|
import com.comphenix.protocol.reflect.accessors.FieldAccessor;
|
||||||
import com.comphenix.protocol.utility.MinecraftReflection;
|
import com.comphenix.protocol.utility.MinecraftReflection;
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.mockito.MockedStatic;
|
import org.mockito.MockedStatic;
|
||||||
|
|
||||||
import static org.mockito.ArgumentMatchers.any;
|
import java.util.Optional;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
import static org.mockito.Mockito.mockStatic;
|
import static org.mockito.Mockito.mockStatic;
|
||||||
|
|
||||||
class VerifyResponseTaskTest {
|
class VerifyResponseTaskTest {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -26,7 +26,6 @@
|
|||||||
package com.github.games647.fastlogin.bukkit.task;
|
package com.github.games647.fastlogin.bukkit.task;
|
||||||
|
|
||||||
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
||||||
|
|
||||||
import lombok.val;
|
import lombok.val;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2015-2022 games647 and contributors
|
Copyright (c) 2015-2023 games647 and contributors
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -47,7 +47,7 @@
|
|||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<version>3.4.1</version>
|
<version>3.5.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<minimizeJar>true</minimizeJar>
|
<minimizeJar>true</minimizeJar>
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -25,8 +25,8 @@
|
|||||||
*/
|
*/
|
||||||
package com.github.games647.fastlogin.bungee;
|
package com.github.games647.fastlogin.bungee;
|
||||||
|
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
import com.github.games647.fastlogin.core.shared.LoginSession;
|
import com.github.games647.fastlogin.core.shared.LoginSession;
|
||||||
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
|
|
||||||
public class BungeeLoginSession extends LoginSession {
|
public class BungeeLoginSession extends LoginSession {
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -26,15 +26,14 @@
|
|||||||
package com.github.games647.fastlogin.bungee;
|
package com.github.games647.fastlogin.bungee;
|
||||||
|
|
||||||
import com.github.games647.fastlogin.core.shared.LoginSource;
|
import com.github.games647.fastlogin.core.shared.LoginSource;
|
||||||
|
|
||||||
import java.net.InetSocketAddress;
|
|
||||||
|
|
||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
import net.md_5.bungee.api.connection.PendingConnection;
|
import net.md_5.bungee.api.connection.PendingConnection;
|
||||||
import net.md_5.bungee.api.event.PreLoginEvent;
|
import net.md_5.bungee.api.event.PreLoginEvent;
|
||||||
|
|
||||||
|
import java.net.InetSocketAddress;
|
||||||
|
|
||||||
public class BungeeLoginSource implements LoginSource {
|
public class BungeeLoginSource implements LoginSource {
|
||||||
|
|
||||||
private final PendingConnection connection;
|
private final PendingConnection connection;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -44,13 +44,6 @@ import com.google.common.collect.MapMaker;
|
|||||||
import com.google.common.io.ByteArrayDataOutput;
|
import com.google.common.io.ByteArrayDataOutput;
|
||||||
import com.google.common.io.ByteStreams;
|
import com.google.common.io.ByteStreams;
|
||||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||||
|
|
||||||
import java.nio.file.Path;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.ConcurrentMap;
|
|
||||||
import java.util.concurrent.ThreadFactory;
|
|
||||||
|
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
import net.md_5.bungee.api.connection.PendingConnection;
|
import net.md_5.bungee.api.connection.PendingConnection;
|
||||||
@ -60,11 +53,16 @@ import net.md_5.bungee.api.plugin.Listener;
|
|||||||
import net.md_5.bungee.api.plugin.Plugin;
|
import net.md_5.bungee.api.plugin.Plugin;
|
||||||
import net.md_5.bungee.api.plugin.PluginManager;
|
import net.md_5.bungee.api.plugin.PluginManager;
|
||||||
import net.md_5.bungee.api.scheduler.GroupedThreadFactory;
|
import net.md_5.bungee.api.scheduler.GroupedThreadFactory;
|
||||||
|
|
||||||
import org.geysermc.floodgate.api.FloodgateApi;
|
import org.geysermc.floodgate.api.FloodgateApi;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.ConcurrentMap;
|
||||||
|
import java.util.concurrent.ThreadFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BungeeCord version of FastLogin. This plugin keeps track on online mode connections.
|
* BungeeCord version of FastLogin. This plugin keeps track on online mode connections.
|
||||||
*/
|
*/
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -25,10 +25,9 @@
|
|||||||
*/
|
*/
|
||||||
package com.github.games647.fastlogin.bungee.event;
|
package com.github.games647.fastlogin.bungee.event;
|
||||||
|
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
import com.github.games647.fastlogin.core.shared.LoginSession;
|
import com.github.games647.fastlogin.core.shared.LoginSession;
|
||||||
import com.github.games647.fastlogin.core.shared.event.FastLoginAutoLoginEvent;
|
import com.github.games647.fastlogin.core.shared.event.FastLoginAutoLoginEvent;
|
||||||
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
import net.md_5.bungee.api.plugin.Cancellable;
|
import net.md_5.bungee.api.plugin.Cancellable;
|
||||||
import net.md_5.bungee.api.plugin.Event;
|
import net.md_5.bungee.api.plugin.Event;
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -25,10 +25,9 @@
|
|||||||
*/
|
*/
|
||||||
package com.github.games647.fastlogin.bungee.event;
|
package com.github.games647.fastlogin.bungee.event;
|
||||||
|
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
import com.github.games647.fastlogin.core.shared.LoginSource;
|
import com.github.games647.fastlogin.core.shared.LoginSource;
|
||||||
import com.github.games647.fastlogin.core.shared.event.FastLoginPreLoginEvent;
|
import com.github.games647.fastlogin.core.shared.event.FastLoginPreLoginEvent;
|
||||||
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
import net.md_5.bungee.api.plugin.Event;
|
import net.md_5.bungee.api.plugin.Event;
|
||||||
|
|
||||||
public class BungeeFastLoginPreLoginEvent extends Event implements FastLoginPreLoginEvent {
|
public class BungeeFastLoginPreLoginEvent extends Event implements FastLoginPreLoginEvent {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -25,9 +25,8 @@
|
|||||||
*/
|
*/
|
||||||
package com.github.games647.fastlogin.bungee.event;
|
package com.github.games647.fastlogin.bungee.event;
|
||||||
|
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
import com.github.games647.fastlogin.core.shared.event.FastLoginPremiumToggleEvent;
|
import com.github.games647.fastlogin.core.shared.event.FastLoginPremiumToggleEvent;
|
||||||
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
import net.md_5.bungee.api.plugin.Event;
|
import net.md_5.bungee.api.plugin.Event;
|
||||||
|
|
||||||
public class BungeeFastLoginPremiumToggleEvent extends Event implements FastLoginPremiumToggleEvent {
|
public class BungeeFastLoginPremiumToggleEvent extends Event implements FastLoginPremiumToggleEvent {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -27,10 +27,8 @@ package com.github.games647.fastlogin.bungee.hook;
|
|||||||
|
|
||||||
import com.github.games647.fastlogin.bungee.FastLoginBungee;
|
import com.github.games647.fastlogin.bungee.FastLoginBungee;
|
||||||
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
||||||
|
|
||||||
import me.vik1395.BungeeAuth.Main;
|
import me.vik1395.BungeeAuth.Main;
|
||||||
import me.vik1395.BungeeAuthAPI.RequestHandler;
|
import me.vik1395.BungeeAuthAPI.RequestHandler;
|
||||||
|
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -31,20 +31,12 @@ import com.github.games647.fastlogin.bungee.FastLoginBungee;
|
|||||||
import com.github.games647.fastlogin.bungee.task.AsyncPremiumCheck;
|
import com.github.games647.fastlogin.bungee.task.AsyncPremiumCheck;
|
||||||
import com.github.games647.fastlogin.bungee.task.FloodgateAuthTask;
|
import com.github.games647.fastlogin.bungee.task.FloodgateAuthTask;
|
||||||
import com.github.games647.fastlogin.bungee.task.ForceLoginTask;
|
import com.github.games647.fastlogin.bungee.task.ForceLoginTask;
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
import com.github.games647.fastlogin.core.antibot.AntiBotService;
|
import com.github.games647.fastlogin.core.antibot.AntiBotService;
|
||||||
import com.github.games647.fastlogin.core.antibot.AntiBotService.Action;
|
import com.github.games647.fastlogin.core.antibot.AntiBotService.Action;
|
||||||
import com.github.games647.fastlogin.core.hooks.bedrock.FloodgateService;
|
import com.github.games647.fastlogin.core.hooks.bedrock.FloodgateService;
|
||||||
import com.github.games647.fastlogin.core.shared.LoginSession;
|
import com.github.games647.fastlogin.core.shared.LoginSession;
|
||||||
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
import com.google.common.base.Throwables;
|
import com.google.common.base.Throwables;
|
||||||
|
|
||||||
import java.lang.invoke.MethodHandle;
|
|
||||||
import java.lang.invoke.MethodHandles;
|
|
||||||
import java.lang.invoke.MethodHandles.Lookup;
|
|
||||||
import java.lang.reflect.Field;
|
|
||||||
import java.net.InetSocketAddress;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
import net.md_5.bungee.api.connection.PendingConnection;
|
import net.md_5.bungee.api.connection.PendingConnection;
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
@ -59,11 +51,17 @@ import net.md_5.bungee.connection.LoginResult;
|
|||||||
import net.md_5.bungee.event.EventHandler;
|
import net.md_5.bungee.event.EventHandler;
|
||||||
import net.md_5.bungee.event.EventPriority;
|
import net.md_5.bungee.event.EventPriority;
|
||||||
import net.md_5.bungee.protocol.Property;
|
import net.md_5.bungee.protocol.Property;
|
||||||
|
|
||||||
import org.geysermc.floodgate.api.player.FloodgatePlayer;
|
import org.geysermc.floodgate.api.player.FloodgatePlayer;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.lang.invoke.MethodHandle;
|
||||||
|
import java.lang.invoke.MethodHandles;
|
||||||
|
import java.lang.invoke.MethodHandles.Lookup;
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.net.InetSocketAddress;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enables online mode logins for specified users and sends plugin message to the Bukkit version of this plugin in
|
* Enables online mode logins for specified users and sends plugin message to the Bukkit version of this plugin in
|
||||||
* order to clear that the connection is online mode.
|
* order to clear that the connection is online mode.
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -28,17 +28,14 @@ package com.github.games647.fastlogin.bungee.listener;
|
|||||||
import com.github.games647.fastlogin.bungee.BungeeLoginSession;
|
import com.github.games647.fastlogin.bungee.BungeeLoginSession;
|
||||||
import com.github.games647.fastlogin.bungee.FastLoginBungee;
|
import com.github.games647.fastlogin.bungee.FastLoginBungee;
|
||||||
import com.github.games647.fastlogin.bungee.task.AsyncToggleMessage;
|
import com.github.games647.fastlogin.bungee.task.AsyncToggleMessage;
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
import com.github.games647.fastlogin.core.hooks.bedrock.FloodgateService;
|
import com.github.games647.fastlogin.core.hooks.bedrock.FloodgateService;
|
||||||
import com.github.games647.fastlogin.core.message.ChangePremiumMessage;
|
import com.github.games647.fastlogin.core.message.ChangePremiumMessage;
|
||||||
import com.github.games647.fastlogin.core.message.NamespaceKey;
|
import com.github.games647.fastlogin.core.message.NamespaceKey;
|
||||||
import com.github.games647.fastlogin.core.message.SuccessMessage;
|
import com.github.games647.fastlogin.core.message.SuccessMessage;
|
||||||
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
||||||
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
import com.google.common.io.ByteArrayDataInput;
|
import com.google.common.io.ByteArrayDataInput;
|
||||||
import com.google.common.io.ByteStreams;
|
import com.google.common.io.ByteStreams;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
@ -47,6 +44,8 @@ import net.md_5.bungee.api.event.PluginMessageEvent;
|
|||||||
import net.md_5.bungee.api.plugin.Listener;
|
import net.md_5.bungee.api.plugin.Listener;
|
||||||
import net.md_5.bungee.event.EventHandler;
|
import net.md_5.bungee.event.EventHandler;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
public class PluginMessageListener implements Listener {
|
public class PluginMessageListener implements Listener {
|
||||||
|
|
||||||
private final FastLoginBungee plugin;
|
private final FastLoginBungee plugin;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -29,10 +29,9 @@ import com.github.games647.fastlogin.bungee.BungeeLoginSession;
|
|||||||
import com.github.games647.fastlogin.bungee.BungeeLoginSource;
|
import com.github.games647.fastlogin.bungee.BungeeLoginSource;
|
||||||
import com.github.games647.fastlogin.bungee.FastLoginBungee;
|
import com.github.games647.fastlogin.bungee.FastLoginBungee;
|
||||||
import com.github.games647.fastlogin.bungee.event.BungeeFastLoginPreLoginEvent;
|
import com.github.games647.fastlogin.bungee.event.BungeeFastLoginPreLoginEvent;
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
import com.github.games647.fastlogin.core.shared.JoinManagement;
|
import com.github.games647.fastlogin.core.shared.JoinManagement;
|
||||||
import com.github.games647.fastlogin.core.shared.event.FastLoginPreLoginEvent;
|
import com.github.games647.fastlogin.core.shared.event.FastLoginPreLoginEvent;
|
||||||
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
import net.md_5.bungee.api.connection.PendingConnection;
|
import net.md_5.bungee.api.connection.PendingConnection;
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -27,10 +27,9 @@ package com.github.games647.fastlogin.bungee.task;
|
|||||||
|
|
||||||
import com.github.games647.fastlogin.bungee.FastLoginBungee;
|
import com.github.games647.fastlogin.bungee.FastLoginBungee;
|
||||||
import com.github.games647.fastlogin.bungee.event.BungeeFastLoginPremiumToggleEvent;
|
import com.github.games647.fastlogin.bungee.event.BungeeFastLoginPremiumToggleEvent;
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
||||||
import com.github.games647.fastlogin.core.shared.event.FastLoginPremiumToggleEvent.PremiumToggleReason;
|
import com.github.games647.fastlogin.core.shared.event.FastLoginPremiumToggleEvent.PremiumToggleReason;
|
||||||
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -29,16 +29,14 @@ import com.github.games647.fastlogin.bungee.BungeeLoginSession;
|
|||||||
import com.github.games647.fastlogin.bungee.FastLoginBungee;
|
import com.github.games647.fastlogin.bungee.FastLoginBungee;
|
||||||
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
||||||
import com.github.games647.fastlogin.core.shared.FloodgateManagement;
|
import com.github.games647.fastlogin.core.shared.FloodgateManagement;
|
||||||
|
|
||||||
import java.net.InetSocketAddress;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
import net.md_5.bungee.api.connection.Server;
|
import net.md_5.bungee.api.connection.Server;
|
||||||
|
|
||||||
import org.geysermc.floodgate.api.player.FloodgatePlayer;
|
import org.geysermc.floodgate.api.player.FloodgatePlayer;
|
||||||
|
|
||||||
|
import java.net.InetSocketAddress;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public class FloodgateAuthTask
|
public class FloodgateAuthTask
|
||||||
extends FloodgateManagement<ProxiedPlayer, CommandSender, BungeeLoginSession, FastLoginBungee> {
|
extends FloodgateManagement<ProxiedPlayer, CommandSender, BungeeLoginSession, FastLoginBungee> {
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -28,7 +28,6 @@ package com.github.games647.fastlogin.bungee.task;
|
|||||||
import com.github.games647.fastlogin.bungee.BungeeLoginSession;
|
import com.github.games647.fastlogin.bungee.BungeeLoginSession;
|
||||||
import com.github.games647.fastlogin.bungee.FastLoginBungee;
|
import com.github.games647.fastlogin.bungee.FastLoginBungee;
|
||||||
import com.github.games647.fastlogin.bungee.event.BungeeFastLoginAutoLoginEvent;
|
import com.github.games647.fastlogin.bungee.event.BungeeFastLoginAutoLoginEvent;
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
import com.github.games647.fastlogin.core.message.ChannelMessage;
|
import com.github.games647.fastlogin.core.message.ChannelMessage;
|
||||||
import com.github.games647.fastlogin.core.message.LoginActionMessage;
|
import com.github.games647.fastlogin.core.message.LoginActionMessage;
|
||||||
import com.github.games647.fastlogin.core.message.LoginActionMessage.Type;
|
import com.github.games647.fastlogin.core.message.LoginActionMessage.Type;
|
||||||
@ -36,14 +35,14 @@ import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
|||||||
import com.github.games647.fastlogin.core.shared.ForceLoginManagement;
|
import com.github.games647.fastlogin.core.shared.ForceLoginManagement;
|
||||||
import com.github.games647.fastlogin.core.shared.LoginSession;
|
import com.github.games647.fastlogin.core.shared.LoginSession;
|
||||||
import com.github.games647.fastlogin.core.shared.event.FastLoginAutoLoginEvent;
|
import com.github.games647.fastlogin.core.shared.event.FastLoginAutoLoginEvent;
|
||||||
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
import net.md_5.bungee.api.connection.Server;
|
import net.md_5.bungee.api.connection.Server;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public class ForceLoginTask
|
public class ForceLoginTask
|
||||||
extends ForceLoginManagement<ProxiedPlayer, CommandSender, BungeeLoginSession, FastLoginBungee> {
|
extends ForceLoginManagement<ProxiedPlayer, CommandSender, BungeeLoginSession, FastLoginBungee> {
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -25,15 +25,14 @@
|
|||||||
*/
|
*/
|
||||||
package com.github.games647.fastlogin.bungee.listener;
|
package com.github.games647.fastlogin.bungee.listener;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import net.md_5.bungee.BungeeCord;
|
import net.md_5.bungee.BungeeCord;
|
||||||
import net.md_5.bungee.conf.Configuration;
|
import net.md_5.bungee.conf.Configuration;
|
||||||
import net.md_5.bungee.connection.InitialHandler;
|
import net.md_5.bungee.connection.InitialHandler;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2015-2022 games647 and contributors
|
Copyright (c) 2015-2023 games647 and contributors
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -220,6 +220,14 @@
|
|||||||
<property name="optional" value="true"/>
|
<property name="optional" value="true"/>
|
||||||
</module>
|
</module>
|
||||||
|
|
||||||
|
<!-- Suppress filters via comments -->
|
||||||
|
<!-- https://stackoverflow.com/a/4023351/9767089 -->
|
||||||
|
<module name="SuppressionCommentFilter">
|
||||||
|
<property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
|
||||||
|
<property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
|
||||||
|
<property name="checkFormat" value="$1"/>
|
||||||
|
</module>
|
||||||
|
|
||||||
</module>
|
</module>
|
||||||
|
|
||||||
</module>
|
</module>
|
||||||
|
29
core/pom.xml
29
core/pom.xml
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2015-2022 games647 and contributors
|
Copyright (c) 2015-2023 games647 and contributors
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -63,6 +63,23 @@
|
|||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<version>3.3.0</version>
|
||||||
|
<configuration>
|
||||||
|
<archive>
|
||||||
|
<manifestEntries>
|
||||||
|
<Automatic-Module-Name>com.github.games647.fastlogin.core</Automatic-Module-Name>
|
||||||
|
</manifestEntries>
|
||||||
|
</archive>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<!-- Libraries that we shade into the project -->
|
<!-- Libraries that we shade into the project -->
|
||||||
|
|
||||||
@ -85,7 +102,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-jdk14</artifactId>
|
<artifactId>slf4j-jdk14</artifactId>
|
||||||
<version>2.0.7</version>
|
<version>2.0.11</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- snakeyaml is present in Bungee, Spigot, Cauldron, so we could use this independent implementation -->
|
<!-- snakeyaml is present in Bungee, Spigot, Cauldron, so we could use this independent implementation -->
|
||||||
@ -93,12 +110,6 @@
|
|||||||
<groupId>net.md-5</groupId>
|
<groupId>net.md-5</groupId>
|
||||||
<artifactId>bungeecord-config</artifactId>
|
<artifactId>bungeecord-config</artifactId>
|
||||||
<version>1.19-R0.1-SNAPSHOT</version>
|
<version>1.19-R0.1-SNAPSHOT</version>
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>*</groupId>
|
|
||||||
<artifactId>*</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--Floodgate for Xbox Live Authentication-->
|
<!--Floodgate for Xbox Live Authentication-->
|
||||||
@ -184,7 +195,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.code.gson</groupId>
|
<groupId>com.google.code.gson</groupId>
|
||||||
<artifactId>gson</artifactId>
|
<artifactId>gson</artifactId>
|
||||||
<version>2.10</version>
|
<version>2.10.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -25,12 +25,12 @@
|
|||||||
*/
|
*/
|
||||||
package com.github.games647.fastlogin.core;
|
package com.github.games647.fastlogin.core;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This limits the number of threads that are used at maximum. Thread creation can be very heavy for the CPU and
|
* This limits the number of threads that are used at maximum. Thread creation can be very heavy for the CPU and
|
||||||
* context switching between threads too. However, we need many threads for blocking HTTP and database calls.
|
* context switching between threads too. However, we need many threads for blocking HTTP and database calls.
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -26,6 +26,9 @@
|
|||||||
package com.github.games647.fastlogin.core;
|
package com.github.games647.fastlogin.core;
|
||||||
|
|
||||||
import com.google.common.cache.CacheBuilder;
|
import com.google.common.cache.CacheBuilder;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.slf4j.jul.JDK14LoggerAdapter;
|
||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
@ -33,10 +36,6 @@ import java.util.concurrent.ConcurrentMap;
|
|||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.slf4j.jul.JDK14LoggerAdapter;
|
|
||||||
|
|
||||||
public final class CommonUtil {
|
public final class CommonUtil {
|
||||||
|
|
||||||
private static final char COLOR_CHAR = '&';
|
private static final char COLOR_CHAR = '&';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -25,10 +25,10 @@
|
|||||||
*/
|
*/
|
||||||
package com.github.games647.fastlogin.core.antibot;
|
package com.github.games647.fastlogin.core.antibot;
|
||||||
|
|
||||||
import java.net.InetSocketAddress;
|
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
|
import java.net.InetSocketAddress;
|
||||||
|
|
||||||
public class AntiBotService {
|
public class AntiBotService {
|
||||||
|
|
||||||
private final Logger logger;
|
private final Logger logger;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -107,7 +107,7 @@ public class TickingRateLimiter implements RateLimiter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class TimeRecord implements Comparable<Long> {
|
private static class TimeRecord implements Comparable<TimeRecord> {
|
||||||
|
|
||||||
private final long firstMinuteRecord;
|
private final long firstMinuteRecord;
|
||||||
private final long expireTime;
|
private final long expireTime;
|
||||||
@ -131,9 +131,9 @@ public class TickingRateLimiter implements RateLimiter {
|
|||||||
return firstMinuteRecord + expireTime <= now;
|
return firstMinuteRecord + expireTime <= now;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public int compareTo(long other) {
|
||||||
public int compareTo(Long other) {
|
|
||||||
if (other < firstMinuteRecord) {
|
if (other < firstMinuteRecord) {
|
||||||
|
// other is earlier
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,5 +143,10 @@ public class TickingRateLimiter implements RateLimiter {
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(TimeRecord other) {
|
||||||
|
return compareTo(other.firstMinuteRecord);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -25,8 +25,17 @@
|
|||||||
*/
|
*/
|
||||||
package com.github.games647.fastlogin.core.hooks;
|
package com.github.games647.fastlogin.core.hooks;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Password generator for your auth plugin.
|
||||||
|
* @param <P> platform dependent player class
|
||||||
|
*/
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface PasswordGenerator<P> {
|
public interface PasswordGenerator<P> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate a password for a non-registered player
|
||||||
|
* @param player
|
||||||
|
* @return daw
|
||||||
|
*/
|
||||||
String getRandomPassword(P player);
|
String getRandomPassword(P player);
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -27,9 +27,9 @@ package com.github.games647.fastlogin.core.hooks.bedrock;
|
|||||||
|
|
||||||
import com.github.games647.craftapi.model.Profile;
|
import com.github.games647.craftapi.model.Profile;
|
||||||
import com.github.games647.craftapi.resolver.RateLimitException;
|
import com.github.games647.craftapi.resolver.RateLimitException;
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
||||||
import com.github.games647.fastlogin.core.shared.LoginSource;
|
import com.github.games647.fastlogin.core.shared.LoginSource;
|
||||||
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -25,16 +25,15 @@
|
|||||||
*/
|
*/
|
||||||
package com.github.games647.fastlogin.core.hooks.bedrock;
|
package com.github.games647.fastlogin.core.hooks.bedrock;
|
||||||
|
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
||||||
import com.github.games647.fastlogin.core.shared.LoginSource;
|
import com.github.games647.fastlogin.core.shared.LoginSource;
|
||||||
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
|
import org.geysermc.floodgate.api.FloodgateApi;
|
||||||
|
import org.geysermc.floodgate.api.player.FloodgatePlayer;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.geysermc.floodgate.api.FloodgateApi;
|
|
||||||
import org.geysermc.floodgate.api.player.FloodgatePlayer;
|
|
||||||
|
|
||||||
public class FloodgateService extends BedrockService<FloodgatePlayer> {
|
public class FloodgateService extends BedrockService<FloodgatePlayer> {
|
||||||
|
|
||||||
private final FloodgateApi floodgate;
|
private final FloodgateApi floodgate;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -27,13 +27,12 @@ package com.github.games647.fastlogin.core.hooks.bedrock;
|
|||||||
|
|
||||||
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
||||||
import com.github.games647.fastlogin.core.shared.LoginSource;
|
import com.github.games647.fastlogin.core.shared.LoginSource;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.api.network.AuthType;
|
import org.geysermc.geyser.api.network.AuthType;
|
||||||
import org.geysermc.geyser.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public class GeyserService extends BedrockService<GeyserSession> {
|
public class GeyserService extends BedrockService<GeyserSession> {
|
||||||
|
|
||||||
private final GeyserImpl geyser;
|
private final GeyserImpl geyser;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -36,11 +36,15 @@ import com.github.games647.fastlogin.core.antibot.TickingRateLimiter;
|
|||||||
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
||||||
import com.github.games647.fastlogin.core.hooks.DefaultPasswordGenerator;
|
import com.github.games647.fastlogin.core.hooks.DefaultPasswordGenerator;
|
||||||
import com.github.games647.fastlogin.core.hooks.PasswordGenerator;
|
import com.github.games647.fastlogin.core.hooks.PasswordGenerator;
|
||||||
|
import com.github.games647.fastlogin.core.storage.PostgreSQLStorage;
|
||||||
import com.github.games647.fastlogin.core.storage.MySQLStorage;
|
import com.github.games647.fastlogin.core.storage.MySQLStorage;
|
||||||
import com.github.games647.fastlogin.core.storage.SQLStorage;
|
import com.github.games647.fastlogin.core.storage.SQLStorage;
|
||||||
import com.github.games647.fastlogin.core.storage.SQLiteStorage;
|
import com.github.games647.fastlogin.core.storage.SQLiteStorage;
|
||||||
import com.google.common.base.Ticker;
|
import com.google.common.base.Ticker;
|
||||||
import com.zaxxer.hikari.HikariConfig;
|
import com.zaxxer.hikari.HikariConfig;
|
||||||
|
import net.md_5.bungee.config.Configuration;
|
||||||
|
import net.md_5.bungee.config.ConfigurationProvider;
|
||||||
|
import net.md_5.bungee.config.YamlConfiguration;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@ -61,10 +65,6 @@ import java.util.UUID;
|
|||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.ConcurrentMap;
|
import java.util.concurrent.ConcurrentMap;
|
||||||
|
|
||||||
import net.md_5.bungee.config.Configuration;
|
|
||||||
import net.md_5.bungee.config.ConfigurationProvider;
|
|
||||||
import net.md_5.bungee.config.YamlConfiguration;
|
|
||||||
|
|
||||||
import static java.util.function.Function.identity;
|
import static java.util.function.Function.identity;
|
||||||
import static java.util.stream.Collectors.toMap;
|
import static java.util.stream.Collectors.toMap;
|
||||||
import static java.util.stream.Collectors.toSet;
|
import static java.util.stream.Collectors.toSet;
|
||||||
@ -230,7 +230,25 @@ public class FastLoginCore<P extends C, C, T extends PlatformPlugin<C>> {
|
|||||||
databaseConfig.setMaxLifetime(config.getInt("lifetime", 30) * 1_000L);
|
databaseConfig.setMaxLifetime(config.getInt("lifetime", 30) * 1_000L);
|
||||||
|
|
||||||
if (type.contains("sqlite")) {
|
if (type.contains("sqlite")) {
|
||||||
storage = new SQLiteStorage(this, database, databaseConfig);
|
storage = new SQLiteStorage(plugin, database, databaseConfig);
|
||||||
|
} else if (type.contains("postgresql")) {
|
||||||
|
String host = config.get("host", "");
|
||||||
|
int port = config.get("port", 3306);
|
||||||
|
boolean useSSL = config.get("useSSL", false);
|
||||||
|
|
||||||
|
if (useSSL) {
|
||||||
|
boolean publicKeyRetrieval = config.getBoolean("allowPublicKeyRetrieval", false);
|
||||||
|
String rsaPublicKeyFile = config.getString("ServerRSAPublicKeyFile");
|
||||||
|
String sslMode = config.getString("sslMode", "Required");
|
||||||
|
|
||||||
|
databaseConfig.addDataSourceProperty("allowPublicKeyRetrieval", publicKeyRetrieval);
|
||||||
|
databaseConfig.addDataSourceProperty("serverRSAPublicKeyFile", rsaPublicKeyFile);
|
||||||
|
databaseConfig.addDataSourceProperty("sslMode", sslMode);
|
||||||
|
}
|
||||||
|
|
||||||
|
databaseConfig.setUsername(config.get("username", ""));
|
||||||
|
databaseConfig.setPassword(config.getString("password"));
|
||||||
|
storage = new PostgreSQLStorage(plugin, type, host, port, database, databaseConfig, useSSL);
|
||||||
} else {
|
} else {
|
||||||
String host = config.get("host", "");
|
String host = config.get("host", "");
|
||||||
int port = config.get("port", 3306);
|
int port = config.get("port", 3306);
|
||||||
@ -248,7 +266,7 @@ public class FastLoginCore<P extends C, C, T extends PlatformPlugin<C>> {
|
|||||||
|
|
||||||
databaseConfig.setUsername(config.get("username", ""));
|
databaseConfig.setUsername(config.get("username", ""));
|
||||||
databaseConfig.setPassword(config.getString("password"));
|
databaseConfig.setPassword(config.getString("password"));
|
||||||
storage = new MySQLStorage(this, type, host, port, database, databaseConfig, useSSL);
|
storage = new MySQLStorage(plugin, type, host, port, database, databaseConfig, useSSL);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -27,16 +27,16 @@ package com.github.games647.fastlogin.core.shared;
|
|||||||
|
|
||||||
import com.github.games647.craftapi.model.Profile;
|
import com.github.games647.craftapi.model.Profile;
|
||||||
import com.github.games647.craftapi.resolver.RateLimitException;
|
import com.github.games647.craftapi.resolver.RateLimitException;
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
||||||
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
|
import org.geysermc.floodgate.api.player.FloodgatePlayer;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.geysermc.floodgate.api.player.FloodgatePlayer;
|
|
||||||
|
|
||||||
public abstract class FloodgateManagement<P extends C, C, L extends LoginSession, T extends PlatformPlugin<C>>
|
public abstract class FloodgateManagement<P extends C, C, L extends LoginSession, T extends PlatformPlugin<C>>
|
||||||
implements Runnable {
|
implements Runnable {
|
||||||
|
|
||||||
@ -62,9 +62,9 @@ public abstract class FloodgateManagement<P extends C, C, L extends LoginSession
|
|||||||
this.username = getName(player);
|
this.username = getName(player);
|
||||||
|
|
||||||
//load values from config.yml
|
//load values from config.yml
|
||||||
autoLoginFloodgate = core.getConfig().get("autoLoginFloodgate").toString().toLowerCase();
|
autoLoginFloodgate = core.getConfig().getString("autoLoginFloodgate").toLowerCase(Locale.ROOT);
|
||||||
autoRegisterFloodgate = core.getConfig().get("autoRegisterFloodgate").toString().toLowerCase();
|
autoRegisterFloodgate = core.getConfig().getString("autoRegisterFloodgate").toLowerCase(Locale.ROOT);
|
||||||
allowNameConflict = core.getConfig().get("allowFloodgateNameConflict").toString().toLowerCase();
|
allowNameConflict = core.getConfig().getString("allowFloodgateNameConflict").toLowerCase(Locale.ROOT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -81,6 +81,40 @@ public abstract class FloodgateManagement<P extends C, C, L extends LoginSession
|
|||||||
}
|
}
|
||||||
|
|
||||||
profile = core.getStorage().loadProfile(username);
|
profile = core.getStorage().loadProfile(username);
|
||||||
|
|
||||||
|
if (profile.isSaved()) {
|
||||||
|
if (profile.isFloodgateMigrated()) {
|
||||||
|
if (profile.getFloodgate() == FloodgateState.TRUE && isLinked) {
|
||||||
|
core.getPlugin().getLog()
|
||||||
|
.info("Player {} is already stored by FastLogin as a non-linked Bedrock Edition player",
|
||||||
|
username);
|
||||||
|
return;
|
||||||
|
} else if (profile.getFloodgate() == FloodgateState.FALSE && isLinked) {
|
||||||
|
profile.setFloodgate(FloodgateState.LINKED);
|
||||||
|
core.getPlugin().getLog().info(
|
||||||
|
"Player {} will be changed from a Java player to a linked Floodgate player",
|
||||||
|
username);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (isLinked) {
|
||||||
|
profile.setFloodgate(FloodgateState.LINKED);
|
||||||
|
core.getPlugin().getLog().info(
|
||||||
|
"Player {} will be migrated to the v2 database schema as a linked Floodgate user",
|
||||||
|
username);
|
||||||
|
} else {
|
||||||
|
profile.setFloodgate(FloodgateState.TRUE);
|
||||||
|
core.getPlugin().getLog().info(
|
||||||
|
"Player {} will be migrated to the v2 database schema as a Floodgate user", username);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (isLinked) {
|
||||||
|
profile.setFloodgate(FloodgateState.LINKED);
|
||||||
|
} else {
|
||||||
|
profile.setFloodgate(FloodgateState.TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
AuthPlugin<P> authPlugin = core.getAuthPluginHook();
|
AuthPlugin<P> authPlugin = core.getAuthPluginHook();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -120,13 +154,17 @@ public abstract class FloodgateManagement<P extends C, C, L extends LoginSession
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// defer auto registration, if it's not enabled in the config
|
||||||
if (!isRegistered && !isAutoAuthAllowed(autoRegisterFloodgate)) {
|
if (!isRegistered && !isAutoAuthAllowed(autoRegisterFloodgate)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//logging in from bedrock for a second time threw an error with UUID
|
// stop the auto login procedure, if the current connection's parameters don't match the one stored in our
|
||||||
if (profile == null) {
|
// database
|
||||||
profile = new StoredProfile(getUUID(player), username, true, getAddress(player).toString());
|
// ex. we stored a LINKED account, but the current connection is not linked
|
||||||
|
if ((profile.getFloodgate() == FloodgateState.LINKED && !isLinked)
|
||||||
|
|| (profile.getFloodgate() == FloodgateState.TRUE && isLinked)) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//start Bukkit/Bungee specific tasks
|
//start Bukkit/Bungee specific tasks
|
||||||
|
@ -0,0 +1,86 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*/
|
||||||
|
package com.github.games647.fastlogin.core.shared;
|
||||||
|
|
||||||
|
public enum FloodgateState {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Purely Java profile
|
||||||
|
*/
|
||||||
|
FALSE(0),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Purely Bedrock profile
|
||||||
|
*/
|
||||||
|
TRUE(1),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bedrock profile is bidirectional associated with the Java Mojang profile.
|
||||||
|
*/
|
||||||
|
LINKED(2),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Data before floodgate database migration. Floodgate state is unknown.
|
||||||
|
*/
|
||||||
|
NOT_MIGRATED(3);
|
||||||
|
|
||||||
|
private int value;
|
||||||
|
|
||||||
|
FloodgateState(int value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert a number to FloodgateState
|
||||||
|
* <ol start="0">
|
||||||
|
* <li>False</li>
|
||||||
|
* <li>True</li>
|
||||||
|
* <li>Linked</li>
|
||||||
|
* <li>Not Migrated</li>
|
||||||
|
* </ol>
|
||||||
|
* @param num the number, most likely loaded from the database
|
||||||
|
* @return FloodgateStatus on success, null otherwise
|
||||||
|
*/
|
||||||
|
public static FloodgateState fromInt(int num) {
|
||||||
|
// using Enum.values()[i] is expensive as per https://stackoverflow.com/a/8762387/9767089
|
||||||
|
switch (num) {
|
||||||
|
case 0:
|
||||||
|
return FloodgateState.FALSE;
|
||||||
|
case 1:
|
||||||
|
return FloodgateState.TRUE;
|
||||||
|
case 2:
|
||||||
|
return FloodgateState.LINKED;
|
||||||
|
case 3:
|
||||||
|
return FloodgateState.NOT_MIGRATED;
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -25,10 +25,10 @@
|
|||||||
*/
|
*/
|
||||||
package com.github.games647.fastlogin.core.shared;
|
package com.github.games647.fastlogin.core.shared;
|
||||||
|
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
||||||
import com.github.games647.fastlogin.core.shared.event.FastLoginAutoLoginEvent;
|
import com.github.games647.fastlogin.core.shared.event.FastLoginAutoLoginEvent;
|
||||||
import com.github.games647.fastlogin.core.storage.SQLStorage;
|
import com.github.games647.fastlogin.core.storage.SQLStorage;
|
||||||
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
|
|
||||||
public abstract class ForceLoginManagement<P extends C, C, L extends LoginSession, T extends PlatformPlugin<C>>
|
public abstract class ForceLoginManagement<P extends C, C, L extends LoginSession, T extends PlatformPlugin<C>>
|
||||||
implements Runnable {
|
implements Runnable {
|
||||||
@ -62,7 +62,7 @@ public abstract class ForceLoginManagement<P extends C, C, L extends LoginSessio
|
|||||||
//premium player
|
//premium player
|
||||||
AuthPlugin<P> authPlugin = core.getAuthPluginHook();
|
AuthPlugin<P> authPlugin = core.getAuthPluginHook();
|
||||||
if (authPlugin == null) {
|
if (authPlugin == null) {
|
||||||
//maybe only bungeecord plugin
|
// maybe only bungeecord plugin
|
||||||
onForceActionSuccess(session);
|
onForceActionSuccess(session);
|
||||||
} else {
|
} else {
|
||||||
boolean success = true;
|
boolean success = true;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -27,15 +27,14 @@ package com.github.games647.fastlogin.core.shared;
|
|||||||
|
|
||||||
import com.github.games647.craftapi.model.Profile;
|
import com.github.games647.craftapi.model.Profile;
|
||||||
import com.github.games647.craftapi.resolver.RateLimitException;
|
import com.github.games647.craftapi.resolver.RateLimitException;
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
||||||
import com.github.games647.fastlogin.core.hooks.bedrock.BedrockService;
|
import com.github.games647.fastlogin.core.hooks.bedrock.BedrockService;
|
||||||
import com.github.games647.fastlogin.core.shared.event.FastLoginPreLoginEvent;
|
import com.github.games647.fastlogin.core.shared.event.FastLoginPreLoginEvent;
|
||||||
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
|
import net.md_5.bungee.config.Configuration;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import net.md_5.bungee.config.Configuration;
|
|
||||||
|
|
||||||
public abstract class JoinManagement<P extends C, C, S extends LoginSource> {
|
public abstract class JoinManagement<P extends C, C, S extends LoginSource> {
|
||||||
|
|
||||||
protected final FastLoginCore<P, C, ?> core;
|
protected final FastLoginCore<P, C, ?> core;
|
||||||
@ -50,17 +49,32 @@ public abstract class JoinManagement<P extends C, C, S extends LoginSource> {
|
|||||||
|
|
||||||
public void onLogin(String username, S source) {
|
public void onLogin(String username, S source) {
|
||||||
core.getPlugin().getLog().info("Handling player {}", username);
|
core.getPlugin().getLog().info("Handling player {}", username);
|
||||||
|
|
||||||
|
//check if the player is connecting through Bedrock Edition
|
||||||
|
if (bedrockService != null && bedrockService.isBedrockConnection(username)) {
|
||||||
|
//perform Bedrock specific checks and skip Java checks if no longer needed
|
||||||
|
if (bedrockService.performChecks(username, source)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StoredProfile profile = core.getStorage().loadProfile(username);
|
StoredProfile profile = core.getStorage().loadProfile(username);
|
||||||
|
|
||||||
|
//can't be a premium Java player, if it's not saved in the database
|
||||||
if (profile == null) {
|
if (profile == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//check if the player is connecting through Bedrock Edition
|
if (profile.isFloodgateMigrated()) {
|
||||||
if (bedrockService != null && bedrockService.isBedrockConnection(username)) {
|
if (profile.getFloodgate() == FloodgateState.TRUE) {
|
||||||
//perform Bedrock specific checks and skip Java checks, if they are not needed
|
// migrated and enabled floodgate player, however the above bedrocks fails, so the current connection
|
||||||
if (bedrockService.performChecks(username, source)) {
|
// isn't premium
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
profile.setFloodgate(FloodgateState.FALSE);
|
||||||
|
core.getPlugin().getLog().info(
|
||||||
|
"Player {} will be migrated to the v2 database schema as a JAVA user", username);
|
||||||
}
|
}
|
||||||
|
|
||||||
callFastLoginPreLoginEvent(username, source, profile);
|
callFastLoginPreLoginEvent(username, source, profile);
|
||||||
@ -140,6 +154,12 @@ public abstract class JoinManagement<P extends C, C, S extends LoginSource> {
|
|||||||
if (core.getConfig().get("nameChangeCheck", false)) {
|
if (core.getConfig().get("nameChangeCheck", false)) {
|
||||||
StoredProfile storedProfile = core.getStorage().loadProfile(profile.getId());
|
StoredProfile storedProfile = core.getStorage().loadProfile(profile.getId());
|
||||||
if (storedProfile != null) {
|
if (storedProfile != null) {
|
||||||
|
if (storedProfile.getFloodgate() == FloodgateState.TRUE) {
|
||||||
|
core.getPlugin().getLog()
|
||||||
|
.info("Player {} is already stored by FastLogin as a Bedrock Edition player.", username);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//uuid exists in the database
|
//uuid exists in the database
|
||||||
core.getPlugin().getLog().info("GameProfile {} changed it's username", profile);
|
core.getPlugin().getLog().info("GameProfile {} changed it's username", profile);
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.github.games647.fastlogin.core.shared;
|
package com.github.games647.fastlogin.core.shared;
|
||||||
|
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
|
|
||||||
import java.util.StringJoiner;
|
import java.util.StringJoiner;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@ -61,6 +61,7 @@ public abstract class LoginSession {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Check if user needs registration once login is successful
|
||||||
* @return This value is always false if we authenticate the player with a cracked authentication
|
* @return This value is always false if we authenticate the player with a cracked authentication
|
||||||
*/
|
*/
|
||||||
public synchronized boolean needsRegistration() {
|
public synchronized boolean needsRegistration() {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -28,12 +28,11 @@ package com.github.games647.fastlogin.core.shared;
|
|||||||
import com.github.games647.fastlogin.core.AsyncScheduler;
|
import com.github.games647.fastlogin.core.AsyncScheduler;
|
||||||
import com.github.games647.fastlogin.core.hooks.bedrock.BedrockService;
|
import com.github.games647.fastlogin.core.hooks.bedrock.BedrockService;
|
||||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.concurrent.ThreadFactory;
|
import java.util.concurrent.ThreadFactory;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
|
|
||||||
public interface PlatformPlugin<C> {
|
public interface PlatformPlugin<C> {
|
||||||
|
|
||||||
String getName();
|
String getName();
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -25,13 +25,24 @@
|
|||||||
*/
|
*/
|
||||||
package com.github.games647.fastlogin.core.shared.event;
|
package com.github.games647.fastlogin.core.shared.event;
|
||||||
|
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
import com.github.games647.fastlogin.core.shared.LoginSession;
|
import com.github.games647.fastlogin.core.shared.LoginSession;
|
||||||
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event fires if the plugin performs an auto login on the platform where the login plugin is.
|
* This event fires if the plugin performs an auto login on the platform where the login plugin is
|
||||||
|
*
|
||||||
|
* {@snippet :
|
||||||
|
* @EventHandler()
|
||||||
|
* public void onPlayerLogin(FastLoginAutoLoginEvent loginEvent) {
|
||||||
|
* StoredProfile profile = loginEvent.getProfile();
|
||||||
|
* LoginSession session = loginEvent.getSession();
|
||||||
|
*
|
||||||
|
* System.out.println("Player: " + session.getUsername() + " is about to be force logged in");
|
||||||
|
* }
|
||||||
|
* }
|
||||||
*/
|
*/
|
||||||
public interface FastLoginAutoLoginEvent extends FastLoginCancellableEvent {
|
public interface FastLoginAutoLoginEvent extends FastLoginCancellableEvent {
|
||||||
LoginSession getSession();
|
LoginSession getSession();
|
||||||
|
|
||||||
StoredProfile getProfile();
|
StoredProfile getProfile();
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -28,5 +28,6 @@ package com.github.games647.fastlogin.core.shared.event;
|
|||||||
public interface FastLoginCancellableEvent {
|
public interface FastLoginCancellableEvent {
|
||||||
|
|
||||||
boolean isCancelled();
|
boolean isCancelled();
|
||||||
|
|
||||||
void setCancelled(boolean cancelled);
|
void setCancelled(boolean cancelled);
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -25,8 +25,8 @@
|
|||||||
*/
|
*/
|
||||||
package com.github.games647.fastlogin.core.shared.event;
|
package com.github.games647.fastlogin.core.shared.event;
|
||||||
|
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
import com.github.games647.fastlogin.core.shared.LoginSource;
|
import com.github.games647.fastlogin.core.shared.LoginSource;
|
||||||
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This action represents the login attempt of a player before the plugin makes any online mode actions.
|
* This action represents the login attempt of a player before the plugin makes any online mode actions.
|
||||||
@ -34,6 +34,8 @@ import com.github.games647.fastlogin.core.shared.LoginSource;
|
|||||||
public interface FastLoginPreLoginEvent {
|
public interface FastLoginPreLoginEvent {
|
||||||
|
|
||||||
String getUsername();
|
String getUsername();
|
||||||
|
|
||||||
LoginSource getSource();
|
LoginSource getSource();
|
||||||
|
|
||||||
StoredProfile getProfile();
|
StoredProfile getProfile();
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.github.games647.fastlogin.core.shared.event;
|
package com.github.games647.fastlogin.core.shared.event;
|
||||||
|
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
import com.github.games647.fastlogin.core.storage.StoredProfile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This even represents the opt-in premium status change by request.
|
* This even represents the opt-in premium status change by request.
|
||||||
@ -33,6 +33,7 @@ import com.github.games647.fastlogin.core.StoredProfile;
|
|||||||
public interface FastLoginPremiumToggleEvent {
|
public interface FastLoginPremiumToggleEvent {
|
||||||
|
|
||||||
StoredProfile getProfile();
|
StoredProfile getProfile();
|
||||||
|
|
||||||
PremiumToggleReason getReason();
|
PremiumToggleReason getReason();
|
||||||
|
|
||||||
enum PremiumToggleReason {
|
enum PremiumToggleReason {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2022 games647 and contributors
|
* Copyright (c) 2015-2023 games647 and contributors
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -25,8 +25,6 @@
|
|||||||
*/
|
*/
|
||||||
package com.github.games647.fastlogin.core.storage;
|
package com.github.games647.fastlogin.core.storage;
|
||||||
|
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public interface AuthStorage {
|
public interface AuthStorage {
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user