按 10.13 抓包对齐 WSS:host 自动解析、exp 回传、pingSignal 与兑换记录字段
- 新增 launch.queryHttpDns:类型定义 + HTTPClient.QueryHttpDns + WSSClient.resolveHost(TTL 缓存、多 host 轮询、失败回退默认 host);Host 留空或等于历史默认值即视为自动解析 - WSS 握手 baseinfo 补 tag5=exp 与 tag10 空 customHeaders;UpdateUserExpsReq(cmd23) 改为回传 getConfig 的版本 map(缓存供重连复用) - 新增 launch.pingSignal:HTTP 预热改走 pingSignal,WSS 预热在建连后探测业务通道(失败仅记日志) - UserPrizeInfo 补 tag12 orderId/tag14 图标/tag16 prizeId/tag17 shopItemId/tag19 itemId/tag20 ext/tag21 exchangeDate,前端复盘表加订单号列 - taf 补 WriteListString/ReadListString/ReadMapStringInt64/ReadMapStringStruct - 新增 internal/huya/launch_test.go:用抓包真实报文做字节级夹具(baseinfo 122B、queryHttpDns 请求 93B、记录 308B 等) - CLI -wss-host 默认改为留空;GUI 设置支持留空并给出占位提示;README/WSS_NOTES 同步协议细节
This commit is contained in:
+46
-12
@@ -368,18 +368,31 @@ func (q *GetUserPrizeRecordsReq) ReadFrom(r *taf.Reader) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// UserPrizeInfo 对应 getUserPrizeRecords 的一条兑换记录。
|
||||
//
|
||||
// 除 tag0~tag10 外,2026-10-13 HAR 实测还有 tag11~tag23:
|
||||
// 12=orderId、14=奖品图、16=奖品 pid、17=商城 itemId(数量级与 shopMiddleUI
|
||||
// 的 itemId 一致,语义未在样本中最终确认)、19=prizeItemId、20=扩展 map
|
||||
// (game/cjm/plat/isRole/liveLinkActId)、21=兑换日期(如 20261013)。
|
||||
type UserPrizeInfo struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Score int64 `json:"score"`
|
||||
CreateTime int64 `json:"create_time"`
|
||||
Status int32 `json:"status"`
|
||||
Type int32 `json:"type"`
|
||||
IsReal int32 `json:"is_real"`
|
||||
NewScore int64 `json:"new_score"`
|
||||
Account string `json:"account,omitempty"`
|
||||
Code string `json:"code,omitempty"`
|
||||
CommonPrizeType int32 `json:"common_prize_type"`
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Score int64 `json:"score"`
|
||||
CreateTime int64 `json:"create_time"`
|
||||
Status int32 `json:"status"`
|
||||
Type int32 `json:"type"`
|
||||
IsReal int32 `json:"is_real"`
|
||||
NewScore int64 `json:"new_score"`
|
||||
Account string `json:"account,omitempty"`
|
||||
Code string `json:"code,omitempty"`
|
||||
CommonPrizeType int32 `json:"common_prize_type"`
|
||||
OrderID string `json:"order_id,omitempty"`
|
||||
Image string `json:"img,omitempty"`
|
||||
PrizeID int64 `json:"prize_id,omitempty"`
|
||||
ShopItemID int64 `json:"shop_item_id,omitempty"`
|
||||
ItemID int64 `json:"item_id,omitempty"`
|
||||
Ext map[string]string `json:"ext,omitempty"`
|
||||
ExchangeDate int32 `json:"exchange_date,omitempty"`
|
||||
}
|
||||
|
||||
func (p *UserPrizeInfo) WriteTo(w *taf.Writer) error { return nil }
|
||||
@@ -416,7 +429,28 @@ func (p *UserPrizeInfo) ReadFrom(r *taf.Reader) error {
|
||||
if p.Code, err = r.ReadString(9, false, p.Code); err != nil {
|
||||
return err
|
||||
}
|
||||
p.CommonPrizeType, err = r.ReadInt32(10, false, p.CommonPrizeType)
|
||||
if p.CommonPrizeType, err = r.ReadInt32(10, false, p.CommonPrizeType); err != nil {
|
||||
return err
|
||||
}
|
||||
if p.OrderID, err = r.ReadString(12, false, p.OrderID); err != nil {
|
||||
return err
|
||||
}
|
||||
if p.Image, err = r.ReadString(14, false, p.Image); err != nil {
|
||||
return err
|
||||
}
|
||||
if p.PrizeID, err = r.ReadInt64(16, false, p.PrizeID); err != nil {
|
||||
return err
|
||||
}
|
||||
if p.ShopItemID, err = r.ReadInt64(17, false, p.ShopItemID); err != nil {
|
||||
return err
|
||||
}
|
||||
if p.ItemID, err = r.ReadInt64(19, false, p.ItemID); err != nil {
|
||||
return err
|
||||
}
|
||||
if p.Ext, err = r.ReadMapStringString(20, false); err != nil {
|
||||
return err
|
||||
}
|
||||
p.ExchangeDate, err = r.ReadInt32(21, false, p.ExchangeDate)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user