This commit is contained in:
aozhiwei 2024-03-14 21:19:52 +08:00
parent b23d159226
commit 59121452dd
2 changed files with 8 additions and 6 deletions

View File

@ -22,12 +22,12 @@ type LoginRsp struct {
HeadId string `json:"head_id"`
HeroId string `json:"hero_id"`
HeadFrame string `json:"head_frame"`
SpecSkill string `json:"spec_skill"`
} `json:"user_info"`
HeroInfo struct {
HeroUniId string `json:"hero_uniid"`
HeroId string `json:"hero_id"`
Quality string `json:"quality"`
SpecSkill string `json:"spec_skill"`
} `json:"hero_info"`
} `json:"info"`
}
@ -50,6 +50,7 @@ type UpdateBattleInfoRsp struct {
HeroUniId string `json:"hero_uniid"`
HeroId string `json:"hero_id"`
Quality string `json:"quality"`
SpecSkill string `json:"spec_skill"`
} `json:"hero_info"`
} `json:"info"`
}

View File

@ -16,6 +16,7 @@ type hero struct {
heroUniId string
heroId int32
quality int32
specSkill int32
}
type player struct {
@ -28,7 +29,6 @@ type player struct {
name string
avatarUrl string
headFrame string
specSkill int32
state int32
isReady int32
permission int32
@ -52,11 +52,11 @@ 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
this.specSkill = q5.ToInt32(rsp.Info.UserInfo.SpecSkill)
{
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)
}
}
@ -73,6 +73,7 @@ func (this *player) againInit(req *pendingLoginRequest, rsp *common.LoginRsp){
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)
}
}
@ -153,7 +154,7 @@ func (this *player) FillMFTeamMember(member_pb *cs.MFTeamMember) {
} else {
member_pb.IsLeader = proto.Int32(0)
}
member_pb.SpecSkill = proto.Int32(this.specSkill)
member_pb.SpecSkill = proto.Int32(this.hero.specSkill)
{
member_pb.Hero = &cs.MFHero{}
member_pb.Hero.HeroId = proto.Int32(this.hero.heroId)
@ -293,7 +294,7 @@ func (this *player) CMChooseHero(hdr *f5.MsgHdr, msg *cs.CMChooseHero) {
return
} else {
this.updateChoose(
this.specSkill,
this.hero.specSkill,
msg.GetHeroUniid(),
func (errCode int32, errMsg string) {
if errCode == 0 {
@ -355,11 +356,11 @@ func (this *player) updateChoose(skillId int32, heroUniId string,
this.name = rspObj.Info.UserInfo.Name
this.avatarUrl = rspObj.Info.UserInfo.HeadId
this.headFrame = rspObj.Info.UserInfo.HeadFrame
this.specSkill = q5.ToInt32(rspObj.Info.UserInfo.SpecSkill)
{
this.hero.heroUniId = rspObj.Info.HeroInfo.HeroUniId
this.hero.heroId = q5.ToInt32(rspObj.Info.HeroInfo.HeroId)
this.hero.quality = q5.ToInt32(rspObj.Info.HeroInfo.Quality)
this.hero.specSkill = q5.ToInt32(rspObj.Info.HeroInfo.SpecSkill)
}
}