This commit is contained in:
aozhiwei 2024-04-18 19:24:01 +08:00
parent b291fbaa85
commit 01c1aedee4
3 changed files with 18 additions and 0 deletions

View File

@ -22,12 +22,16 @@ type LoginRsp struct {
HeadId string `json:"head_id"`
HeroId string `json:"hero_id"`
HeadFrame string `json:"head_frame"`
TotalLucky interface{} `json:"total_lucky"`
AdmissionItemNum interface{} `json:"admission_item_num"`
} `json:"user_info"`
HeroInfo struct {
HeroUniId string `json:"hero_uniid"`
HeroId string `json:"hero_id"`
Quality string `json:"quality"`
SpecSkill string `json:"spec_skill"`
Wealth interface{} `json:"wealth"`
ValidLefttime interface{} `json:"valid_lefttime"`
} `json:"hero_info"`
MapInfo MapInfoRsp `json:"map_info"`
} `json:"info"`

View File

@ -29,6 +29,7 @@ func (this *HandlerMgr) Init() {
cs.RegHandlerId(int(cs.CMMessageIdE__CMChooseHero), constant.PLAYER_HANDLER_ID)
cs.RegHandlerId(int(cs.CMMessageIdE__CMChooseMap), constant.PLAYER_HANDLER_ID)
cs.RegHandlerId(int(cs.CMMessageIdE__CMGrantInvitePermission), constant.PLAYER_HANDLER_ID)
cs.RegHandlerId(int(cs.CMMessageIdE__CMRefreshUser), constant.PLAYER_HANDLER_ID)
}
func (this *HandlerMgr) UnInit() {

View File

@ -17,6 +17,8 @@ type hero struct {
heroId int32
quality int32
specSkill int32
wealth int32
validLeftTime int32
}
type player struct {
@ -32,6 +34,8 @@ type player struct {
state int32
isReady int32
permission int32
admissionItemNum int32
totalLucky int64
hero hero
team common.Team
sortIdx int32
@ -52,11 +56,15 @@ func (this *player) init(req *pendingLoginRequest, rsp *common.LoginRsp){
this.name = rsp.Info.UserInfo.Name
this.avatarUrl = rsp.Info.UserInfo.HeadId
this.headFrame = rsp.Info.UserInfo.HeadFrame
q5.DuckToSimple(rsp.Info.UserInfo.AdmissionItemNum, &this.admissionItemNum)
q5.DuckToSimple(rsp.Info.UserInfo.TotalLucky, &this.totalLucky)
{
this.hero.heroUniId = rsp.Info.HeroInfo.HeroUniId
this.hero.heroId = q5.ToInt32(rsp.Info.HeroInfo.HeroId)
this.hero.quality = q5.ToInt32(rsp.Info.HeroInfo.Quality)
this.hero.specSkill = q5.ToInt32(rsp.Info.HeroInfo.SpecSkill)
q5.DuckToSimple(rsp.Info.HeroInfo.Wealth, &this.hero.wealth)
q5.DuckToSimple(rsp.Info.HeroInfo.ValidLefttime, &this.hero.validLeftTime)
}
}
@ -378,6 +386,11 @@ func (this *player) CMChooseMap(hdr *f5.MsgHdr, msg *cs.CMChooseMap) {
}
}
func (this *player) CMRefreshUser(hdr *f5.MsgHdr, msg *cs.CMRefreshUser) {
rspMsg := new(cs.SMRefreshUser)
this.SendMsg(rspMsg)
}
func (this *player) updateChoose(skillId int32, heroUniId string,
cb func (int32, string)) {
params := map[string]string{