From 7b1143186f020815958287aeef0100fa373b2f6f Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 19 Sep 2024 14:52:03 +0800 Subject: [PATCH] 1 --- server/matchserver/common/types.go | 3 +++ server/matchserver/player/player.go | 6 ++++++ server/matchserver/proto/cs_proto.proto | 1 + 3 files changed, 10 insertions(+) diff --git a/server/matchserver/common/types.go b/server/matchserver/common/types.go index ad983b4b..2f9a1561 100644 --- a/server/matchserver/common/types.go +++ b/server/matchserver/common/types.go @@ -24,6 +24,7 @@ type LoginRsp struct { HeadFrame string `json:"head_frame"` TotalLucky interface{} `json:"total_lucky"` AdmissionItemNum interface{} `json:"admission_item_num"` + CircuitScore interface{} `json:"circuit_score"` } `json:"user_info"` HeroInfo struct { HeroUniId string `json:"hero_uniid"` @@ -54,6 +55,7 @@ type UserRsp struct { HeadFrame string `json:"head_frame"` TotalLucky interface{} `json:"total_lucky"` AdmissionItemNum interface{} `json:"admission_item_num"` + CircuitScore interface{} `json:"circuit_score"` } `json:"user_info"` HeroInfo struct { HeroUniId string `json:"hero_uniid"` @@ -102,6 +104,7 @@ type UpdateBattleInfoRsp struct { SpecSkill string `json:"spec_skill"` TotalLucky interface{} `json:"total_lucky"` AdmissionItemNum interface{} `json:"admission_item_num"` + CircuitScore interface{} `json:"circuit_score"` } `json:"user_info"` HeroInfo struct { HeroUniId string `json:"hero_uniid"` diff --git a/server/matchserver/player/player.go b/server/matchserver/player/player.go index 7281b85f..00b54a94 100644 --- a/server/matchserver/player/player.go +++ b/server/matchserver/player/player.go @@ -38,6 +38,7 @@ type player struct { isReady int32 permission int32 admissionItemNum int32 + circuitScore int32 totalLucky int64 hero hero team common.Team @@ -61,6 +62,7 @@ func (this *player) init(req *pendingLoginRequest, rsp *common.LoginRsp){ 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.CircuitScore, &this.circuitScore) q5.DuckToSimple(rsp.Info.UserInfo.TotalLucky, &this.totalLucky) { this.hero.heroUniId = rsp.Info.HeroInfo.HeroUniId @@ -85,6 +87,7 @@ func (this *player) againInit(req *pendingLoginRequest, rsp *common.LoginRsp){ 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.CircuitScore, &this.circuitScore) q5.DuckToSimple(rsp.Info.UserInfo.TotalLucky, &this.totalLucky) { this.hero.heroUniId = rsp.Info.HeroInfo.HeroUniId @@ -234,6 +237,7 @@ func (this *player) FillMFTeamMember(member_pb *cs.MFTeamMember) { member_pb.TotalLucky = proto.Int64(this.totalLucky) member_pb.ValidLefttime = proto.Int32(this.hero.validLeftTime) member_pb.AdmissionItemNum = proto.Int32(this.admissionItemNum) + member_pb.CircuitScore = proto.Int32(this.circuitScore) } func (this *player) CMLeaveTeam(hdr *f5.MsgHdr, msg *cs.CMLeaveTeam) { @@ -428,6 +432,7 @@ func (this *player) CMRefreshUser(hdr *f5.MsgHdr, msg *cs.CMRefreshUser) { this.avatarUrl = rspObj.Info.UserInfo.HeadId this.headFrame = rspObj.Info.UserInfo.HeadFrame q5.DuckToSimple(rspObj.Info.UserInfo.AdmissionItemNum, &this.admissionItemNum) + q5.DuckToSimple(rspObj.Info.UserInfo.CircuitScore, &this.circuitScore) q5.DuckToSimple(rspObj.Info.UserInfo.TotalLucky, &this.totalLucky) { this.hero.heroUniId = rspObj.Info.HeroInfo.HeroUniId @@ -481,6 +486,7 @@ func (this *player) updateChoose(skillId int32, heroUniId string, this.avatarUrl = rspObj.Info.UserInfo.HeadId this.headFrame = rspObj.Info.UserInfo.HeadFrame q5.DuckToSimple(rspObj.Info.UserInfo.AdmissionItemNum, &this.admissionItemNum) + q5.DuckToSimple(rspObj.Info.UserInfo.CircuitScore, &this.circuitScore) q5.DuckToSimple(rspObj.Info.UserInfo.TotalLucky, &this.totalLucky) { this.hero.heroUniId = rspObj.Info.HeroInfo.HeroUniId diff --git a/server/matchserver/proto/cs_proto.proto b/server/matchserver/proto/cs_proto.proto index d1840a87..009cf24b 100644 --- a/server/matchserver/proto/cs_proto.proto +++ b/server/matchserver/proto/cs_proto.proto @@ -140,6 +140,7 @@ message MFTeamMember optional int32 valid_lefttime = 13; //最大有效时间 optional int32 admission_item_num = 14; //门票数 optional int32 battling = 15; //是否战斗中 + optional int32 circuit_score = 16; //循回赛积分 } //队伍信息