mirror of
				https://e.coding.net/circlecloud/Yum.git
				synced 2025-11-04 13:16:02 +00:00 
			
		
		
		
	
							
								
								
									
										5
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								pom.xml
									
									
									
									
									
								
							@@ -3,7 +3,7 @@
 | 
			
		||||
	<modelVersion>4.0.0</modelVersion>
 | 
			
		||||
	<groupId>pw.yumc</groupId>
 | 
			
		||||
	<artifactId>Yum</artifactId>
 | 
			
		||||
	<version>2.6.2</version>
 | 
			
		||||
	<version>2.6.3</version>
 | 
			
		||||
	<name>Yum</name>
 | 
			
		||||
	<description>Minecraft 服务器插件管理系统</description>
 | 
			
		||||
	<build>
 | 
			
		||||
@@ -60,9 +60,10 @@
 | 
			
		||||
	<properties>
 | 
			
		||||
		<update.description>&a全新 2.X 版本 更多守护与优化</update.description>
 | 
			
		||||
		<update.changes>
 | 
			
		||||
			&e预告  &6- &e下个版本将加入从&bBukkitDev&e下载和更新...;
 | 
			
		||||
			&b2.6.3 &6- &a注入操作延时执行 防止部分任务未注册 添加手动注入...;
 | 
			
		||||
			&b2.6.2 &6- &d能耗监控添加忽略列表 &3详见monitor.yml...;
 | 
			
		||||
			&b2.6.1 &6- &c优化能耗监控 命令别名修改为mi(防止与ESS冲突)...;
 | 
			
		||||
			&b2.6   &6- &a添加能耗监控系统 事件错误监控...;
 | 
			
		||||
		</update.changes>
 | 
			
		||||
		<env.GIT_COMMIT>DEBUG</env.GIT_COMMIT>
 | 
			
		||||
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 | 
			
		||||
 
 | 
			
		||||
@@ -26,6 +26,7 @@ import cn.citycraft.PluginHelper.commands.InvokeSubCommand;
 | 
			
		||||
import cn.citycraft.PluginHelper.ext.kit.Reflect;
 | 
			
		||||
import cn.citycraft.PluginHelper.kit.StrKit;
 | 
			
		||||
import pw.yumc.Yum.Yum;
 | 
			
		||||
import pw.yumc.Yum.api.YumAPI;
 | 
			
		||||
import pw.yumc.Yum.inject.CommandInjector;
 | 
			
		||||
import pw.yumc.Yum.inject.ListenerInjector;
 | 
			
		||||
import pw.yumc.Yum.inject.TaskInjector;
 | 
			
		||||
