Rewrite Ping Passthrough (#468)

* Fix ping passthrough on BungeeCord

* Initial implementation of direct ping passthrough

* Finished implementation of direct ping passthrough

* Remove test for something else entirely

* Fix standalone

* Add config option for ping passthrough interval

* Use GeyserPingInfo to reduce methods

* Add querying; modify ping passthrough

* Add separate config options for passthrough MOTD and player counts

* Convert all plugin bootstraps to use internal ping events to that other plugins can handle ping modifications

* Small changes

* Fix invalid packet spawm

* Add legacy ping passthrough option

* Fix BungeeCord

* Proper UUID for BungeeCord, thanks @theminecoder

* Update config version and messages

* Merge master... again

* Add missing javadocs and minor changes

Co-authored-by: James Harrison <james@fasttortoise.co.uk>
Co-authored-by: theminecoder <theminecoder.dev@gmail.com>
Co-authored-by: Redned <redned235@gmail.com>
This commit is contained in:
Camotoy 2020-05-23 17:50:04 -04:00 committed by GitHub
parent 59da87a10f
commit 99f69b3a7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 1108 additions and 106 deletions

View file

@ -26,10 +26,12 @@
package org.geysermc.platform.standalone;
import org.geysermc.common.PlatformType;
import org.geysermc.connector.ping.GeyserLegacyPingPassthrough;
import org.geysermc.connector.GeyserConfiguration;
import org.geysermc.connector.bootstrap.GeyserBootstrap;
import org.geysermc.connector.GeyserConnector;
import org.geysermc.connector.command.CommandManager;
import org.geysermc.connector.ping.IGeyserPingPassthrough;
import org.geysermc.connector.utils.FileUtils;
import org.geysermc.platform.standalone.command.GeyserCommandManager;
@ -40,8 +42,9 @@ import java.util.UUID;
public class GeyserStandaloneBootstrap implements GeyserBootstrap {
private GeyserCommandManager geyserCommandManager;
private GeyserConfiguration geyserConfig;
private GeyserStandaloneConfiguration geyserConfig;
private GeyserStandaloneLogger geyserLogger;
private IGeyserPingPassthrough geyserPingPassthrough;
private GeyserConnector connector;
@ -66,6 +69,9 @@ public class GeyserStandaloneBootstrap implements GeyserBootstrap {
connector = GeyserConnector.start(PlatformType.STANDALONE, this);
geyserCommandManager = new GeyserCommandManager(connector);
geyserPingPassthrough = GeyserLegacyPingPassthrough.init(connector);
geyserLogger.start();
}
@ -89,4 +95,9 @@ public class GeyserStandaloneBootstrap implements GeyserBootstrap {
public CommandManager getGeyserCommandManager() {
return geyserCommandManager;
}
@Override
public IGeyserPingPassthrough getGeyserPingPassthrough() {
return geyserPingPassthrough;
}
}

View file

@ -50,8 +50,17 @@ public class GeyserStandaloneConfiguration implements GeyserConfiguration {
@JsonProperty("command-suggestions")
private boolean isCommandSuggestions;
@JsonProperty("ping-passthrough")
private boolean pingPassthrough;
@JsonProperty("passthrough-motd")
private boolean isPassthroughMotd;
@JsonProperty("passthrough-player-counts")
private boolean isPassthroughPlayerCounts;
@JsonProperty("legacy-ping-passthrough")
private boolean isLegacyPingPassthrough;
@JsonProperty("ping-passthrough-interval")
private int pingPassthroughInterval;
@JsonProperty("max-players")
private int maxPlayers;