Add warning when bungeecord settings mismatch between server and plugin

This commit is contained in:
GeorgH93 2020-12-08 16:04:29 +01:00
parent 865148fee3
commit 4df0ea78e9
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8
3 changed files with 15 additions and 4 deletions

View File

@ -20,6 +20,7 @@
import at.pcgamingfreaks.Bukkit.Configuration;
import at.pcgamingfreaks.Bukkit.MCVersion;
import at.pcgamingfreaks.Bukkit.MinecraftMaterial;
import at.pcgamingfreaks.Bukkit.Util.Utils;
import at.pcgamingfreaks.ConsoleColor;
import at.pcgamingfreaks.Database.DatabaseConnectionConfiguration;
import at.pcgamingfreaks.Minepacks.Bukkit.API.WorldBlacklistMode;
@ -84,7 +85,7 @@ public int getAutoCleanupMaxInactiveDays()
public String getDatabaseType()
{
return getConfigE().getString("Database.Type", "sqlite");
return getConfigE().getString("Database.Type", "sqlite").toLowerCase(Locale.ENGLISH);
}
public void setDatabaseType(String type)
@ -216,7 +217,17 @@ public String getUpdateChannel()
public boolean isBungeeCordModeEnabled()
{
return getConfigE().getBoolean("Misc.UseBungeeCord", false);
boolean useBungee = getConfigE().getBoolean("Misc.UseBungeeCord", false);
boolean spigotUsesBungee = Utils.detectBungeeCord();
if(useBungee && !spigotUsesBungee)
{
logger.warning("You have BungeeCord enabled, but it looks like you have not enabled it in your spigot.yml! You probably should check your configuration.");
}
else if(!useBungee && spigotUsesBungee && getDatabaseType().equals("mysql"))
{
logger.warning("Your server is running behind a BungeeCord server. If you are using the plugin please make sure to also enable the 'UseBungeeCord' config option.");
}
return useBungee;
}
//endregion

View File

@ -88,7 +88,7 @@ public void close()
{
try
{
String dbType = plugin.getConfiguration().getDatabaseType().toLowerCase(Locale.ROOT);
String dbType = plugin.getConfiguration().getDatabaseType();
ConnectionProvider connectionProvider = null;
if(dbType.equals("shared") || dbType.equals("external") || dbType.equals("global"))
{

View File

@ -7,7 +7,7 @@
<packaging>pom</packaging>
<properties>
<revision>2.3.21.1</revision>
<revision>2.3.21.2</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>