Closed ofbwyx closed 1 year ago
@Nambers 原本的没了,但好像出现新问题了
lateinit property commandReg has not been initialized
{"data":"{\"bindId\":0,\"description\":\"null\",\"override\":false,\"pluginId\":\"id1\",\"preFixOption\":false,\"primaryName\":\"test\",\"secondName\":[\"sname1\",\"sname2\"],\"usage\":\"null\"}","type":24}
kotlin.UninitializedPropertyAccessException: lateinit property commandReg has not been initialized
at tech.eritquearcus.miraicp.shared.PublicSharedData.getCommandReg(PublicShared.kt:73)
at tech.eritquearcus.miraicp.shared.PublicShared.commandReg(PublicShared.kt:789)
at tech.eritquearcus.miraicp.shared.Packets$Incoming$operations$25.invoke(Packet.kt:375)
at tech.eritquearcus.miraicp.shared.Packets$Incoming$operations$25.invoke(Packet.kt:375)
at tech.eritquearcus.miraicp.shared.CPPLib$operation$1.invokeSuspend(CPPLib.kt:61)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
at tech.eritquearcus.miraicp.shared.CPPLib.operation(CPPLib.kt:58)
at tech.eritquearcus.miraicp.shared.CPPLibMultiplatform.KOperation(CPPLibMultiplatform.kt:45)
调用栈:
MiraiCP::KtOperation::ktOperationStr KtOperation.cpp:32
MiraiCP::KtOperation::ktOperation KtOperation.cpp:26
MiraiCP::CommandManager::registerCommand<…> Command.h:101
Main::onEnable test.cpp:70
FUNC_ENTRANCE utils.cpp:58
LibLoader::Plugin::callEntranceFuncNormal Plugin.cpp:126
operator() Plugin.cpp:254
std::__invoke_impl<…>(std::__invoke_other, struct {...} &) invoke.h:61
std::__invoke<…>(struct {...} &) invoke.h:96
std::_Bind::__call<…>(std::tuple<…> &&, std::_Index_tuple<…>) functional:484
std::_Bind::operator()<…>(void) functional:567
std::__invoke_impl<…>(std::__invoke_other, std::_Bind<…> &) invoke.h:61
std::__invoke_r<…>(std::_Bind<…> &) invoke.h:111
std::_Function_handler::_M_invoke(const std::_Any_data &) std_function.h:290
std::function::operator()() const std_function.h:591
BS::thread_pool::worker BS_thread_pool.hpp:633
std::__invoke_impl<…> invoke.h:74
std::__invoke<…> invoke.h:96
std::thread::_Invoker::_M_invoke<…> std_thread.h:252
std::thread::_Invoker::operator() std_thread.h:259
std::thread::_State_impl::_M_run std_thread.h:210
execute_native_thread_routine 0x00007fffc5a60b63
<unknown> 0x00007ffff7dfe8fd
<unknown> 0x00007ffff7e80a60
局部变量:
type = MiraiCP::KtOperation::CommandReg;
data = "{\"bindId\":0,\"description\":\"null\",\"override\":false,\"pluginId\":\"id1\",\"preFixOption\":false,\"primaryName\":\"test\",\"secondName\":[\"sname1\",\"sname2\"],\"usage\":\"null\"}"
re = "EA"
Code of Conduct
问题描述
在插件里写了自定义命令,编译正常,但在加载插件过程中出现报错 'Serializer for class 'Command' is not found.'。
主要代码(照着例子写的):
若去掉
onEnable
里面的那行,则这个插件可以正常加载。其他插件(包括另一个自己通过 MiraiCP 写的)都可以正常使用。MCL:2.1.2;Java 17(64 位);Mirai:2.13.2;MiraiCP:2.13.0-alpha-3;目录中均无中文。
日志
版本
2.13.0-alpha-3
组件
No response
编译器
Microsoft Visual C++ (MSVC)
系统
Windows
架构
x86-64/amd64