Replies: 10 comments
-
按理说通信这块应该都是兼容的,你用的 OneBot(CQHTTP)实现是哪个 |
Beta Was this translation helpful? Give feedback.
-
cqhttp-mirai Embedded分支版本 |
Beta Was this translation helpful? Give feedback.
-
发一下你的配置文件看看? |
Beta Was this translation helpful? Give feedback.
-
"1169699211":
ws_reverse:
# 可选,是否启用反向客户端,默认不启用
- enable: true
# 上报消息格式,string 为字符串格式,array 为数组格式
postMessageFormat: string
# 反向Websocket主机
reverseHost: 127.0.0.1
# 反向Websocket端口
reversePort: 9200
# 访问口令, 默认为空, 即不设置Token
accessToken: ""
# 反向Websocket路径
reversePath: /ws/
# 可选, 反向Websocket Api路径, 默认为reversePath
# reverseApiPath: /api/
# 可选, 反向Websocket Event路径, 默认为reversePath
# reverseEventPath: /event/
# 是否使用Universal客户端 默认为true
useUniversal: true
# 反向 WebSocket 客户端断线重连间隔,单位毫秒
reconnectInterval: 3000 |
Beta Was this translation helpful? Give feedback.
-
刚刚去查看了cqhttp.WebSocketReverse.NETCore的源代码 出错的代码: if (socket.ConnectionInfo.Headers.TryGetValue("X-Self-ID", out string selfId) == false) { return; }
if (socket.ConnectionInfo.Headers.TryGetValue("X-Client-Role", out string type) == false) { return; }
var connection = new Connection { Send = socket.Send, WebSocketConnectionInfo = socket.ConnectionInfo };
if (socket.ConnectionInfo.Headers.TryGetValue("Authorization", out string auth) == true)
{
var ea = new AuthorizationEventArgs(selfId, auth, type, connection);
if (OnAuthorizationAsync != null) { await OnAuthorizationAsync(selfId, ea); }
if (ea.Pass == false && OnAuthorizationAsync != null) { return; }
} |
Beta Was this translation helpful? Give feedback.
-
Authorization获取为空应该是我token没有设置的问题 |
Beta Was this translation helpful? Give feedback.
-
目前侦测到的问题: |
Beta Was this translation helpful? Give feedback.
-
后续补充
这部分没了解何以引致解析错误,因已是以try形式提取,需要提供更多讯息
cqhttp-mirai 指出已修正时间戳问题 |
Beta Was this translation helpful? Give feedback.
-
@cqbef 想问一下框架今后还会对onebot继续支持和维护吗 |
Beta Was this translation helpful? Give feedback.
-
假若将来ONEBOT与CQHTTP差异变化増加,可能做的也是建立新项目而不是修改这个项目,因为它是基于CQHTTP的。 |
Beta Was this translation helpful? Give feedback.
-
目前测试得出失效的框架有:
frank-bots/cqhttp.Cyan 不支持新版本的协议,反向ws服务端失效
cqbef/cqhttp.WebSocketReverse.NETCore不支持新版本的协议,反向ws服务端有效但无法解析json数据
Beta Was this translation helpful? Give feedback.
All reactions