diff --git a/bukkit/src/main/resources/config.yml b/bukkit/src/main/resources/config.yml index 8fa99a81a..954fe5b96 100644 --- a/bukkit/src/main/resources/config.yml +++ b/bukkit/src/main/resources/config.yml @@ -328,7 +328,7 @@ data: # The prefix to use for all LuckPerms collections. Change this if you want to use different # collections for different servers. The default is no prefix. mongodb_collection_prefix: '' - + # MongoDB ClientConnectionURI for use with replicasets and custom connection options # See https://docs.mongodb.com/manual/reference/connection-string/ mongodb_connection_URI: '' diff --git a/bungee/src/main/resources/config.yml b/bungee/src/main/resources/config.yml index fe15c40e7..f2bc458ff 100644 --- a/bungee/src/main/resources/config.yml +++ b/bungee/src/main/resources/config.yml @@ -270,7 +270,7 @@ data: # The prefix to use for all LuckPerms collections. Change this if you want to use different # collections for different servers. The default is no prefix. mongodb_collection_prefix: '' - + # MongoDB ClientConnectionURI for use with replicasets and custom connection options # See https://docs.mongodb.com/manual/reference/connection-string/ mongodb_connection_URI: '' diff --git a/common/src/main/java/me/lucko/luckperms/common/config/ConfigKeys.java b/common/src/main/java/me/lucko/luckperms/common/config/ConfigKeys.java index 53f29b912..b6bc56fe5 100644 --- a/common/src/main/java/me/lucko/luckperms/common/config/ConfigKeys.java +++ b/common/src/main/java/me/lucko/luckperms/common/config/ConfigKeys.java @@ -404,12 +404,12 @@ public class ConfigKeys { * The prefix for any MongoDB collections */ public static final ConfigKey MONGODB_COLLECTION_PREFIX = EnduringKey.wrap(StringKey.of("data.mongodb_collection_prefix", "")); - + /** * MongoDB ClientConnectionURI to override default connection options */ public static final ConfigKey MONGODB_CONNECTION_URI = EnduringKey.wrap(StringKey.of("data.mongodb_connection_URI", "")); - + /** * The name of the storage method being used */ diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/dao/mongodb/MongoDao.java b/common/src/main/java/me/lucko/luckperms/common/storage/dao/mongodb/MongoDao.java index ed6426f5e..127f10627 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/dao/mongodb/MongoDao.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/dao/mongodb/MongoDao.java @@ -78,19 +78,19 @@ public class MongoDao extends AbstractDao { private MongoClient mongoClient; private MongoDatabase database; private final String prefix; - private final String connectionURI; + private final String connectionUri; - public MongoDao(LuckPermsPlugin plugin, StorageCredentials configuration, String prefix, String connectionURI) { + public MongoDao(LuckPermsPlugin plugin, StorageCredentials configuration, String prefix, String connectionUri) { super(plugin, "MongoDB"); this.configuration = configuration; this.prefix = prefix; - this.connectionURI = connectionURI; + this.connectionUri = connectionUri; } @Override public void init() { - if (!Strings.isNullOrempty(this.connectionURI)) { - this.mongoClient = new MongoClient(new MongoClientURI(this.connectionURI)); + if (!Strings.isNullOrEmpty(this.connectionUri)) { + this.mongoClient = new MongoClient(new MongoClientURI(this.connectionUri)); } else { MongoCredential credential = null; if (!Strings.isNullOrEmpty(this.configuration.getUsername())) { diff --git a/nukkit/src/main/resources/config.yml b/nukkit/src/main/resources/config.yml index 2b691e3e0..173e298fe 100644 --- a/nukkit/src/main/resources/config.yml +++ b/nukkit/src/main/resources/config.yml @@ -328,7 +328,7 @@ data: # The prefix to use for all LuckPerms collections. Change this if you want to use different # collections for different servers. The default is no prefix. mongodb_collection_prefix: '' - + # MongoDB ClientConnectionURI for use with replicasets and custom connection options # See https://docs.mongodb.com/manual/reference/connection-string/ mongodb_connection_URI: '' diff --git a/sponge/src/main/resources/luckperms.conf b/sponge/src/main/resources/luckperms.conf index 2e495230b..d4135c4e5 100644 --- a/sponge/src/main/resources/luckperms.conf +++ b/sponge/src/main/resources/luckperms.conf @@ -277,7 +277,7 @@ data { # The prefix to use for all LuckPerms collections. Change this if you want to use different # collections for different servers. The default is no prefix. mongodb_collection_prefix="" - + # MongoDB ClientConnectionURI for use with replicasets and custom connection options # See https://docs.mongodb.com/manual/reference/connection-string/ mongodb_connection_URI=""