diff --git a/bin/json/game_heroawaken.json b/bin/json/game_heroawaken.json new file mode 100644 index 000000000..19661df1b --- /dev/null +++ b/bin/json/game_heroawaken.json @@ -0,0 +1,586 @@ +[ + { + "key": 1, + "hid": 15001, + "phase": 1, + "phasebonus": [ + "hp", + "950" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 10000 + }, + { + "a": "item", + "t": "10001", + "n": 10 + } + ] + }, + { + "key": 2, + "hid": 15001, + "phase": 2, + "phasebonus": [ + "def", + "70" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 20000 + }, + { + "a": "item", + "t": "10001", + "n": 20 + } + ] + }, + { + "key": 3, + "hid": 15001, + "phase": 3, + "phasebonus": [ + "121500100", + "3" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 30000 + }, + { + "a": "item", + "t": "10002", + "n": 10 + }, + { + "a": "item", + "t": "10001", + "n": 10 + } + ] + }, + { + "key": 4, + "hid": 15001, + "phase": 4, + "phasebonus": [ + "defpro", + "100" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 40000 + }, + { + "a": "item", + "t": "10002", + "n": 20 + }, + { + "a": "item", + "t": "10001", + "n": 20 + } + ] + }, + { + "key": 5, + "hid": 15001, + "phase": 5, + "phasebonus": [ + "speed", + "10" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 50000 + }, + { + "a": "item", + "t": "10003", + "n": 10 + }, + { + "a": "item", + "t": "10002", + "n": 10 + } + ] + }, + { + "key": 6, + "hid": 15001, + "phase": 6, + "phasebonus": [ + "hppro", + "200" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 60000 + }, + { + "a": "item", + "t": "10003", + "n": 20 + }, + { + "a": "item", + "t": "10002", + "n": 20 + } + ] + }, + { + "key": 7, + "hid": 25001, + "phase": 1, + "phasebonus": [ + "hp", + "950" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 10000 + }, + { + "a": "item", + "t": "10011", + "n": 10 + } + ] + }, + { + "key": 8, + "hid": 25001, + "phase": 2, + "phasebonus": [ + "def", + "70" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 20000 + }, + { + "a": "item", + "t": "10011", + "n": 20 + } + ] + }, + { + "key": 9, + "hid": 25001, + "phase": 3, + "phasebonus": [ + "122500100", + "3" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 30000 + }, + { + "a": "item", + "t": "10012", + "n": 10 + }, + { + "a": "item", + "t": "10011", + "n": 10 + } + ] + }, + { + "key": 10, + "hid": 25001, + "phase": 4, + "phasebonus": [ + "defpro", + "100" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 40000 + }, + { + "a": "item", + "t": "10012", + "n": 20 + }, + { + "a": "item", + "t": "10011", + "n": 20 + } + ] + }, + { + "key": 11, + "hid": 25001, + "phase": 5, + "phasebonus": [ + "speed", + "10" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 50000 + }, + { + "a": "item", + "t": "10013", + "n": 10 + }, + { + "a": "item", + "t": "10012", + "n": 10 + } + ] + }, + { + "key": 12, + "hid": 25001, + "phase": 6, + "phasebonus": [ + "hppro", + "200" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 60000 + }, + { + "a": "item", + "t": "10013", + "n": 20 + }, + { + "a": "item", + "t": "10012", + "n": 20 + } + ] + }, + { + "key": 13, + "hid": 35001, + "phase": 1, + "phasebonus": [ + "hp", + "950" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 10000 + }, + { + "a": "item", + "t": "10021", + "n": 10 + } + ] + }, + { + "key": 14, + "hid": 35001, + "phase": 2, + "phasebonus": [ + "def", + "70" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 20000 + }, + { + "a": "item", + "t": "10021", + "n": 20 + } + ] + }, + { + "key": 15, + "hid": 35001, + "phase": 3, + "phasebonus": [ + "123500100", + "3" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 30000 + }, + { + "a": "item", + "t": "10022", + "n": 10 + }, + { + "a": "item", + "t": "10021", + "n": 10 + } + ] + }, + { + "key": 16, + "hid": 35001, + "phase": 4, + "phasebonus": [ + "defpro", + "100" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 40000 + }, + { + "a": "item", + "t": "10022", + "n": 20 + }, + { + "a": "item", + "t": "10021", + "n": 20 + } + ] + }, + { + "key": 17, + "hid": 35001, + "phase": 5, + "phasebonus": [ + "speed", + "10" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 50000 + }, + { + "a": "item", + "t": "10023", + "n": 10 + }, + { + "a": "item", + "t": "10022", + "n": 10 + } + ] + }, + { + "key": 18, + "hid": 35001, + "phase": 6, + "phasebonus": [ + "hppro", + "200" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 60000 + }, + { + "a": "item", + "t": "10023", + "n": 20 + }, + { + "a": "item", + "t": "10022", + "n": 20 + } + ] + }, + { + "key": 19, + "hid": 44001, + "phase": 1, + "phasebonus": [ + "hp", + "950" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 10000 + }, + { + "a": "item", + "t": "10031", + "n": 10 + } + ] + }, + { + "key": 20, + "hid": 44001, + "phase": 2, + "phasebonus": [ + "def", + "70" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 20000 + }, + { + "a": "item", + "t": "10031", + "n": 20 + } + ] + }, + { + "key": 21, + "hid": 44001, + "phase": 3, + "phasebonus": [ + "124400100", + "3" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 30000 + }, + { + "a": "item", + "t": "10032", + "n": 10 + }, + { + "a": "item", + "t": "10031", + "n": 10 + } + ] + }, + { + "key": 22, + "hid": 44001, + "phase": 4, + "phasebonus": [ + "defpro", + "100" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 40000 + }, + { + "a": "item", + "t": "10032", + "n": 20 + }, + { + "a": "item", + "t": "10031", + "n": 20 + } + ] + }, + { + "key": 23, + "hid": 44001, + "phase": 5, + "phasebonus": [ + "speed", + "10" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 50000 + }, + { + "a": "item", + "t": "10033", + "n": 10 + }, + { + "a": "item", + "t": "10032", + "n": 10 + } + ] + }, + { + "key": 24, + "hid": 44001, + "phase": 6, + "phasebonus": [ + "hppro", + "200" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 60000 + }, + { + "a": "item", + "t": "10033", + "n": 20 + }, + { + "a": "item", + "t": "10032", + "n": 20 + } + ] + } +] \ No newline at end of file diff --git a/cmd/robot/hero.go b/cmd/robot/hero.go index 862e42948..2ea33ac8a 100644 --- a/cmd/robot/hero.go +++ b/cmd/robot/hero.go @@ -24,7 +24,7 @@ var ( fmt.Printf("%d- %v\n", (i + 1), v) } }, - enabled: true, + // enabled: true, }, { mainType: string(comm.ModuleHero), subType: hero.HeroSubTypeInfo, diff --git a/cmd/robot/user.go b/cmd/robot/user.go index d50ed2fad..5905f2aaa 100644 --- a/cmd/robot/user.go +++ b/cmd/robot/user.go @@ -18,6 +18,16 @@ var user_builders = []*builder{ }, rsp: &pb.UserCreateRsp{}, enabled: true, + }, { + desc: "添加资源", + mainType: string(comm.ModuleUser), + subType: user.UserSubTypeAddRes, + req: &pb.UserAddResReq{ //设置请求参数 + ResType: comm.ResGold, + Count: 100, + }, + rsp: &pb.UserAddResResp{}, + enabled: true, }, } diff --git a/modules/compconfigure.go b/modules/compconfigure.go index 1a7e1db50..edbe2b02e 100644 --- a/modules/compconfigure.go +++ b/modules/compconfigure.go @@ -1,6 +1,7 @@ package modules import ( + "go_dreamfactory/lego/base" "go_dreamfactory/lego/core" "go_dreamfactory/lego/core/cbase" "go_dreamfactory/lego/sys/log" @@ -19,7 +20,9 @@ type MCompConfigure struct { //组件初始化接口 func (this *MCompConfigure) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { - this.ModuleCompBase.Init(service, module, comp, options) + err = this.ModuleCompBase.Init(service, module, comp, options) + this.S = service.(base.IRPCXService) + this.M = module.(IModule) err = this.LoadConfigure(game_global, cfg.NewGame_global) return } diff --git a/modules/dbservice/db_comp.go b/modules/dbservice/db_comp.go index 2b8dfca63..2fd0bed63 100644 --- a/modules/dbservice/db_comp.go +++ b/modules/dbservice/db_comp.go @@ -114,11 +114,12 @@ func (this *DB_Comp) Model_UpdateDBByLog(uid string) (err error) { continue } _key := data.D[0].(string) - _objKey := make([]string, 0) + + _obj := bson.M{} for _, v := range data.D[1].(bson.D) { - _objKey = append(_objKey, v.Value.(string)) + _obj[v.Key] = v.Value } - _, err = this.DB.DeleteMany(core.SqlTable(_key), bson.M{"_id": bson.M{"$in": _objKey}}, options.Delete()) + _, err = this.DB.DeleteMany(core.SqlTable(_key), _obj, options.Delete()) if err != nil { log.Errorf("delete %s db err:%v", core.SqlTable(_key), err) ErrorLogCount[data.ID]++ diff --git a/modules/hero/api.go b/modules/hero/api.go index 35fd4d2e6..70d57278c 100644 --- a/modules/hero/api.go +++ b/modules/hero/api.go @@ -23,6 +23,7 @@ const ( //消息回复的头名称 ResonanceReset = "resonancereset" // 共鸣重置 StrengthenUpSkill = "strengthenupskill" // 技能强化 StrengthenUpStar = "strengthensupstar" // 英雄升星 + Awaken = "awaken" // 英雄觉醒 ) //组件初始化接口 diff --git a/modules/hero/api_awaken.go b/modules/hero/api_awaken.go new file mode 100644 index 000000000..5193e2d51 --- /dev/null +++ b/modules/hero/api_awaken.go @@ -0,0 +1,121 @@ +package hero + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/lego/sys/log" + "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" + "strconv" +) + +//参数校验 +func (this *apiComp) AwakenCheck(session comm.IUserSession, req *pb.HeroAwakenReq) (result map[string]interface{}, code comm.ErrorCode) { + var ( + costRes map[string]int32 + ) + costRes = make(map[string]int32, 0) + if req.HeroObjID == "" { + code.Code = pb.ErrorCode_ReqParameterError + return + } + var ( + awakenData *cfg.Game_heroAwakenData + bCheckOk bool + ) + bCheckOk = true + + _hero, err := this.moduleHero.GetHero(session.GetUserId(), req.HeroObjID) + + if err != pb.ErrorCode_Success { + code.Code = pb.ErrorCode_HeroNoExist + return + } + AwakenConfig, err1 := this.moduleHero.configure.GetHeroAwakenConfig() + if err1 != nil { + code.Code = pb.ErrorCode_ConfigNoFound + return + } + for _, v := range AwakenConfig.GetDataMap() { + if v.Hid == _hero.HeroID && v.Phase == _hero.JuexingLv+1 { + awakenData = v + break + } + } + if awakenData == nil { + code.Code = pb.ErrorCode_ConfigNoFound + return + } + // 参数校验 + for _, v := range awakenData.Phaseneed { + if v.A == "attr" { // 消耗玩家身上资源 + curGold := this.user.QueryAttributeValue(session.GetUserId(), v.T) + if curGold < v.N { + bCheckOk = false + break + } + costRes[v.T] = v.N + } else if v.A == "item" { //消耗道具 + itemid, err := strconv.Atoi(v.T) + if err != nil { + curCount := this.moduleHero.items.QueryItemAmount(nil, session.GetUserId(), int32(itemid)) + if curCount < uint32(v.N) { + bCheckOk = false + break + } + } + } + } + if !bCheckOk { + code.Code = pb.ErrorCode_GoldNoEnough + return + } + result = map[string]interface{}{ + "awakenData": awakenData, + "heroObj": _hero, + "costRes": costRes, + } + return +} + +/// 英雄觉醒 +func (this *apiComp) Awaken(session comm.IUserSession, agrs map[string]interface{}, req *pb.HeroAwakenReq) (code pb.ErrorCode) { + + awakenData := agrs["awakenData"].(*cfg.Game_heroAwakenData) + _hero := agrs["heroObj"].(*pb.DBHero) + costRes := agrs["costRes"].(map[string]int32) + if _hero == nil || awakenData == nil { + code = pb.ErrorCode_HeroNoExist + return + } + defer func() { + if code == pb.ErrorCode_Success { + session.SendMsg(string(this.moduleHero.GetType()), StrengthenUplv, &pb.HeroAwakenResp{Hero: _hero}) + } + }() + + for _, v := range awakenData.Phaseneed { + if v.A == "attr" { // 消耗玩家身上资源 + if data, ok := costRes[v.T]; ok { + code = this.user.AddAttributeValue(session.GetUserId(), v.T, data) + if code != pb.ErrorCode_Success { + return + } + } + + } else if v.A == "item" { //消耗道具 + itemid, err := strconv.Atoi(v.T) + if err != nil { + code = this.moduleHero.items.AddItem(nil, session.GetUserId(), int32(itemid), -v.N) + if code != pb.ErrorCode_Success { + return + } + } + } + } + + err := this.moduleHero.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化 + if err != nil { + log.Errorf("PushHeroProperty err!") + } + return +} diff --git a/modules/hero/api_resonance.go b/modules/hero/api_resonance.go index 088cb5534..5ee8af76e 100644 --- a/modules/hero/api_resonance.go +++ b/modules/hero/api_resonance.go @@ -107,7 +107,7 @@ func (this *apiComp) Resonance(session comm.IUserSession, agrs map[string]interf if v.A == "attr" { // 查询玩家身上资源是否满足 value := this.moduleHero.api.user.QueryAttributeValue(session.GetUserId(), v.T) if value >= v.N { // 直接删除财富 - code = this.user.AddAttributeValue(session.GetUserId(), v.T, -v.N) // 扣除资源 + code = this.user.AddAttributeValue(session.GetUserId(), v.T, value-v.N) // 扣除资源 break } else { code = pb.ErrorCode_ResNoEnough diff --git a/modules/hero/api_starUp.go b/modules/hero/api_starUp.go index 4a6e65f1b..94dcc3fd8 100644 --- a/modules/hero/api_starUp.go +++ b/modules/hero/api_starUp.go @@ -97,6 +97,7 @@ func (this *apiComp) StrengthenUpStarCheck(session comm.IUserSession, req *pb.He result = map[string]interface{}{ "costGold": target.Gold, "heroObj": tagHero, + "curGold": curGold, } return } @@ -106,6 +107,7 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, agrs map[string costGold := agrs["costGold"].(int32) _hero := agrs["heroObj"].(*pb.DBHero) + curGold := agrs["curGold"].(int32) if _hero == nil { code = pb.ErrorCode_HeroNoExist return @@ -117,7 +119,7 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, agrs map[string }() // 消耗道具 - code = this.user.AddAttributeValue(session.GetUserId(), "gold", -costGold) // 减少金币 + code = this.user.AddAttributeValue(session.GetUserId(), "gold", curGold-costGold) // 减少金币 if code != pb.ErrorCode_Success { log.Errorf("cost gold failed ,count = %d", costGold) code = pb.ErrorCode_GoldNoEnough diff --git a/modules/hero/api_strengthen.go b/modules/hero/api_strengthen.go index 1c7e08c3c..49482e332 100644 --- a/modules/hero/api_strengthen.go +++ b/modules/hero/api_strengthen.go @@ -13,23 +13,24 @@ func (this *apiComp) StrengthenUplvCheck(session comm.IUserSession, req *pb.Hero return } var ( - curLv int32 - curExp int32 // 当前英雄的经验 - costGold int32 // 当前需要消耗金币的数量 - addExp int32 // 需要增加的经验 - curGold int32 - //atn = map[string]interface{}{} + curLv int32 + curExp int32 // 当前英雄的经验 + costRes int32 // 当前需要消资源的数量 + addExp int32 // 需要增加的经验 + curGold int32 + atn = map[string]interface{}{} ) + atn = make(map[string]interface{}, 0) _hero, err := this.moduleHero.GetHero(session.GetUserId(), req.HeroObjID) // 校验升级的对象是否存在 - if err != 0 { + if err != pb.ErrorCode_Success { code.Code = pb.ErrorCode_HeroNoExist return } _expHero, err := this.moduleHero.GetHero(session.GetUserId(), req.ExpCardID) // 校验需要消耗经验卡牌的对象是否存在 - if err != 0 { + if err != pb.ErrorCode_Success { code.Code = pb.ErrorCode_HeroNoExist return } @@ -39,7 +40,7 @@ func (this *apiComp) StrengthenUplvCheck(session comm.IUserSession, req *pb.Hero } curLv = _hero.Lv curExp = _hero.Exp // 当前英雄的经验 - + addExp = 1000 // 查询 本次消耗会获得多少经验 expConf := this.moduleHero.configure.GetHeroExp(_expHero.HeroID) if expConf != nil { @@ -72,6 +73,7 @@ func (this *apiComp) StrengthenUplvCheck(session comm.IUserSession, req *pb.Hero curExp = _data.Heroexp[0].N break } + if _data.Heroexp[0].N > curExp { // 经验不够升级则不能执行升级操作 break } else { // 升级操作 @@ -82,13 +84,18 @@ func (this *apiComp) StrengthenUplvCheck(session comm.IUserSession, req *pb.Hero curLv -= 1 break } - costGold += _data.Gold[0].N // 统计 升级需要消耗金币的数量 + costRes += _data.Gold[0].N } } + for _, v := range _data.Gold { + atn["a"] = v.A + atn["t"] = v.T + atn["n"] = v.N + } // 金币消耗判断 - curGold = this.user.QueryAttributeValue(session.GetUserId(), "gold") - if curGold < costGold { - // code.Code = pb.ErrorCode_GoldNoEnough + curGold = this.user.QueryAttributeValue(session.GetUserId(), atn["t"].(string)) + if curGold < costRes { + code.Code = pb.ErrorCode_GoldNoEnough } } else { code.Code = pb.ErrorCode_HeroNoExist @@ -97,12 +104,13 @@ func (this *apiComp) StrengthenUplvCheck(session comm.IUserSession, req *pb.Hero // 校验金币消耗 result = map[string]interface{}{ - "costGold": costGold, - "curExp": curExp, - "curLv": curLv, - "addExp": addExp, - "heroObj": _hero, - //"atn": atn, + "costRes": costRes, + "curExp": curExp, + "curLv": curLv, + "addExp": addExp, + "heroObj": _hero, + "curRes": curGold, + "atn": atn, } return } @@ -110,18 +118,21 @@ func (this *apiComp) StrengthenUplvCheck(session comm.IUserSession, req *pb.Hero /// 英雄升级 func (this *apiComp) StrengthenUplv(session comm.IUserSession, agrs map[string]interface{}, req *pb.HeroStrengthenUplvReq) (code pb.ErrorCode) { var ( - curLv int32 - curExp int32 // 当前英雄的经验 - costGold int32 // 当前需要消耗金币的数量 - addExp int32 // 需要增加的经验 - //atn = map[string]interface{}{} + curLv int32 + curExp int32 // 当前英雄的经验 + costRes int32 // 当前需要消耗金币的数量 + addExp int32 // 需要增加的经验 + curRes int32 + atn = map[string]interface{}{} ) - costGold = agrs["costGold"].(int32) + costRes = agrs["costRes"].(int32) curLv = agrs["curLv"].(int32) curExp = agrs["curExp"].(int32) addExp = agrs["addExp"].(int32) _hero := agrs["heroObj"].(*pb.DBHero) + curRes = agrs["curRes"].(int32) + atn = agrs["atn"].(map[string]interface{}) if _hero == nil { code = pb.ErrorCode_HeroNoExist return @@ -131,27 +142,24 @@ func (this *apiComp) StrengthenUplv(session comm.IUserSession, agrs map[string]i session.SendMsg(string(this.moduleHero.GetType()), StrengthenUplv, &pb.HeroStrengthenUplvResp{Hero: _hero}) } }() - log.Debugf("升级后当前等级: %d,经验: %d,需要消耗的金币: %d,增加的经验: %d", curLv, curExp, costGold, addExp) + log.Debugf("升级后当前等级: %d,经验: %d,需要消耗的金币: %d,增加的经验: %d", curLv, curExp, costRes, addExp) // 执行升级逻辑 code = this.moduleHero.AddCardExp(session.GetUserId(), req.HeroObjID, addExp) // 加经验 if code != pb.ErrorCode_Success { return } // 消耗道具 - code = this.user.AddAttributeValue(session.GetUserId(), "gold", -costGold) // 减少金币 + code = this.user.AddAttributeValue(session.GetUserId(), atn["t"].(string), int32(curRes-costRes)) // 减少金币 if code != pb.ErrorCode_Success { return } // 删除经验卡 - err := this.moduleHero.modelHero.DelListlds(session.GetUserId(), req.ExpCardID) + err := this.moduleHero.modelHero.consumeOneHeroCard(session.GetUserId(), req.ExpCardID, req.Amount) if err != nil { log.Errorf("delete err failed err:%T!", err) return } - //code = this.moduleHero.modelHero.moduleHero.DelCard(req.ExpCardID, req.Amount) - if code != pb.ErrorCode_Success { - return - } + err = this.moduleHero.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化 if err != nil { log.Errorf("PushHeroProperty err!") diff --git a/modules/hero/configure_comp.go b/modules/hero/configure_comp.go index 78d31eddf..e5f8a2310 100644 --- a/modules/hero/configure_comp.go +++ b/modules/hero/configure_comp.go @@ -6,7 +6,6 @@ import ( cfg "go_dreamfactory/sys/configure/structs" "go_dreamfactory/lego/core" - "go_dreamfactory/lego/sys/log" ) const ( @@ -20,6 +19,7 @@ const ( game_skillatk = "game_skillatk.json" // 英雄技能 hero_resonance = "game_heroresonance.json" // 英雄共鸣 hero_comatn = "game_comatn.json" // 英雄共鸣重置 + hero_awaken = "game_heroawaken.json" // 英雄觉醒 ) ///配置管理组件 @@ -42,11 +42,9 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp game_skillatk: cfg.NewGame_skillAtk, hero_resonance: cfg.NewGame_heroResonance, hero_comatn: cfg.NewGame_comAtn, + hero_awaken: cfg.NewGame_heroAwaken, }) - _data, err := this.GetHeroResonanceRestConfig() - if err == nil { - log.Debugf("%v", _data) - } + return } @@ -331,3 +329,19 @@ func (this *configureComp) GetHeroResonanceRestConfig() (data *cfg.Game_comAtnDa return } +func (this *configureComp) GetHeroAwakenConfig() (configure *cfg.Game_heroAwaken, err error) { + var ( + v interface{} + ok bool + ) + if v, err = this.GetConfigure(hero_awaken); err == nil { + if configure, ok = v.(*cfg.Game_heroAwaken); !ok { + err = fmt.Errorf("%T no is *cfg.Game_heroResonance", v) + return + } + } else { + err = fmt.Errorf("%T no is *cfg.Game_hero", v) + } + + return +} diff --git a/modules/user/api.go b/modules/user/api.go index 324a00d36..618e82436 100644 --- a/modules/user/api.go +++ b/modules/user/api.go @@ -12,6 +12,7 @@ const ( UserSubTypeLogin = "login" UserSubTypeLogout = "logout" UserSubTypeCreate = "create" + UserSubTypeAddRes = "addres" //添加用户资源 金币、宝石等 ) type apiComp struct { diff --git a/modules/user/api_create.go b/modules/user/api_create.go index f05962790..da2d2da96 100644 --- a/modules/user/api_create.go +++ b/modules/user/api_create.go @@ -31,14 +31,15 @@ func (this *apiComp) Create(session comm.IUserSession, result map[string]interfa if self, ok := result["self"]; ok { v := self.(*pb.DBUser) - if v.Name != "" { + if v.Created { code = pb.ErrorCode_RoleCreated return } } update := map[string]interface{}{ - "name": req.NickName, + "name": req.NickName, + "created": true, } //设置初始金币 diff --git a/modules/user/api_res.go b/modules/user/api_res.go new file mode 100644 index 000000000..4099b6f80 --- /dev/null +++ b/modules/user/api_res.go @@ -0,0 +1,49 @@ +package user + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" +) + +func (this *apiComp) AddResCheck(session comm.IUserSession, req *pb.UserAddResReq) (result map[string]interface{}, code comm.ErrorCode) { + result = make(map[string]interface{}) + user := this.module.modelUser.getUser(session.GetUserId()) + if user == nil { + code = comm.ErrorCode{Code: pb.ErrorCode_UserSessionNobeing} + return + } + result["user"] = user + return +} + +func (this *apiComp) AddRes(session comm.IUserSession, result map[string]interface{}, req *pb.UserAddResReq) (code pb.ErrorCode) { + rsp := &pb.UserAddResResp{} + + defer func() { + if err := session.SendMsg(string(this.module.GetType()), UserSubTypeAddRes, rsp); err != nil { + code = pb.ErrorCode_SystemError + return + } + }() + + if u, ok := result["user"]; ok { + user := u.(*pb.DBUser) + count := req.Count + + switch req.ResType { + case comm.ResGold: + count += user.Gold + case comm.ResExp: + count += user.Exp + } + code = this.module.AddAttributeValue(session.GetUserId(), req.ResType, count) + if code != pb.ErrorCode_Success { + return + } + + rsp.ResType = req.ResType + rsp.Count = count + } + + return +} diff --git a/modules/user/configure.go b/modules/user/configure.go index d895376ef..cc8ac1c0b 100644 --- a/modules/user/configure.go +++ b/modules/user/configure.go @@ -11,6 +11,6 @@ type configureComp struct { //组件初始化接口 func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { - err = this.MCompConfigure.Init(service, module, comp, options) + err = this.ModuleCompBase.Init(service, module, comp, options) return } diff --git a/pb/hero_msg.pb.go b/pb/hero_msg.pb.go index 00d79e5d1..ff03bec56 100644 --- a/pb/hero_msg.pb.go +++ b/pb/hero_msg.pb.go @@ -981,17 +981,16 @@ func (x *HeroResonanceUseEnergyResp) GetHero() *DBHero { } // 觉醒 -type HeroJuexingReq struct { +type HeroAwakenReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - HeroObjID string `protobuf:"bytes,1,opt,name=heroObjID,proto3" json:"heroObjID"` // 英雄对象ID - CostItmes *ItemData `protobuf:"bytes,2,opt,name=costItmes,proto3" json:"costItmes"` // 觉醒消耗待定 + HeroObjID string `protobuf:"bytes,1,opt,name=heroObjID,proto3" json:"heroObjID"` // 英雄对象ID } -func (x *HeroJuexingReq) Reset() { - *x = HeroJuexingReq{} +func (x *HeroAwakenReq) Reset() { + *x = HeroAwakenReq{} if protoimpl.UnsafeEnabled { mi := &file_hero_hero_msg_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -999,13 +998,13 @@ func (x *HeroJuexingReq) Reset() { } } -func (x *HeroJuexingReq) String() string { +func (x *HeroAwakenReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*HeroJuexingReq) ProtoMessage() {} +func (*HeroAwakenReq) ProtoMessage() {} -func (x *HeroJuexingReq) ProtoReflect() protoreflect.Message { +func (x *HeroAwakenReq) ProtoReflect() protoreflect.Message { mi := &file_hero_hero_msg_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1017,27 +1016,20 @@ func (x *HeroJuexingReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use HeroJuexingReq.ProtoReflect.Descriptor instead. -func (*HeroJuexingReq) Descriptor() ([]byte, []int) { +// Deprecated: Use HeroAwakenReq.ProtoReflect.Descriptor instead. +func (*HeroAwakenReq) Descriptor() ([]byte, []int) { return file_hero_hero_msg_proto_rawDescGZIP(), []int{18} } -func (x *HeroJuexingReq) GetHeroObjID() string { +func (x *HeroAwakenReq) GetHeroObjID() string { if x != nil { return x.HeroObjID } return "" } -func (x *HeroJuexingReq) GetCostItmes() *ItemData { - if x != nil { - return x.CostItmes - } - return nil -} - // 觉醒返回 -type HeroJuexingResp struct { +type HeroAwakenResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -1045,8 +1037,8 @@ type HeroJuexingResp struct { Hero *DBHero `protobuf:"bytes,1,opt,name=hero,proto3" json:"hero"` // 英雄对象 } -func (x *HeroJuexingResp) Reset() { - *x = HeroJuexingResp{} +func (x *HeroAwakenResp) Reset() { + *x = HeroAwakenResp{} if protoimpl.UnsafeEnabled { mi := &file_hero_hero_msg_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1054,13 +1046,13 @@ func (x *HeroJuexingResp) Reset() { } } -func (x *HeroJuexingResp) String() string { +func (x *HeroAwakenResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*HeroJuexingResp) ProtoMessage() {} +func (*HeroAwakenResp) ProtoMessage() {} -func (x *HeroJuexingResp) ProtoReflect() protoreflect.Message { +func (x *HeroAwakenResp) ProtoReflect() protoreflect.Message { mi := &file_hero_hero_msg_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1072,12 +1064,12 @@ func (x *HeroJuexingResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use HeroJuexingResp.ProtoReflect.Descriptor instead. -func (*HeroJuexingResp) Descriptor() ([]byte, []int) { +// Deprecated: Use HeroAwakenResp.ProtoReflect.Descriptor instead. +func (*HeroAwakenResp) Descriptor() ([]byte, []int) { return file_hero_hero_msg_proto_rawDescGZIP(), []int{19} } -func (x *HeroJuexingResp) GetHero() *DBHero { +func (x *HeroAwakenResp) GetHero() *DBHero { if x != nil { return x.Hero } @@ -1283,87 +1275,87 @@ var file_hero_hero_msg_proto_rawDesc = []byte{ 0x65, 0x72, 0x6f, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x43, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x72, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x12, 0x29, 0x0a, 0x08, 0x68, 0x65, 0x72, 0x6f, 0x52, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0d, 0x2e, 0x43, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x72, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, - 0x08, 0x68, 0x65, 0x72, 0x6f, 0x52, 0x61, 0x63, 0x65, 0x22, 0x37, 0x0a, 0x18, 0x48, 0x65, 0x72, - 0x6f, 0x53, 0x74, 0x72, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x65, 0x6e, 0x55, 0x70, 0x53, 0x74, 0x61, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1b, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04, 0x68, 0x65, - 0x72, 0x6f, 0x22, 0x5a, 0x0a, 0x18, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x74, 0x72, 0x65, 0x6e, 0x67, - 0x74, 0x68, 0x65, 0x6e, 0x55, 0x70, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 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, 0x20, 0x0a, 0x0b, - 0x63, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x72, 0x64, 0x4f, 0x62, 0x6a, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x72, 0x64, 0x4f, 0x62, 0x6a, 0x22, 0x38, - 0x0a, 0x19, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x74, 0x72, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x65, 0x6e, - 0x55, 0x70, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1b, 0x0a, 0x04, 0x68, - 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x48, 0x65, - 0x72, 0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, 0x66, 0x0a, 0x10, 0x48, 0x65, 0x72, 0x6f, - 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x6e, 0x63, 0x65, 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, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x22, 0x71, 0x0a, 0x11, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x6e, 0x63, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1b, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 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, 0x27, 0x0a, 0x0a, 0x75, 0x70, - 0x53, 0x74, 0x61, 0x72, 0x43, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, - 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x0a, 0x75, 0x70, 0x53, 0x74, 0x61, 0x72, 0x43, - 0x61, 0x72, 0x64, 0x22, 0x35, 0x0a, 0x15, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x6e, - 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x65, 0x74, 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, 0x4d, 0x0a, 0x16, 0x48, 0x65, - 0x72, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x65, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x1b, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 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, 0x71, 0x0a, 0x19, 0x48, 0x65, 0x72, - 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x55, 0x73, 0x65, 0x45, 0x6e, 0x65, - 0x72, 0x67, 0x79, 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, 0x39, 0x0a, 0x1a, - 0x48, 0x65, 0x72, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x55, 0x73, 0x65, - 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1b, 0x0a, 0x04, 0x68, 0x65, - 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, - 0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, 0x57, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x4a, - 0x75, 0x65, 0x78, 0x69, 0x6e, 0x67, 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, 0x27, 0x0a, 0x09, 0x63, 0x6f, 0x73, 0x74, 0x49, - 0x74, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x49, 0x74, 0x65, - 0x6d, 0x44, 0x61, 0x74, 0x61, 0x52, 0x09, 0x63, 0x6f, 0x73, 0x74, 0x49, 0x74, 0x6d, 0x65, 0x73, - 0x22, 0x2e, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, 0x4a, 0x75, 0x65, 0x78, 0x69, 0x6e, 0x67, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x1b, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, - 0x22, 0x29, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x68, 0x6f, 0x75, 0x6b, 0x61, 0x52, 0x65, - 0x71, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x05, 0x52, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x73, 0x22, 0x31, 0x0a, 0x0e, 0x48, - 0x65, 0x72, 0x6f, 0x43, 0x68, 0x6f, 0x75, 0x6b, 0x61, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, - 0x06, 0x68, 0x65, 0x72, 0x6f, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x07, 0x2e, - 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x65, 0x73, 0x22, 0x9e, + 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, 0x3a, 0x0a, 0x18, + 0x48, 0x65, 0x72, 0x6f, 0x53, 0x74, 0x72, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x65, 0x6e, 0x55, 0x70, + 0x53, 0x74, 0x61, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x48, 0x65, + 0x72, 0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, 0x5a, 0x0a, 0x18, 0x48, 0x65, 0x72, 0x6f, + 0x53, 0x74, 0x72, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x65, 0x6e, 0x55, 0x70, 0x53, 0x6b, 0x69, 0x6c, + 0x6c, 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, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x72, 0x64, 0x4f, 0x62, + 0x6a, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x72, + 0x64, 0x4f, 0x62, 0x6a, 0x22, 0x3b, 0x0a, 0x19, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x74, 0x72, 0x65, + 0x6e, 0x67, 0x74, 0x68, 0x65, 0x6e, 0x55, 0x70, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, + 0x6f, 0x22, 0x66, 0x0a, 0x10, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x6e, + 0x63, 0x65, 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, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x77, 0x0a, 0x11, 0x48, 0x65, 0x72, + 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, + 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, + 0x62, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 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, 0x2a, 0x0a, 0x0a, 0x75, 0x70, 0x53, 0x74, 0x61, 0x72, + 0x43, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, + 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x0a, 0x75, 0x70, 0x53, 0x74, 0x61, 0x72, 0x43, 0x61, + 0x72, 0x64, 0x22, 0x35, 0x0a, 0x15, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, + 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x65, 0x74, 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, 0x50, 0x0a, 0x16, 0x48, 0x65, 0x72, + 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 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, 0x71, 0x0a, 0x19, 0x48, + 0x65, 0x72, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x55, 0x73, 0x65, 0x45, + 0x6e, 0x65, 0x72, 0x67, 0x79, 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, 0x3c, + 0x0a, 0x1a, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x55, + 0x73, 0x65, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, + 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, + 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, 0x2d, 0x0a, 0x0d, + 0x48, 0x65, 0x72, 0x6f, 0x41, 0x77, 0x61, 0x6b, 0x65, 0x6e, 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, 0x30, 0x0a, 0x0e, 0x48, + 0x65, 0x72, 0x6f, 0x41, 0x77, 0x61, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, + 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, + 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, 0x29, 0x0a, + 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x68, 0x6f, 0x75, 0x6b, 0x61, 0x52, 0x65, 0x71, 0x12, 0x18, + 0x0a, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, + 0x07, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x73, 0x22, 0x34, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, + 0x43, 0x68, 0x6f, 0x75, 0x6b, 0x61, 0x52, 0x65, 0x73, 0x70, 0x12, 0x22, 0x0a, 0x06, 0x68, 0x65, + 0x72, 0x6f, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, + 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x65, 0x73, 0x22, 0xa4, 0x02, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, - 0x72, 0x74, 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x48, 0x65, 0x72, 0x6f, - 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, - 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, - 0x12, 0x40, 0x0a, 0x0b, 0x61, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x48, 0x65, 0x72, 0x6f, 0x50, 0x72, 0x6f, 0x70, - 0x65, 0x72, 0x74, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x1a, 0x3b, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, - 0x3e, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, - 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x12, 0x3a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x48, + 0x65, 0x72, 0x6f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x79, 0x12, 0x43, 0x0a, 0x0b, 0x61, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, + 0x74, 0x79, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x65, + 0x72, 0x6f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, + 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x64, 0x64, + 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x1a, 0x3b, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1380,55 +1372,54 @@ func file_hero_hero_msg_proto_rawDescGZIP() []byte { var file_hero_hero_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 25) var file_hero_hero_msg_proto_goTypes = []interface{}{ - (*HeroInfoReq)(nil), // 0: HeroInfoReq - (*HeroInfoRsp)(nil), // 1: HeroInfoRsp - (*HeroListReq)(nil), // 2: HeroListReq - (*HeroListRsp)(nil), // 3: HeroListRsp - (*ItemData)(nil), // 4: ItemData - (*HeroStrengthenUplvReq)(nil), // 5: HeroStrengthenUplvReq - (*HeroStrengthenUplvResp)(nil), // 6: HeroStrengthenUplvResp - (*CostCardData)(nil), // 7: CostCardData - (*HeroStrengthenUpStarReq)(nil), // 8: HeroStrengthenUpStarReq - (*HeroStrengthenUpStarResp)(nil), // 9: HeroStrengthenUpStarResp - (*HeroStrengthenUpSkillReq)(nil), // 10: HeroStrengthenUpSkillReq - (*HeroStrengthenUpSkillResp)(nil), // 11: HeroStrengthenUpSkillResp - (*HeroResonanceReq)(nil), // 12: HeroResonanceReq - (*HeroResonanceResp)(nil), // 13: HeroResonanceResp - (*HeroResonanceResetReq)(nil), // 14: HeroResonanceResetReq - (*HeroResonanceResetResp)(nil), // 15: HeroResonanceResetResp - (*HeroResonanceUseEnergyReq)(nil), // 16: HeroResonanceUseEnergyReq - (*HeroResonanceUseEnergyResp)(nil), // 17: HeroResonanceUseEnergyResp - (*HeroJuexingReq)(nil), // 18: HeroJuexingReq - (*HeroJuexingResp)(nil), // 19: HeroJuexingResp - (*HeroChoukaReq)(nil), // 20: HeroChoukaReq - (*HeroChoukaResp)(nil), // 21: HeroChoukaResp - (*HeroProperty)(nil), // 22: HeroProperty - nil, // 23: HeroProperty.PropertyEntry - nil, // 24: HeroProperty.AddPropertyEntry - (*DBHero)(nil), // 25: DBHero + (*HeroInfoReq)(nil), // 0: pb.HeroInfoReq + (*HeroInfoRsp)(nil), // 1: pb.HeroInfoRsp + (*HeroListReq)(nil), // 2: pb.HeroListReq + (*HeroListRsp)(nil), // 3: pb.HeroListRsp + (*ItemData)(nil), // 4: pb.ItemData + (*HeroStrengthenUplvReq)(nil), // 5: pb.HeroStrengthenUplvReq + (*HeroStrengthenUplvResp)(nil), // 6: pb.HeroStrengthenUplvResp + (*CostCardData)(nil), // 7: pb.CostCardData + (*HeroStrengthenUpStarReq)(nil), // 8: pb.HeroStrengthenUpStarReq + (*HeroStrengthenUpStarResp)(nil), // 9: pb.HeroStrengthenUpStarResp + (*HeroStrengthenUpSkillReq)(nil), // 10: pb.HeroStrengthenUpSkillReq + (*HeroStrengthenUpSkillResp)(nil), // 11: pb.HeroStrengthenUpSkillResp + (*HeroResonanceReq)(nil), // 12: pb.HeroResonanceReq + (*HeroResonanceResp)(nil), // 13: pb.HeroResonanceResp + (*HeroResonanceResetReq)(nil), // 14: pb.HeroResonanceResetReq + (*HeroResonanceResetResp)(nil), // 15: pb.HeroResonanceResetResp + (*HeroResonanceUseEnergyReq)(nil), // 16: pb.HeroResonanceUseEnergyReq + (*HeroResonanceUseEnergyResp)(nil), // 17: pb.HeroResonanceUseEnergyResp + (*HeroAwakenReq)(nil), // 18: pb.HeroAwakenReq + (*HeroAwakenResp)(nil), // 19: pb.HeroAwakenResp + (*HeroChoukaReq)(nil), // 20: pb.HeroChoukaReq + (*HeroChoukaResp)(nil), // 21: pb.HeroChoukaResp + (*HeroProperty)(nil), // 22: pb.HeroProperty + nil, // 23: pb.HeroProperty.PropertyEntry + nil, // 24: pb.HeroProperty.AddPropertyEntry + (*DBHero)(nil), // 25: pb.DBHero } var file_hero_hero_msg_proto_depIdxs = []int32{ - 25, // 0: HeroInfoRsp.base:type_name -> DBHero - 25, // 1: HeroListRsp.list:type_name -> DBHero - 25, // 2: HeroStrengthenUplvResp.hero:type_name -> DBHero - 7, // 3: HeroStrengthenUpStarReq.hero:type_name -> CostCardData - 7, // 4: HeroStrengthenUpStarReq.heroRace:type_name -> CostCardData - 25, // 5: HeroStrengthenUpStarResp.hero:type_name -> DBHero - 25, // 6: HeroStrengthenUpSkillResp.hero:type_name -> DBHero - 25, // 7: HeroResonanceResp.hero:type_name -> DBHero - 25, // 8: HeroResonanceResp.upStarCard:type_name -> DBHero - 25, // 9: HeroResonanceResetResp.hero:type_name -> DBHero - 25, // 10: HeroResonanceUseEnergyResp.hero:type_name -> DBHero - 4, // 11: HeroJuexingReq.costItmes:type_name -> ItemData - 25, // 12: HeroJuexingResp.hero:type_name -> DBHero - 25, // 13: HeroChoukaResp.heroes:type_name -> DBHero - 23, // 14: HeroProperty.property:type_name -> HeroProperty.PropertyEntry - 24, // 15: HeroProperty.addProperty:type_name -> HeroProperty.AddPropertyEntry - 16, // [16:16] is the sub-list for method output_type - 16, // [16:16] is the sub-list for method input_type - 16, // [16:16] is the sub-list for extension type_name - 16, // [16:16] is the sub-list for extension extendee - 0, // [0:16] is the sub-list for field type_name + 25, // 0: pb.HeroInfoRsp.base:type_name -> pb.DBHero + 25, // 1: pb.HeroListRsp.list:type_name -> pb.DBHero + 25, // 2: pb.HeroStrengthenUplvResp.hero:type_name -> pb.DBHero + 7, // 3: pb.HeroStrengthenUpStarReq.hero:type_name -> pb.CostCardData + 7, // 4: pb.HeroStrengthenUpStarReq.heroRace:type_name -> pb.CostCardData + 25, // 5: pb.HeroStrengthenUpStarResp.hero:type_name -> pb.DBHero + 25, // 6: pb.HeroStrengthenUpSkillResp.hero:type_name -> pb.DBHero + 25, // 7: pb.HeroResonanceResp.hero:type_name -> pb.DBHero + 25, // 8: pb.HeroResonanceResp.upStarCard:type_name -> pb.DBHero + 25, // 9: pb.HeroResonanceResetResp.hero:type_name -> pb.DBHero + 25, // 10: pb.HeroResonanceUseEnergyResp.hero:type_name -> pb.DBHero + 25, // 11: pb.HeroAwakenResp.hero:type_name -> pb.DBHero + 25, // 12: pb.HeroChoukaResp.heroes:type_name -> pb.DBHero + 23, // 13: pb.HeroProperty.property:type_name -> pb.HeroProperty.PropertyEntry + 24, // 14: pb.HeroProperty.addProperty:type_name -> pb.HeroProperty.AddPropertyEntry + 15, // [15:15] is the sub-list for method output_type + 15, // [15:15] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name } func init() { file_hero_hero_msg_proto_init() } @@ -1655,7 +1646,7 @@ func file_hero_hero_msg_proto_init() { } } file_hero_hero_msg_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HeroJuexingReq); i { + switch v := v.(*HeroAwakenReq); i { case 0: return &v.state case 1: @@ -1667,7 +1658,7 @@ func file_hero_hero_msg_proto_init() { } } file_hero_hero_msg_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HeroJuexingResp); i { + switch v := v.(*HeroAwakenResp); i { case 0: return &v.state case 1: diff --git a/pb/proto/hero/hero_msg.proto b/pb/proto/hero/hero_msg.proto index b44c77900..be963e6ee 100644 --- a/pb/proto/hero/hero_msg.proto +++ b/pb/proto/hero/hero_msg.proto @@ -96,13 +96,12 @@ message HeroResonanceUseEnergyResp { } // 觉醒 -message HeroJuexingReq { +message HeroAwakenReq { string heroObjID = 1; // 英雄对象ID - ItemData costItmes = 2; // 觉醒消耗待定 } // 觉醒返回 -message HeroJuexingResp { +message HeroAwakenResp { DBHero hero = 1; // 英雄对象 } diff --git a/pb/proto/user/user_db.proto b/pb/proto/user/user_db.proto index 9833e2cb9..59afbbc7b 100644 --- a/pb/proto/user/user_db.proto +++ b/pb/proto/user/user_db.proto @@ -23,4 +23,5 @@ message DBUser { int32 avatar = 12; //@go_tags(`bson:"avatar"`) 头像 int32 gold = 13; //@go_tags(`bson:"gold"`) 金币 int32 exp = 14; //@go_tags(`bson:"exp"`) 经验 + bool created = 15; //@go_tags(`bson:"created"`) 创角 } \ No newline at end of file diff --git a/pb/proto/user/user_msg.proto b/pb/proto/user/user_msg.proto index 3f57901d9..791486aae 100644 --- a/pb/proto/user/user_msg.proto +++ b/pb/proto/user/user_msg.proto @@ -28,4 +28,15 @@ message UserCreateReq { string NickName = 1; //昵称 } -message UserCreateRsp {} \ No newline at end of file +message UserCreateRsp {} + +//添加用户资源 +message UserAddResReq { + string resType = 1; //资源类型 + int32 count = 2; //资源数量 +} + +message UserAddResResp { + string resType = 1; //资源类型 + int32 count = 2; //资源数量 +} diff --git a/pb/user_db.pb.go b/pb/user_db.pb.go index f3214d987..4424d5ddb 100644 --- a/pb/user_db.pb.go +++ b/pb/user_db.pb.go @@ -102,6 +102,7 @@ type DBUser struct { Avatar int32 `protobuf:"varint,12,opt,name=avatar,proto3" json:"avatar" bson:"avatar"` //头像 Gold int32 `protobuf:"varint,13,opt,name=gold,proto3" json:"gold" bson:"gold"` //金币 Exp int32 `protobuf:"varint,14,opt,name=exp,proto3" json:"exp" bson:"exp"` //经验 + Created bool `protobuf:"varint,15,opt,name=created,proto3" json:"created" bson:"created"` //创角 } func (x *DBUser) Reset() { @@ -234,6 +235,13 @@ func (x *DBUser) GetExp() int32 { return 0 } +func (x *DBUser) GetCreated() bool { + if x != nil { + return x.Created + } + return false +} + var File_user_user_db_proto protoreflect.FileDescriptor var file_user_user_db_proto_rawDesc = []byte{ @@ -244,7 +252,7 @@ var file_user_user_db_proto_rawDesc = []byte{ 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x47, 0x61, 0x74, - 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x22, 0xd0, 0x02, + 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x22, 0xea, 0x02, 0x0a, 0x06, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, @@ -266,7 +274,9 @@ var file_user_user_db_proto_rawDesc = []byte{ 0x28, 0x05, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x70, - 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x0f, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, + 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/user_msg.pb.go b/pb/user_msg.pb.go index 8462c6ff1..ddaa8ce3a 100644 --- a/pb/user_msg.pb.go +++ b/pb/user_msg.pb.go @@ -366,6 +366,117 @@ func (*UserCreateRsp) Descriptor() ([]byte, []int) { return file_user_user_msg_proto_rawDescGZIP(), []int{6} } +//添加用户资源 +type UserAddResReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResType string `protobuf:"bytes,1,opt,name=resType,proto3" json:"resType"` //资源类型 + Count int32 `protobuf:"varint,2,opt,name=count,proto3" json:"count"` //资源数量 +} + +func (x *UserAddResReq) Reset() { + *x = UserAddResReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_msg_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserAddResReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserAddResReq) ProtoMessage() {} + +func (x *UserAddResReq) ProtoReflect() protoreflect.Message { + mi := &file_user_user_msg_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserAddResReq.ProtoReflect.Descriptor instead. +func (*UserAddResReq) Descriptor() ([]byte, []int) { + return file_user_user_msg_proto_rawDescGZIP(), []int{7} +} + +func (x *UserAddResReq) GetResType() string { + if x != nil { + return x.ResType + } + return "" +} + +func (x *UserAddResReq) GetCount() int32 { + if x != nil { + return x.Count + } + return 0 +} + +type UserAddResResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResType string `protobuf:"bytes,1,opt,name=resType,proto3" json:"resType"` //资源类型 + Count int32 `protobuf:"varint,2,opt,name=count,proto3" json:"count"` //资源数量 +} + +func (x *UserAddResResp) Reset() { + *x = UserAddResResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_msg_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserAddResResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserAddResResp) ProtoMessage() {} + +func (x *UserAddResResp) ProtoReflect() protoreflect.Message { + mi := &file_user_user_msg_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserAddResResp.ProtoReflect.Descriptor instead. +func (*UserAddResResp) Descriptor() ([]byte, []int) { + return file_user_user_msg_proto_rawDescGZIP(), []int{8} +} + +func (x *UserAddResResp) GetResType() string { + if x != nil { + return x.ResType + } + return "" +} + +func (x *UserAddResResp) GetCount() int32 { + if x != nil { + return x.Count + } + return 0 +} + var File_user_user_msg_proto protoreflect.FileDescriptor var file_user_user_msg_proto_rawDesc = []byte{ @@ -394,8 +505,16 @@ var file_user_user_msg_proto_rawDesc = []byte{ 0x2b, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x4e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x0f, 0x0a, 0x0d, - 0x55, 0x73, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x73, 0x70, 0x42, 0x06, 0x5a, - 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x55, 0x73, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x73, 0x70, 0x22, 0x3f, 0x0a, + 0x0d, 0x55, 0x73, 0x65, 0x72, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x18, + 0x0a, 0x07, 0x72, 0x65, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x72, 0x65, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x40, + 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x72, 0x65, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -410,7 +529,7 @@ func file_user_user_msg_proto_rawDescGZIP() []byte { return file_user_user_msg_proto_rawDescData } -var file_user_user_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_user_user_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_user_user_msg_proto_goTypes = []interface{}{ (*UserLoginReq)(nil), // 0: UserLoginReq (*UserLoginResp)(nil), // 1: UserLoginResp @@ -419,19 +538,21 @@ var file_user_user_msg_proto_goTypes = []interface{}{ (*UserLoadRsp)(nil), // 4: UserLoadRsp (*UserCreateReq)(nil), // 5: UserCreateReq (*UserCreateRsp)(nil), // 6: UserCreateRsp - (*DBUser)(nil), // 7: DBUser - (ErrorCode)(0), // 8: ErrorCode - (*CacheUser)(nil), // 9: CacheUser + (*UserAddResReq)(nil), // 7: UserAddResReq + (*UserAddResResp)(nil), // 8: UserAddResResp + (*DBUser)(nil), // 9: DBUser + (ErrorCode)(0), // 10: ErrorCode + (*CacheUser)(nil), // 11: CacheUser } var file_user_user_msg_proto_depIdxs = []int32{ - 7, // 0: UserLoginResp.data:type_name -> DBUser - 8, // 1: UserRegisterRsp.Code:type_name -> ErrorCode - 9, // 2: UserLoadRsp.data:type_name -> CacheUser - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 9, // 0: UserLoginResp.data:type_name -> DBUser + 10, // 1: UserRegisterRsp.Code:type_name -> ErrorCode + 11, // 2: UserLoadRsp.data:type_name -> CacheUser + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_user_user_msg_proto_init() } @@ -526,6 +647,30 @@ func file_user_user_msg_proto_init() { return nil } } + file_user_user_msg_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserAddResReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_msg_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserAddResResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -533,7 +678,7 @@ func file_user_user_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_user_user_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 7, + NumMessages: 9, NumExtensions: 0, NumServices: 0, }, diff --git a/sys/configure/structs/game.heroAwaken.go b/sys/configure/structs/game.heroAwaken.go new file mode 100644 index 000000000..1f4bace1e --- /dev/null +++ b/sys/configure/structs/game.heroAwaken.go @@ -0,0 +1,42 @@ + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ +package cfg + +type Game_heroAwaken struct { + _dataMap map[int32]*Game_heroAwakenData + _dataList []*Game_heroAwakenData +} + +func NewGame_heroAwaken(_buf []map[string]interface{}) (*Game_heroAwaken, error) { + _dataList := make([]*Game_heroAwakenData, 0, len(_buf)) + dataMap := make(map[int32]*Game_heroAwakenData) + for _, _ele_ := range _buf { + if _v, err2 := NewGame_heroAwakenData(_ele_); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) + dataMap[_v.Key] = _v + } + } + return &Game_heroAwaken{_dataList:_dataList, _dataMap:dataMap}, nil +} + +func (table *Game_heroAwaken) GetDataMap() map[int32]*Game_heroAwakenData { + return table._dataMap +} + +func (table *Game_heroAwaken) GetDataList() []*Game_heroAwakenData { + return table._dataList +} + +func (table *Game_heroAwaken) Get(key int32) *Game_heroAwakenData { + return table._dataMap[key] +} + + diff --git a/sys/configure/structs/game.heroAwakenData.go b/sys/configure/structs/game.heroAwakenData.go new file mode 100644 index 000000000..a2408aacf --- /dev/null +++ b/sys/configure/structs/game.heroAwakenData.go @@ -0,0 +1,59 @@ + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ +package cfg + +import "errors" + +type Game_heroAwakenData struct { + Key int32 + Hid int32 + Phase int32 + Phasebonus []string + Phaseneed []*Game_atn +} + +func (Game_heroAwakenData) GetTypeId() int { + return -1396976663 +} + +func NewGame_heroAwakenData(_buf map[string]interface{}) (_v *Game_heroAwakenData, err error) { + _v = &Game_heroAwakenData{} + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["key"].(float64); !_ok_ { err = errors.New("key error"); return }; _v.Key = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["hid"].(float64); !_ok_ { err = errors.New("hid error"); return }; _v.Hid = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["phase"].(float64); !_ok_ { err = errors.New("phase error"); return }; _v.Phase = int32(_tempNum_) } + { + var _arr_ []interface{} + var _ok_ bool + if _arr_, _ok_ = _buf["phasebonus"].([]interface{}); !_ok_ { err = errors.New("phasebonus error"); return } + + _v.Phasebonus = make([]string, 0, len(_arr_)) + + for _, _e_ := range _arr_ { + var _list_v_ string + { if _list_v_, _ok_ = _e_.(string); !_ok_ { err = errors.New("_list_v_ error"); return } } + _v.Phasebonus = append(_v.Phasebonus, _list_v_) + } + } + + { + var _arr_ []interface{} + var _ok_ bool + if _arr_, _ok_ = _buf["phaseneed"].([]interface{}); !_ok_ { err = errors.New("phaseneed error"); return } + + _v.Phaseneed = make([]*Game_atn, 0, len(_arr_)) + + for _, _e_ := range _arr_ { + var _list_v_ *Game_atn + { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = NewGame_atn(_x_); err != nil { return } } + _v.Phaseneed = append(_v.Phaseneed, _list_v_) + } + } + + return +}