From 07b2df7c7e2ee141bdc30ceb96e505abba3a98a2 Mon Sep 17 00:00:00 2001 From: Luck Date: Thu, 23 Apr 2020 13:05:39 +0100 Subject: [PATCH] Cleanup configuration files slightly --- bukkit/src/main/resources/config.yml | 13 +++++++------ bungee/src/main/resources/config.yml | 13 +++++++------ .../lucko/luckperms/common/config/ConfigKeys.java | 12 +++++++++--- .../inject/server/LuckPermsSubscriptionMap.java | 2 +- nukkit/src/main/resources/config.yml | 13 +++++++------ sponge/src/main/resources/luckperms.conf | 13 +++++++------ velocity/src/main/resources/config.yml | 13 +++++++------ 7 files changed, 45 insertions(+), 34 deletions(-) diff --git a/bukkit/src/main/resources/config.yml b/bukkit/src/main/resources/config.yml index a3b761c3f..a38ca1589 100644 --- a/bukkit/src/main/resources/config.yml +++ b/bukkit/src/main/resources/config.yml @@ -139,24 +139,25 @@ data: # useUnicode: true # characterEncoding: utf8 # - # You can also use this section to disable SSL connections, by setting: - # useSSL: false - # verifyServerCertificate: false + # You can also use this section to disable SSL connections, by uncommenting the 'useSSL' and + # 'verifyServerCertificate' options below. properties: useUnicode: true characterEncoding: utf8 + #useSSL: false + #verifyServerCertificate: false # The prefix for all LuckPerms SQL tables. # - Change this is you want to use different tables for different servers. - table_prefix: 'luckperms_' + table-prefix: 'luckperms_' # 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-collection-prefix: '' # MongoDB ClientConnectionURI for use with replica sets and custom connection options # - See https://docs.mongodb.com/manual/reference/connection-string/ - mongodb_connection_URI: '' + mongodb-connection-uri: '' # Define settings for a "split" storage setup. # diff --git a/bungee/src/main/resources/config.yml b/bungee/src/main/resources/config.yml index ebd8b2a40..199748997 100644 --- a/bungee/src/main/resources/config.yml +++ b/bungee/src/main/resources/config.yml @@ -136,24 +136,25 @@ data: # useUnicode: true # characterEncoding: utf8 # - # You can also use this section to disable SSL connections, by setting: - # useSSL: false - # verifyServerCertificate: false + # You can also use this section to disable SSL connections, by uncommenting the 'useSSL' and + # 'verifyServerCertificate' options below. properties: useUnicode: true characterEncoding: utf8 + #useSSL: false + #verifyServerCertificate: false # The prefix for all LuckPerms SQL tables. # - Change this is you want to use different tables for different servers. - table_prefix: 'luckperms_' + table-prefix: 'luckperms_' # 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-collection-prefix: '' # MongoDB ClientConnectionURI for use with replica sets and custom connection options # - See https://docs.mongodb.com/manual/reference/connection-string/ - mongodb_connection_URI: '' + mongodb-connection-uri: '' # Define settings for a "split" storage setup. # 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 2d52dc663..14c9fda23 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 @@ -461,17 +461,23 @@ public final class ConfigKeys { /** * The prefix for any SQL tables */ - public static final ConfigKey SQL_TABLE_PREFIX = enduringKey(stringKey("data.table_prefix", "luckperms_")); + public static final ConfigKey SQL_TABLE_PREFIX = enduringKey(customKey(c -> { + return c.getString("data.table-prefix", c.getString("data.table_prefix", "luckperms_")); + })); /** * The prefix for any MongoDB collections */ - public static final ConfigKey MONGODB_COLLECTION_PREFIX = enduringKey(stringKey("data.mongodb_collection_prefix", "")); + public static final ConfigKey MONGODB_COLLECTION_PREFIX = enduringKey(customKey(c -> { + return c.getString("data.mongodb-collection-prefix", c.getString("data.mongodb_collection_prefix", "")); + })); /** * MongoDB ClientConnectionURI to override default connection options */ - public static final ConfigKey MONGODB_CONNECTION_URI = enduringKey(stringKey("data.mongodb_connection_URI", "")); + public static final ConfigKey MONGODB_CONNECTION_URI = enduringKey(customKey(c -> { + return c.getString("data.mongodb-connection-uri", c.getString("data.mongodb_connection_URI", "")); + })); /** * The name of the storage method being used diff --git a/nukkit/src/main/java/me/lucko/luckperms/nukkit/inject/server/LuckPermsSubscriptionMap.java b/nukkit/src/main/java/me/lucko/luckperms/nukkit/inject/server/LuckPermsSubscriptionMap.java index 8727f192f..63fc2226e 100644 --- a/nukkit/src/main/java/me/lucko/luckperms/nukkit/inject/server/LuckPermsSubscriptionMap.java +++ b/nukkit/src/main/java/me/lucko/luckperms/nukkit/inject/server/LuckPermsSubscriptionMap.java @@ -95,7 +95,7 @@ public final class LuckPermsSubscriptionMap extends HashMap result = super.get(key); + LPSubscriptionValueSet result = (LPSubscriptionValueSet) super.get(key); if (result == null) { // calculate a new map - always! result = new LPSubscriptionValueSet(permission); diff --git a/nukkit/src/main/resources/config.yml b/nukkit/src/main/resources/config.yml index 3e671d2cd..1c2a596d3 100644 --- a/nukkit/src/main/resources/config.yml +++ b/nukkit/src/main/resources/config.yml @@ -139,24 +139,25 @@ data: # useUnicode: true # characterEncoding: utf8 # - # You can also use this section to disable SSL connections, by setting: - # useSSL: false - # verifyServerCertificate: false + # You can also use this section to disable SSL connections, by uncommenting the 'useSSL' and + # 'verifyServerCertificate' options below. properties: useUnicode: true characterEncoding: utf8 + #useSSL: false + #verifyServerCertificate: false # The prefix for all LuckPerms SQL tables. # - Change this is you want to use different tables for different servers. - table_prefix: 'luckperms_' + table-prefix: 'luckperms_' # 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-collection-prefix: '' # MongoDB ClientConnectionURI for use with replica sets and custom connection options # - See https://docs.mongodb.com/manual/reference/connection-string/ - mongodb_connection_URI: '' + mongodb-connection-uri: '' # Define settings for a "split" storage setup. # diff --git a/sponge/src/main/resources/luckperms.conf b/sponge/src/main/resources/luckperms.conf index 7acee2c36..57eed48b8 100644 --- a/sponge/src/main/resources/luckperms.conf +++ b/sponge/src/main/resources/luckperms.conf @@ -139,26 +139,27 @@ data { # useUnicode = true # characterEncoding = "utf8" # - # You can also use this section to disable SSL connections, by setting: - # useSSL = false - # verifyServerCertificate = false + # You can also use this section to disable SSL connections, by uncommenting the 'useSSL' and + # 'verifyServerCertificate' options below. properties { useUnicode = true characterEncoding = "utf8" + #useSSL: false + #verifyServerCertificate: false } } # The prefix for all LuckPerms SQL tables. # - Change this is you want to use different tables for different servers. - table_prefix = "luckperms_" + table-prefix = "luckperms_" # 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-collection-prefix = "" # MongoDB ClientConnectionURI for use with replica sets and custom connection options # - See https://docs.mongodb.com/manual/reference/connection-string/ - mongodb_connection_URI = "" + mongodb-connection-uri = "" } # Define settings for a "split" storage setup. diff --git a/velocity/src/main/resources/config.yml b/velocity/src/main/resources/config.yml index ecbd7090a..fbecd9886 100644 --- a/velocity/src/main/resources/config.yml +++ b/velocity/src/main/resources/config.yml @@ -129,24 +129,25 @@ data: # useUnicode: true # characterEncoding: utf8 # - # You can also use this section to disable SSL connections, by setting: - # useSSL: false - # verifyServerCertificate: false + # You can also use this section to disable SSL connections, by uncommenting the 'useSSL' and + # 'verifyServerCertificate' options below. properties: useUnicode: true characterEncoding: utf8 + #useSSL: false + #verifyServerCertificate: false # The prefix for all LuckPerms SQL tables. # - Change this is you want to use different tables for different servers. - table_prefix: 'luckperms_' + table-prefix: 'luckperms_' # 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-collection-prefix: '' # MongoDB ClientConnectionURI for use with replica sets and custom connection options # - See https://docs.mongodb.com/manual/reference/connection-string/ - mongodb_connection_URI: '' + mongodb-connection-uri: '' # Define settings for a "split" storage setup. #