From 59121452dd407e38f81dc9619737c0f81bd0cd64 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 14 Mar 2024 21:19:52 +0800 Subject: [PATCH] 1 --- server/matchserver/common/types.go | 3 ++- server/matchserver/player/player.go | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/server/matchserver/common/types.go b/server/matchserver/common/types.go index 325a3c41..76badf72 100644 --- a/server/matchserver/common/types.go +++ b/server/matchserver/common/types.go @@ -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"` } diff --git a/server/matchserver/player/player.go b/server/matchserver/player/player.go index b0c530a9..69eb066a 100644 --- a/server/matchserver/player/player.go +++ b/server/matchserver/player/player.go @@ -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) } }