Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow watchdog to listen to bedrock port if using geyser #59

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

yurisasc
Copy link

@yurisasc yurisasc commented Mar 3, 2023

This should fix #58, where the watchdog closes the server if it's a Java server using Geyser plugin and the online players are connecting using the Bedrock edition.

I've published a watchdog container to test. You can replace doctorray/minecraft-ecsfargate-watchdog on minecraft-stack.ts with yurisasc/minecraft-ecsfargate-watchdog.

I'm currently still testing the container itself. Any help will be appreciated.

@yurisasc
Copy link
Author

yurisasc commented Mar 3, 2023

I keep getting this error whenever I try to use my updated watchdog. I don't get the error when running the watchdog container locally.

exec ./watchdog.sh: exec format error

@yurisasc
Copy link
Author

yurisasc commented Mar 3, 2023

I can confirm it was due to me building the docker image using arm64. The latest image should be working.

@doctorray117 doctorray117 self-assigned this Mar 8, 2023
@doctorray117
Copy link
Owner

@yurisasc I think I'm good to merge as is, however after reviewing I've got some thoughts. First, maybe the watchdog script shouldn't care what edition is in use and perform auto-detection based on listening ports, and decide how to check them at that point. This might be the next step.

Second, do you think the geyser plugin should be integrated to be run by default here? It sure seems like a good benefit but I wonder if it can integrate easily for vanilla minecraft or if it requires one of the popular mod platforms (spigot, paper, whatever). I had always thought giving these as options up front would be a great addition but a potential maintenance nightmare. LMK what you think.

@yurisasc
Copy link
Author

yurisasc commented Mar 10, 2023

To your first point, it didn't cross my mind because I thought the method to check connections for java and bedrock edition are essentially different. While implementing this feature, I treated them as a black box because I didn't know much about how they work. I think it would be good if the watchdog could receive ports as the input and use them to check player connections without knowing which editions (or even whether they use Geyser or not).

For your second point, Geyser requires a mod loader such as Paper, Fabric, etc. People looking to host vanilla servers won't need to care about it. I think a good approach would be to treat Geyser as a possible extension for those who want to host mod loader servers. In terms of maintenance, we can avoid it by only giving ways for people to use Geyser, instead of supporting it by default.

To add Geyser, people will need to:

  1. Choose the java edition
  2. Open a new UDP port, preferably 19132
  3. Add additional configurations in the Minecraft container environment variables, which is to choose a mod loader and download Geyser

The CDK already supports the first and the third steps, and this PR resolves the issue with the watchdog when using Geyser. I think just adding the second step won't require much maintenance. What I can think about is that we will only need to add docs.

In my fork, I have already added functionality to open extra TCP or UDP ports. I can open another PR if you like.

@Rithmatist
Copy link

Note that the current docker image is very advanced and you can just add agruments like TYPE=SPIGOT like the EULA=TRUE.

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.

Watchdog isn't aware of Geyser usage - Bedrock client on Java server
3 participants