This commit is contained in:
aozhiwei 2024-03-20 21:32:27 +08:00
parent 334baed12e
commit 1a37d9670a
2 changed files with 23 additions and 20 deletions

View File

@ -9,6 +9,27 @@ import (
proto "github.com/golang/protobuf/proto" proto "github.com/golang/protobuf/proto"
) )
type HistorySeasons struct {
TotalKills int `json:"total_kills"`
WinTimes int `json:"win_times"`
}
type LoginRsp struct {
Errcode int `json:"errcode"`
Errmsg string `json:"errmsg"`
Info struct {
Activated string `json:"activated"`
AccountID string `json:"account_id"`
Name string `json:"name"`
Avatar string `json:"head_id"`
AvatarHead string `json:"head_frame"`
Star string `json:"current_star_num"`
Rank string `json:"current_rank"`
LastLoginTime string `json:"last_login_time"`
HistorySeasons []HistorySeasons `json:"history_seasons"`
} `json:"info"`
}
type WspListener interface { type WspListener interface {
ProcessSSMMsg(*ss.SsNetMsgHandler, *f5.MsgHdr) ProcessSSMMsg(*ss.SsNetMsgHandler, *f5.MsgHdr)
SendProxyMsg(net.Conn, uint16, proto.Message) SendProxyMsg(net.Conn, uint16, proto.Message)

View File

@ -10,6 +10,7 @@ import (
"q5" "q5"
//"net" //"net"
"main/constant" "main/constant"
"main/common"
. "main/global" . "main/global"
) )
@ -72,27 +73,8 @@ func (this *playerMgr) CMLogin(hdr *f5.MsgHdr, msg *cs.CMLogin) {
}) })
} }
type HistorySeasons struct {
TotalKills int `json:"total_kills"`
WinTimes int `json:"win_times"`
}
func (this *playerMgr) apiAuthCb(hdr *f5.MsgHdr, msg *cs.CMLogin, rsp f5.HttpCliResponse) { func (this *playerMgr) apiAuthCb(hdr *f5.MsgHdr, msg *cs.CMLogin, rsp f5.HttpCliResponse) {
resObj := struct { resObj := common.LoginRsp{}
Errcode int `json:"errcode"`
Errmsg string `json:"errmsg"`
Info struct {
Activated string `json:"activated"`
AccountID string `json:"account_id"`
Name string `json:"name"`
Avatar string `json:"head_id"`
AvatarHead string `json:"head_frame"`
Star string `json:"current_star_num"`
Rank string `json:"current_rank"`
LastLoginTime string `json:"last_login_time"`
HistorySeasons []HistorySeasons `json:"history_seasons"`
} `json:"info"`
}{}
err := json.Unmarshal([]byte(rsp.GetRawData()), &resObj) err := json.Unmarshal([]byte(rsp.GetRawData()), &resObj)
if err != nil { if err != nil {
f5.GetSysLog().Info("Api服务器JSON 解析错误:%s\n", err) f5.GetSysLog().Info("Api服务器JSON 解析错误:%s\n", err)