mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Feature: Detect incorrect proxy setups
This commit is contained in:
parent
83d8c19824
commit
4bf692b41a
1 changed files with 26 additions and 0 deletions
|
@ -148,6 +148,22 @@ public class GeyserSpigotPlugin extends JavaPlugin implements GeyserBootstrap {
|
|||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
// Check spigot config for BungeeCord mode
|
||||
if (!Boolean.TRUE.equals(Bukkit.getServer().spigot().getConfig().get("settings.bungeecord"))) {
|
||||
disableOnBackendServers("BungeeCord");
|
||||
return;
|
||||
}
|
||||
|
||||
// Now: Check for velocity mode - deliberately after checking bungeecord because this is a paper config
|
||||
if (!Boolean.TRUE.equals(Bukkit.getServer().spigot().getPaperConfig().get("proxies.velocity.enabled"))) {
|
||||
disableOnBackendServers("Velocity");
|
||||
return;
|
||||
}
|
||||
} catch (NoSuchMethodError e) {
|
||||
// no-op
|
||||
}
|
||||
|
||||
if (!loadConfig()) {
|
||||
return;
|
||||
}
|
||||
|
@ -458,4 +474,14 @@ public class GeyserSpigotPlugin extends JavaPlugin implements GeyserBootstrap {
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void disableOnBackendServers(String platform) {
|
||||
geyserLogger.error("*********************************************");
|
||||
geyserLogger.error("");
|
||||
geyserLogger.error(GeyserLocale.getLocaleStringLog("geyser.bootstrap.unsupported_proxy_backend", platform));
|
||||
geyserLogger.error(GeyserLocale.getLocaleStringLog("geyser.bootstrap.setup_guide", "https://geysermc.org/wiki/geyser/setup/"));
|
||||
geyserLogger.error("");
|
||||
geyserLogger.error("*********************************************");
|
||||
Bukkit.getPluginManager().disablePlugin(this);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue