mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-01 12:05:27 +02:00
Expanding DB cleanup settings, Player Leveling config pt 1
This commit is contained in:
@@ -10,6 +10,10 @@ public class ConfigDatabase {
|
||||
* CONFIG NODES
|
||||
*/
|
||||
|
||||
@Setting(value = "Database_Cleaning",
|
||||
comment = "Settings to automatically purge old users to keep database sizes small.")
|
||||
private ConfigSectionCleaning configSectionCleaning = new ConfigSectionCleaning();
|
||||
|
||||
@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" +
|
||||
@@ -24,4 +28,8 @@ public class ConfigDatabase {
|
||||
public ConfigSectionMySQL getConfigSectionMySQL() {
|
||||
return configSectionMySQL;
|
||||
}
|
||||
|
||||
public ConfigSectionCleaning getConfigSectionCleaning() {
|
||||
return configSectionCleaning;
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,67 @@
|
||||
package com.gmail.nossr50.config.hocon.database;
|
||||
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
@ConfigSerializable
|
||||
public class ConfigSectionCleaning {
|
||||
|
||||
/* DEFAULT VALUES */
|
||||
private static final boolean PURGE_OLD_USERS = false;
|
||||
private static final boolean PURGE_POWERLESS_USERS = true;
|
||||
private static final boolean ONLY_PURGE_AT_STARTUP = false;
|
||||
private static final int PURGE_INTERVAL_DEFAULT = 1;
|
||||
private static final int OLD_USER_CUTOFF_IN_MONTHS = 6;
|
||||
|
||||
/*
|
||||
* CONFIG NODES
|
||||
*/
|
||||
|
||||
@Setting(value = "Purge_Old_Users",
|
||||
comment = "Turn this on to enable automatic database pruning of old users." +
|
||||
"\nDefault value: "+PURGE_OLD_USERS)
|
||||
private boolean purgeOldUsers = PURGE_OLD_USERS;
|
||||
|
||||
@Setting(value = "Purge_Powerless_Users", comment = "Powerless users are players who have not" +
|
||||
" leveled up in a single skill." +
|
||||
"\nDefault value: "+PURGE_POWERLESS_USERS)
|
||||
private boolean purgePowerlessUsers = PURGE_POWERLESS_USERS;
|
||||
|
||||
@Setting(value = "Only_Purge_At_Plugin_Startup",
|
||||
comment = "If set to true, then purging will only happen when the plugin first loads." +
|
||||
"\nKeep in mind, this will trigger on reload as well." +
|
||||
"\nThis purge is on a 2 second delay from plugin start-up and runs in an ASYNC thread." +
|
||||
"\nDefault value: "+ONLY_PURGE_AT_STARTUP)
|
||||
private boolean onlyPurgeAtStartup = ONLY_PURGE_AT_STARTUP;
|
||||
|
||||
@Setting(value = "Purge_Interval_In_Hours", comment = "How many hours between automatic purging?")
|
||||
private int purgeInterval = PURGE_INTERVAL_DEFAULT;
|
||||
|
||||
@Setting(value = "Old_User_Cutoff_In_Months", comment = "Users who haven't connected in this many months will be purged" +
|
||||
"\nDefault value: "+OLD_USER_CUTOFF_IN_MONTHS)
|
||||
private int oldUserCutoffMonths = OLD_USER_CUTOFF_IN_MONTHS;
|
||||
|
||||
/*
|
||||
* GETTER BOILERPLATE
|
||||
*/
|
||||
|
||||
public boolean isPurgePowerlessUsers() {
|
||||
return purgePowerlessUsers;
|
||||
}
|
||||
|
||||
public boolean isPurgeOldUsers() {
|
||||
return purgeOldUsers;
|
||||
}
|
||||
|
||||
public boolean isOnlyPurgeAtStartup() {
|
||||
return onlyPurgeAtStartup;
|
||||
}
|
||||
|
||||
public int getPurgeInterval() {
|
||||
return purgeInterval;
|
||||
}
|
||||
|
||||
public int getOldUserCutoffMonths() {
|
||||
return oldUserCutoffMonths;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user