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

三个建议 #1

Open
ESEAbsolute opened this issue Dec 18, 2023 · 5 comments
Open

三个建议 #1

ESEAbsolute opened this issue Dec 18, 2023 · 5 comments

Comments

@ESEAbsolute
Copy link

断开连接的处理

当断网之后 heartbeat 没有正常被 receive,洛谷的 ws 连接会断开,这个时候客户端并没有明确提示断开了,但是后面的私信并不会被正确接收。

希望可以添加一个断开连接的处理,自动重连或者提示手动重新打开( )

并且可以在打开的时候通过请求 https://www.luogu.com.cn/user/notification?_contentOnly 然后查看 "unreadMessageCount" 在上线的时候通知下线时在洛谷有多少条未读消息(此处大概无必要)

密码登陆

可以弄一个洛谷验证码识别的模块,最好是使用一些现成的 api 之类的(例如说 exlg 的验证码识别),以实现密码登陆

通知提醒

可以以一个适当的间隔请求 https://www.luogu.com.cn/user/notification?_contentOnly,并检查 "unreadNoticeCount" 处。?_contentOnly&type=1&type=2&type=3 分别对应 @我的,回复 和 系统通知。

@hyc1230
Copy link
Contributor

hyc1230 commented Dec 18, 2023

  1. 断开连接真不好搞()
    大概可以看有没有收到 heartbeat?
  2. 让用户输密码不是更会让人怀疑嘛
    但是确实方便
    btw exlg 那个 ocr 文字识别非常不稳定。。
  3. 通知提醒也许没有那么大的需要,在犇里面 at、博客的评论和系统通知其实也没有什么必要去通知(特别是在你做题的时候对吧)
    但是学术帖子的 at 可以考虑,也可以加个设置学术模式()

@hyc1230
Copy link
Contributor

hyc1230 commented Dec 18, 2023

如果您可以实现部分或全部的代码,欢迎您发起 pr。

@ESEAbsolute
Copy link
Author

heartbeat 是约 90s 一次的,感觉如果连续 120s 没有心跳就是寄了。

寄了就退出,能否以一个外部程序调用连接 ws 的程序的形式运行,然后连接程序被结束了就重新打开一个?(说胡话 ing……)

@ESEAbsolute
Copy link
Author

js 我不会写(草)我去学学去

@hyc1230
Copy link
Contributor

hyc1230 commented Dec 18, 2023

emm 如果网络断开了 ws 还不会自动断开的话,那我觉得 ws 的机制有问题

迷之自信()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants