mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-25 16:45:28 +02:00
add missing defaults and constructor for database config
This commit is contained in:
@@ -7,16 +7,16 @@ import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
public class ConfigCategoryDatabase {
|
||||
|
||||
@Setting(value = "User_Name", comment = "The authorized user for your MySQL/MariaDB DB")
|
||||
private String username;
|
||||
private String username = "example_user_name";
|
||||
|
||||
@Setting(value = "User_Password", comment = "The password for your authorized user")
|
||||
private String password;
|
||||
private String password = "example_user_password";
|
||||
|
||||
@Setting(value = "Database_Name", comment = "The database name for your DB, this DB must already exist on the SQL server.")
|
||||
private String databaseName;
|
||||
private String databaseName = "example_database_name";
|
||||
|
||||
@Setting(value = "Table_Prefix", comment = "The Prefix that will be used for tables in your DB")
|
||||
private String tablePrefix;
|
||||
private String tablePrefix = "mcmmo_";
|
||||
|
||||
@Setting(value = "Max_Connections", comment = "This setting is the max simultaneous MySQL/MariaDB connections allowed at a time, this needs to be high enough to support multiple player logins in quick succession")
|
||||
private ConfigCategoryMaxConnections configCategoryMaxConnections;
|
||||
|
@@ -7,12 +7,12 @@ import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
public class ConfigCategoryMaxConnections {
|
||||
|
||||
@Setting(value = "Misc")
|
||||
private int misc;
|
||||
private int misc = 30;
|
||||
|
||||
@Setting(value = "Load")
|
||||
private int load;
|
||||
private int load = 30;
|
||||
|
||||
@Setting(value = "Save")
|
||||
private int save;
|
||||
private int save = 30;
|
||||
|
||||
}
|
||||
|
@@ -6,11 +6,11 @@ import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
@ConfigSerializable
|
||||
public class ConfigCategoryMaxPoolSize {
|
||||
@Setting(value = "Misc")
|
||||
private int misc;
|
||||
private int misc = 10;
|
||||
|
||||
@Setting(value = "Load")
|
||||
private int load;
|
||||
private int load = 20;
|
||||
|
||||
@Setting(value = "Save")
|
||||
private int save;
|
||||
private int save = 20;
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@ import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
public class ConfigCategoryMySQL {
|
||||
|
||||
@Setting(value = "Enabled", comment = "If set to true, mcMMO will use MySQL/MariaDB instead of FlatFile storage")
|
||||
private boolean enabled;
|
||||
private boolean enabled = true;
|
||||
|
||||
@Setting(value = "Database", comment = "Database settings for MySQL/MariaDB")
|
||||
private ConfigCategoryDatabase configCategoryDatabase;
|
||||
|
@@ -1,12 +1,32 @@
|
||||
package com.gmail.nossr50.config.hocon.database;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.ConfigConstants;
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
@ConfigSerializable
|
||||
public class ConfigDatabase {
|
||||
public class ConfigDatabase extends Config {
|
||||
|
||||
@Setting(value = "MySQL", comment = "Settings for using MySQL or MariaDB database")
|
||||
private ConfigCategoryMySQL configCategoryMySQL;
|
||||
|
||||
public ConfigDatabase() {
|
||||
super(ConfigConstants.getDataFolder(), ConfigConstants.RELATIVE_PATH_CONFIG_DIR, true, false, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unload() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* The version of this config
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public double getConfigVersion() {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user