From 842c8e4e11acf92e2724bbf4dee57573aad235e1 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 28 Jun 2022 19:10:57 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=8D=87=E6=98=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hero/api_heroSkillUp.go | 28 +++++ modules/hero/api_heroStarUp.go | 108 +++++++++++++++++- modules/hero/api_heroStrengthen.go | 6 + modules/hero/configure_comp.go | 10 +- pb/errorcode.pb.go | 83 ++++++++------ pb/hero_msg.pb.go | 176 +++++++++++++++-------------- pb/proto/errorcode.proto | 2 + 7 files changed, 288 insertions(+), 125 deletions(-) create mode 100644 modules/hero/api_heroSkillUp.go diff --git a/modules/hero/api_heroSkillUp.go b/modules/hero/api_heroSkillUp.go new file mode 100644 index 000000000..c8ccb984e --- /dev/null +++ b/modules/hero/api_heroSkillUp.go @@ -0,0 +1,28 @@ +package hero + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" +) + +//参数校验 +func (this *apiComp) StrengthenUpSkillCheck(session comm.IUserSession, req *pb.Hero_StrengthenUpSkill_Req) (result map[string]interface{}, code comm.ErrorCode) { + if req.HeroObjID == "" { + code.Code = pb.ErrorCode_ReqParameterError + return + } + + return +} + +/// 英雄技能升级 +func (this *apiComp) StrengthenUpSkill(session comm.IUserSession, agrs map[string]interface{}, req *pb.Hero_StrengthenUpSkill_Req) (code pb.ErrorCode) { + + defer func() { + if code == pb.ErrorCode_Success { + session.SendMsg(string(this.moduleHero.GetType()), StrengthenUplv, &pb.Hero_StrengthenUpSkill_Resp{}) + } + }() + + return +} diff --git a/modules/hero/api_heroStarUp.go b/modules/hero/api_heroStarUp.go index 52db12bbe..e5a7fe960 100644 --- a/modules/hero/api_heroStarUp.go +++ b/modules/hero/api_heroStarUp.go @@ -2,7 +2,9 @@ package hero import ( "go_dreamfactory/comm" + "go_dreamfactory/lego/sys/log" "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" ) //参数校验 @@ -11,19 +13,123 @@ func (this *apiComp) StrengthenUpStarCheck(session comm.IUserSession, req *pb.He code.Code = pb.ErrorCode_ReqParameterError return } + var ( + curLv int32 + target *cfg.Game_heroStarupData // 配置表目标升星英雄信息 + raceHero *pb.DB_HeroData // 消耗的阵容英雄 + costRaceCount int32 + curGold int32 + ) + tagHero, err := this.moduleHero.modelHero.moduleHero.GetHero(session.GetUserId(), req.HeroObjID) + if err != 0 { + code.Code = pb.ErrorCode_HeroNoExist + return + } + curLv = tagHero.Lv + log.Debugf("curLv:%d", curLv) // 校验指定英雄 + tagHeroConfig, err1 := this.moduleHero.configure.GetHeroStarupConfig() + if err1 != nil { + code.Code = pb.ErrorCode_ReqParameterError + return + } + for _, value := range tagHeroConfig.GetDataList() { + if tagHero.HeroID == value.Id && tagHero.Star == value.Star && tagHero.Lv == value.Maxlevel { // 找到了 满足升星条件 + target = value + break + } + } + // 指定英雄消耗校验 + for _, v := range req.Hero { + if tagHero, err := this.moduleHero.modelHero.moduleHero.GetHero(session.GetUserId(), v.CostCardObj); err != 0 { + code.Code = pb.ErrorCode_ReqParameterError + return + } else { + if tagHero.Count < v.Amount { // 校验数量 + code.Code = pb.ErrorCode_ReqParameterError + return + } + // 校验ID + if tagHero.HeroID != target.Needhero && tagHero.Star != target.Needherostar && tagHero.Count < target.Needheronum { + code.Code = pb.ErrorCode_ReqParameterError + return + } + } + } + // 校验阵容英雄消耗 + for _, v := range req.HeroRace { + if raceHero, err = this.moduleHero.modelHero.moduleHero.GetHero(session.GetUserId(), v.CostCardObj); err != 0 { + code.Code = pb.ErrorCode_ReqParameterError + return + } else { + // 校验阵容信息 + if raceHero.Star != target.Needracestar { + code.Code = pb.ErrorCode_ReqParameterError + return + } + bFind := false + for _, value := range target.Needrace { // 阵营校验 + if raceHero.Formation == value { + bFind = true + break + } + } + if !bFind { + code.Code = pb.ErrorCode_ReqParameterError + return + } + } + + costRaceCount += v.Amount + } + if costRaceCount != target.Needracenum { // 数量不匹配 + code.Code = pb.ErrorCode_ReqParameterError + return + } + // 金币消耗判断 + curGold = this.user.QueryAttributeValue(session.GetUserId(), "gold") + if curGold < target.Gold { // 金币不足 + code.Code = pb.ErrorCode_GoldNoEnough + return + } + + result = map[string]interface{}{ + "costGold": target.Gold, + } return } /// 英雄升星 func (this *apiComp) StrengthenUpStar(session comm.IUserSession, agrs map[string]interface{}, req *pb.Hero_StrengthenUpStar_Req) (code pb.ErrorCode) { - + var ( + costGold int32 // 当前需要消耗金币的数量 + ) defer func() { if code == pb.ErrorCode_Success { session.SendMsg(string(this.moduleHero.GetType()), StrengthenUplv, &pb.Hero_StrengthenUpStar_Resp{}) } }() + costGold = agrs["costGold"].(int32) + // 消耗道具 + code = this.user.AddAttributeValue(session.GetUserId(), "gold", -costGold) // 减少金币 + if code != pb.ErrorCode_Success { + return + } + // 消耗指定英雄 + for _, v := range req.Hero { + code = this.moduleHero.DelCard(v.CostCardObj, v.Amount) + if code != 0 { + return + } + } + //消耗种族英雄 + for _, v := range req.HeroRace { + code = this.moduleHero.DelCard(v.CostCardObj, v.Amount) + if code != 0 { + return + } + } return } diff --git a/modules/hero/api_heroStrengthen.go b/modules/hero/api_heroStrengthen.go index 40d9afe32..106d71ce8 100644 --- a/modules/hero/api_heroStrengthen.go +++ b/modules/hero/api_heroStrengthen.go @@ -17,6 +17,7 @@ func (this *apiComp) StrengthenUplvCheck(session comm.IUserSession, req *pb.Hero curExp int32 // 当前英雄的经验 costGold int32 // 当前需要消耗金币的数量 addExp int32 // 需要增加的经验 + curGold int32 //atn = map[string]interface{}{} ) @@ -84,6 +85,11 @@ func (this *apiComp) StrengthenUplvCheck(session comm.IUserSession, req *pb.Hero costGold += _data.Gold[0].N // 统计 升级需要消耗金币的数量 } } + // 金币消耗判断 + curGold = this.user.QueryAttributeValue(session.GetUserId(), "gold") + if curGold < costGold { + code.Code = pb.ErrorCode_GoldNoEnough + } } else { code.Code = pb.ErrorCode_HeroNoExist return diff --git a/modules/hero/configure_comp.go b/modules/hero/configure_comp.go index 165c3e587..3fffcb0c4 100644 --- a/modules/hero/configure_comp.go +++ b/modules/hero/configure_comp.go @@ -56,7 +56,7 @@ func (this *configureComp) getHeroConfigure() (configure *cfg.Game_newHero, err } // 获取英雄强化增加属性配置数据 -func (this *configureComp) GetHeroStargrowCon() (configure *cfg.Game_heroStargrow, err error) { +func (this *configureComp) GetHeroStargrowConfig() (configure *cfg.Game_heroStargrow, err error) { var ( v interface{} ok bool @@ -74,7 +74,7 @@ func (this *configureComp) GetHeroStargrowCon() (configure *cfg.Game_heroStargro } // 获取英雄升级属性变化相关配置数据 -func (this *configureComp) GetHeroLevelgrowCon() (configure *cfg.Game_heroLevelgrow, err error) { +func (this *configureComp) GetHeroLevelgrowConfig() (configure *cfg.Game_heroLevelgrow, err error) { var ( v interface{} ok bool @@ -90,7 +90,7 @@ func (this *configureComp) GetHeroLevelgrowCon() (configure *cfg.Game_heroLevelg } // 获取英雄升星相关配置数据 -func (this *configureComp) GetHeroStarupCon() (configure *cfg.Game_heroStarup, err error) { +func (this *configureComp) GetHeroStarupConfig() (configure *cfg.Game_heroStarup, err error) { var ( v interface{} ok bool @@ -107,7 +107,7 @@ func (this *configureComp) GetHeroStarupCon() (configure *cfg.Game_heroStarup, e } // 获取英雄升级相关配置数据 -func (this *configureComp) GetHeroLevelUpCon() (configure *cfg.Game_heroLevelup, err error) { +func (this *configureComp) GetHeroLevelUpConfig() (configure *cfg.Game_heroLevelup, err error) { var ( v interface{} ok bool @@ -123,7 +123,7 @@ func (this *configureComp) GetHeroLevelUpCon() (configure *cfg.Game_heroLevelup, return } -func (this *configureComp) GetHeroExpCon() (configure *cfg.Game_heroExp, err error) { +func (this *configureComp) GetHeroExpConfig() (configure *cfg.Game_heroExp, err error) { var ( v interface{} ok bool diff --git a/pb/errorcode.pb.go b/pb/errorcode.pb.go index 7f19da7fd..859393cec 100644 --- a/pb/errorcode.pb.go +++ b/pb/errorcode.pb.go @@ -43,9 +43,11 @@ const ( ErrorCode_ConfigurationException ErrorCode = 103 //配置异常 ErrorCode_ConfigNoFound ErrorCode = 104 //配置未找到 // user - ErrorCode_SecKeyInvalid ErrorCode = 1000 //秘钥无效 - ErrorCode_SecKey ErrorCode = 1001 //秘钥格式错误 - ErrorCode_BindUser ErrorCode = 1002 //用户绑定错误 + ErrorCode_SecKeyInvalid ErrorCode = 1000 //秘钥无效 + ErrorCode_SecKey ErrorCode = 1001 //秘钥格式错误 + ErrorCode_BindUser ErrorCode = 1002 //用户绑定错误 + ErrorCode_GoldNoEnough ErrorCode = 1003 // 金币不足 + ErrorCode_DiamondNoEnough ErrorCode = 1004 // 钻石不足 // friend ErrorCode_FriendNotSelf ErrorCode = 1100 //不能是自己 ErrorCode_FriendSelfMax ErrorCode = 1101 //超出好友最大数量 @@ -99,6 +101,8 @@ var ( 1000: "SecKeyInvalid", 1001: "SecKey", 1002: "BindUser", + 1003: "GoldNoEnough", + 1004: "DiamondNoEnough", 1100: "FriendNotSelf", 1101: "FriendSelfMax", 1102: "FriendTargetMax", @@ -145,6 +149,8 @@ var ( "SecKeyInvalid": 1000, "SecKey": 1001, "BindUser": 1002, + "GoldNoEnough": 1003, + "DiamondNoEnough": 1004, "FriendNotSelf": 1100, "FriendSelfMax": 1101, "FriendTargetMax": 1102, @@ -201,7 +207,7 @@ var File_errorcode_proto protoreflect.FileDescriptor var file_errorcode_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2a, 0xa6, 0x07, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, + 0x6f, 0x2a, 0xcf, 0x07, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12, 0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, @@ -228,39 +234,42 @@ var file_errorcode_proto_rawDesc = []byte{ 0x6f, 0x75, 0x6e, 0x64, 0x10, 0x68, 0x12, 0x12, 0x0a, 0x0d, 0x53, 0x65, 0x63, 0x4b, 0x65, 0x79, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x10, 0xe8, 0x07, 0x12, 0x0b, 0x0a, 0x06, 0x53, 0x65, 0x63, 0x4b, 0x65, 0x79, 0x10, 0xe9, 0x07, 0x12, 0x0d, 0x0a, 0x08, 0x42, 0x69, 0x6e, 0x64, 0x55, - 0x73, 0x65, 0x72, 0x10, 0xea, 0x07, 0x12, 0x12, 0x0a, 0x0d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, - 0x4e, 0x6f, 0x74, 0x53, 0x65, 0x6c, 0x66, 0x10, 0xcc, 0x08, 0x12, 0x12, 0x0a, 0x0d, 0x46, 0x72, - 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x6c, 0x66, 0x4d, 0x61, 0x78, 0x10, 0xcd, 0x08, 0x12, 0x14, - 0x0a, 0x0f, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x61, - 0x78, 0x10, 0xce, 0x08, 0x12, 0x15, 0x0a, 0x10, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, - 0x6c, 0x66, 0x4e, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x10, 0xcf, 0x08, 0x12, 0x17, 0x0a, 0x12, 0x46, - 0x72, 0x69, 0x65, 0x6e, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x6f, 0x44, 0x61, 0x74, - 0x61, 0x10, 0xd0, 0x08, 0x12, 0x0e, 0x0a, 0x09, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x59, 0x65, - 0x74, 0x10, 0xd1, 0x08, 0x12, 0x13, 0x0a, 0x0e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, 0x70, - 0x70, 0x6c, 0x79, 0x59, 0x65, 0x74, 0x10, 0xd2, 0x08, 0x12, 0x17, 0x0a, 0x12, 0x46, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x53, 0x65, 0x6c, 0x66, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x59, 0x65, 0x74, 0x10, - 0xd3, 0x08, 0x12, 0x19, 0x0a, 0x14, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x59, 0x65, 0x74, 0x10, 0xd4, 0x08, 0x12, 0x15, 0x0a, - 0x10, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x45, 0x72, 0x72, 0x6f, - 0x72, 0x10, 0xd5, 0x08, 0x12, 0x13, 0x0a, 0x0e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x42, 0x6c, - 0x61, 0x63, 0x6b, 0x4d, 0x61, 0x78, 0x10, 0xd6, 0x08, 0x12, 0x1a, 0x0a, 0x15, 0x46, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x10, 0xd7, 0x08, 0x12, 0x12, 0x0a, 0x0d, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x4e, 0x6f, - 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xb0, 0x09, 0x12, 0x15, 0x0a, 0x10, 0x49, 0x74, 0x65, - 0x6d, 0x73, 0x4e, 0x6f, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x47, 0x69, 0x72, 0x64, 0x10, 0xb1, 0x09, - 0x12, 0x16, 0x0a, 0x11, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x47, 0x72, 0x69, 0x64, 0x4e, 0x75, 0x6d, - 0x55, 0x70, 0x70, 0x65, 0x72, 0x10, 0xb2, 0x09, 0x12, 0x19, 0x0a, 0x14, 0x49, 0x74, 0x65, 0x6d, - 0x73, 0x47, 0x69, 0x72, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x70, 0x70, 0x65, 0x72, - 0x10, 0xb3, 0x09, 0x12, 0x10, 0x0a, 0x0b, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x45, 0x78, 0x69, - 0x73, 0x74, 0x10, 0x94, 0x0a, 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x45, - 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x95, 0x0a, 0x12, 0x0e, 0x0a, 0x09, 0x48, 0x65, 0x72, 0x6f, - 0x4d, 0x61, 0x78, 0x4c, 0x76, 0x10, 0x96, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, - 0x49, 0x6e, 0x69, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x10, 0x97, 0x0a, 0x12, 0x1e, 0x0a, 0x19, - 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x6e, 0x46, 0x6f, 0x75, 0x6e, 0x64, - 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x10, 0xf8, 0x0a, 0x12, 0x1c, 0x0a, 0x17, - 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x76, 0x6c, 0x69, 0x6d, 0x69, 0x74, - 0x52, 0x65, 0x61, 0x63, 0x68, 0x65, 0x64, 0x10, 0xf9, 0x0a, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, - 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x65, 0x72, 0x10, 0xea, 0x07, 0x12, 0x11, 0x0a, 0x0c, 0x47, 0x6f, 0x6c, 0x64, 0x4e, 0x6f, + 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xeb, 0x07, 0x12, 0x14, 0x0a, 0x0f, 0x44, 0x69, 0x61, + 0x6d, 0x6f, 0x6e, 0x64, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xec, 0x07, 0x12, + 0x12, 0x0a, 0x0d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4e, 0x6f, 0x74, 0x53, 0x65, 0x6c, 0x66, + 0x10, 0xcc, 0x08, 0x12, 0x12, 0x0a, 0x0d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x6c, + 0x66, 0x4d, 0x61, 0x78, 0x10, 0xcd, 0x08, 0x12, 0x14, 0x0a, 0x0f, 0x46, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x61, 0x78, 0x10, 0xce, 0x08, 0x12, 0x15, 0x0a, + 0x10, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x6c, 0x66, 0x4e, 0x6f, 0x44, 0x61, 0x74, + 0x61, 0x10, 0xcf, 0x08, 0x12, 0x17, 0x0a, 0x12, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x4e, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x10, 0xd0, 0x08, 0x12, 0x0e, 0x0a, + 0x09, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x59, 0x65, 0x74, 0x10, 0xd1, 0x08, 0x12, 0x13, 0x0a, + 0x0e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x59, 0x65, 0x74, 0x10, + 0xd2, 0x08, 0x12, 0x17, 0x0a, 0x12, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x6c, 0x66, + 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x59, 0x65, 0x74, 0x10, 0xd3, 0x08, 0x12, 0x19, 0x0a, 0x14, 0x46, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x42, 0x6c, 0x61, 0x63, 0x6b, + 0x59, 0x65, 0x74, 0x10, 0xd4, 0x08, 0x12, 0x15, 0x0a, 0x10, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, + 0x41, 0x70, 0x70, 0x6c, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xd5, 0x08, 0x12, 0x13, 0x0a, + 0x0e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x4d, 0x61, 0x78, 0x10, + 0xd6, 0x08, 0x12, 0x1a, 0x0a, 0x15, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x10, 0xd7, 0x08, 0x12, 0x12, + 0x0a, 0x0d, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, + 0xb0, 0x09, 0x12, 0x15, 0x0a, 0x10, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x4e, 0x6f, 0x46, 0x6f, 0x75, + 0x6e, 0x64, 0x47, 0x69, 0x72, 0x64, 0x10, 0xb1, 0x09, 0x12, 0x16, 0x0a, 0x11, 0x49, 0x74, 0x65, + 0x6d, 0x73, 0x47, 0x72, 0x69, 0x64, 0x4e, 0x75, 0x6d, 0x55, 0x70, 0x70, 0x65, 0x72, 0x10, 0xb2, + 0x09, 0x12, 0x19, 0x0a, 0x14, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x47, 0x69, 0x72, 0x64, 0x41, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x70, 0x70, 0x65, 0x72, 0x10, 0xb3, 0x09, 0x12, 0x10, 0x0a, 0x0b, + 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x45, 0x78, 0x69, 0x73, 0x74, 0x10, 0x94, 0x0a, 0x12, 0x11, + 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x95, + 0x0a, 0x12, 0x0e, 0x0a, 0x09, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x4c, 0x76, 0x10, 0x96, + 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x10, 0x97, 0x0a, 0x12, 0x1e, 0x0a, 0x19, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, + 0x6e, 0x74, 0x4f, 0x6e, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, + 0x6e, 0x74, 0x10, 0xf8, 0x0a, 0x12, 0x1c, 0x0a, 0x17, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, + 0x6e, 0x74, 0x4c, 0x76, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x61, 0x63, 0x68, 0x65, 0x64, + 0x10, 0xf9, 0x0a, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( diff --git a/pb/hero_msg.pb.go b/pb/hero_msg.pb.go index 82e092408..7a52ec9e1 100644 --- a/pb/hero_msg.pb.go +++ b/pb/hero_msg.pb.go @@ -430,7 +430,8 @@ type Hero_StrengthenUpStar_Req struct { unknownFields protoimpl.UnknownFields HeroObjID string `protobuf:"bytes,1,opt,name=heroObjID,proto3" json:"heroObjID"` // 英雄对象ID - Items []*CostCardData `protobuf:"bytes,2,rep,name=items,proto3" json:"items"` // 消耗卡牌对象ID + Hero []*CostCardData `protobuf:"bytes,2,rep,name=hero,proto3" json:"hero"` // 消耗卡牌对象ID + HeroRace []*CostCardData `protobuf:"bytes,3,rep,name=heroRace,proto3" json:"heroRace"` // 消耗种族卡牌对象ID } func (x *Hero_StrengthenUpStar_Req) Reset() { @@ -472,9 +473,16 @@ func (x *Hero_StrengthenUpStar_Req) GetHeroObjID() string { return "" } -func (x *Hero_StrengthenUpStar_Req) GetItems() []*CostCardData { +func (x *Hero_StrengthenUpStar_Req) GetHero() []*CostCardData { if x != nil { - return x.Items + return x.Hero + } + return nil +} + +func (x *Hero_StrengthenUpStar_Req) GetHeroRace() []*CostCardData { + if x != nil { + return x.HeroRace } return nil } @@ -1111,74 +1119,77 @@ var file_hero_hero_msg_proto_rawDesc = []byte{ 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x72, 0x64, 0x4f, 0x62, 0x6a, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x72, 0x64, 0x4f, 0x62, 0x6a, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x61, 0x0a, 0x19, 0x48, 0x65, 0x72, - 0x6f, 0x5f, 0x53, 0x74, 0x72, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x65, 0x6e, 0x55, 0x70, 0x53, 0x74, - 0x61, 0x72, 0x5f, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, - 0x6a, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, - 0x62, 0x6a, 0x49, 0x44, 0x12, 0x26, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, + 0x05, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x8d, 0x01, 0x0a, 0x19, 0x48, 0x65, + 0x72, 0x6f, 0x5f, 0x53, 0x74, 0x72, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x65, 0x6e, 0x55, 0x70, 0x53, + 0x74, 0x61, 0x72, 0x5f, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, + 0x62, 0x6a, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x65, 0x72, 0x6f, + 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x12, 0x24, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x72, - 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x41, 0x0a, 0x1a, - 0x48, 0x65, 0x72, 0x6f, 0x5f, 0x53, 0x74, 0x72, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x65, 0x6e, 0x55, - 0x70, 0x53, 0x74, 0x61, 0x72, 0x5f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x04, 0x68, 0x65, - 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, - 0x5f, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, - 0x82, 0x01, 0x0a, 0x1a, 0x48, 0x65, 0x72, 0x6f, 0x5f, 0x53, 0x74, 0x72, 0x65, 0x6e, 0x67, 0x74, - 0x68, 0x65, 0x6e, 0x55, 0x70, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x5f, 0x52, 0x65, 0x71, 0x12, 0x1c, - 0x0a, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, - 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x0a, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x26, 0x0a, 0x05, - 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, - 0x2e, 0x43, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x72, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x69, - 0x74, 0x65, 0x6d, 0x73, 0x22, 0x42, 0x0a, 0x1b, 0x48, 0x65, 0x72, 0x6f, 0x5f, 0x53, 0x74, 0x72, - 0x65, 0x6e, 0x67, 0x74, 0x68, 0x65, 0x6e, 0x55, 0x70, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x5f, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x5f, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x61, - 0x74, 0x61, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, 0x4f, 0x0a, 0x11, 0x48, 0x65, 0x72, 0x6f, - 0x5f, 0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, 0x5f, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, - 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x63, - 0x6f, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x63, 0x6f, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x22, 0x82, 0x01, 0x0a, 0x12, 0x48, 0x65, - 0x72, 0x6f, 0x5f, 0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, 0x5f, 0x52, 0x65, 0x73, 0x70, + 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x12, 0x2c, 0x0a, 0x08, 0x68, + 0x65, 0x72, 0x6f, 0x52, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x72, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, + 0x08, 0x68, 0x65, 0x72, 0x6f, 0x52, 0x61, 0x63, 0x65, 0x22, 0x41, 0x0a, 0x1a, 0x48, 0x65, 0x72, + 0x6f, 0x5f, 0x53, 0x74, 0x72, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x65, 0x6e, 0x55, 0x70, 0x53, 0x74, + 0x61, 0x72, 0x5f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x5f, 0x48, 0x65, + 0x72, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, 0x82, 0x01, 0x0a, + 0x1a, 0x48, 0x65, 0x72, 0x6f, 0x5f, 0x53, 0x74, 0x72, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x65, 0x6e, + 0x55, 0x70, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x5f, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x68, + 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x6b, 0x69, + 0x6c, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, + 0x6b, 0x69, 0x6c, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x26, 0x0a, 0x05, 0x69, 0x74, 0x65, + 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, + 0x73, 0x74, 0x43, 0x61, 0x72, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, + 0x73, 0x22, 0x42, 0x0a, 0x1b, 0x48, 0x65, 0x72, 0x6f, 0x5f, 0x53, 0x74, 0x72, 0x65, 0x6e, 0x67, + 0x74, 0x68, 0x65, 0x6e, 0x55, 0x70, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x5f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x5f, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x52, - 0x04, 0x68, 0x65, 0x72, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x12, 0x2f, 0x0a, - 0x0a, 0x75, 0x70, 0x53, 0x74, 0x61, 0x72, 0x43, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x5f, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x61, - 0x74, 0x61, 0x52, 0x0a, 0x75, 0x70, 0x53, 0x74, 0x61, 0x72, 0x43, 0x61, 0x72, 0x64, 0x22, 0x36, - 0x0a, 0x16, 0x48, 0x65, 0x72, 0x6f, 0x5f, 0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, 0x52, - 0x65, 0x73, 0x65, 0x74, 0x5f, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x65, 0x72, 0x6f, - 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x65, 0x72, - 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x22, 0x56, 0x0a, 0x17, 0x48, 0x65, 0x72, 0x6f, 0x5f, 0x47, - 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x65, 0x74, 0x5f, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x23, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x5f, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x61, 0x74, 0x61, - 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x22, 0x72, - 0x0a, 0x1a, 0x48, 0x65, 0x72, 0x6f, 0x5f, 0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, 0x55, - 0x73, 0x65, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x5f, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, - 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x73, - 0x65, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x75, - 0x73, 0x65, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x54, - 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x75, 0x73, 0x65, 0x54, 0x79, - 0x70, 0x65, 0x22, 0x42, 0x0a, 0x1b, 0x48, 0x65, 0x72, 0x6f, 0x5f, 0x47, 0x6f, 0x6e, 0x67, 0x6d, - 0x69, 0x6e, 0x67, 0x55, 0x73, 0x65, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x5f, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x23, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x5f, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x61, 0x74, 0x61, - 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, 0x5c, 0x0a, 0x10, 0x48, 0x65, 0x72, 0x6f, 0x5f, 0x4a, - 0x75, 0x65, 0x78, 0x69, 0x6e, 0x67, 0x5f, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x65, + 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, 0x4f, 0x0a, 0x11, 0x48, 0x65, 0x72, 0x6f, 0x5f, 0x47, 0x6f, + 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, 0x5f, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x68, - 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x12, 0x2a, 0x0a, 0x09, 0x63, 0x6f, 0x73, 0x74, - 0x49, 0x74, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, - 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x52, 0x09, 0x63, 0x6f, 0x73, 0x74, 0x49, - 0x74, 0x6d, 0x65, 0x73, 0x22, 0x38, 0x0a, 0x11, 0x48, 0x65, 0x72, 0x6f, 0x5f, 0x4a, 0x75, 0x65, - 0x78, 0x69, 0x6e, 0x67, 0x5f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x04, 0x68, 0x65, 0x72, - 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x5f, - 0x48, 0x65, 0x72, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x42, 0x06, - 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x73, 0x74, + 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x73, + 0x74, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x22, 0x82, 0x01, 0x0a, 0x12, 0x48, 0x65, 0x72, 0x6f, 0x5f, + 0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, 0x5f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, + 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, + 0x2e, 0x44, 0x42, 0x5f, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x68, 0x65, + 0x72, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x12, 0x2f, 0x0a, 0x0a, 0x75, 0x70, + 0x53, 0x74, 0x61, 0x72, 0x43, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, + 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x5f, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x52, + 0x0a, 0x75, 0x70, 0x53, 0x74, 0x61, 0x72, 0x43, 0x61, 0x72, 0x64, 0x22, 0x36, 0x0a, 0x16, 0x48, + 0x65, 0x72, 0x6f, 0x5f, 0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x65, + 0x74, 0x5f, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, + 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, + 0x6a, 0x49, 0x44, 0x22, 0x56, 0x0a, 0x17, 0x48, 0x65, 0x72, 0x6f, 0x5f, 0x47, 0x6f, 0x6e, 0x67, + 0x6d, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x65, 0x74, 0x5f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, + 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, + 0x62, 0x2e, 0x44, 0x42, 0x5f, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x68, + 0x65, 0x72, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x22, 0x72, 0x0a, 0x1a, 0x48, + 0x65, 0x72, 0x6f, 0x5f, 0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, 0x55, 0x73, 0x65, 0x45, + 0x6e, 0x65, 0x72, 0x67, 0x79, 0x5f, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x65, 0x72, + 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x65, + 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x45, 0x6e, + 0x65, 0x72, 0x67, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x75, 0x73, 0x65, 0x45, + 0x6e, 0x65, 0x72, 0x67, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x75, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, + 0x42, 0x0a, 0x1b, 0x48, 0x65, 0x72, 0x6f, 0x5f, 0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, + 0x55, 0x73, 0x65, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x5f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, + 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, + 0x62, 0x2e, 0x44, 0x42, 0x5f, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x68, + 0x65, 0x72, 0x6f, 0x22, 0x5c, 0x0a, 0x10, 0x48, 0x65, 0x72, 0x6f, 0x5f, 0x4a, 0x75, 0x65, 0x78, + 0x69, 0x6e, 0x67, 0x5f, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, + 0x62, 0x6a, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x65, 0x72, 0x6f, + 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x12, 0x2a, 0x0a, 0x09, 0x63, 0x6f, 0x73, 0x74, 0x49, 0x74, 0x6d, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74, + 0x65, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x52, 0x09, 0x63, 0x6f, 0x73, 0x74, 0x49, 0x74, 0x6d, 0x65, + 0x73, 0x22, 0x38, 0x0a, 0x11, 0x48, 0x65, 0x72, 0x6f, 0x5f, 0x4a, 0x75, 0x65, 0x78, 0x69, 0x6e, + 0x67, 0x5f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x5f, 0x48, 0x65, 0x72, + 0x6f, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x42, 0x06, 0x5a, 0x04, 0x2e, + 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1221,21 +1232,22 @@ var file_hero_hero_msg_proto_depIdxs = []int32{ 20, // 0: pb.Hero_Info_Rsp.base:type_name -> pb.DB_HeroData 20, // 1: pb.Hero_List_Rsp.list:type_name -> pb.DB_HeroData 20, // 2: pb.Hero_StrengthenUplv_Resp.hero:type_name -> pb.DB_HeroData - 7, // 3: pb.Hero_StrengthenUpStar_Req.items:type_name -> pb.CostCardData - 20, // 4: pb.Hero_StrengthenUpStar_Resp.hero:type_name -> pb.DB_HeroData - 7, // 5: pb.Hero_StrengthenUpSkill_Req.items:type_name -> pb.CostCardData - 20, // 6: pb.Hero_StrengthenUpSkill_Resp.hero:type_name -> pb.DB_HeroData - 20, // 7: pb.Hero_Gongming_Resp.hero:type_name -> pb.DB_HeroData - 20, // 8: pb.Hero_Gongming_Resp.upStarCard:type_name -> pb.DB_HeroData - 20, // 9: pb.Hero_GongmingReset_Resp.hero:type_name -> pb.DB_HeroData - 20, // 10: pb.Hero_GongmingUseEnergy_Resp.hero:type_name -> pb.DB_HeroData - 4, // 11: pb.Hero_Juexing_Req.costItmes:type_name -> pb.ItemData - 20, // 12: pb.Hero_Juexing_Resp.hero:type_name -> pb.DB_HeroData - 13, // [13:13] is the sub-list for method output_type - 13, // [13:13] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name + 7, // 3: pb.Hero_StrengthenUpStar_Req.hero:type_name -> pb.CostCardData + 7, // 4: pb.Hero_StrengthenUpStar_Req.heroRace:type_name -> pb.CostCardData + 20, // 5: pb.Hero_StrengthenUpStar_Resp.hero:type_name -> pb.DB_HeroData + 7, // 6: pb.Hero_StrengthenUpSkill_Req.items:type_name -> pb.CostCardData + 20, // 7: pb.Hero_StrengthenUpSkill_Resp.hero:type_name -> pb.DB_HeroData + 20, // 8: pb.Hero_Gongming_Resp.hero:type_name -> pb.DB_HeroData + 20, // 9: pb.Hero_Gongming_Resp.upStarCard:type_name -> pb.DB_HeroData + 20, // 10: pb.Hero_GongmingReset_Resp.hero:type_name -> pb.DB_HeroData + 20, // 11: pb.Hero_GongmingUseEnergy_Resp.hero:type_name -> pb.DB_HeroData + 4, // 12: pb.Hero_Juexing_Req.costItmes:type_name -> pb.ItemData + 20, // 13: pb.Hero_Juexing_Resp.hero:type_name -> pb.DB_HeroData + 14, // [14:14] is the sub-list for method output_type + 14, // [14:14] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name } func init() { file_hero_hero_msg_proto_init() } diff --git a/pb/proto/errorcode.proto b/pb/proto/errorcode.proto index 9c0f0aa45..148451495 100644 --- a/pb/proto/errorcode.proto +++ b/pb/proto/errorcode.proto @@ -26,6 +26,8 @@ enum ErrorCode { SecKeyInvalid = 1000; //秘钥无效 SecKey = 1001; //秘钥格式错误 BindUser = 1002; //用户绑定错误 + GoldNoEnough = 1003; // 金币不足 + DiamondNoEnough = 1004; // 钻石不足 // friend FriendNotSelf = 1100; //不能是自己 From 6871a1a50b743520d61a4fac3469d96e539c19f7 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 28 Jun 2022 19:17:25 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=8A=A5=E9=94=99=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hero/api_heroSkillUp.go | 6 +++--- modules/hero/api_heroStarUp.go | 2 +- pb/hero_msg.pb.go | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/hero/api_heroSkillUp.go b/modules/hero/api_heroSkillUp.go index c8ccb984e..6503a575e 100644 --- a/modules/hero/api_heroSkillUp.go +++ b/modules/hero/api_heroSkillUp.go @@ -6,7 +6,7 @@ import ( ) //参数校验 -func (this *apiComp) StrengthenUpSkillCheck(session comm.IUserSession, req *pb.Hero_StrengthenUpSkill_Req) (result map[string]interface{}, code comm.ErrorCode) { +func (this *apiComp) StrengthenUpSkillCheck(session comm.IUserSession, req *pb.HeroStrengthenUpSkillReq) (result map[string]interface{}, code comm.ErrorCode) { if req.HeroObjID == "" { code.Code = pb.ErrorCode_ReqParameterError return @@ -16,11 +16,11 @@ func (this *apiComp) StrengthenUpSkillCheck(session comm.IUserSession, req *pb.H } /// 英雄技能升级 -func (this *apiComp) StrengthenUpSkill(session comm.IUserSession, agrs map[string]interface{}, req *pb.Hero_StrengthenUpSkill_Req) (code pb.ErrorCode) { +func (this *apiComp) StrengthenUpSkill(session comm.IUserSession, agrs map[string]interface{}, req *pb.HeroStrengthenUpSkillReq) (code pb.ErrorCode) { defer func() { if code == pb.ErrorCode_Success { - session.SendMsg(string(this.moduleHero.GetType()), StrengthenUplv, &pb.Hero_StrengthenUpSkill_Resp{}) + session.SendMsg(string(this.moduleHero.GetType()), StrengthenUplv, &pb.HeroStrengthenUpSkillResp{}) } }() diff --git a/modules/hero/api_heroStarUp.go b/modules/hero/api_heroStarUp.go index 3b327cdc2..030e21f3e 100644 --- a/modules/hero/api_heroStarUp.go +++ b/modules/hero/api_heroStarUp.go @@ -16,7 +16,7 @@ func (this *apiComp) StrengthenUpStarCheck(session comm.IUserSession, req *pb.He var ( curLv int32 target *cfg.Game_heroStarupData // 配置表目标升星英雄信息 - raceHero *pb.DBHeroData // 消耗的阵容英雄 + raceHero *pb.DBHero // 消耗的阵容英雄 costRaceCount int32 curGold int32 ) diff --git a/pb/hero_msg.pb.go b/pb/hero_msg.pb.go index b7453daa2..0d136263e 100644 --- a/pb/hero_msg.pb.go +++ b/pb/hero_msg.pb.go @@ -480,7 +480,6 @@ func (x *HeroStrengthenUpStarReq) GetHero() []*CostCardData { return nil } - func (x *HeroStrengthenUpStarReq) GetHeroRace() []*CostCardData { if x != nil { return x.HeroRace