MrXiaoM/Overflow

好想要热重载功能!

Closed this issue · 2 comments

https://github.com/gnuf0rce/debug-helper
这是一个有着多种调试功能的mirai插件,其中有热重载插件的功能
尝试在使用overflow时,重载某插件时抛出异常java.lang.NoSuchMethodError: 'net.mamoe.mirai.console.internal.plugin.JvmPluginsLoadingCtx net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.getJvmPluginLoadingCtx$mirai_console()'

热重载因为找不到net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl类的getJvmPluginLoadingCtx方法而失败
getJvmPluginLoadingCtx是一个internal类
jvmPluginLoadingCtx是该类的一个私有字段,上述的插件通过反射机制访问该类和它的字段

大概是因为它使用了mirai-core的内部方法?我不确定,看起来是这样的

首先,Overflow 仅仅更改了 mirai-core 这个模块,从官网下载的 mirai-console 依然是原装的 mirai-console,与 Overflow 无关。
其次,cssxsh 本人也说,热重载是不推荐的操作,极易出现问题。