Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

于mirai载入插件报错 #32

Closed
SakuraWuhen opened this issue Aug 30, 2020 · 7 comments
Closed

于mirai载入插件报错 #32

SakuraWuhen opened this issue Aug 30, 2020 · 7 comments
Labels
help wanted Extra attention is needed

Comments

@SakuraWuhen
Copy link

如题,请求您的帮助

【使用环境】
使用于Q群文件下载的 JustChat-Server-CoolQ-2.0.1-Unpack 文件夹,正确放置插件
右键mirai菜单 - 加载Dll -
image

【报错】
01:37:51 [INFO] [NETWORK] Send: Heartbeat.Alive
01:37:51 [INFO] [NETWORK] Recv: Heartbeat.Alive.Response
Exception in thread "MiraiNative" kotlinx.serialization.json.JsonDecodingException: Unexpected JSON token at offset 23: Expected ':'.
JSON input: {
"ret":1, // 返回码,固定为1
"apiver":9, .....
at kotlinx.serialization.json.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:26)
at kotlinx.serialization.json.internal.JsonReader.fail(JsonReader.kt:311)
at kotlinx.serialization.json.internal.StreamingJsonInput.decodeObjectIndex(StreamingJsonInput.kt:116)
at kotlinx.serialization.json.internal.StreamingJsonInput.decodeElementIndex(StreamingJsonInput.kt:88)
at org.itxtech.mirainative.plugin.PluginInfo$$serializer.deserialize(PluginInfo.kt)
at org.itxtech.mirainative.plugin.PluginInfo$$serializer.deserialize(PluginInfo.kt:30)
at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:52)
at kotlinx.serialization.json.internal.StreamingJsonInput.decodeSerializableValue(StreamingJsonInput.kt:33)
at kotlinx.serialization.DecodingKt.decode(Decoding.kt:521)
at kotlinx.serialization.json.Json.parse(Json.kt:131)
at org.itxtech.mirainative.manager.PluginManager$loadPlugin$2.invokeSuspend(PluginManager.kt:110)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

@ExerciseBook
Copy link
Contributor

83EF5F35-73B4-4269-9B18-AE4886F9C03E

@ExerciseBook ExerciseBook added the help wanted Extra attention is needed label Aug 31, 2020
@zhzhongshi
Copy link

json不支持注释(

@Cheny233
Copy link

删完注释后报错126怎么回事

@ExerciseBook
Copy link
Contributor

ExerciseBook commented Aug 31, 2020

http://gnuwin32.sourceforge.net/packages/libiconv.htm
具体原因是我们的这个插件使用了 libiconv.dll ,这个文件 酷Q 自带了,而 mirai native 没有带。手动复制一下,具体放到什么位置我不清楚,我还没开始用 mirai 。

还有一个坑是,根据群友提供的信息,配置文件好像不会自动生成。可能需要手动复制一下配置文件到 mirai native 的配置文件目录。

https://github.com/ParaParty/JustChat_CoolQ/blob/2.0.0/com.superexercisebook.justchat/default_configuration.json
这里是默认配置文件模板。文件名为 config.json

@SakuraWuhen
Copy link
Author

出现了新报错,我发现也许便是这个报错引起“游戏内消息无法转发到群内”和“群内消息转发到游戏时”没有玩家昵称的情况
image

13:20:41 [DEBUG] [MiraiNative] [JustChat Message Handler] [192.168.3.10:64189] : Received a pulse echo.
Exception in thread "DefaultDispatcher-worker-3" java.util.NoSuchElementException: group 976110274
at net.mamoe.mirai.Bot.getGroup(Bot.kt:178)
at org.itxtech.mirainative.bridge.MiraiBridge$sendGroupMessage$$inlined$call$lambda$1.invokeSuspend(MiraiBridge.kt:147)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

@ExerciseBook
Copy link
Contributor

看起来像是 mirai-native 发起的错误。只是刚好和插件的日志输出在了一起。

我大概猜测是获取群信息/群成员信息失败。
因为在 justchat 的代码逻辑里是获取成功则显示昵称,否则显示QQ号。

@SakuraWuhen
Copy link
Author

收到,遇到这种情况后重启mirai一般能生效

@ExerciseBook ExerciseBook pinned this issue Sep 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants