mirror of
				https://e.coding.net/circlecloud/Yum.git
				synced 2025-11-04 05:06:02 +00:00 
			
		
		
		
	@@ -38,7 +38,7 @@ public class YumPluginLoader implements PluginLoader {
 | 
			
		||||
        internal_loader = new JavaPluginLoader(instance);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static void cleanJavaPluginLoaders() {
 | 
			
		||||
    public static void replaceJavaPluginLoaders() {
 | 
			
		||||
        final YumPluginLoader yumPluginLoader = new YumPluginLoader(Bukkit.getServer());
 | 
			
		||||
        final PluginManager spm = Bukkit.getPluginManager();
 | 
			
		||||
        try {
 | 
			
		||||
 
 | 
			
		||||
@@ -6,6 +6,7 @@ import org.bukkit.plugin.java.JavaPlugin;
 | 
			
		||||
 | 
			
		||||
import cn.citycraft.PluginHelper.bukkit.P;
 | 
			
		||||
import cn.citycraft.PluginHelper.config.FileConfig;
 | 
			
		||||
import cn.citycraft.PluginHelper.sql.DataBase;
 | 
			
		||||
 | 
			
		||||
public class ConfigManager {
 | 
			
		||||
    public final static String ENABLE = "Enable";
 | 
			
		||||
@@ -36,6 +37,10 @@ public class ConfigManager {
 | 
			
		||||
        return config.getStringList("blacklist");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public DataBase getDataBase() {
 | 
			
		||||
        return DataBase.create(P.instance, config.getConfigurationSection(""));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public List<String> getIgnoreList() {
 | 
			
		||||
        return config.getStringList("ignorelist");
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										20
									
								
								src/main/java/pw/yumc/Yum/managers/DataManager.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								src/main/java/pw/yumc/Yum/managers/DataManager.java
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
package pw.yumc.Yum.managers;
 | 
			
		||||
 | 
			
		||||
import cn.citycraft.PluginHelper.sql.DataBase;
 | 
			
		||||
import cn.citycraft.PluginHelper.sql.KeyValue;
 | 
			
		||||
import cn.citycraft.PluginHelper.sql.Type;
 | 
			
		||||
 | 
			
		||||
public class DataManager {
 | 
			
		||||
    private static DataBase db = ConfigManager.i().getDataBase();
 | 
			
		||||
 | 
			
		||||
    public static void init() {
 | 
			
		||||
        db.createTables(TableName.cmd, new KeyValue("name", Type.VARCHAR.get()), null);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    static class TableName {
 | 
			
		||||
        public static String prefix = "monitor_";
 | 
			
		||||
        public static String cmd = prefix + "cmd";
 | 
			
		||||
        public static String event = prefix + "event";
 | 
			
		||||
        public static String task = prefix + "task";
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -42,13 +42,17 @@ public class MonitorManager {
 | 
			
		||||
    private final static Map<String, Long> event = new ConcurrentHashMap<>();
 | 
			
		||||
    private final static Map<String, Long> cmd = new ConcurrentHashMap<>();
 | 
			
		||||
 | 
			
		||||
    private final static DataBase db = null;
 | 
			
		||||
    private static DataBase db;
 | 
			
		||||
 | 
			
		||||
    private final static double um = 1000000.00;
 | 
			
		||||
 | 
			
		||||
    private final static LogKit mlog = new LogKit("monitor.log");
 | 
			
		||||
    private final static LogKit elog = new LogKit("error.log");
 | 
			
		||||
 | 
			
		||||
    public MonitorManager() {
 | 
			
		||||
        db = ConfigManager.i().getDataBase();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static void addCmd(final String pname, final long time) {
 | 
			
		||||
        add(pname, time, monitor, cmd);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user