mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 19:17:38 +08:00
fix connection lost.
This commit is contained in:
parent
c1739dba15
commit
ede6cb30d3
@ -1129,6 +1129,7 @@ func (c *QQClient) netLoop() {
|
||||
|
||||
func (c *QQClient) doHeartbeat() {
|
||||
c.heartbeatEnabled = true
|
||||
times := 0
|
||||
for c.Online {
|
||||
seq := c.nextSeq()
|
||||
sso := packets.BuildSsoPacket(seq, c.version.AppId, "Heartbeat.Alive", SystemDeviceInfo.IMEI, []byte{}, c.OutGoingPacketSessionId, []byte{}, c.ksid)
|
||||
@ -1139,6 +1140,11 @@ func (c *QQClient) doHeartbeat() {
|
||||
c.Disconnect()
|
||||
break
|
||||
}
|
||||
times++
|
||||
if times >= 7 {
|
||||
_ = c.registerClient()
|
||||
times = 0
|
||||
}
|
||||
time.Sleep(time.Second * 30)
|
||||
}
|
||||
c.heartbeatEnabled = false
|
||||
|
Loading…
x
Reference in New Issue
Block a user