Coder Social home page Coder Social logo

Comments (4)

CyanChanges avatar CyanChanges commented on June 4, 2024

你连 Koishi 用的 server-satori?

from koishi.

Nyayurn avatar Nyayurn commented on June 4, 2024

image

from koishi.

CyanChanges avatar CyanChanges commented on June 4, 2024

看 satori-server 和 satori core 看了一圈了,没看出来可以没 status 的情况,我不到了,也不到你是怎么连的,你也不说。。

image

不是,You block me, i block you...

from koishi.

Lipraty avatar Lipraty commented on June 4, 2024

看 satori-server 和 satori core 看了一圈了,没看出来可以没 status 的情况

这是协议连接过程出现的问题。


根据 Satori 文档, status 字段应该必需

根据文档, status 字段来自 Login

见文档 WebSocket 连接流程:

总的来说,Satori 应用需要在连接后遵循以下步骤:

  1. 连接建立后,在 10s 内发送一个 IDENTIFY 信令,用于鉴权和恢复会话;
    SDK 收到后会回复一个 READY 信令,并开启事件推送;
  2. 连接建立后,每隔 10s 向 SDK 发送一次 PING 信令;
    SDK 收到后会回复一个 PONG 信令;
  3. 应用持续接收来自 SDK 的 EVENT 信令,用于接收事件。

综上所述,READY 答复中缺失 status 的原因应该是:

  • Chronocat 有 Token 鉴权,拥有登录流程,因此会下达 Login 事件
  • Koishi 中 server-satori 可能没有进行鉴权,因此没有 Login 事件

可以尝试的操作:

在 server-satori 中配置 Token 后重新尝试。

建议:

  • 鉴权目前来看不是必须的,因此 status 字段建议为可选
  • 信令数据 body 是可选项,无须进行过多的检查

参见:

https://satori.js.org/zh-CN/resources/login.html#login
https://satori.js.org/zh-CN/protocol/events.html#%E8%BF%9E%E6%8E%A5%E6%B5%81%E7%A8%8B

由于这非 koishi 问题,先 Close 了。

from koishi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.