@@ -43,6 +44,10 @@ public class MonitorCommand implements HandlerCommands {
 | 
			
		||||
    private final String avg_warn = "§6平均耗时: §c%.5f毫秒!";
 | 
			
		||||
    private final String p_n_f = prefix + "§c插件 §b%s §c不存在!";
 | 
			
		||||
 | 
			
		||||
    private final String injected = "§a插件 §b%s §a成功注入能耗监控器!";
 | 
			
		||||
    private final String uninjected = "§a插件 §b%s §a成功撤销能耗监控器!";
 | 
			
		||||
    private final String notEnable = "§c插件 §b%s §c未成功加载 无法执行注入!";
 | 
			
		||||
 | 
			
		||||
    private final double um = 1000000.0;
 | 
			
		||||
 | 
			
		||||
    public MonitorCommand(final Yum yum) {
 | 
			
		||||
@@ -51,7 +56,7 @@ public class MonitorCommand implements HandlerCommands {
 | 
			
		||||
        cmdhandler.registerCommands(PluginTabComplete.instence);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @HandlerCommand(name = "cmd", description = "查看插件命令能耗", minimumArguments = 1, possibleArguments = "插件名称")
 | 
			
		||||
    @HandlerCommand(name = "cmd", description = "查看插件命令能耗", minimumArguments = 1, possibleArguments = "[插件名称]")
 | 
			
		||||
    public void cmd(final InvokeCommandEvent e) {
 | 
			
		||||
        final String pname = e.getArgs()[0];
 | 
			
		||||
        final CommandSender sender = e.getSender();
 | 
			
		||||
@@ -88,7 +93,7 @@ public class MonitorCommand implements HandlerCommands {
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @HandlerCommand(name = "event", description = "查看插件事件能耗", minimumArguments = 1, possibleArguments = "插件名称")
 | 
			
		||||
    @HandlerCommand(name = "event", description = "查看插件事件能耗", minimumArguments = 1, possibleArguments = "[插件名称]")
 | 
			
		||||
    public void event(final InvokeCommandEvent e) throws InstantiationException, IllegalAccessException {
 | 
			
		||||
        final String pname = e.getArgs()[0];
 | 
			
		||||
        final CommandSender sender = e.getSender();
 | 
			
		||||
@@ -135,7 +140,24 @@ public class MonitorCommand implements HandlerCommands {
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @HandlerCommand(name = "task", description = "查看插件任务能耗", minimumArguments = 1, possibleArguments = "插件名称")
 | 
			
		||||
    @HandlerCommand(name = "inject", aliases = "i", description = "注入能耗监控器", minimumArguments = 1, possibleArguments = "[插件名称]")
 | 
			
		||||
    public void inject(final InvokeCommandEvent e) {
 | 
			
		||||
        final String pname = e.getArgs()[0];
 | 
			
		||||
        final CommandSender sender = e.getSender();
 | 
			
		||||
        final Plugin plugin = Bukkit.getPluginManager().getPlugin(pname);
 | 
			
		||||
        if (plugin == null) {
 | 
			
		||||
            sender.sendMessage(String.format(p_n_f, pname));
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
        if (plugin.isEnabled()) {
 | 
			
		||||
            YumAPI.inject(plugin);
 | 
			
		||||
            sender.sendMessage(String.format(prefix + injected, pname));
 | 
			
		||||
        } else {
 | 
			
		||||
            sender.sendMessage(String.format(prefix + notEnable, pname));
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @HandlerCommand(name = "task", description = "查看插件任务能耗", minimumArguments = 1, possibleArguments = "[插件名称]")
 | 
			
		||||
    public void task(final InvokeCommandEvent e) {
 | 
			
		||||
        final String pname = e.getArgs()[0];
 | 
			
		||||
        final CommandSender sender = e.getSender();
 | 
			
		||||
@@ -164,4 +186,19 @@ public class MonitorCommand implements HandlerCommands {
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @HandlerCommand(name = "uninject", aliases = "ui", description = "撤销能耗监控器", minimumArguments = 1, possibleArguments = "[插件名称]")
 | 
			
		||||
    public void uninject(final InvokeCommandEvent e) {
 | 
			
		||||
        final String pname = e.getArgs()[0];
 | 
			
		||||
        final CommandSender sender = e.getSender();
 | 
			
		||||
        final Plugin plugin = Bukkit.getPluginManager().getPlugin(pname);
 | 
			
		||||
        if (plugin == null) {
 | 
			
		||||
            sender.sendMessage(String.format(p_n_f, pname));
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
        if (plugin.isEnabled()) {
 | 
			
		||||
            YumAPI.uninject(plugin);
 | 
			
		||||
            sender.sendMessage(String.format(prefix + uninjected, pname));
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -29,6 +29,11 @@ public class PluginListener implements Listener {
 | 
			
		||||
 | 
			
		||||
    @EventHandler
 | 
			
		||||
    public void onPluginEnable(final PluginEnableEvent e) {
 | 
			
		||||
        YumAPI.inject(e.getPlugin());
 | 
			
		||||
        PluginKit.runTaskLater(new Runnable() {
 | 
			
		||||
            @Override
 | 
			
		||||
            public void run() {
 | 
			
		||||
                YumAPI.inject(e.getPlugin());
 | 
			
		||||
            }
 | 
			
		||||
        }, 60);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -39,7 +39,7 @@ public class PluginNetworkListener implements Listener {
 | 
			
		||||
        if (ConfigManager.i().getNetworkWhiteURL().contains(e.getUrl().getHost())) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
        if (urlinfo.contains("yumc") || urlinfo.contains("502647092")) {
 | 
			
		||||
        if (urlinfo.contains("yumc") || urlinfo.contains("citycraft") || urlinfo.contains("502647092")) {
 | 
			
		||||
            final String 大神你好 = "反编译的大神们我知道你们又要说了这货有后门";
 | 
			
		||||
            大神你好.isEmpty();
 | 
			
		||||
            return;
 | 
			
		||||
 
 | 
			
		||||
@@ -25,4 +25,5 @@ WhiteURL:
 | 
			
		||||
- mcstats.org
 | 
			
		||||
- report.mcstats.org
 | 
			
		||||
- www.spigotmc.org
 | 
			
		||||
- dev.bukkit.org
 | 
			
		||||
- dev.bukkit.org
 | 
			
		||||
- api.curseforge.com
 | 
			
		||||
		Reference in New Issue
	
	Block a user