mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
client: add VipLevel in SummaryCard
This commit is contained in:
parent
ae8c187aa5
commit
24ee0103e7
@ -417,6 +417,32 @@ func (r *JceReader) ReadMapStrByte(tag int) map[string][]byte {
|
||||
}
|
||||
}
|
||||
|
||||
func (r *JceReader) ReadMapIntVipInfo(tag int) map[int]*VipInfo {
|
||||
if !r.skipToTag(tag) {
|
||||
return nil
|
||||
}
|
||||
r.skipHead()
|
||||
hd, _ := r.readHead()
|
||||
switch hd.Type {
|
||||
case 8:
|
||||
s := r.ReadInt32(0)
|
||||
m := make(map[int]*VipInfo, s)
|
||||
for i := 0; i < int(s); i++ {
|
||||
k := r.ReadInt64(0)
|
||||
v := new(VipInfo)
|
||||
r.readHead()
|
||||
v.ReadFrom(r)
|
||||
r.skipToStructEnd()
|
||||
m[int(k)] = v
|
||||
}
|
||||
r.skipToStructEnd()
|
||||
return m
|
||||
default:
|
||||
r.skipToStructEnd()
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func (r *JceReader) ReadMapStrMapStrByte(tag int) map[string]map[string][]byte {
|
||||
if !r.skipToTag(tag) {
|
||||
return nil
|
||||
|
@ -527,6 +527,12 @@ type (
|
||||
DelType byte `jceId:"2"`
|
||||
Version int32 `jceId:"3"`
|
||||
}
|
||||
|
||||
VipInfo struct {
|
||||
Open byte `jceId:"0"` // 1 为开通
|
||||
Type int32 `jceId:"1"` // 1 为年费
|
||||
Level int32 `jceId:"2"`
|
||||
}
|
||||
)
|
||||
|
||||
func (pkt *RequestPacket) ReadFrom(r *JceReader) {
|
||||
@ -736,3 +742,9 @@ func (pkt *InstanceInfo) ReadFrom(r *JceReader) {
|
||||
pkt.ProductType = r.ReadInt64(3)
|
||||
pkt.ClientType = r.ReadInt64(4)
|
||||
}
|
||||
|
||||
func (pkt *VipInfo) ReadFrom(r *JceReader) {
|
||||
pkt.Open = r.ReadByte(0)
|
||||
pkt.Type = r.ReadInt32(1)
|
||||
pkt.Level = r.ReadInt32(2)
|
||||
}
|
||||
|
@ -750,3 +750,11 @@ func (pkt *DelFriendReq) ToBytes() []byte {
|
||||
w.WriteInt32(pkt.Version, 3)
|
||||
return w.Bytes()
|
||||
}
|
||||
|
||||
func (pkt *VipInfo) ToBytes() []byte {
|
||||
w := NewJceWriter()
|
||||
w.WriteByte(pkt.Open, 0)
|
||||
w.WriteInt32(pkt.Type, 1)
|
||||
w.WriteInt32(pkt.Level, 2)
|
||||
return w.Bytes()
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package client
|
||||
|
||||
import (
|
||||
"crypto/md5"
|
||||
"fmt"
|
||||
"net/netip"
|
||||
"strconv"
|
||||
"strings"
|
||||
@ -428,16 +429,25 @@ func decodeSummaryCardResponse(_ *QQClient, _ *network.IncomingPacketInfo, paylo
|
||||
return jce.NewJceReader(data.Map["RespSummaryCard"]["SummaryCard_Old.RespSummaryCard"][1:])
|
||||
}()
|
||||
info := &SummaryCardInfo{
|
||||
Sex: rsp.ReadByte(1),
|
||||
Age: rsp.ReadByte(2),
|
||||
Nickname: rsp.ReadString(3),
|
||||
Level: rsp.ReadInt32(5),
|
||||
City: rsp.ReadString(7),
|
||||
Sign: rsp.ReadString(8),
|
||||
Mobile: rsp.ReadString(11),
|
||||
Uin: rsp.ReadInt64(23),
|
||||
LoginDays: rsp.ReadInt64(36),
|
||||
Sex: rsp.ReadByte(1),
|
||||
Age: rsp.ReadByte(2),
|
||||
Nickname: rsp.ReadString(3),
|
||||
Level: rsp.ReadInt32(5),
|
||||
City: rsp.ReadString(7),
|
||||
Sign: rsp.ReadString(8),
|
||||
Mobile: rsp.ReadString(11),
|
||||
Uin: rsp.ReadInt64(23),
|
||||
}
|
||||
vipInfo := rsp.ReadMapIntVipInfo(29) // 1 -> vip, 3 -> svip
|
||||
if v1, v3 := vipInfo[1], vipInfo[3]; v1 != nil || v3 != nil {
|
||||
if v1.Open != 0 {
|
||||
info.VipLevel = fmt.Sprintf("vip%d", v1.Level)
|
||||
}
|
||||
if v3.Open != 0 {
|
||||
info.VipLevel = fmt.Sprintf("svip%d", v3.Level)
|
||||
}
|
||||
}
|
||||
info.LoginDays = rsp.ReadInt64(36)
|
||||
services := rsp.ReadByteArrArr(46)
|
||||
readService := func(buf []byte) (*profilecard.BusiComm, []byte) {
|
||||
r := binary.NewReader(buf)
|
||||
|
@ -77,6 +77,7 @@ type (
|
||||
Mobile string
|
||||
LoginDays int64
|
||||
Qid string
|
||||
VipLevel string
|
||||
}
|
||||
|
||||
OtherClientInfo struct {
|
||||
|
Loading…
x
Reference in New Issue
Block a user