mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
add: GetSummaryInfo().
This commit is contained in:
parent
a6139bfb2b
commit
381186d631
@ -317,6 +317,27 @@ type (
|
||||
Email string `jceId:"5"`
|
||||
Remark string `jceId:"6"`
|
||||
}
|
||||
|
||||
SummaryCardReq struct {
|
||||
IJceStruct
|
||||
Uin int64 `jceId:"0"`
|
||||
ComeFrom int32 `jceId:"1"`
|
||||
QzoneFeedTimestamp int64 `jceId:"2"`
|
||||
IsFriend byte `jceId:"3"`
|
||||
GroupCode int64 `jceId:"4"`
|
||||
GroupUin int64 `jceId:"5"`
|
||||
//Seed []byte`jceId:"6"`
|
||||
//SearchName string`jceId:"7"`
|
||||
GetControl int64 `jceId:"8"`
|
||||
AddFriendSource int32 `jceId:"9"`
|
||||
SecureSig []byte `jceId:"10"`
|
||||
TinyId int64 `jceId:"15"`
|
||||
LikeSource int64 `jceId:"16"`
|
||||
ReqMedalWallInfo byte `jceId:"18"`
|
||||
Req0x5ebFieldId []int64 `jceId:"19"`
|
||||
ReqNearbyGodInfo byte `jceId:"20"`
|
||||
ReqExtendCard byte `jceId:"22"`
|
||||
}
|
||||
)
|
||||
|
||||
func (pkt *RequestPacket) ToBytes() []byte {
|
||||
@ -382,6 +403,12 @@ func (pkt *FriendListRequest) ToBytes() []byte {
|
||||
return w.Bytes()
|
||||
}
|
||||
|
||||
func (pkt *SummaryCardReq) ToBytes() []byte {
|
||||
w := NewJceWriter()
|
||||
w.WriteJceStructRaw(pkt)
|
||||
return w.Bytes()
|
||||
}
|
||||
|
||||
func (pkt *FriendInfo) ReadFrom(r *JceReader) {
|
||||
pkt.FriendUin = r.ReadInt64(0)
|
||||
pkt.GroupId = r.ReadByte(1)
|
||||
|
@ -251,6 +251,38 @@ func (c *QQClient) buildFriendGroupListRequestPacket(friendStartIndex, friendLis
|
||||
return seq, packet
|
||||
}
|
||||
|
||||
// SummaryCard.ReqSummaryCard
|
||||
func (c *QQClient) buildSummaryCardRequestPacket(target int64) (uint16, []byte) {
|
||||
seq := c.nextSeq()
|
||||
req := &jce.SummaryCardReq{
|
||||
Uin: target,
|
||||
ComeFrom: 31,
|
||||
GetControl: 69181,
|
||||
AddFriendSource: 3001,
|
||||
SecureSig: []byte{0x00},
|
||||
ReqMedalWallInfo: 0,
|
||||
Req0x5ebFieldId: []int64{27225, 27224, 42122, 42121, 27236, 27238, 42167, 42172, 40324, 42284, 42326, 42325, 42356, 42363, 42361, 42367, 42377, 42425},
|
||||
ReqNearbyGodInfo: 1,
|
||||
ReqExtendCard: 1,
|
||||
}
|
||||
head := jce.NewJceWriter()
|
||||
head.WriteInt32(2, 0)
|
||||
buf := &jce.RequestDataVersion3{Map: map[string][]byte{
|
||||
"ReqHead": packRequestDataV3(head.Bytes()),
|
||||
"ReqSummaryCard": packRequestDataV3(req.ToBytes()),
|
||||
}}
|
||||
pkt := &jce.RequestPacket{
|
||||
IVersion: 3,
|
||||
SServantName: "SummaryCardServantObj",
|
||||
SFuncName: "ReqSummaryCard",
|
||||
SBuffer: buf.ToBytes(),
|
||||
Context: make(map[string]string),
|
||||
Status: make(map[string]string),
|
||||
}
|
||||
packet := packets.BuildUniPacket(c.Uin, seq, "SummaryCard.ReqSummaryCard", 1, c.OutGoingPacketSessionId, []byte{}, c.sigInfo.d2Key, pkt.ToBytes())
|
||||
return seq, packet
|
||||
}
|
||||
|
||||
// friendlist.GetTroopListReqV2
|
||||
func (c *QQClient) buildGroupListRequestPacket(vecCookie []byte) (uint16, []byte) {
|
||||
seq := c.nextSeq()
|
||||
@ -955,7 +987,7 @@ func (c *QQClient) buildGroupAdminSetPacket(groupCode, member int64, flag bool)
|
||||
return seq, packet
|
||||
}
|
||||
|
||||
// OidbSvc.0x88d_7
|
||||
// OidbSvc.0x88d_0
|
||||
func (c *QQClient) buildGroupInfoRequestPacket(groupCode int64) (uint16, []byte) {
|
||||
seq := c.nextSeq()
|
||||
body := &oidb.D88DReqBody{
|
||||
|
@ -140,6 +140,7 @@ func NewClientMd5(uin int64, passwordMd5 [16]byte) *QQClient {
|
||||
"MultiMsg.ApplyDown": decodeMultiApplyDownResponse,
|
||||
"OidbSvc.0x6d6_2": decodeOIDB6d6Response,
|
||||
"OidbSvc.0x88d_0": decodeGroupInfoResponse,
|
||||
"SummaryCard.ReqSummaryCard": decodeSummaryCardResponse,
|
||||
"PttCenterSvr.ShortVideoDownReq": decodePttShortVideoDownResponse,
|
||||
},
|
||||
sigInfo: &loginSigInfo{},
|
||||
@ -246,6 +247,14 @@ func (c *QQClient) GetGroupHonorInfo(groupCode int64, honorType HonorType) (*Gro
|
||||
return &ret, nil
|
||||
}
|
||||
|
||||
func (c *QQClient) GetSummaryInfo(target int64) (*SummaryCardInfo, error) {
|
||||
rsp, err := c.sendAndWait(c.buildSummaryCardRequestPacket(target))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rsp.(*SummaryCardInfo), nil
|
||||
}
|
||||
|
||||
// SubmitCaptcha send captcha to server
|
||||
func (c *QQClient) SubmitCaptcha(result string, sign []byte) (*LoginResponse, error) {
|
||||
seq, packet := c.buildCaptchaPacket(result, sign)
|
||||
|
@ -331,6 +331,25 @@ func decodeSvcNotify(c *QQClient, _ uint16, _ []byte) (interface{}, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func decodeSummaryCardResponse(c *QQClient, _ uint16, payload []byte) (interface{}, error) {
|
||||
request := &jce.RequestPacket{}
|
||||
request.ReadFrom(jce.NewJceReader(payload))
|
||||
data := &jce.RequestDataVersion2{}
|
||||
data.ReadFrom(jce.NewJceReader(request.SBuffer))
|
||||
rsp := jce.NewJceReader(data.Map["RespSummaryCard"]["SummaryCard.RespSummaryCard"][1:])
|
||||
return &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),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func decodeFriendGroupListResponse(_ *QQClient, _ uint16, payload []byte) (interface{}, error) {
|
||||
request := &jce.RequestPacket{}
|
||||
request.ReadFrom(jce.NewJceReader(payload))
|
||||
|
@ -42,6 +42,18 @@ type (
|
||||
//msgSeqList *utils.Cache
|
||||
}
|
||||
|
||||
SummaryCardInfo struct {
|
||||
Uin int64
|
||||
Sex byte
|
||||
Age uint8
|
||||
Nickname string
|
||||
Level int32
|
||||
City string
|
||||
Sign string
|
||||
Mobile string
|
||||
LoginDays int64
|
||||
}
|
||||
|
||||
FriendListResponse struct {
|
||||
TotalCount int32
|
||||
List []*FriendInfo
|
||||
|
Loading…
x
Reference in New Issue
Block a user