mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 19:17:38 +08:00
fix(client): fix alignment.
This commit is contained in:
parent
4128ec65a0
commit
d57f10ceae
@ -34,6 +34,10 @@ var json = jsoniter.ConfigFastest
|
||||
type QQClient struct {
|
||||
Uin int64
|
||||
PasswordMd5 [16]byte
|
||||
|
||||
stat Statistics
|
||||
once sync.Once
|
||||
|
||||
AllowSlider bool
|
||||
|
||||
Nickname string
|
||||
@ -98,7 +102,6 @@ type QQClient struct {
|
||||
groupDataTransSeq int32
|
||||
highwayApplyUpSeq int32
|
||||
eventHandlers *eventHandlers
|
||||
stat Statistics
|
||||
|
||||
groupListLock sync.Mutex
|
||||
}
|
||||
@ -426,7 +429,7 @@ func (c *QQClient) init(tokenLogin bool) error {
|
||||
}
|
||||
seq, pkt := c.buildGetMessageRequestPacket(msg.SyncFlag_START, time.Now().Unix())
|
||||
_, _ = c.sendAndWait(seq, pkt, requestParams{"used_reg_proxy": true, "init": true})
|
||||
c.stat.once.Do(func() {
|
||||
c.once.Do(func() {
|
||||
c.OnGroupMessage(func(_ *QQClient, _ *message.GroupMessage) {
|
||||
atomic.AddUint64(&c.stat.MessageReceived, 1)
|
||||
atomic.StoreInt64(&c.stat.LastMessageTime, time.Now().Unix())
|
||||
|
@ -3,7 +3,6 @@ package client
|
||||
import (
|
||||
"bytes"
|
||||
"strconv"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
)
|
||||
|
||||
@ -13,11 +12,9 @@ type Statistics struct {
|
||||
PacketLost uint64
|
||||
MessageReceived uint64
|
||||
MessageSent uint64
|
||||
LastMessageTime int64
|
||||
DisconnectTimes uint32
|
||||
LostTimes uint32
|
||||
LastMessageTime int64
|
||||
|
||||
once sync.Once
|
||||
}
|
||||
|
||||
func (s *Statistics) MarshalJSON() ([]byte, error) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user