Skip to content

Commit

Permalink
Add velocity and paper proxy online mode detection
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgH93 committed May 7, 2023
1 parent fcfd96d commit ae52896
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ public boolean useOnlineUUIDs()
{
if(isBungeeCordModeEnabled())
{
Boolean detectedOnlineMode = Utils.getBungeeOrVelocityOnlineMode();
if (detectedOnlineMode != null)
{
logger.info("Detected online mode in paper config: " + detectedOnlineMode);
return detectedOnlineMode;
}
logger.warning("When using BungeeCord please make sure to set the UUID_Type config option explicitly!");
}
return Bukkit.getServer().getOnlineMode();
Expand Down Expand Up @@ -222,13 +228,13 @@ public String getUpdateChannel()
public boolean isBungeeCordModeEnabled()
{
boolean useBungee = getConfigE().getBoolean("Misc.UseBungeeCord", false);
boolean spigotUsesBungee = Utils.detectBungeeCord();
boolean runsProxy = Utils.detectBungeeCord() || Utils.detectVelocity();
boolean shareableDB = getDatabaseType().equals("mysql") || getDatabaseType().equals("global");
if(useBungee && !spigotUsesBungee)
if(useBungee && !runsProxy)
{
logger.warning("You have BungeeCord enabled for the plugin, but it looks like you have not enabled it in your spigot.yml! You probably should check your configuration.");
}
else if(!useBungee && spigotUsesBungee && shareableDB)
else if(!useBungee && runsProxy && shareableDB)
{
logger.warning("Your server is running behind a BungeeCord server. If you are using the plugin on more than one server with a shared database, please make sure to also enable the 'UseBungeeCord' config option.");
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<packaging>pom</packaging>

<properties>
<revision>2.4.18</revision>
<revision>2.4.19</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

Expand Down

0 comments on commit ae52896

Please sign in to comment.