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"` HeadId string `json:"head_id"`
HeroId string `json:"hero_id"` HeroId string `json:"hero_id"`
HeadFrame string `json:"head_frame"` HeadFrame string `json:"head_frame"`
SpecSkill string `json:"spec_skill"`
} `json:"user_info"` } `json:"user_info"`
HeroInfo struct { HeroInfo struct {
HeroUniId string `json:"hero_uniid"` HeroUniId string `json:"hero_uniid"`
HeroId string `json:"hero_id"` HeroId string `json:"hero_id"`
Quality string `json:"quality"` Quality string `json:"quality"`
SpecSkill string `json:"spec_skill"`
} `json:"hero_info"` } `json:"hero_info"`
} `json:"info"` } `json:"info"`
} }
@ -50,6 +50,7 @@ type UpdateBattleInfoRsp struct {
HeroUniId string `json:"hero_uniid"` HeroUniId string `json:"hero_uniid"`
HeroId string `json:"hero_id"` HeroId string `json:"hero_id"`
Quality string `json:"quality"` Quality string `json:"quality"`
SpecSkill string `json:"spec_skill"`
} `json:"hero_info"` } `json:"hero_info"`
} `json:"info"` } `json:"info"`
} }

View File

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