Skip to content

initial bedrock geyser support#552

Merged
robinbraemer merged 18 commits into
masterfrom
feat/geyser
Sep 3, 2025
Merged

initial bedrock geyser support#552
robinbraemer merged 18 commits into
masterfrom
feat/geyser

Conversation

@robinbraemer

@robinbraemer robinbraemer commented Sep 2, 2025

Copy link
Copy Markdown
Member

credits: https://github.com/alexsobiek/gate-geyser ❤️


hey friends, the geyser integration is working and is in draft. I'm still cleaning things up but you can read the docs and test it out and let me know what could be better #552

git clone https://github.com/minekube/gate.git
cd gate
git checkout feat/geyser
go run . --config config-bedrock.yml

I plan to move the bedrock config into the main config section and remove editions concept for simplicity.
I also want to implement an managed geyser mode that downloads, configures and starts it for you
docs https://feat-geyser.gate-minekube.pages.dev/guide/bedrock.html (still need to replace the mermaid with a rendered image...)

Looking forward to your comments ❤️

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 2, 2025

Copy link
Copy Markdown

Deploying gate-minekube with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8247c0a
Status: ✅  Deploy successful!
Preview URL: https://82d510d5.gate-minekube.pages.dev
Branch Preview URL: https://feat-geyser.gate-minekube.pages.dev

View logs

@julian-siebert

Copy link
Copy Markdown
Contributor

Amazing, but I suggest adding an Event for determining the Username. Being limited to username-prefix is kinda bad, because it may look pretty ugly ingame. If you could change the Username of Floodgate players itself with plugins via Events, this would be amazing. Are you planning to expand the Gate API further with some neat Methods for getting DeviceOS (maybe as an enum string instead of int) or the Linking api for example?

- Added support for managed Geyser mode, allowing automatic handling of Geyser processes.
- Updated configuration to include managed settings for Geyser, enabling easier setup for Bedrock players.
- Refactored existing Bedrock configuration to streamline integration with Geyser and Floodgate.
- Improved documentation to clarify the new managed mode and its benefits for users.
- Removed obsolete Floodgate configuration file as its settings are now integrated into the main configuration.
- Changed the section title from 'HTTP API' to 'API & SDKs' in the VitePress configuration to better reflect the content and improve user navigation.
- Changed DeviceOS field in BedrockData to use a new DeviceOS struct for better type safety and clarity.
- Introduced DeviceOS constants to represent various operating systems.
- Added DeviceOSFromID function to retrieve DeviceOS by ID, enhancing code maintainability and readability.
- Introduced a check for OTEL_METRICS_ENABLED and OTEL_TRACES_ENABLED environment variables to conditionally log OpenTelemetry shutdown messages.
- Enhanced logging clarity by ensuring shutdown messages are only displayed when telemetry is enabled.
@robinbraemer

robinbraemer commented Sep 3, 2025

Copy link
Copy Markdown
Member Author

Thanks a lot @julian-siebert

Amazing, but I suggest adding an Event for determining the Username. Being limited to username-prefix is kinda bad, because it may look pretty ugly ingame. If you could change the Username of Floodgate players itself with plugins via Events, this would be amazing

You can use the standard GameProfileRequestEvent to change the username. I'll set our handler to a higher "system" priority so you can use 0 for example and get called after the bedrock integration updated the GameProfile from the linking data. You could do what ever you want here.

Are you planning to expand the Gate API further with some neat Methods for getting DeviceOS (maybe as an enum string instead of int) or the Linking api for example?

Good one, I have added proper device names caea694 (#552) and 04f65b5 (#552) and I'll see how I can expose the BedrockData from a connection with a helper function.

- Updated event subscription priority in the Geyser integration to ensure Bedrock players are processed before other handlers.
- Introduced a constant for priority to enhance code clarity and maintainability.
- Created a new file for DeviceOS struct and its associated constants, enhancing code organization and clarity.
- Implemented methods for identifying device types (console, mobile, desktop, etc.) based on DeviceOS.
- Removed DeviceOS definitions from BedrockData to streamline the structure and improve maintainability.
@julian-siebert

Copy link
Copy Markdown
Contributor

Thanks a lot @julian-siebert

Amazing, but I suggest adding an Event for determining the Username. Being limited to username-prefix is kinda bad, because it may look pretty ugly ingame. If you could change the Username of Floodgate players itself with plugins via Events, this would be amazing

You can use the standard GameProfileRequestEvent to change the username. I'll set our handler to a higher "system" priority so you can use 0 for example and get called after the bedrock integration updated the GameProfile from the linking data. You could do what ever you want here.

Are you planning to expand the Gate API further with some neat Methods for getting DeviceOS (maybe as an enum string instead of int) or the Linking api for example?

Good one, I have added proper device names caea694 (#552) and 04f65b5 (#552) and I'll see how I can expose the BedrockData from a connection with a helper function.

Amazing, thank you!

- Removed obsolete Bedrock configuration options from `config-simple.yml` to streamline setup.
- Updated README and guide documentation to highlight cross-platform compatibility and Bedrock support features.
- Improved navigation in the documentation by adding links to Bedrock support and adjusting section titles for clarity.
- Refactored example configurations to reflect the new managed Geyser integration and simplified setup process.
- Changed default Geyser listen address to 'localhost:25567' for enhanced security in local setups.
- Simplified Bedrock configuration by removing redundant options and streamlining the structure.
- Updated documentation to reflect changes in configuration and clarify setup instructions for Bedrock support.
- Enhanced test coverage for Bedrock configuration handling, ensuring robust validation and integration.
…ndows compatibility

- Updated file permission checks in floodgate_test.go to account for Windows differences, ensuring owner read/write access and warning for world-readable files.
- Modified download_test.go to create separate temporary directories for each subtest, preventing file conflicts on Windows.
- Enhanced error handling in managed.go during file operations to ensure proper cleanup and compatibility across platforms.
@robinbraemer robinbraemer marked this pull request as ready for review September 3, 2025 14:16
- Added context support to GeyserConnection for better integration with player connections.
- Introduced functions to manage Geyser connections within context, improving retrieval and safety.
- Removed obsolete methods for Geyser connection retrieval, streamlining the codebase.
@robinbraemer

Copy link
Copy Markdown
Member Author

you can use geyser.FromContext(player.Context()) to get the device info and other bedrock data

- Introduced a new section in the guide detailing how developers can access Bedrock player information through the context system.
- Provided a code example demonstrating how to handle player join events and access device-specific data.
- Highlighted the benefits of this access for creating platform-specific features and optimizations.
- Revised Bedrock configuration in `gate.yml` to clarify the manual mode for Geyser as a separate container.
- Enhanced documentation in `bedrock.md` to reflect updated configuration options and improve readability.
- Streamlined the layout and content in `LandingAfter.vue` to better highlight Bedrock support features and quick start instructions.
@robinbraemer robinbraemer merged commit 75ec7d3 into master Sep 3, 2025
5 checks passed
@robinbraemer robinbraemer deleted the feat/geyser branch September 3, 2025 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants