Closed Nambers closed 3 years ago
此外,日志部分乱码好像是因为启动的日志的颜色,那是在哪关掉吗hhhh还是有其他的解决方法 然后这里面的logger是我重写了,代码如下
object logger{
fun info(t:String){
println(t)
}
fun warning(t:String){
println(t)
}
fun error(t:String){
println(t)
}
}
此外,这个异常我本身无法复现,我重开了1次就正常启动了
欸没有nick不是在2.4.0解决了? https://github.com/mamoe/mirai/issues/1019
关闭Logger打印Ansi颜色代码:
MiraiLogger.setDefaultLoggerCreator { identity ->
PlatformLogger(identity, ::println, false)
}
更建议配合jansi
自动选择合适的方式处理Ansi代码(Windows下转换成Console API调用,不支持的情况下自动转换为纯文字的输出)
dependencies {
implementation("org.fusesource.jansi:jansi:1.18")
}
import org.fusesource.jansi.AnsiConsole
MiraiLogger.setDefaultLoggerCreator { identity ->
PlatformLogger(identity, AnsiConsole.out::println, true)
}
~看上去像是收到 FriendList.GetFriendGroupList.Response 前login步骤就已经完成了,应该得等到至少收到一个 response 再结束login~ 应该是服务器没有下发 selfInfo
此外,还遇到了个问题
2021-02-15 14:56:32 V/Net 692928873: Recv: FriendList.GetFriendGroupList.Response
2021-02-15 14:56:32 V/Net 692928873: Send: friendlist.GetTroopMemberListReq
2021-02-15 14:56:32 V/Net 692928873: Send: friendlist.GetTroopMemberListReq
2021-02-15 14:56:32 V/Net 692928873: Recv: FriendList.GetTroopMemberList.Response
2021-02-15 14:56:32 V/Net 692928873: Recv: FriendList.GetTroopMemberList.Response
2021-02-15 14:56:32 I/Net 692928873: Successfully loaded group list: 2 in total.
2021-02-15 14:56:32 I/Bot 692928873: Login successful
2021-02-15 14:56:32 I/Bot 692928873: 2333
2021-02-15 14:56:34 D/Net 692928873: Received unknown commandName: ConfigPushSvc.PushDomain
2021-02-15 14:56:34 V/Net 692928873: Recv: ConfigPushSvc.PushReq.PushReqResponse.ConfigPush
2021-02-15 14:56:34 V/Net 692928873: Saving bdh session to cache
2021-02-15 14:56:34 V/Net 692928873: Send: ConfigPushSvc.PushResp
2021-02-15 14:56:34 I/Net 692928873: ConfigPushSvc.PushReq: Config updated.
里面有个unknown command不知道是不是小bug @Karlatemp
或者是服务器没有下发 selfInfo? 总之很奇怪
也可能是我代码写的有个逻辑错误,就我把bot online event的监听写在alsologin后了,然后在里面赋值我本地bot变量,如果没人遇到就是我的问题吧hhh
应该是偶然性的,如果出现次数多会提高处理优先级,此问题属于协议问题与你自身的调用代码没啥关联
okok
@AdoptOSS 谢谢啦可以用
此外,还遇到了个问题
2021-02-15 14:56:32 V/Net 692928873: Recv: FriendList.GetFriendGroupList.Response 2021-02-15 14:56:32 V/Net 692928873: Send: friendlist.GetTroopMemberListReq 2021-02-15 14:56:32 V/Net 692928873: Send: friendlist.GetTroopMemberListReq 2021-02-15 14:56:32 V/Net 692928873: Recv: FriendList.GetTroopMemberList.Response 2021-02-15 14:56:32 V/Net 692928873: Recv: FriendList.GetTroopMemberList.Response 2021-02-15 14:56:32 I/Net 692928873: Successfully loaded group list: 2 in total. 2021-02-15 14:56:32 I/Bot 692928873: Login successful 2021-02-15 14:56:32 I/Bot 692928873: 2333 2021-02-15 14:56:34 D/Net 692928873: Received unknown commandName: ConfigPushSvc.PushDomain 2021-02-15 14:56:34 V/Net 692928873: Recv: ConfigPushSvc.PushReq.PushReqResponse.ConfigPush 2021-02-15 14:56:34 V/Net 692928873: Saving bdh session to cache 2021-02-15 14:56:34 V/Net 692928873: Send: ConfigPushSvc.PushResp 2021-02-15 14:56:34 I/Net 692928873: ConfigPushSvc.PushReq: Config updated.
里面有个unknown command不知道是不是小bug @Karlatemp
unknown command是正常现象 当前最好的解决办法应该是缓存自身信息
此外,还遇到了个问题
2021-02-15 14:56:32 V/Net 692928873: Recv: FriendList.GetFriendGroupList.Response 2021-02-15 14:56:32 V/Net 692928873: Send: friendlist.GetTroopMemberListReq 2021-02-15 14:56:32 V/Net 692928873: Send: friendlist.GetTroopMemberListReq 2021-02-15 14:56:32 V/Net 692928873: Recv: FriendList.GetTroopMemberList.Response 2021-02-15 14:56:32 V/Net 692928873: Recv: FriendList.GetTroopMemberList.Response 2021-02-15 14:56:32 I/Net 692928873: Successfully loaded group list: 2 in total. 2021-02-15 14:56:32 I/Bot 692928873: Login successful 2021-02-15 14:56:32 I/Bot 692928873: 2333 2021-02-15 14:56:34 D/Net 692928873: Received unknown commandName: ConfigPushSvc.PushDomain 2021-02-15 14:56:34 V/Net 692928873: Recv: ConfigPushSvc.PushReq.PushReqResponse.ConfigPush 2021-02-15 14:56:34 V/Net 692928873: Saving bdh session to cache 2021-02-15 14:56:34 V/Net 692928873: Send: ConfigPushSvc.PushResp 2021-02-15 14:56:34 I/Net 692928873: ConfigPushSvc.PushReq: Config updated.
里面有个unknown command不知道是不是小bug @Karlatemp
unknown command是正常现象 当前最好的解决办法应该是缓存自身信息
okok 是我这边自己缓存? 缓存bot?
不 应该是我们的工作 不需要你自己缓存(
不 应该是我们的工作 不需要你自己缓存(
okok
复现
这里复现比较麻烦,我是使用mirai-hello-world然后用shadowJar打包成jar然后用cmd启动 以下为我完整启动日志:
因为我完整项目全部代码加起来可能超过1k行,在这我就截取登陆部分代码,如果有需要再发
版本
2.4.0
补充信息