diff --git a/bin/build_linux.sh b/bin/build_linux.sh old mode 100644 new mode 100755 diff --git a/bin/gateway b/bin/gateway new file mode 100755 index 000000000..d6349e562 Binary files /dev/null and b/bin/gateway differ diff --git a/bin/mainte b/bin/mainte new file mode 100755 index 000000000..32c88ee86 Binary files /dev/null and b/bin/mainte differ diff --git a/bin/start.sh b/bin/start.sh old mode 100644 new mode 100755 index 48a92c7dc..8d3862fe6 --- a/bin/start.sh +++ b/bin/start.sh @@ -1,3 +1,5 @@ +./stup.sh start worker_cross worker ./conf/worker_cross.yaml +sleep 1 ./stup.sh start mainte mainte ./conf/mainte.yaml sleep 1 ./stup.sh start worker_1 worker ./conf/worker_1.yaml diff --git a/bin/stop.sh b/bin/stop.sh old mode 100644 new mode 100755 index d9cd2d95f..f4f421867 --- a/bin/stop.sh +++ b/bin/stop.sh @@ -3,3 +3,5 @@ ./stup.sh stop mainte ./stup.sh stop worker_1 + +./stup.sh stop worker_cross diff --git a/bin/stup.sh b/bin/stup.sh old mode 100644 new mode 100755 diff --git a/bin/worker b/bin/worker new file mode 100755 index 000000000..5f6cb4c45 Binary files /dev/null and b/bin/worker differ diff --git a/modules/comp_configure.go b/modules/comp_configure.go index 31149617c..78e0a334a 100644 --- a/modules/comp_configure.go +++ b/modules/comp_configure.go @@ -55,20 +55,18 @@ func (this *MCompConfigure) GetConfigure(name string) (v interface{}, err error) //全局配置 func (this *MCompConfigure) GetGlobalConf() *cfg.GameglobalData { + var ( + configure *cfg.Gameglobal + ok bool + ) if v, err := this.GetConfigure(game_global); err != nil { log.Errorf("get global conf err:%v", err) - return nil } else { - var ( - configure *cfg.Gameglobal - ok bool - ) if configure, ok = v.(*cfg.Gameglobal); !ok { log.Errorf("%T no is *cfg.Game_global", v) - return nil } - return configure.GetDataList()[0] } + return configure.GetDataList()[0] // 返回对象信息 } func (this *MCompConfigure) GetGlobalInitConf() (configure *cfg.Gameinitial, err error) { diff --git a/modules/hero/api.go b/modules/hero/api.go index 2c30f1eb3..1e682f6fe 100644 --- a/modules/hero/api.go +++ b/modules/hero/api.go @@ -2,10 +2,12 @@ package hero import ( "go_dreamfactory/lego/core" + "go_dreamfactory/lego/core/cbase" "go_dreamfactory/modules" ) type apiComp struct { + cbase.ModuleCompBase modules.MCompGate service core.IService module *Hero diff --git a/modules/hero/api_drawCard.go b/modules/hero/api_drawCard.go index e83e96d28..5901b5857 100644 --- a/modules/hero/api_drawCard.go +++ b/modules/hero/api_drawCard.go @@ -3,6 +3,7 @@ package hero import ( "go_dreamfactory/comm" "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" "google.golang.org/protobuf/proto" ) @@ -16,134 +17,174 @@ func (this *apiComp) DrawCardCheck(session comm.IUserSession, req *pb.HeroDrawCa //抽卡 func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq) (code pb.ErrorCode, data proto.Message) { - // var ( - // szCards []string // 最终抽到的卡牌 - // totalWeight int64 // 总权重 - // curWeigth int64 // 临时随机获得的权重 - // curStar4Count int32 // 当前4星没抽到的次数 - // curStar5Count int32 // 当前5星没抽到的次数 - // config4Count int32 // 配置表中4星保底次数 - // config5Count int32 // 配置表中5星保底次数 - // race int32 - // cardW map[string]int32 // 当前卡牌卡池卡牌对应的权重 - // baodiPool int32 // 保底卡池id - // drawCount int32 // 抽卡次数 - // ) + var ( + szCards []string // 最终抽到的卡牌 + drawCount int32 // 抽卡次数 + szStar []int32 //星级 + costRes []*cfg.Gameatn + star4Max int32 // 10连抽最大4星数量 + star5Max int32 // 10连抽最大5星数量 + cfgDraw *cfg.GameglobalData + costAtn *cfg.Gameatn + heroRecord *pb.DBHeroRecord - // cardW = make(map[string]int32, 0) - // szCards = make([]string, 0) - // rsp := &pb.HeroDrawCardResp{} - // this.module.Debugf("当前4星抽卡没中次数:%d, 当前5星抽卡没中次数:%d", curStar4Count, curStar5Count) + //heroRecord *pb.DBHeroRecord // 英雄扩展属性 + ) - // curStar4Count, curStar5Count, drawCount = this.module.modelHero.GetCurStarCount(session.GetUserId(), req.DrawType) // 获取缓存中4,5星没抽到的次数 - // // 获取配置文件的权重信息 - // // _conf, err := this.module.configure.GetHeroDrawConfig(race) - // // if err != nil { - // // code = pb.ErrorCode_DrawCardTypeNotFound // 抽卡类型不匹配 - // // return - // // } - // // // 权重赋值 - // // for _, v := range _conf { - // // cardW[v.Id] += v.Weight - // // totalWeight += int64(cardW[v.Id]) - // // } + cfgDraw = this.module.configure.GetGlobalConf() // 读取抽卡配置文件 - // // ======记录活动数据 - // cfgData, err := this.module.configure.GetDrawUpDrawConfig() - // if err == nil { - // for _, v := range cfgData.GetDataList() { - // if time.Now().Unix() >= int64(v.TimeOn) && time.Now().Unix() <= int64(v.TimeOff) { // 在这个时间范围之内 - // for index, v1 := range v.UpHero { - // if _, ok := cardW[v1]; ok { // 判断卡池有没有这张卡 - // cardW[v1] += v.UpWeight[index] - // totalWeight += int64(v.UpWeight[index]) - // } - // } - // } - // } - // } - // =======活动数据记录完成 - //_costConf, err := this.module.configure.GetDrawCostConfigByID(req.DrawType) // 抽卡消耗 + szCards = make([]string, 0) + rsp := &pb.HeroDrawCardResp{} + cfg := cfgDraw - // if err != nil { - // code = pb.ErrorCode_ConfigNoFound - // return - // } - // config4Count = _costConf.Floor4 // 4星保底次数 - // config5Count = _costConf.Floor5 // 5星保底次数 - // if config4Count <= 0 { // 小于等于零 表示没有保底 - // config4Count = math.MaxInt32 - // } - // if config5Count <= 0 { // 小于等于零 表示没有保底 - // config5Count = math.MaxInt32 - // } + heroRecord, _ = this.module.modelRecord.GetHeroRecord(session.GetUserId()) + drawCount = heroRecord.Drawcount + if req.DrawType == 0 { // 普通卡池抽卡 + // 获取普通抽卡池 + pool := this.module.modelHero.CheckPool(drawCount, cfg) + _data := this.module.configure.GetPollByType(pool) + if _data == nil { + code = pb.ErrorCode_ConfigNoFound + return + } + costAtn = cfgDraw.BasePoolCost + costAtn.N *= req.DrawCount // 重新计算消耗数量 + costRes = append(costRes, costAtn) + code = this.module.CheckRes(session, costRes) + if code != pb.ErrorCode_Success { // 消耗数量不足直接返回 + return + } - // code = this.module.CheckRes(session, []*cfg.Gameatn{_costConf.Cost}) // 消耗校验 - // if code != pb.ErrorCode_Success { - // return - // } + for { + sz := make([]int32, 0) + if cfgDraw.BasePoolStar3 != 0 { + sz = append(sz, cfgDraw.BasePoolStar3) + } + if cfgDraw.BasePoolStar4 != 0 { + sz = append(sz, cfgDraw.BasePoolStar4) - // for i := 0; i < int(_costConf.Count); i++ { - // n, _ := rand.Int(rand.Reader, big.NewInt(totalWeight)) // [0,totalWeight) - // curWeigth = 0 - // for k, v := range cardW { - // curWeigth += int64(v) - // if curWeigth > n.Int64() { // 命中 - // // 获取当前星级 - // _getCardCfg := this.module.configure.GetHero(k) //获取的英雄信息 - // if _getCardCfg == nil { - // continue - // } - // curStar4Count++ - // curStar5Count++ - // if _getCardCfg.Star == 4 { // 当抽取到的英雄是4星的时候 清除 该类型的保底次数 - // curStar4Count = 0 + } + if cfgDraw.BasePoolStar5 != 0 { + sz = append(sz, cfgDraw.BasePoolStar5) - // } else if _getCardCfg.Star == 5 { // 当抽取到的英雄是5星的时候 清除 该类型的保底次数 - // curStar5Count = 0 // 清0 - // } + } + starIndex := this.module.modelHero.GetRandW(sz) + if starIndex == 1 { + star4Max++ + } else if starIndex == 2 { + star5Max++ + } + if star4Max >= cfgDraw.Draw10Star4Max { + starIndex = 0 + } else if star5Max >= cfgDraw.Draw10Star5Max { + starIndex = 0 + } + szStar = append(szStar, starIndex) + if len(szStar) >= int(req.DrawCount) { + break + } + } + for star := range szCards { // szStar 转 szHeroId - // // 达标保底次数 - // if curStar4Count >= config4Count { - // baodiPool = _costConf.Floor4cards - // } else if curStar5Count >= config5Count { - // baodiPool = _costConf.Floor5cards - // } - // if baodiPool != 0 { - // id := this.module.modelHero.FloorDrawCard(baodiPool) - // if id != "" { - // szCards = append(szCards, id) // 保底卡池里的卡放入数组种 - // break - // } - // } - // szCards = append(szCards, k) - // break - // } - // } - // } - // raceData := &pb.Floor{ - // H4: curStar4Count, - // H5: curStar5Count, - // } - // // 更新record 配置信息 - // update := map[string]interface{}{} - // if drawCount != -1 { - // drawCount += _costConf.Count - // update["drawcount"] = drawCount - // } - // update["race"+strconv.Itoa(int(race)-1)] = raceData - // this.module.modelRecord.ChangeHeroRecord(session.GetUserId(), update) - // // 消耗道具 - // code = this.module.ConsumeRes(session, []*cfg.Gameatn{_costConf.Cost}, true) - // if code != pb.ErrorCode_Success { - // return - // } - // if err := this.module.modelHero.createMultiHero(session.GetUserId(), szCards...); err != nil { - // code = pb.ErrorCode_HeroCreate - // return - // } + sz := make([]int32, 0) + for _, v := range _data[int32(star)] { + sz = append(sz, v.Weight) + } + randomIndex := this.module.modelHero.GetRandW(sz) - // rsp.Heroes = szCards - // session.SendMsg(string(this.module.GetType()), DrawCard, rsp) + szCards = append(szCards, _data[int32(star)][randomIndex].Id) + } + + } else { // 所有阵营抽卡都走这里 + pool := "" + + switch req.DrawType { + case 1: + pool = cfg.Camp1Pool1 + costAtn = cfgDraw.Camp1PoolCost + + case 2: + pool = cfg.Camp2Pool1 + costAtn = cfgDraw.Camp2PoolCost + case 3: + pool = cfg.Camp3Pool1 + costAtn = cfgDraw.Camp3PoolCost + case 4: + pool = cfg.Camp4Pool1 + costAtn = cfgDraw.Camp4PoolCost + } + costAtn.N *= req.DrawCount + costRes = append(costRes, costAtn) + _data := this.module.configure.GetPollByType(pool) + if _data == nil { + code = pb.ErrorCode_ConfigNoFound + return + } + //阵营消耗 + code = this.module.CheckRes(session, costRes) + if code != pb.ErrorCode_Success { // 消耗数量不足直接返回 + return + } + for { + sz := make([]int32, 0) + if cfgDraw.CampPoolStar3 != 0 { + sz = append(sz, cfgDraw.CampPoolStar3) + } + if cfgDraw.CampPoolStar4 != 0 { + sz = append(sz, cfgDraw.CampPoolStar4) + + } + if cfgDraw.CampPoolStar5 != 0 { + sz = append(sz, cfgDraw.CampPoolStar5) + + } + starIndex := this.module.modelHero.GetRandW(sz) + if starIndex == 1 { + star4Max++ + } else if starIndex == 2 { + star5Max++ + } + if star4Max >= cfgDraw.Draw10Star4Max { + starIndex = 0 + } else if star5Max >= cfgDraw.Draw10Star5Max { + starIndex = 0 + } + szStar = append(szStar, starIndex) + if len(szStar) >= int(req.DrawCount) { + break + } + } + for star := range szCards { // szStar 转 szHeroId + + sz := make([]int32, 0) + for _, v := range _data[int32(star)] { + sz = append(sz, v.Weight) + } + randomIndex := this.module.modelHero.GetRandW(sz) + + szCards = append(szCards, _data[int32(star)][randomIndex].Id) + } + } + + // 更新record 配置信息 + update := map[string]interface{}{} + if drawCount != -1 { + drawCount += req.DrawCount + update["drawcount"] = drawCount + } + //update["race"+strconv.Itoa(int(race)-1)] = raceData + this.module.modelRecord.ChangeHeroRecord(session.GetUserId(), update) + // 消耗道具 + code = this.module.ConsumeRes(session, costRes, true) + if code != pb.ErrorCode_Success { + return + } + if err := this.module.modelHero.createMultiHero(session.GetUserId(), szCards...); err != nil { + code = pb.ErrorCode_HeroCreate + return + } + + rsp.Heroes = szCards + session.SendMsg(string(this.module.GetType()), DrawCard, rsp) return } diff --git a/modules/hero/configure_comp.go b/modules/hero/configure_comp.go index 8bae84cab..dd13398da 100644 --- a/modules/hero/configure_comp.go +++ b/modules/hero/configure_comp.go @@ -56,13 +56,13 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp this.drawCardCfg = make(map[string]map[int32][]*cfg.GamedrawCardData, 0) configure.RegisterConfigure(hero_drawcard, cfg.NewGamedrawCard, func() { - this.GetHeroDrawConfig() + this.SetHeroDrawConfig() }) return } // 抽卡配置表 -func (this *configureComp) GetHeroDrawConfig() (err error) { +func (this *configureComp) SetHeroDrawConfig() (err error) { var ( v interface{} ) @@ -87,6 +87,9 @@ func (this *configureComp) GetHeroDrawConfig() (err error) { return } +func (this *configureComp) GetPollByType(poosType string) map[int32][]*cfg.GamedrawCardData { + return this.drawCardCfg[poosType] +} //获取英雄配置数据 func (this *configureComp) getHeroConfigure() (configure *cfg.Gamehero, err error) { diff --git a/modules/hero/model_hero.go b/modules/hero/model_hero.go index 3820cf21f..dba76ef0e 100644 --- a/modules/hero/model_hero.go +++ b/modules/hero/model_hero.go @@ -1,13 +1,16 @@ package hero import ( + "crypto/rand" "errors" "fmt" "go_dreamfactory/comm" "go_dreamfactory/lego/core" "go_dreamfactory/modules" "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" "math" + "math/big" mengine "github.com/dengsgo/math-engine/engine" "go.mongodb.org/mongo-driver/bson/primitive" @@ -522,47 +525,6 @@ func (this *ModelHero) RemoveUserHeroInfo(session comm.IUserSession) (err error) return } -// 获取抽卡保底相关数据 -func (this *ModelHero) GetCurStarCount(uid string, drawType int32) (curStar4Count int32, curStar5Count int32, drawCount int32) { - var race int32 - rst, _ := this.moduleHero.modelRecord.GetHeroRecord(uid) - if drawType%2 == 0 { // 转成对应阵营信息 1~5 - race = int32((int(drawType)) / 2) - } else { - race = int32(int(drawType+1) / 2) - } - drawCount = -1 - if race == comm.RacePt { // 普通卡池 - if rst.Race0 != nil { - curStar4Count = rst.Race0.H4 - curStar5Count = rst.Race0.H5 - } - drawCount = rst.Drawcount - } else if race == comm.RaceZr { // 灼热 - if rst.Race1 != nil { - curStar4Count = rst.Race1.H4 - curStar5Count = rst.Race1.H5 - } - } else if race == comm.RaceYd { // 涌动 - if rst.Race2 != nil { - curStar4Count = rst.Race2.H4 - curStar5Count = rst.Race2.H5 - } - } else if race == comm.RaceHx { // 呼啸 - if rst.Race3 != nil { - curStar4Count = rst.Race3.H4 - curStar5Count = rst.Race3.H5 - } - } else if race == comm.RaceSy { // 闪耀 - if rst.Race4 != nil { - curStar4Count = rst.Race4.H4 - curStar5Count = rst.Race4.H5 - } - } - - return -} - // 保底抽卡 (参数 卡池id, 返回抽到卡配置id) func (this *ModelHero) FloorDrawCard(Cardpool int32) (cardId string) { // _bd, err := this.moduleHero.configure.GetHeroDrawConfig(Cardpool) @@ -584,3 +546,58 @@ func (this *ModelHero) FloorDrawCard(Cardpool int32) (cardId string) { // } return } + +func (this *ModelHero) CheckPool(drawCount int32, config *cfg.GameglobalData) (pools string) { + if config.BasePool1.S <= drawCount && config.BasePool1.E >= drawCount { + return config.BasePool1.P + } else if config.BasePool2.S <= drawCount && config.BasePool2.E >= drawCount { + return config.BasePool2.P + } else if config.BasePool3.S <= drawCount && config.BasePool3.E >= drawCount { + return config.BasePool3.P + } else { + return config.BasePool4.P + } + return +} + +// 通数组里的权重随机命中 返回值为数组的下标 +func (this *ModelHero) GetRandW(sz []int32) int32 { + + if len(sz) > 0 { + var _totalW int64 // 总权重 + var _tmpW int64 // 临时权重 + for _, v := range sz { + _totalW += int64(v) + } + // 随机权重 + n, _ := rand.Int(rand.Reader, big.NewInt(_totalW)) + for i, v := range sz { + _tmpW += int64(v) + if n.Int64() < _tmpW { // 种族保底卡池命中 + return int32(i) + } + } + } + return 0 +} + +// 通过卡池的权重 获取英雄 +func (this *ModelHero) GetRandHeroIdBypool(sz []int32) int32 { + + if len(sz) > 0 { + var _totalW int64 // 总权重 + var _tmpW int64 // 临时权重 + for _, v := range sz { + _totalW += int64(v) + } + // 随机权重 + n, _ := rand.Int(rand.Reader, big.NewInt(_totalW)) + for i, v := range sz { + _tmpW += int64(v) + if n.Int64() < _tmpW { // 种族保底卡池命中 + return int32(i) + } + } + } + return 0 +} diff --git a/pb/comm.pb.go b/pb/comm.pb.go index 0943732fb..529b5dc1a 100644 --- a/pb/comm.pb.go +++ b/pb/comm.pb.go @@ -838,7 +838,7 @@ func (x *NoticeUserCloseReq) GetGatewayServiceId() string { return "" } -//用户资产数据 对标*cfg.Gameatn 数据结构 +//用户资产数据 对标*cfg.Game_atn 数据结构 type UserAssets struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/pb/hero_db.pb.go b/pb/hero_db.pb.go index d56f72a34..412337e60 100644 --- a/pb/hero_db.pb.go +++ b/pb/hero_db.pb.go @@ -375,17 +375,12 @@ type DBHeroRecord struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID 主键id - Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID - Race0 *Floor `protobuf:"bytes,3,opt,name=race0,proto3" json:"race0"` // 普通卡池 - Race1 *Floor `protobuf:"bytes,4,opt,name=race1,proto3" json:"race1"` // 阵型1卡池 - Race2 *Floor `protobuf:"bytes,5,opt,name=race2,proto3" json:"race2"` // 阵型2卡池 - Race3 *Floor `protobuf:"bytes,6,opt,name=race3,proto3" json:"race3"` // 阵型3卡池 - Race4 *Floor `protobuf:"bytes,7,opt,name=race4,proto3" json:"race4"` // 阵型4卡池 - Triggernum int32 `protobuf:"varint,8,opt,name=triggernum,proto3" json:"triggernum"` // 活动数据 存放没有触发次数 - Activityid int32 `protobuf:"varint,9,opt,name=activityid,proto3" json:"activityid"` // 活动id - Mtime int64 `protobuf:"varint,10,opt,name=mtime,proto3" json:"mtime"` // 修改时间 - Drawcount int32 `protobuf:"varint,11,opt,name=drawcount,proto3" json:"drawcount"` // 普通卡牌累计抽取次数 + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID 主键id + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID + Star4 int32 `protobuf:"varint,3,opt,name=star4,proto3" json:"star4"` // 4星保底 + Star5 int32 `protobuf:"varint,4,opt,name=star5,proto3" json:"star5"` // 5星保底 + Mtime int64 `protobuf:"varint,5,opt,name=mtime,proto3" json:"mtime"` // 修改时间 + Drawcount int32 `protobuf:"varint,6,opt,name=drawcount,proto3" json:"drawcount"` // 普通卡牌累计抽取次数 } func (x *DBHeroRecord) Reset() { @@ -434,51 +429,16 @@ func (x *DBHeroRecord) GetUid() string { return "" } -func (x *DBHeroRecord) GetRace0() *Floor { +func (x *DBHeroRecord) GetStar4() int32 { if x != nil { - return x.Race0 - } - return nil -} - -func (x *DBHeroRecord) GetRace1() *Floor { - if x != nil { - return x.Race1 - } - return nil -} - -func (x *DBHeroRecord) GetRace2() *Floor { - if x != nil { - return x.Race2 - } - return nil -} - -func (x *DBHeroRecord) GetRace3() *Floor { - if x != nil { - return x.Race3 - } - return nil -} - -func (x *DBHeroRecord) GetRace4() *Floor { - if x != nil { - return x.Race4 - } - return nil -} - -func (x *DBHeroRecord) GetTriggernum() int32 { - if x != nil { - return x.Triggernum + return x.Star4 } return 0 } -func (x *DBHeroRecord) GetActivityid() int32 { +func (x *DBHeroRecord) GetStar5() int32 { if x != nil { - return x.Activityid + return x.Star5 } return 0 } @@ -581,27 +541,17 @@ var file_hero_hero_db_proto_rawDesc = []byte{ 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x27, 0x0a, 0x05, 0x46, 0x6c, 0x6f, 0x6f, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x68, 0x34, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x68, 0x34, 0x12, 0x0e, 0x0a, 0x02, 0x68, 0x35, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x68, - 0x35, 0x22, 0xba, 0x02, 0x0a, 0x0c, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x65, 0x63, 0x6f, + 0x35, 0x22, 0x90, 0x01, 0x0a, 0x0c, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 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, 0x1c, 0x0a, 0x05, 0x72, 0x61, 0x63, 0x65, 0x30, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x46, 0x6c, 0x6f, 0x6f, 0x72, 0x52, 0x05, 0x72, 0x61, 0x63, - 0x65, 0x30, 0x12, 0x1c, 0x0a, 0x05, 0x72, 0x61, 0x63, 0x65, 0x31, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x06, 0x2e, 0x46, 0x6c, 0x6f, 0x6f, 0x72, 0x52, 0x05, 0x72, 0x61, 0x63, 0x65, 0x31, - 0x12, 0x1c, 0x0a, 0x05, 0x72, 0x61, 0x63, 0x65, 0x32, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x06, 0x2e, 0x46, 0x6c, 0x6f, 0x6f, 0x72, 0x52, 0x05, 0x72, 0x61, 0x63, 0x65, 0x32, 0x12, 0x1c, - 0x0a, 0x05, 0x72, 0x61, 0x63, 0x65, 0x33, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, - 0x46, 0x6c, 0x6f, 0x6f, 0x72, 0x52, 0x05, 0x72, 0x61, 0x63, 0x65, 0x33, 0x12, 0x1c, 0x0a, 0x05, - 0x72, 0x61, 0x63, 0x65, 0x34, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x46, 0x6c, - 0x6f, 0x6f, 0x72, 0x52, 0x05, 0x72, 0x61, 0x63, 0x65, 0x34, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x72, - 0x69, 0x67, 0x67, 0x65, 0x72, 0x6e, 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, - 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x6e, 0x75, 0x6d, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x63, - 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, - 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x74, - 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6d, 0x74, 0x69, 0x6d, 0x65, - 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x72, 0x61, 0x77, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0b, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x09, 0x64, 0x72, 0x61, 0x77, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x06, - 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x34, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x34, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x72, 0x35, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x35, + 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x05, 0x6d, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x72, 0x61, 0x77, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x64, 0x72, 0x61, 0x77, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -629,22 +579,17 @@ var file_hero_hero_db_proto_goTypes = []interface{}{ nil, // 8: DBHero.JuexPropertyEntry } var file_hero_hero_db_proto_depIdxs = []int32{ - 0, // 0: DBHero.normalSkill:type_name -> SkillData - 4, // 1: DBHero.property:type_name -> DBHero.PropertyEntry - 5, // 2: DBHero.addProperty:type_name -> DBHero.AddPropertyEntry - 6, // 3: DBHero.energy:type_name -> DBHero.EnergyEntry - 7, // 4: DBHero.energyProperty:type_name -> DBHero.EnergyPropertyEntry - 8, // 5: DBHero.juexProperty:type_name -> DBHero.JuexPropertyEntry - 2, // 6: DBHeroRecord.race0:type_name -> Floor - 2, // 7: DBHeroRecord.race1:type_name -> Floor - 2, // 8: DBHeroRecord.race2:type_name -> Floor - 2, // 9: DBHeroRecord.race3:type_name -> Floor - 2, // 10: DBHeroRecord.race4:type_name -> Floor - 11, // [11:11] is the sub-list for method output_type - 11, // [11:11] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name + 0, // 0: DBHero.normalSkill:type_name -> SkillData + 4, // 1: DBHero.property:type_name -> DBHero.PropertyEntry + 5, // 2: DBHero.addProperty:type_name -> DBHero.AddPropertyEntry + 6, // 3: DBHero.energy:type_name -> DBHero.EnergyEntry + 7, // 4: DBHero.energyProperty:type_name -> DBHero.EnergyPropertyEntry + 8, // 5: DBHero.juexProperty:type_name -> DBHero.JuexPropertyEntry + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_hero_hero_db_proto_init() } diff --git a/pb/hero_msg.pb.go b/pb/hero_msg.pb.go index 91396e881..8002cb667 100644 --- a/pb/hero_msg.pb.go +++ b/pb/hero_msg.pb.go @@ -1542,7 +1542,8 @@ type HeroDrawCardReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - DrawType int32 `protobuf:"varint,1,opt,name=drawType,proto3" json:"drawType"` // 抽卡类型 见drawCardCost表 + DrawType int32 `protobuf:"varint,1,opt,name=drawType,proto3" json:"drawType"` // 抽卡类型 0 普通 + DrawCount int32 `protobuf:"varint,2,opt,name=drawCount,proto3" json:"drawCount"` // 抽卡次数 } func (x *HeroDrawCardReq) Reset() { @@ -1584,6 +1585,13 @@ func (x *HeroDrawCardReq) GetDrawType() int32 { return 0 } +func (x *HeroDrawCardReq) GetDrawCount() int32 { + if x != nil { + return x.DrawCount + } + return 0 +} + type HeroDrawCardResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1818,16 +1826,18 @@ var file_hero_hero_msg_proto_rawDesc = []byte{ 0x65, 0x72, 0x6f, 0x47, 0x65, 0x74, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 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, 0x2d, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x72, 0x61, 0x77, 0x43, 0x61, 0x72, 0x64, + 0x22, 0x4b, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x72, 0x61, 0x77, 0x43, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x72, 0x61, 0x77, 0x54, 0x79, 0x70, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, 0x72, 0x61, 0x77, 0x54, 0x79, 0x70, 0x65, 0x22, - 0x2a, 0x0a, 0x10, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x72, 0x61, 0x77, 0x43, 0x61, 0x72, 0x64, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x65, 0x73, 0x22, 0x2d, 0x0a, 0x0e, 0x48, - 0x65, 0x72, 0x6f, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x75, 0x73, 0x68, 0x12, 0x1b, 0x0a, - 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, - 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, - 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, 0x72, 0x61, 0x77, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x1c, 0x0a, 0x09, 0x64, 0x72, 0x61, 0x77, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x64, 0x72, 0x61, 0x77, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x2a, 0x0a, + 0x10, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x72, 0x61, 0x77, 0x43, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x65, 0x73, 0x22, 0x2d, 0x0a, 0x0e, 0x48, 0x65, 0x72, + 0x6f, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x75, 0x73, 0x68, 0x12, 0x1b, 0x0a, 0x04, 0x6c, + 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x48, 0x65, + 0x72, 0x6f, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var (