Scoreboard config part 1

This commit is contained in:
nossr50
2019-03-13 09:42:57 -07:00
parent 1c289cfcdf
commit f00601931d
38 changed files with 708 additions and 96 deletions

View File

@@ -10,12 +10,13 @@ public class ConfigDatabase {
* CONFIG NODES
*/
@Setting(value = "MySQL", comment = "Settings for using MySQL or MariaDB database")
@Setting(value = "MySQL", comment = "Settings for using MySQL or MariaDB database" +
"\nI recommend using MariaDB, its completely compatible with MySQL and runs a lot better" +
"\nI also recommend having the MySQL/MariaDB server in the same datacenter or LAN as your Minecraft server" +
"\nmcMMO uses ASYNC threaded requests for SQL, so the latency is not really a big deal," +
" but ideally you want low latency to your SQL server anyways!")
private ConfigSectionMySQL configSectionMySQL = new ConfigSectionMySQL();
@Setting(value = "Enabled", comment = "If set to true, mcMMO will use MySQL/MariaDB instead of FlatFile storage")
private boolean enabled = true;
/*
* GETTER BOILERPLATE
*/

View File

@@ -6,6 +6,10 @@ import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
@ConfigSerializable
public class ConfigSectionDatabase {
/*
* CONFIG NODES
*/
@Setting(value = "Database_Name", comment = "The database name for your DB, this DB must already exist on the SQL server.")
private String databaseName = "example_database_name";

View File

@@ -6,13 +6,22 @@ import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
@ConfigSerializable
public class ConfigSectionMaxConnections {
@Setting(value = "Misc_Connection_Limit")
/* DEFAULT VALUES */
private static final int MISC_DEFAULT = 30;
private static final int LOAD_DEFAULT = 30;
private static final int SAVE_DEFAULT = 30;
/*
* CONFIG NODES
*/
@Setting(value = "Misc_Connection_Limit", comment = "Default value: "+MISC_DEFAULT)
private int misc = 30;
@Setting(value = "Load_Connection_Limit")
@Setting(value = "Load_Connection_Limit", comment = "Default value: "+LOAD_DEFAULT)
private int load = 30;
@Setting(value = "Save_Connection_Limit")
@Setting(value = "Save_Connection_Limit", comment = "Default value: "+SAVE_DEFAULT)
private int save = 30;
/*

View File

@@ -5,13 +5,23 @@ import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
@ConfigSerializable
public class ConfigSectionMaxPoolSize {
@Setting(value = "Misc_Pool")
/* DEFAULT VALUES */
private static final int MISC_DEFAULT = 10;
private static final int LOAD_DEFAULT = 20;
private static final int SAVE_DEFAULT = 20;
/*
* CONFIG NODES
*/
@Setting(value = "Misc_Pool", comment = "Default value: "+MISC_DEFAULT)
private int misc = 10;
@Setting(value = "Load_Pool")
@Setting(value = "Load_Pool", comment = "Default value: "+LOAD_DEFAULT)
private int load = 20;
@Setting(value = "Save_Pool")
@Setting(value = "Save_Pool", comment = "Default value: "+SAVE_DEFAULT)
private int save = 20;
/*

View File

@@ -7,8 +7,18 @@ import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
@ConfigSerializable
public class ConfigSectionMySQL {
@Setting(value = "Enabled", comment = "If set to true, mcMMO will use MySQL/MariaDB instead of FlatFile storage")
private boolean enabled = true;
/* DEFAULT VALUES */
private static final boolean USE_MYSQL_DEFAULT = false;
/*
* CONFIG NODES
*/
@Setting(value = "Use_MySQL", comment = "If set to true, mcMMO will use MySQL/MariaDB instead of FlatFile storage" +
"\nIt is highly recommended to use a MySQL/MariaDB server over FlatFile," +
" especially if the number of players on your Minecraft server is fairly high." +
"\nDefault value: "+USE_MYSQL_DEFAULT)
private boolean useMySQL = USE_MYSQL_DEFAULT;
@Setting(value = "User", comment = "Your MySQL User Settings")
private ConfigSectionUser configSectionUser = new ConfigSectionUser();
@@ -24,7 +34,7 @@ public class ConfigSectionMySQL {
*/
public boolean isMySQLEnabled() {
return enabled;
return useMySQL;
}
public ConfigSectionUser getConfigSectionUser() {
@@ -39,6 +49,10 @@ public class ConfigSectionMySQL {
return userConfigSectionServer;
}
/*
* HELPER METHODS
*/
public int getMaxPoolSize(SQLDatabaseManager.PoolIdentifier poolIdentifier)
{
switch (poolIdentifier)

View File

@@ -6,7 +6,12 @@ import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
@ConfigSerializable
public class ConfigSectionUser {
@Setting(value = "User_Name", comment = "The authorized user for your MySQL/MariaDB DB")
/*
* CONFIG NODES
*/
@Setting(value = "User_Name", comment = "The authorized user for your MySQL/MariaDB DB" +
"\nThis needs to be an existing user")
private String username = "example_user_name";
@Setting(value = "User_Password", comment = "The password for your authorized user")
@@ -24,5 +29,4 @@ public class ConfigSectionUser {
return password;
}
}

View File

@@ -6,18 +6,30 @@ import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
@ConfigSerializable
public class UserConfigSectionServer {
/* DEFAULT VALUES */
private static final boolean USE_SSL_DEFAULT = true;
private static final int SERVER_PORT_DEFAULT = 3306;
private static final String SERVER_ADDRESS_DEFAULT = "localhost";
/*
* CONFIG NODES
*/
@Setting(value = "Use_SSL", comment = "Enables SSL for MySQL/MariaDB connections." +
"\nIf your SQL server supports SSL, it is recommended to have it on but not necessary." +
"\nIf you run into any issues involving SSL, its best to just turn this off.")
private boolean useSSL = true;
"\nIf you run into any issues involving SSL, its best to just turn this off." +
"\nDefault value: "+USE_SSL_DEFAULT)
private boolean useSSL = USE_SSL_DEFAULT;
@Setting(value = "Server_Port", comment = "Your MySQL/MariaDB server port" +
"\nThe default port is typically 3306 for MySQL, but every server configuration is different!")
private int serverPort = 3306;
"\nThe default port is typically 3306 for MySQL, but every server configuration is different!" +
"\nDefault value: "+SERVER_PORT_DEFAULT)
private int serverPort = SERVER_PORT_DEFAULT;
@Setting(value = "Server_Address", comment = "The address for your MySQL/MariaDB server" +
"If the MySQL server is hosted on the same machine, you can use the localhost alias")
private String serverAddress = "localhost";
"If the MySQL server is hosted on the same machine, you can use the localhost alias" +
"\nDefault value: "+SERVER_ADDRESS_DEFAULT)
private String serverAddress = SERVER_ADDRESS_DEFAULT;
@Setting(value = "Max_Connections", comment = "This setting is the max simultaneous MySQL/MariaDB connections allowed at a time." +
"\nThis needs to be high enough to support multiple player logins in quick succession, it is recommended that you do not lower these values")