小白求救,Mirai_CP插件在MCL上收到消息就报错
-
如题,之前在使用MCL Installer Auto Release 72b890d安装的MCL上运行了使用Mirai_CP2.7Beta的demo开发的插件,loader也是对应版本,插件运行正常
后来看到mcl和mirai_cp都有更新,就把mcl更新到了1.0.3,插件也在mirai_cpv2.7-RC-dev4上重新写了一遍,使用了对应的loader,插件未改动代码,只把e.message.to_string()改成了e.message.serialize2string();插件启动的时候未发现错误,但在收到任何消息(私聊消息,群消息,好友请求,群邀请等)mcl上都会出现如下报错。
为了检查是否是插件的问题,使用mirai_cpv2.7-RC-dev4的demo将其中的示例程序注释掉后未作其他改动,生成cpp.dll插件在mcl中运行,仍然出现相同的报错
求教该怎么解决插件正常启动 10:54:24 [INFO] iTXTech Mirai Console Loader version 1.2.2-60c67fb 10:54:24 [INFO] https://github.com/iTXTech/mirai-console-loader 10:54:24 [INFO] This program is licensed under GNU AGPL v3 10:54:24 [INFO] Fetching Mirai Console Loader Announcement... 10:54:24 [INFO] Mirai Console Loader Announcement: Mirai Console Loader 公告栏 [mirai-console] 最近, 项目组发现了权限系统可能会被错误的提前加载导致的3rd权限系统无法正确加载 于是决定, 于 2.6 起, 超前访问权限系统将得到一个错误并中断插件加载, 请各开发者及时检查 影响范围: https://github.com/mamoe/mirai-console/pull/307 10:54:24 [INFO] Verifying "net.mamoe:mirai-console" v2.7-M2 10:54:25 [INFO] Verifying "net.mamoe:mirai-console-terminal" v2.7-M2 10:54:25 [INFO] Verifying "net.mamoe:mirai-core-all" v2.7-M2 10:54:25 [INFO] Verifying "org.itxtech:mcl-addon" v1.2.2 2021-08-08 10:54:26 I/main: Starting mirai-console... 2021-08-08 10:54:27 I/main: Backend: version 2.7-M2, built on 2021-07-06 21:43:31. 2021-08-08 10:54:27 I/main: Frontend Terminal: version 2.7-M2, provided by Mamoe Technologies 2021-08-08 10:54:27 I/main: Welcome to visit https://mirai.mamoe.net/ 2021-08-08 10:54:27 I/plugin: Successfully loaded plugin MCL Addon 2021-08-08 10:54:27 I/plugin: Successfully loaded plugin miraiCP 2021-08-08 10:54:27 I/main: Prepared built-in commands: autoLogin, help, login, permission, status, stop 2021-08-08 10:54:27 I/MCL Addon: iTXTech MCL Version: 1.2.2-60c67fb 2021-08-08 10:54:27 I/MiraiCP: ⭐MiraiCP启动中⭐ 2021-08-08 10:54:27 I/MiraiCP: 本项目github存储库:https://github.com/Nambers/MiraiCP 2021-08-08 10:54:27 E/MiraiCP: 配置文件E:\mirai1.0.3\data\miraiCP\miraicp.txt 不存在,使用默认dll路径E:\mirai1.0.3\data\miraiCP\cpp.dll 2021-08-08 10:54:27 I/miraiCP: ⭐已加载插件: name 2021-08-08 10:54:27 I/miraiCP: ⭐作者: Eritque arcus 2021-08-08 10:54:27 I/miraiCP: ⭐版本: 1.0 2021-08-08 10:54:27 I/miraiCP: ⭐描述: hello world 2021-08-08 10:54:27 I/miraiCP: ⭐发行时间: 2021 2021-08-08 10:54:27 I/miraiCP: ⭐已成功启动MiraiCP⭐ 2021-08-08 10:54:27 I/main: 2 plugin(s) enabled. 2021-08-08 10:54:27 I/main: mirai-console started successfully.
这里是报错信息 个人信息经过处理 常***宜 (3*****1)Login successful 2021-08-08 10:54:56 V/Bot.34******31: [H******b(9*******4)] 不******盟(4******2) -> [mirai:image:{EAC945A7-9047-2853-1DE9-B6F289BD8680}.jpg] 2021-08-08 10:59:05 E/miraiCP: Exception in coroutine Plugin miraiCP of miraiCP kotlin.UninitializedPropertyAccessException: lateinit property cpp has not been initialized at tech.eritquearcus.miraicp.shared.PublicShared.getCpp(PublicShared.kt:59) at tech.eritquearcus.miraicp.shared.PublicShared$onEnable$2.invokeSuspend(PublicShared.kt:747) at tech.eritquearcus.miraicp.shared.PublicShared$onEnable$2.invoke(PublicShared.kt) at tech.eritquearcus.miraicp.shared.PublicShared$onEnable$2.invoke(PublicShared.kt) at net.mamoe.mirai.event.EventChannel$subscribeAlways$1.invokeSuspend(EventChannel.kt:432) at net.mamoe.mirai.event.EventChannel$subscribeAlways$1.invoke(EventChannel.kt) at net.mamoe.mirai.event.EventChannel$subscribeAlways$1.invoke(EventChannel.kt) at net.mamoe.mirai.internal.event.Handler$onEvent$2.invokeSuspend(InternalEventListeners.kt:50) at net.mamoe.mirai.internal.event.Handler$onEvent$2.invoke(InternalEventListeners.kt) at net.mamoe.mirai.internal.event.Handler$onEvent$2.invoke(InternalEventListeners.kt) at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89) at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:165) at kotlinx.coroutines.BuildersKt.withContext(Unknown Source) at net.mamoe.mirai.internal.event.Handler.onEvent(InternalEventListeners.kt:50) at net.mamoe.mirai.internal.event.InternalEventListenersKt.process(InternalEventListeners.kt:160) at net.mamoe.mirai.internal.event.InternalEventListenersKt.callAndRemoveIfRequired(InternalEventListeners.kt:109) at net.mamoe.mirai.event._EventBroadcast.broadcastImpl(Event.kt:174) at net.mamoe.mirai.IMirai.broadcastEvent(IMirai.kt:312) at net.mamoe.mirai.internal.MiraiImpl.broadcastEvent$suspendImpl(MiraiImpl.kt:296) at net.mamoe.mirai.internal.MiraiImpl.broadcastEvent(MiraiImpl.kt) at net.mamoe.mirai.event._EventBroadcast.broadcastPublic$suspendImpl(Event.kt:161) at net.mamoe.mirai.event._EventBroadcast.broadcastPublic(Event.kt) at net.mamoe.mirai.event.EventKt.broadcast(Event.kt:148) at net.mamoe.mirai.internal.network.components.EventDispatcherImpl$broadcast$2.invokeSuspend(EventDispatcher.kt:90) at net.mamoe.mirai.internal.network.components.EventDispatcherImpl$broadcast$2.invoke(EventDispatcher.kt) at net.mamoe.mirai.internal.network.components.EventDispatcherImpl$broadcast$2.invoke(EventDispatcher.kt) at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89) at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:165) at kotlinx.coroutines.BuildersKt.withContext(Unknown Source) at net.mamoe.mirai.internal.network.components.EventDispatcherImpl.broadcast$suspendImpl(EventDispatcher.kt:89) at net.mamoe.mirai.internal.network.components.EventDispatcherImpl.broadcast(EventDispatcher.kt) at net.mamoe.mirai.internal.network.components.EventDispatcherImpl$broadcastAsync$job$1.invokeSuspend(EventDispatcher.kt:105) at net.mamoe.mirai.internal.network.components.EventDispatcherImpl$broadcastAsync$job$1.invoke(EventDispatcher.kt) at net.mamoe.mirai.internal.network.components.EventDispatcherImpl$broadcastAsync$job$1.invoke(EventDispatcher.kt) at kotlinx.coroutines.intrinsics.UndispatchedKt.startCoroutineUndispatched(Undispatched.kt:55) at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:112) at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:126) at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56) at kotlinx.coroutines.BuildersKt.launch(Unknown Source) at net.mamoe.mirai.internal.network.components.EventDispatcherImpl.broadcastAsync-kKe4JaQ(EventDispatcher.kt:102) at net.mamoe.mirai.internal.network.components.EventDispatcher.broadcastAsync-kKe4JaQ$default(EventDispatcher.kt:35) at net.mamoe.mirai.internal.network.components.EventBroadcasterPacketHandler.impl(PacketHandler.kt:87) at net.mamoe.mirai.internal.network.components.EventBroadcasterPacketHandler.handlePacket(PacketHandler.kt:73) at net.mamoe.mirai.internal.network.components.PacketHandlerChain.handlePacket(PacketHandler.kt:42) at net.mamoe.mirai.internal.network.handler.NetworkHandlerSupport$collectReceived$3.invokeSuspend(NetworkHandlerSupport.kt:83) at net.mamoe.mirai.internal.network.handler.NetworkHandlerSupport$collectReceived$3.invoke(NetworkHandlerSupport.kt) at net.mamoe.mirai.internal.network.handler.NetworkHandlerSupport$collectReceived$3.invoke(NetworkHandlerSupport.kt) at kotlinx.coroutines.intrinsics.UndispatchedKt.startCoroutineUndispatched(Undispatched.kt:55) at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:112) at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:126) at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56) at kotlinx.coroutines.BuildersKt.launch(Unknown Source) at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(Builders.common.kt:47) at kotlinx.coroutines.BuildersKt.launch$default(Unknown Source) at net.mamoe.mirai.internal.network.handler.NetworkHandlerSupport.collectReceived$mirai_core(NetworkHandlerSupport.kt:81) at net.mamoe.mirai.internal.network.impl.netty.NettyNetworkHandler$PacketDecodePipeline$2$1.invokeSuspend(NettyNetworkHandler.kt:186) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
-
稍等我看看
-
在2.7-RC-dev5 修复
预计今晚发
dev5相比于dev4没有很大改动 -
谢谢大佬!
-
已发
去github发issue更容易追踪(