├── .github
└── workflows
│ ├── build.yml
│ └── pullrequest.yml
├── .gitignore
├── .gitmodules
├── .idea
├── codeStyles
│ ├── Project.xml
│ └── codeStyleConfig.xml
└── copyright
│ ├── GeyserMC.xml
│ └── profiles_settings.xml
├── LICENSE
├── README.md
├── ap
├── build.gradle.kts
└── src
│ └── main
│ ├── java
│ └── org
│ │ └── geysermc
│ │ └── floodgate
│ │ └── ap
│ │ ├── AutoBindProcessor.java
│ │ └── ClassProcessor.java
│ └── resources
│ └── META-INF
│ └── services
│ └── javax.annotation.processing.Processor
├── api
├── build.gradle.kts
└── src
│ └── main
│ └── java
│ └── org
│ └── geysermc
│ └── floodgate
│ └── api
│ ├── FloodgateApi.java
│ ├── InstanceHolder.java
│ ├── event
│ ├── FloodgateEventBus.java
│ ├── FloodgateSubscriber.java
│ └── skin
│ │ └── SkinApplyEvent.java
│ ├── handshake
│ ├── HandshakeData.java
│ ├── HandshakeHandler.java
│ └── HandshakeHandlers.java
│ ├── inject
│ ├── InjectorAddon.java
│ └── PlatformInjector.java
│ ├── link
│ ├── LinkRequest.java
│ ├── LinkRequestResult.java
│ └── PlayerLink.java
│ ├── logger
│ └── FloodgateLogger.java
│ ├── packet
│ ├── PacketHandler.java
│ └── PacketHandlers.java
│ ├── player
│ ├── FloodgatePlayer.java
│ └── PropertyKey.java
│ ├── unsafe
│ └── Unsafe.java
│ └── util
│ └── TriFunction.java
├── build-logic
├── build.gradle.kts
├── settings.gradle.kts
└── src
│ └── main
│ └── kotlin
│ ├── Versions.kt
│ ├── extensions.kt
│ ├── floodgate.base-conventions.gradle.kts
│ ├── floodgate.build-logic.gradle.kts
│ ├── floodgate.database-conventions.gradle.kts
│ ├── floodgate.generate-templates.gradle.kts
│ ├── floodgate.publish-conventions.gradle.kts
│ └── floodgate.shadow-conventions.gradle.kts
├── build.gradle.kts
├── bungee
├── build.gradle.kts
└── src
│ └── main
│ ├── java
│ └── org
│ │ └── geysermc
│ │ └── floodgate
│ │ ├── BungeePlugin.java
│ │ ├── addon
│ │ └── data
│ │ │ ├── BungeeDataAddon.java
│ │ │ ├── BungeeProxyDataHandler.java
│ │ │ └── BungeeServerDataHandler.java
│ │ ├── inject
│ │ └── bungee
│ │ │ └── BungeeInjector.java
│ │ ├── listener
│ │ ├── BungeeListener.java
│ │ └── BungeeListenerRegistration.java
│ │ ├── module
│ │ ├── BungeeAddonModule.java
│ │ ├── BungeeListenerModule.java
│ │ └── BungeePlatformModule.java
│ │ ├── pluginmessage
│ │ ├── BungeePluginMessageRegistration.java
│ │ ├── BungeePluginMessageUtils.java
│ │ └── BungeeSkinApplier.java
│ │ └── util
│ │ ├── BungeeCommandUtil.java
│ │ ├── BungeePlatformUtils.java
│ │ └── BungeeReflectionUtils.java
│ └── resources
│ └── plugin.yml
├── checkstyle.xml
├── core
├── build.gradle.kts
└── src
│ └── main
│ ├── java
│ └── org
│ │ └── geysermc
│ │ └── floodgate
│ │ ├── FloodgatePlatform.java
│ │ ├── addon
│ │ ├── AddonManagerAddon.java
│ │ ├── DebugAddon.java
│ │ ├── PacketHandlerAddon.java
│ │ ├── data
│ │ │ ├── CommonDataHandler.java
│ │ │ ├── HandshakeDataImpl.java
│ │ │ ├── HandshakeHandlersImpl.java
│ │ │ └── PacketBlocker.java
│ │ ├── debug
│ │ │ ├── ChannelInDebugHandler.java
│ │ │ ├── ChannelOutDebugHandler.java
│ │ │ └── State.java
│ │ └── packethandler
│ │ │ ├── ChannelInPacketHandler.java
│ │ │ └── ChannelOutPacketHandler.java
│ │ ├── api
│ │ ├── ProxyFloodgateApi.java
│ │ ├── SimpleFloodgateApi.java
│ │ └── UnsafeFloodgateApi.java
│ │ ├── command
│ │ ├── CommonCommandMessage.java
│ │ ├── LinkAccountCommand.java
│ │ ├── TestCommand.java
│ │ ├── UnlinkAccountCommand.java
│ │ ├── WhitelistCommand.java
│ │ ├── main
│ │ │ ├── FirewallCheckSubcommand.java
│ │ │ ├── MainCommand.java
│ │ │ └── VersionSubcommand.java
│ │ └── util
│ │ │ ├── Permission.java
│ │ │ └── PermissionDefault.java
│ │ ├── config
│ │ ├── ConfigLoader.java
│ │ ├── FloodgateConfig.java
│ │ └── ProxyFloodgateConfig.java
│ │ ├── database
│ │ └── config
│ │ │ ├── DatabaseConfig.java
│ │ │ └── DatabaseConfigLoader.java
│ │ ├── event
│ │ ├── EventBus.java
│ │ ├── EventSubscriber.java
│ │ ├── lifecycle
│ │ │ ├── PostEnableEvent.java
│ │ │ └── ShutdownEvent.java
│ │ ├── skin
│ │ │ └── SkinApplyEventImpl.java
│ │ └── util
│ │ │ └── ListenerAnnotationMatcher.java
│ │ ├── inject
│ │ └── CommonPlatformInjector.java
│ │ ├── link
│ │ ├── CommonPlayerLink.java
│ │ ├── DisabledPlayerLink.java
│ │ ├── GlobalPlayerLinking.java
│ │ ├── LinkRequestImpl.java
│ │ └── PlayerLinkHolder.java
│ │ ├── logger
│ │ └── JavaUtilFloodgateLogger.java
│ │ ├── module
│ │ ├── AutoBindModule.java
│ │ ├── CommandModule.java
│ │ ├── CommonModule.java
│ │ ├── ConfigLoadedModule.java
│ │ ├── PluginMessageModule.java
│ │ ├── PostInitializeModule.java
│ │ ├── ProxyCommonModule.java
│ │ └── ServerCommonModule.java
│ │ ├── news
│ │ └── NewsChecker.java
│ │ ├── packet
│ │ └── PacketHandlersImpl.java
│ │ ├── platform
│ │ ├── command
│ │ │ ├── CommandUtil.java
│ │ │ ├── FloodgateCommand.java
│ │ │ ├── FloodgateSubCommand.java
│ │ │ ├── SubCommands.java
│ │ │ └── TranslatableMessage.java
│ │ ├── listener
│ │ │ └── ListenerRegistration.java
│ │ ├── pluginmessage
│ │ │ └── PluginMessageUtils.java
│ │ └── util
│ │ │ ├── PlatformUtils.java
│ │ │ └── PlayerType.java
│ │ ├── player
│ │ ├── FloodgateCommandPreprocessor.java
│ │ ├── FloodgateHandshakeHandler.java
│ │ ├── FloodgatePlayerImpl.java
│ │ ├── HostnameSeparationResult.java
│ │ ├── UserAudience.java
│ │ └── audience
│ │ │ ├── FloodgateSenderMapper.java
│ │ │ ├── InvalidPlayerIdentifierException.java
│ │ │ ├── PlayerAudienceArgument.java
│ │ │ └── ProfileAudience.java
│ │ ├── pluginmessage
│ │ ├── PluginMessageChannel.java
│ │ ├── PluginMessageManager.java
│ │ ├── PluginMessageRegistration.java
│ │ └── channel
│ │ │ ├── FormChannel.java
│ │ │ ├── PacketChannel.java
│ │ │ ├── SkinChannel.java
│ │ │ └── TransferChannel.java
│ │ ├── register
│ │ ├── AddonRegister.java
│ │ ├── CommandRegister.java
│ │ ├── ListenerRegister.java
│ │ └── PluginMessageRegister.java
│ │ ├── skin
│ │ ├── SkinApplier.java
│ │ ├── SkinDataImpl.java
│ │ ├── SkinUploadManager.java
│ │ └── SkinUploadSocket.java
│ │ └── util
│ │ ├── AutoBind.java
│ │ ├── BrigadierUtils.java
│ │ ├── HttpClient.java
│ │ ├── InjectorHolder.java
│ │ ├── LanguageManager.java
│ │ ├── MessageFormatter.java
│ │ ├── Metrics.java
│ │ ├── MojangUtils.java
│ │ ├── PostEnableMessages.java
│ │ ├── ReflectionUtils.java
│ │ └── Utils.java
│ ├── resources
│ ├── config.yml
│ └── proxy-config.yml
│ └── templates
│ └── org
│ └── geysermc
│ └── floodgate
│ └── util
│ └── Constants.java
├── database
├── mongo
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ ├── java
│ │ └── org
│ │ │ └── geysermc
│ │ │ └── floodgate
│ │ │ └── database
│ │ │ ├── MongoDbDatabase.java
│ │ │ └── config
│ │ │ └── MongoConfig.java
│ │ └── resources
│ │ ├── init.json
│ │ └── mongo.yml
├── mysql
│ ├── .editorconfig
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ ├── java
│ │ └── org
│ │ │ └── geysermc
│ │ │ └── floodgate
│ │ │ └── database
│ │ │ ├── MysqlDatabase.java
│ │ │ └── config
│ │ │ └── MysqlConfig.java
│ │ └── resources
│ │ ├── init.json
│ │ └── mysql.yml
└── sqlite
│ ├── build.gradle.kts
│ └── src
│ └── main
│ ├── java
│ └── org
│ │ └── geysermc
│ │ └── floodgate
│ │ └── database
│ │ └── SqliteDatabase.java
│ └── resources
│ └── init.json
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── ruleset.xml
├── settings.gradle.kts
├── spigot
├── build.gradle.kts
└── src
│ └── main
│ ├── java
│ └── org
│ │ └── geysermc
│ │ └── floodgate
│ │ ├── SpigotPlugin.java
│ │ ├── addon
│ │ └── data
│ │ │ ├── SpigotDataAddon.java
│ │ │ └── SpigotDataHandler.java
│ │ ├── inject
│ │ └── spigot
│ │ │ ├── CustomList.java
│ │ │ └── SpigotInjector.java
│ │ ├── listener
│ │ ├── PaperProfileListener.java
│ │ ├── SpigotListener.java
│ │ └── SpigotListenerRegistration.java
│ │ ├── module
│ │ ├── PaperListenerModule.java
│ │ ├── SpigotAddonModule.java
│ │ ├── SpigotCommandModule.java
│ │ ├── SpigotListenerModule.java
│ │ └── SpigotPlatformModule.java
│ │ ├── pluginmessage
│ │ ├── SpigotPluginMessageRegistration.java
│ │ ├── SpigotPluginMessageUtils.java
│ │ └── SpigotSkinApplier.java
│ │ └── util
│ │ ├── ClassNames.java
│ │ ├── ProxyUtils.java
│ │ ├── SpigotCommandUtil.java
│ │ ├── SpigotHandshakeHandler.java
│ │ ├── SpigotPlatformUtils.java
│ │ ├── SpigotProtocolSupportHandler.java
│ │ ├── SpigotProtocolSupportListener.java
│ │ ├── SpigotVersionSpecificMethods.java
│ │ └── WhitelistUtils.java
│ └── resources
│ └── plugin.yml
└── velocity
├── build.gradle.kts
└── src
└── main
├── java
└── org
│ └── geysermc
│ └── floodgate
│ ├── VelocityPlugin.java
│ ├── addon
│ └── data
│ │ ├── VelocityDataAddon.java
│ │ ├── VelocityProxyDataHandler.java
│ │ └── VelocityServerDataHandler.java
│ ├── inject
│ └── velocity
│ │ └── VelocityInjector.java
│ ├── listener
│ ├── VelocityListener.java
│ └── VelocityListenerRegistration.java
│ ├── logger
│ └── Slf4jFloodgateLogger.java
│ ├── module
│ ├── VelocityAddonModule.java
│ ├── VelocityListenerModule.java
│ └── VelocityPlatformModule.java
│ ├── pluginmessage
│ ├── VelocityPluginMessageRegistration.java
│ └── VelocityPluginMessageUtils.java
│ └── util
│ ├── VelocityCommandUtil.java
│ ├── VelocityPlatformUtils.java
│ └── VelocitySkinApplier.java
└── resources
└── velocity-plugin.json
/.github/workflows/pullrequest.yml:
--------------------------------------------------------------------------------
1 | name: Build Pull Request
2 |
3 | on: [ pull_request ]
4 |
5 | jobs:
6 | build:
7 |
8 | runs-on: ubuntu-latest
9 |
10 | steps:
11 | - name: Set Build Number
12 | run: |
13 | echo "BUILD_NUMBER=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
14 |
15 | - name: Checkout repository and submodules
16 | # See https://github.com/actions/checkout/commits
17 | uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
18 | with:
19 | submodules: recursive
20 |
21 | - name: Validate Gradle Wrapper
22 | # See https://github.com/gradle/wrapper-validation-action/commits
23 | uses: gradle/actions/wrapper-validation@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2
24 |
25 | - name: Setup Java
26 | # See https://github.com/actions/setup-java/commits
27 | uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
28 | with:
29 | java-version: 17
30 | distribution: temurin
31 |
32 | - name: Setup Gradle
33 | # See https://github.com/gradle/actions/commits
34 | uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2
35 | with:
36 | cache-read-only: true
37 |
38 | - name: Build Floodgate
39 | run: ./gradlew build
40 |
41 | - name: Archive artifacts (Floodgate Bungee)
42 | # See https://github.com/actions/upload-artifact/commits
43 | uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
44 | if: success()
45 | with:
46 | name: Floodgate Bungee
47 | path: bungee/build/libs/floodgate-bungee.jar
48 | if-no-files-found: error
49 |
50 | - name: Archive artifacts (Floodgate Spigot)
51 | uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
52 | if: success()
53 | with:
54 | name: Floodgate Spigot
55 | path: spigot/build/libs/floodgate-spigot.jar
56 | if-no-files-found: error
57 |
58 | - name: Archive artifacts (Floodgate Velocity)
59 | uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
60 | if: success()
61 | with:
62 | name: Floodgate Velocity
63 | path: velocity/build/libs/floodgate-velocity.jar
64 | if-no-files-found: error
65 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "core/src/main/resources/languages"]
2 | path = core/src/main/resources/languages
3 | url = https://github.com/GeyserMC/languages
4 | branch = floodgate
--------------------------------------------------------------------------------
/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/.idea/copyright/GeyserMC.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019-2022 GeyserMC
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Floodgate
2 |
3 | [](LICENSE)
4 | [](https://github.com/GeyserMC/Floodgate/actions/workflows/build.yml?query=branch%3Amaster)
5 | [](http://discord.geysermc.org/)
6 | [](http://hits.dwyl.com/GeyserMC/Floodgate)
7 |
8 | [Download](https://geysermc.org/download/?project=floodgate)
9 |
10 | Hybrid mode plugin to allow for connections from [Geyser](https://github.com/GeyserMC/Geyser) to join online mode servers.
11 |
12 | Geyser is an open collaboration project by [CubeCraft Games](https://cubecraft.net).
13 |
14 | See the [Floodgate](https://geysermc.org/wiki/floodgate/) section in the GeyserMC Wiki for more info about what Floodgate is, how you setup Floodgate and known issues/caveats. Additionally, it includes a more in-depth look into how Floodgate works and the Floodgate API.
15 |
--------------------------------------------------------------------------------
/ap/build.gradle.kts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GeyserMC/Floodgate/0e3163c94220cdc516d1d1219557376c5216312b/ap/build.gradle.kts
--------------------------------------------------------------------------------
/ap/src/main/java/org/geysermc/floodgate/ap/AutoBindProcessor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in
12 | * all copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | * THE SOFTWARE.
21 | *
22 | * @author GeyserMC
23 | * @link https://github.com/GeyserMC/Floodgate
24 | */
25 |
26 | package org.geysermc.floodgate.ap;
27 |
28 | import javax.annotation.processing.SupportedAnnotationTypes;
29 | import javax.annotation.processing.SupportedSourceVersion;
30 | import javax.lang.model.SourceVersion;
31 |
32 | @SupportedAnnotationTypes("*")
33 | @SupportedSourceVersion(SourceVersion.RELEASE_8)
34 | public class AutoBindProcessor extends ClassProcessor {
35 | public AutoBindProcessor() {
36 | super("org.geysermc.floodgate.util.AutoBind");
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/ap/src/main/resources/META-INF/services/javax.annotation.processing.Processor:
--------------------------------------------------------------------------------
1 | org.geysermc.floodgate.ap.AutoBindProcessor
--------------------------------------------------------------------------------
/api/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2 |
3 | dependencies {
4 | api("org.geysermc.geyser", "common", Versions.geyserVersion)
5 | api("org.geysermc.cumulus", "cumulus", Versions.cumulusVersion)
6 | api("org.geysermc.event", "events", Versions.eventsVersion)
7 |
8 | compileOnly("io.netty", "netty-transport", Versions.nettyVersion)
9 | }
10 |
11 | tasks {
12 | named("jar") {
13 | archiveClassifier.set("")
14 | }
15 | named("shadowJar") {
16 | archiveClassifier.set("shaded")
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/api/src/main/java/org/geysermc/floodgate/api/event/FloodgateEventBus.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in
12 | * all copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | * THE SOFTWARE.
21 | *
22 | * @author GeyserMC
23 | * @link https://github.com/GeyserMC/Floodgate
24 | */
25 |
26 | package org.geysermc.floodgate.api.event;
27 |
28 | import org.geysermc.event.bus.EventBus;
29 |
30 | public interface FloodgateEventBus extends EventBus