Feature: Allow setting a different port in the motd (#4293)

* Allow changing the broadcasted port using a system property. This may be needed if the port Geyser runs on & the port Bedrock players connect on do not match - e.g. due to port forwarding/different routing.

* initial stab at making the broadcast port an (unsafe) config option

* Automatically set broadcast port to be the bind port unless manually overridden

* Warn about broadcast port mismatch

* Use 0 instead of -1 as indicator to broadcast the port geyser is running on
This commit is contained in:
chris 2024-01-24 22:28:03 +01:00 committed by GitHub
parent 3f577f4128
commit 61b3ffd0de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 81 additions and 19 deletions

View file

@ -50,6 +50,14 @@ public interface BedrockListener {
*/
int port();
/**
* Gets the broadcast port that's sent to Bedrock clients with the motd.
* This is the port that Bedrock clients will connect with. It usually does not differ from the listening port.
*
* @return the broadcast port
*/
int broadcastPort();
/**
* Gets the primary MOTD shown to Bedrock players if a ping passthrough setting is not enabled.
* <p>