Comments (4)
这里有可能跟轮训的次数有关,但是不太确定,我记得 java8
分支的轮训时间改为了 2 分钟,也会出现问题么?理论上和 w.qq.com
的时间是一样的啊
from smartqq.
@ScienJus 问题已经发现了,经测试是我给@Dilant提供的两个暴力函数的问题,在加入的群过多时会导致大量请求 (///)
所以说不是这个项目的问题
from smartqq.
@TJYSunset (我刚想说……)
@ScienJus
是的,问题出在我的“主类名.java” (sorry...)
我在里面使用了如下代码:
private static String getNick(GroupMessage msg)
{
for (Group group : client.getGroupList())
{
if (msg.getGroupId() == group.getId())
{
for (GroupUser user : client.getGroupInfo(group.getCode()).getUsers())
{
if (user.getUin() == msg.getUserId())
{
//......
}
}
}
}
return "昵称获取错误";
}
每次收到消息,都会调用client.getGroupList
和client.getGroupInfo
,造成了大量请求,服务器自我保护而关闭连接。
我试着自己优化下调用逻辑吧。
感谢跟进,以及致歉。
from smartqq.
好的,Web QQ 服务器确实对调用次数比较敏感,我最开始的做法是在一开始就加载好所有的群成员和好友信息并缓存在内存里,然后收到消息时直接去拿就可以了,即便如此调用时也需要偶尔 Sleep 一下控制请求频率,就像是:
https://gist.github.com/ScienJus/f1ba1e5b1611cca662cc
from smartqq.
Related Issues (20)
- 封号
- 如何在掉线的时候重新登录 HOT 12
- verifyQRCode方法有问题 HOT 2
- SmartQQClient.getVfwebqq方法抛异常: 请求失败,Api返回码[100000]
- pom文件中添加不了依赖怎么回事 HOT 2
- 登录成功后开始接收消息 过会控制台就显示 API异常,API返回码[100012] HOT 3
- Smart QQ 现已支持账户密码登录 HOT 1
- 103 error (((
- 能登陆,但无法拉取消息 HOT 12
- 关于异地登录问题
- 关于打成可执行jar包后的问题
- 反馈错误代码100000
- 红点不会用 HOT 2
- 昨天下午开始,WebQQ就无法正常使用了。 HOT 3
- net.dongliu.requests.exception.RequestException: 请求失败,Api返回码[100003] 是什么原因
- 能正常登陆,但是消息发不出去
- SmartQQ初始化失败: 请求失败,Api返回码[100003] HOT 2
- Invalid cookie header HOT 1
- 作者好像没有维护了,提供一个可用的java版API HOT 1
- Just suggest users to use other framework to devlop qq robot.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smartqq.