优化+爬塔

This commit is contained in:
meixiongfeng 2022-08-09 18:09:14 +08:00
parent de510f42ac
commit e69db22bf1
25 changed files with 3936 additions and 358 deletions

2498
bin/json/game_pagoda.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,146 @@
[
{
"key": 1,
"ranking": [
1,
1
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 10
},
{
"a": "attr",
"t": "gold",
"n": 1000
},
{
"a": "item",
"t": "10002",
"n": 1
}
]
},
{
"key": 2,
"ranking": [
2,
2
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 10
},
{
"a": "attr",
"t": "gold",
"n": 1050
},
{
"a": "item",
"t": "10002",
"n": 1
}
]
},
{
"key": 3,
"ranking": [
3,
3
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 10
},
{
"a": "attr",
"t": "gold",
"n": 1100
},
{
"a": "item",
"t": "10002",
"n": 1
}
]
},
{
"key": 4,
"ranking": [
4,
10
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 10
},
{
"a": "attr",
"t": "gold",
"n": 1150
},
{
"a": "item",
"t": "10002",
"n": 1
}
]
},
{
"key": 5,
"ranking": [
11,
20
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 10
},
{
"a": "attr",
"t": "gold",
"n": 1200
},
{
"a": "item",
"t": "10002",
"n": 1
}
]
},
{
"key": 6,
"ranking": [
21,
50
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 10
},
{
"a": "attr",
"t": "gold",
"n": 1250
},
{
"a": "item",
"t": "10002",
"n": 1
}
]
}
]

View File

@ -0,0 +1,282 @@
[
{
"key": 1,
"pagoda_type": 1,
"layer_num": [
10
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 50
}
]
},
{
"key": 2,
"pagoda_type": 1,
"layer_num": [
20
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 100
}
]
},
{
"key": 3,
"pagoda_type": 1,
"layer_num": [
30
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 150
}
]
},
{
"key": 4,
"pagoda_type": 1,
"layer_num": [
40
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 200
}
]
},
{
"key": 5,
"pagoda_type": 1,
"layer_num": [
50
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 250
}
]
},
{
"key": 6,
"pagoda_type": 1,
"layer_num": [
60
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 300
}
]
},
{
"key": 7,
"pagoda_type": 1,
"layer_num": [
70
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 350
}
]
},
{
"key": 8,
"pagoda_type": 1,
"layer_num": [
80
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 400
}
]
},
{
"key": 9,
"pagoda_type": 1,
"layer_num": [
90
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 450
}
]
},
{
"key": 10,
"pagoda_type": 1,
"layer_num": [
100
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 500
}
]
},
{
"key": 11,
"pagoda_type": 2,
"layer_num": [
5
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 50
}
]
},
{
"key": 12,
"pagoda_type": 2,
"layer_num": [
10
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 100
}
]
},
{
"key": 13,
"pagoda_type": 2,
"layer_num": [
15
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 150
}
]
},
{
"key": 14,
"pagoda_type": 2,
"layer_num": [
20
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 200
}
]
},
{
"key": 15,
"pagoda_type": 2,
"layer_num": [
25
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 250
}
]
},
{
"key": 16,
"pagoda_type": 2,
"layer_num": [
30
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 300
}
]
},
{
"key": 17,
"pagoda_type": 2,
"layer_num": [
35
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 350
}
]
},
{
"key": 18,
"pagoda_type": 2,
"layer_num": [
40
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 400
}
]
},
{
"key": 19,
"pagoda_type": 2,
"layer_num": [
45
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 450
}
]
},
{
"key": 20,
"pagoda_type": 2,
"layer_num": [
50
],
"reward": [
{
"a": "attr",
"t": "diamond",
"n": 500
}
]
}
]

View File

@ -45,6 +45,7 @@ const (
ModuleNotify core.M_Modules = "notify" //公告模块 ModuleNotify core.M_Modules = "notify" //公告模块
ModuleChat core.M_Modules = "chat" //装备模块 ModuleChat core.M_Modules = "chat" //装备模块
ModuleGM core.M_Modules = "gm" //gm模块 ModuleGM core.M_Modules = "gm" //gm模块
ModulePagoda core.M_Modules = "pagoda" //魔塔模块
) )
//RPC服务接口定义处 //RPC服务接口定义处

View File

@ -86,7 +86,7 @@ type (
// 修改章节信息 // 修改章节信息
ModifyMainlineData(uid string, objId string, data interface{}) (code pb.ErrorCode) ModifyMainlineData(uid string, objId string, data interface{}) (code pb.ErrorCode)
// 检查能不能挑战该关卡 // 检查能不能挑战该关卡
CheckChallengeChapter(stroyId int32, uid string, zhangjieID int32) (code pb.ErrorCode) CheckChallengeChapter(storyObjId string, uid string, zhangjieID int32) (code pb.ErrorCode)
} }
//任务 //任务
ITask interface { ITask interface {

View File

@ -81,9 +81,8 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
if config5Count <= 0 { // 小于等于零 表示没有保底 if config5Count <= 0 { // 小于等于零 表示没有保底
config5Count = math.MaxInt32 config5Count = math.MaxInt32
} }
sz := make([]*cfg.Game_atn, 0)
sz = append(sz, _costConf.Cost) code = this.module.CheckRes(session, []*cfg.Game_atn{_costConf.Cost}) // 消耗校验
code = this.module.CheckRes(session, sz) // 消耗校验
if code != pb.ErrorCode_Success { if code != pb.ErrorCode_Success {
return return
} }
@ -134,9 +133,9 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
update := map[string]interface{}{} update := map[string]interface{}{}
update["race"+strconv.Itoa(int(race)-1)] = raceData update["race"+strconv.Itoa(int(race)-1)] = raceData
this.module.modelRecord.ChangeUserRecord(session.GetUserId(), update) this.module.modelRecord.ChangeHeroRecord(session.GetUserId(), update)
// 消耗道具 // 消耗道具
code = this.module.ConsumeRes(session, sz, true) code = this.module.ConsumeRes(session, []*cfg.Game_atn{_costConf.Cost}, true)
if code != pb.ErrorCode_Success { if code != pb.ErrorCode_Success {
return return
} }

View File

@ -92,7 +92,7 @@ func (this *ModelHero) initHeroSkill(hero *pb.DBHero) []*pb.SkillData {
func (this *ModelHero) createOneHero(uid string, heroCfgId string) (hero *pb.DBHero, err error) { func (this *ModelHero) createOneHero(uid string, heroCfgId string) (hero *pb.DBHero, err error) {
hero = this.initHero(uid, heroCfgId) hero = this.initHero(uid, heroCfgId)
if hero != nil { if hero != nil {
if err = this.moduleHero.modelHero.AddList(uid, hero.Id, hero); err != nil { if err = this.AddList(uid, hero.Id, hero); err != nil {
this.moduleHero.Errorf("%v", err) this.moduleHero.Errorf("%v", err)
return return
} }
@ -131,7 +131,7 @@ func (this *ModelHero) initHeroOverlying(uid string, heroCfgId string, count int
}(uid, heroCfgId) }(uid, heroCfgId)
hero.SameCount = count hero.SameCount = count
if err = this.moduleHero.modelHero.AddList(uid, hero.Id, hero); err != nil { if err = this.AddList(uid, hero.Id, hero); err != nil {
this.moduleHero.Errorf("%v", err) this.moduleHero.Errorf("%v", err)
return return
} }
@ -141,7 +141,7 @@ func (this *ModelHero) initHeroOverlying(uid string, heroCfgId string, count int
// 该方法适用创建初始英雄 叠加英雄 count叠加数量 // 该方法适用创建初始英雄 叠加英雄 count叠加数量
func (this *ModelHero) createHeroOverlying(uid string, heroCfgId string, count int32) (hero *pb.DBHero, err error) { func (this *ModelHero) createHeroOverlying(uid string, heroCfgId string, count int32) (hero *pb.DBHero, err error) {
heroes := this.moduleHero.modelHero.getHeroList(uid) heroes := this.getHeroList(uid)
if len(heroes) == 0 { if len(heroes) == 0 {
return this.initHeroOverlying(uid, heroCfgId, count) return this.initHeroOverlying(uid, heroCfgId, count)
} else { } else {
@ -169,7 +169,7 @@ func (this *ModelHero) createHeroOverlying(uid string, heroCfgId string, count i
//创建多个指定的英雄 heroCfgIds可填入多个英雄ID //创建多个指定的英雄 heroCfgIds可填入多个英雄ID
func (this *ModelHero) createMultiHero(uid string, heroCfgIds ...string) error { func (this *ModelHero) createMultiHero(uid string, heroCfgIds ...string) error {
heroes := this.moduleHero.modelHero.getHeroList(uid) heroes := this.getHeroList(uid)
if len(heroes) == 0 { if len(heroes) == 0 {
for _, v := range heroCfgIds { for _, v := range heroCfgIds {
@ -217,7 +217,7 @@ func (this *ModelHero) createMultiHero(uid string, heroCfgIds ...string) error {
//获取一个英雄(参数唯一objID) //获取一个英雄(参数唯一objID)
func (this *ModelHero) getOneHero(uid, heroId string) *pb.DBHero { func (this *ModelHero) getOneHero(uid, heroId string) *pb.DBHero {
hero := &pb.DBHero{} hero := &pb.DBHero{}
err := this.moduleHero.modelHero.GetListObj(uid, heroId, hero) err := this.GetListObj(uid, heroId, hero)
if err != nil { if err != nil {
return nil return nil
} }
@ -241,7 +241,7 @@ func (this *ModelHero) consumeHeroCard(uid string, hero *pb.DBHero, count int32)
} }
hero.SameCount -= count // 数量-1 hero.SameCount -= count // 数量-1
if hero.SameCount == 0 { if hero.SameCount == 0 {
if err := this.moduleHero.modelHero.DelListlds(uid, hero.Id); err != nil { if err := this.DelListlds(uid, hero.Id); err != nil {
this.moduleHero.Errorf("%v", err) this.moduleHero.Errorf("%v", err)
} }
} else { } else {
@ -463,7 +463,7 @@ func (this *ModelHero) ChangeHeroProperty(session comm.IUserSession, hero *pb.DB
func (this *ModelHero) cleanData(uid string) { func (this *ModelHero) cleanData(uid string) {
userList := this.moduleHero.GetHeroList(uid) userList := this.moduleHero.GetHeroList(uid)
for _, v := range userList { for _, v := range userList {
if err := this.moduleHero.modelHero.DelListlds(uid, v.Id); err != nil { if err := this.DelListlds(uid, v.Id); err != nil {
this.moduleHero.Errorf("cleanData err:%v", err) this.moduleHero.Errorf("cleanData err:%v", err)
} }
} }
@ -534,14 +534,14 @@ func (this *ModelHero) AddCardExp(uid string, hero *pb.DBHero, exp int32) (newhe
// 玩家离线 清除缓存 // 玩家离线 清除缓存
func (this *ModelHero) RemoveUserHeroInfo(session comm.IUserSession) (err error) { func (this *ModelHero) RemoveUserHeroInfo(session comm.IUserSession) (err error) {
this.moduleHero.modelHero.BatchDelLists(session.GetUserId()) this.BatchDelLists(session.GetUserId())
return return
} }
// 获取抽卡保底相关数据 // 获取抽卡保底相关数据
func (this *ModelHero) GetCurStarCount(uid string, drawType int32) (curStar4Count int32, curStar5Count int32) { func (this *ModelHero) GetCurStarCount(uid string, drawType int32) (curStar4Count int32, curStar5Count int32) {
var race int32 var race int32
rst, _ := this.moduleHero.modelRecord.GetUserRecord(uid) rst, _ := this.moduleHero.modelRecord.GetHeroRecord(uid)
if drawType%2 == 0 { // 转成对应阵营信息 1~5 if drawType%2 == 0 { // 转成对应阵营信息 1~5
race = int32((int(drawType)) / 2) race = int32((int(drawType)) / 2)
} else { } else {

View File

@ -30,8 +30,8 @@ func (this *ModelRecord) getUserSession(uid string) (cuser *pb.CacheUser) {
} }
//获取用户通过扩展表 //获取用户通过扩展表
func (this *ModelRecord) GetUserRecord(uid string) (result *pb.DBUserRecord, err error) { func (this *ModelRecord) GetHeroRecord(uid string) (result *pb.DBHeroRecord, err error) {
result = &pb.DBUserRecord{} result = &pb.DBHeroRecord{}
if err = this.Get(uid, result); err != nil { if err = this.Get(uid, result); err != nil {
return return
} }
@ -39,7 +39,7 @@ func (this *ModelRecord) GetUserRecord(uid string) (result *pb.DBUserRecord, err
} }
//修改用户扩展数据 //修改用户扩展数据
func (this *ModelRecord) ChangeUserRecord(uid string, value map[string]interface{}) (err error) { func (this *ModelRecord) ChangeHeroRecord(uid string, value map[string]interface{}) (err error) {
if len(value) == 0 { if len(value) == 0 {
return nil return nil
} }

View File

@ -255,6 +255,7 @@ func (this *ModelItemsComp) addItemToUserPack(uid string, items []*pb.DB_UserIte
return return
} }
if conf, err = this.module.configure.GetItemConfigure(itemId); err != nil { if conf, err = this.module.configure.GetItemConfigure(itemId); err != nil {
this.module.Errorln(err)
return return
} }
if conf.UpperLimit == 0 { if conf.UpperLimit == 0 {

View File

@ -5,7 +5,6 @@ import (
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
"go_dreamfactory/modules" "go_dreamfactory/modules"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"sort"
) )
type Mainline struct { type Mainline struct {
@ -46,25 +45,24 @@ func (this *Mainline) ModifyMainlineData(uid string, objId string, data map[stri
} }
// 校验是否能挑战该关卡 // 校验是否能挑战该关卡
func (this *Mainline) CheckChallengeChapter(stroyId int32, uid string, zhangjieID int32, Intensity string) (code pb.ErrorCode) { func (this *Mainline) CheckChallengeChapter(storyObjId string, uid string, zhangjieID int32, Intensity string) (code pb.ErrorCode) {
var (
curChapter *pb.DBMainline
)
_szData, err := this.modelMainline.getMainlineList(uid)
if err != nil {
code = pb.ErrorCode_DBError
return
}
sort.SliceStable(_szData, func(i, j int) bool { // 排序
return _szData[i].ChapterId > _szData[j].ChapterId
})
// 取出最后一条数据 // _szData, err := this.modelMainline.getMainlineList(uid)
curChapter = _szData[len(_szData)-1] // if err != nil {
// code = pb.ErrorCode_DBError
// return
// }
// sort.SliceStable(_szData, func(i, j int) bool { // 排序
// return _szData[i].ChapterId > _szData[j].ChapterId
// })
// 获取当前关卡数据
curChapter := this.modelMainline.getOneChapterInfo(uid, storyObjId)
if curChapter == nil { if curChapter == nil {
code = pb.ErrorCode_MainlineNotFindChapter // 没有找到主线关卡信息 code = pb.ErrorCode_MainlineNotFindChapter // 没有找到主线关卡信息
return return
} }
stroyId := curChapter.ChapterId
// 获取关卡难度用来取配置文件 // 获取关卡难度用来取配置文件
if Intensity == comm.MailLineEasy { if Intensity == comm.MailLineEasy {
configData := this.configure.GetMainlineEasyChapter(curChapter.MainlineId) configData := this.configure.GetMainlineEasyChapter(curChapter.MainlineId)

33
modules/pagoda/api.go Normal file
View File

@ -0,0 +1,33 @@
package pagoda
import (
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
)
const (
MainlineGetListResp = "getlist"
MainlineChallengeResp = "challenge"
MainlineGetRewardResp = "getreward"
MainlineNewChapterPush = "newchapter"
)
type apiComp struct {
modules.MCompGate
service core.IService
module *Pagoda
}
//组件初始化接口
func (this *apiComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
err = this.MCompGate.Init(service, module, comp, options)
this.module = module.(*Pagoda)
this.service = service
return
}
func (this *apiComp) Start() (err error) {
err = this.MCompGate.Start()
return
}

View File

@ -0,0 +1,28 @@
package pagoda
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
//参数校验
func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.MainlineChallengeReq) (code pb.ErrorCode) {
if req.MainlineId == 0 {
code = pb.ErrorCode_ReqParameterError
return
}
return
}
///挑战主线关卡
func (this *apiComp) Challenge(session comm.IUserSession, req *pb.MainlineChallengeReq) (code pb.ErrorCode, data proto.Message) {
code = this.ChallengeCheck(session, req)
if code != pb.ErrorCode_Success {
return // 参数校验失败直接返回
}
return
}

View File

@ -0,0 +1,27 @@
package pagoda
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
//参数校验
func (this *apiComp) GetRewardCheck(session comm.IUserSession, req *pb.MainlineGetRewardReq) (code pb.ErrorCode) {
if req.ChapterObj == "" {
code = pb.ErrorCode_ReqParameterError
}
return
}
///获取主线关卡信息
func (this *apiComp) GetReward(session comm.IUserSession, req *pb.MainlineGetRewardReq) (code pb.ErrorCode, data proto.Message) {
code = this.GetRewardCheck(session, req)
if code != pb.ErrorCode_Success {
return // 参数校验失败直接返回
}
return
}

View File

@ -0,0 +1,46 @@
package pagoda
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"go.mongodb.org/mongo-driver/bson/primitive"
"google.golang.org/protobuf/proto"
)
//参数校验
func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.MainlineGetListReq) (code pb.ErrorCode) {
return
}
///获取主线关卡信息
func (this *apiComp) GetList(session comm.IUserSession, req *pb.MainlineGetListReq) (code pb.ErrorCode, data proto.Message) {
rsp := &pb.MainlineGetListResp{}
code = this.GetListCheck(session, req)
if code != pb.ErrorCode_Success {
return // 参数校验失败直接返回
}
list, err := this.module.modelPagoda.getPagodaList(session.GetUserId())
if err != nil {
code = pb.ErrorCode_DBError
return
}
if len(list) == 0 { // 如果数量为0 则默认创建一条数据
_data := &pb.DBMainline{}
_data.Id = primitive.NewObjectID().Hex()
_data.ChapterId = 1 // 默认第一章节
_mData := make(map[string]interface{}, 0)
_data.Uid = session.GetUserId()
_mData[_data.Id] = _data
this.module.modelPagoda.addNewPagoda(session.GetUserId(), _mData)
list = append(list, _data)
}
rsp.Data = list
session.SendMsg(string(this.module.GetType()), MainlineGetListResp, &pb.MainlineGetListResp{Data: rsp.Data})
return
}

View File

@ -0,0 +1,70 @@
package pagoda
import (
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/core/cbase"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/sys/configure"
cfg "go_dreamfactory/sys/configure/structs"
)
const (
game_pagoda = "game_pagoda.json"
game_pagodaseasonreward = "game_pagodaseasonreward.json"
game_pagodataskreward = "game_pagodataskreward.json"
)
///配置管理基础组件
type configureComp struct {
cbase.ModuleCompBase
}
//组件初始化接口
func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
err = this.ModuleCompBase.Init(service, module, comp, options)
err = this.LoadMultiConfigure(map[string]interface{}{
game_pagoda: cfg.NewGame_pagoda,
game_pagodaseasonreward: cfg.NewGame_pagodaSeasonReward,
game_pagodataskreward: cfg.NewGame_pagodaTaskReward,
})
return
}
//加载多个配置文件
func (this *configureComp) LoadMultiConfigure(confs map[string]interface{}) (err error) {
for k, v := range confs {
err = configure.RegisterConfigure(k, v)
if err != nil {
log.Errorf("配置文件:%s解析失败!", k)
break
}
}
return
}
//读取配置数据
func (this *configureComp) GetConfigure(name string) (v interface{}, err error) {
return configure.GetConfigure(name)
}
// 获取爬塔配置表数据
func (this *configureComp) GetPagodaconfig(id int32) (data *cfg.Game_pagodaData) {
if v, err := this.GetConfigure(game_pagoda); err != nil {
log.Errorf("get global conf err:%v", err)
return
} else {
var (
configure *cfg.Game_pagoda
ok bool
)
if configure, ok = v.(*cfg.Game_pagoda); !ok {
log.Errorf("%T no is *cfg.Game_mainlineEasyData", v)
return
}
if data, ok = configure.GetDataMap()[id]; ok {
return
}
}
return
}

View File

@ -0,0 +1,56 @@
package pagoda
import (
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
)
const ( //Redis
TablePagoda core.SqlTable = "pagoda"
)
type ModelPagoda struct {
modules.MCompModel
module *Pagoda
}
func (this *ModelPagoda) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
err = this.MCompModel.Init(service, module, comp, options)
this.module = module.(*Pagoda)
this.TableName = string(TablePagoda)
return
}
// 获取爬塔信息
func (this *ModelPagoda) getPagodaList(uid string) (storys []*pb.DBMainline, err error) {
storys = make([]*pb.DBMainline, 0)
err = this.GetList(uid, &storys)
return
}
// 修改爬塔数据信息
func (this *ModelPagoda) modifyPagodaDataByObjId(uid string, objid string, data map[string]interface{}) error {
return this.ChangeList(uid, objid, data)
}
// 创建一个新的塔数据
func (this *ModelPagoda) addNewPagoda(uId string, data map[string]interface{}) (err error) {
if err = this.AddLists(uId, data); err != nil {
this.module.Errorf("err:%v", err)
return
}
return nil
}
// 获取指定塔数据
func (this *ModelPagoda) getPagodaByObjId(uid, obj string) *pb.DBMainline {
data := &pb.DBMainline{}
err := this.GetListObj(uid, obj, data)
if err != nil {
this.module.Errorf("%v", err)
return nil
}
return data
}

45
modules/pagoda/module.go Normal file
View File

@ -0,0 +1,45 @@
package pagoda
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
)
type Pagoda struct {
modules.ModuleBase
modelPagoda *ModelPagoda
api *apiComp
configure *configureComp
}
func NewModule() core.IModule {
return &Pagoda{}
}
func (this *Pagoda) GetType() core.M_Modules {
return comm.ModulePagoda
}
func (this *Pagoda) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options)
return
}
func (this *Pagoda) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.modelPagoda = this.RegisterComp(new(ModelPagoda)).(*ModelPagoda)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
}
// 接口信息
func (this *Pagoda) ModifyPagodaData(uid string, objId string, data map[string]interface{}) (code pb.ErrorCode) {
err := this.modelPagoda.modifyPagodaDataByObjId(uid, objId, data)
if err != nil {
code = pb.ErrorCode_DBError
}
return
}

View File

@ -306,6 +306,181 @@ func (x *DBHero) GetEnergyProperty() map[string]int32 {
return nil return nil
} }
type Floor struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
H4 int32 `protobuf:"varint,1,opt,name=h4,proto3" json:"h4"` // 4星次数
H5 int32 `protobuf:"varint,2,opt,name=h5,proto3" json:"h5"` // 5星次数
}
func (x *Floor) Reset() {
*x = Floor{}
if protoimpl.UnsafeEnabled {
mi := &file_hero_hero_db_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Floor) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Floor) ProtoMessage() {}
func (x *Floor) ProtoReflect() protoreflect.Message {
mi := &file_hero_hero_db_proto_msgTypes[2]
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 Floor.ProtoReflect.Descriptor instead.
func (*Floor) Descriptor() ([]byte, []int) {
return file_hero_hero_db_proto_rawDescGZIP(), []int{2}
}
func (x *Floor) GetH4() int32 {
if x != nil {
return x.H4
}
return 0
}
func (x *Floor) GetH5() int32 {
if x != nil {
return x.H5
}
return 0
}
//英雄扩展数据
type DBHeroRecord struct {
state protoimpl.MessageState
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"` // 修改时间
}
func (x *DBHeroRecord) Reset() {
*x = DBHeroRecord{}
if protoimpl.UnsafeEnabled {
mi := &file_hero_hero_db_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DBHeroRecord) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DBHeroRecord) ProtoMessage() {}
func (x *DBHeroRecord) ProtoReflect() protoreflect.Message {
mi := &file_hero_hero_db_proto_msgTypes[3]
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 DBHeroRecord.ProtoReflect.Descriptor instead.
func (*DBHeroRecord) Descriptor() ([]byte, []int) {
return file_hero_hero_db_proto_rawDescGZIP(), []int{3}
}
func (x *DBHeroRecord) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *DBHeroRecord) GetUid() string {
if x != nil {
return x.Uid
}
return ""
}
func (x *DBHeroRecord) GetRace0() *Floor {
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 0
}
func (x *DBHeroRecord) GetActivityid() int32 {
if x != nil {
return x.Activityid
}
return 0
}
func (x *DBHeroRecord) GetMtime() int64 {
if x != nil {
return x.Mtime
}
return 0
}
var File_hero_hero_db_proto protoreflect.FileDescriptor var File_hero_hero_db_proto protoreflect.FileDescriptor
var file_hero_hero_db_proto_rawDesc = []byte{ var file_hero_hero_db_proto_rawDesc = []byte{
@ -379,8 +554,28 @@ var file_hero_hero_db_proto_rawDesc = []byte{
0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03,
0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14,
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 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, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x27, 0x0a, 0x05, 0x46, 0x6c, 0x6f, 0x6f,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 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, 0x9c, 0x02, 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,
0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -395,26 +590,33 @@ func file_hero_hero_db_proto_rawDescGZIP() []byte {
return file_hero_hero_db_proto_rawDescData return file_hero_hero_db_proto_rawDescData
} }
var file_hero_hero_db_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_hero_hero_db_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_hero_hero_db_proto_goTypes = []interface{}{ var file_hero_hero_db_proto_goTypes = []interface{}{
(*SkillData)(nil), // 0: SkillData (*SkillData)(nil), // 0: SkillData
(*DBHero)(nil), // 1: DBHero (*DBHero)(nil), // 1: DBHero
nil, // 2: DBHero.PropertyEntry (*Floor)(nil), // 2: Floor
nil, // 3: DBHero.AddPropertyEntry (*DBHeroRecord)(nil), // 3: DBHeroRecord
nil, // 4: DBHero.EnergyEntry nil, // 4: DBHero.PropertyEntry
nil, // 5: DBHero.EnergyPropertyEntry nil, // 5: DBHero.AddPropertyEntry
nil, // 6: DBHero.EnergyEntry
nil, // 7: DBHero.EnergyPropertyEntry
} }
var file_hero_hero_db_proto_depIdxs = []int32{ var file_hero_hero_db_proto_depIdxs = []int32{
0, // 0: DBHero.normalSkill:type_name -> SkillData 0, // 0: DBHero.normalSkill:type_name -> SkillData
2, // 1: DBHero.property:type_name -> DBHero.PropertyEntry 4, // 1: DBHero.property:type_name -> DBHero.PropertyEntry
3, // 2: DBHero.addProperty:type_name -> DBHero.AddPropertyEntry 5, // 2: DBHero.addProperty:type_name -> DBHero.AddPropertyEntry
4, // 3: DBHero.energy:type_name -> DBHero.EnergyEntry 6, // 3: DBHero.energy:type_name -> DBHero.EnergyEntry
5, // 4: DBHero.energyProperty:type_name -> DBHero.EnergyPropertyEntry 7, // 4: DBHero.energyProperty:type_name -> DBHero.EnergyPropertyEntry
5, // [5:5] is the sub-list for method output_type 2, // 5: DBHeroRecord.race0:type_name -> Floor
5, // [5:5] is the sub-list for method input_type 2, // 6: DBHeroRecord.race1:type_name -> Floor
5, // [5:5] is the sub-list for extension type_name 2, // 7: DBHeroRecord.race2:type_name -> Floor
5, // [5:5] is the sub-list for extension extendee 2, // 8: DBHeroRecord.race3:type_name -> Floor
0, // [0:5] is the sub-list for field type_name 2, // 9: DBHeroRecord.race4:type_name -> Floor
10, // [10:10] is the sub-list for method output_type
10, // [10:10] is the sub-list for method input_type
10, // [10:10] is the sub-list for extension type_name
10, // [10:10] is the sub-list for extension extendee
0, // [0:10] is the sub-list for field type_name
} }
func init() { file_hero_hero_db_proto_init() } func init() { file_hero_hero_db_proto_init() }
@ -447,6 +649,30 @@ func file_hero_hero_db_proto_init() {
return nil return nil
} }
} }
file_hero_hero_db_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Floor); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_hero_hero_db_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBHeroRecord); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
} }
type x struct{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
@ -454,7 +680,7 @@ func file_hero_hero_db_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_hero_hero_db_proto_rawDesc, RawDescriptor: file_hero_hero_db_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 6, NumMessages: 8,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },

View File

@ -1,305 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.0
// protoc v3.20.0
// source: hero/userrecord.proto
package pb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Floor struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
H4 int32 `protobuf:"varint,1,opt,name=h4,proto3" json:"h4"` // 4星次数
H5 int32 `protobuf:"varint,2,opt,name=h5,proto3" json:"h5"` // 5星次数
}
func (x *Floor) Reset() {
*x = Floor{}
if protoimpl.UnsafeEnabled {
mi := &file_hero_userrecord_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Floor) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Floor) ProtoMessage() {}
func (x *Floor) ProtoReflect() protoreflect.Message {
mi := &file_hero_userrecord_proto_msgTypes[0]
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 Floor.ProtoReflect.Descriptor instead.
func (*Floor) Descriptor() ([]byte, []int) {
return file_hero_userrecord_proto_rawDescGZIP(), []int{0}
}
func (x *Floor) GetH4() int32 {
if x != nil {
return x.H4
}
return 0
}
func (x *Floor) GetH5() int32 {
if x != nil {
return x.H5
}
return 0
}
//用户扩展数据
type DBUserRecord struct {
state protoimpl.MessageState
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"` // 修改时间
}
func (x *DBUserRecord) Reset() {
*x = DBUserRecord{}
if protoimpl.UnsafeEnabled {
mi := &file_hero_userrecord_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DBUserRecord) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DBUserRecord) ProtoMessage() {}
func (x *DBUserRecord) ProtoReflect() protoreflect.Message {
mi := &file_hero_userrecord_proto_msgTypes[1]
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 DBUserRecord.ProtoReflect.Descriptor instead.
func (*DBUserRecord) Descriptor() ([]byte, []int) {
return file_hero_userrecord_proto_rawDescGZIP(), []int{1}
}
func (x *DBUserRecord) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *DBUserRecord) GetUid() string {
if x != nil {
return x.Uid
}
return ""
}
func (x *DBUserRecord) GetRace0() *Floor {
if x != nil {
return x.Race0
}
return nil
}
func (x *DBUserRecord) GetRace1() *Floor {
if x != nil {
return x.Race1
}
return nil
}
func (x *DBUserRecord) GetRace2() *Floor {
if x != nil {
return x.Race2
}
return nil
}
func (x *DBUserRecord) GetRace3() *Floor {
if x != nil {
return x.Race3
}
return nil
}
func (x *DBUserRecord) GetRace4() *Floor {
if x != nil {
return x.Race4
}
return nil
}
func (x *DBUserRecord) GetTriggernum() int32 {
if x != nil {
return x.Triggernum
}
return 0
}
func (x *DBUserRecord) GetActivityid() int32 {
if x != nil {
return x.Activityid
}
return 0
}
func (x *DBUserRecord) GetMtime() int64 {
if x != nil {
return x.Mtime
}
return 0
}
var File_hero_userrecord_proto protoreflect.FileDescriptor
var file_hero_userrecord_proto_rawDesc = []byte{
0x0a, 0x15, 0x68, 0x65, 0x72, 0x6f, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x72, 0x65, 0x63, 0x6f, 0x72,
0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 0x9c, 0x02, 0x0a, 0x0c, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 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, 0x42,
0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_hero_userrecord_proto_rawDescOnce sync.Once
file_hero_userrecord_proto_rawDescData = file_hero_userrecord_proto_rawDesc
)
func file_hero_userrecord_proto_rawDescGZIP() []byte {
file_hero_userrecord_proto_rawDescOnce.Do(func() {
file_hero_userrecord_proto_rawDescData = protoimpl.X.CompressGZIP(file_hero_userrecord_proto_rawDescData)
})
return file_hero_userrecord_proto_rawDescData
}
var file_hero_userrecord_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_hero_userrecord_proto_goTypes = []interface{}{
(*Floor)(nil), // 0: Floor
(*DBUserRecord)(nil), // 1: DBUserRecord
}
var file_hero_userrecord_proto_depIdxs = []int32{
0, // 0: DBUserRecord.race0:type_name -> Floor
0, // 1: DBUserRecord.race1:type_name -> Floor
0, // 2: DBUserRecord.race2:type_name -> Floor
0, // 3: DBUserRecord.race3:type_name -> Floor
0, // 4: DBUserRecord.race4:type_name -> Floor
5, // [5:5] is the sub-list for method output_type
5, // [5:5] is the sub-list for method input_type
5, // [5:5] is the sub-list for extension type_name
5, // [5:5] is the sub-list for extension extendee
0, // [0:5] is the sub-list for field type_name
}
func init() { file_hero_userrecord_proto_init() }
func file_hero_userrecord_proto_init() {
if File_hero_userrecord_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_hero_userrecord_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Floor); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_hero_userrecord_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBUserRecord); 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{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_hero_userrecord_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_hero_userrecord_proto_goTypes,
DependencyIndexes: file_hero_userrecord_proto_depIdxs,
MessageInfos: file_hero_userrecord_proto_msgTypes,
}.Build()
File_hero_userrecord_proto = out.File
file_hero_userrecord_proto_rawDesc = nil
file_hero_userrecord_proto_goTypes = nil
file_hero_userrecord_proto_depIdxs = nil
}

View File

@ -0,0 +1,40 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
type Game_pagoda struct {
_dataMap map[int32]*Game_pagodaData
_dataList []*Game_pagodaData
_dataList1 map[int32]*Game_pagodaData
}
func NewGame_pagoda(_buf []map[string]interface{}) (*Game_pagoda, error) {
_dataList := make([]*Game_pagodaData, 0, len(_buf))
dataMap := make(map[int32]*Game_pagodaData)
for _, _ele_ := range _buf {
if _v, err2 := NewGame_pagodaData(_ele_); err2 != nil {
return nil, err2
} else {
_dataList = append(_dataList, _v)
dataMap[_v.Key] = _v
}
}
return &Game_pagoda{_dataList: _dataList, _dataMap: dataMap}, nil
}
func (table *Game_pagoda) GetDataMap() map[int32]*Game_pagodaData {
return table._dataMap
}
func (table *Game_pagoda) GetDataList() []*Game_pagodaData {
return table._dataList
}
func (table *Game_pagoda) Get(key int32) *Game_pagodaData {
return table._dataMap[key]
}

View File

@ -0,0 +1,191 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
import "errors"
type Game_pagodaData struct {
Key int32
PagodaType int32
LevelType int32
PreLevel int32
LayerNum int32
MonsterLv []int32
MonsterHp []float32
MonsterAtk []float32
MonsterDef float32
Batch1 []int32
Batch2 []int32
Batch3 []int32
Proportion1 []float32
Proportion2 []float32
Proportion3 []float32
Reward []*Game_atn
FightScene string
NameDisplay string
ModelDisplay int32
}
func (Game_pagodaData) GetTypeId() int {
return -1914602212
}
func NewGame_pagodaData(_buf map[string]interface{}) (_v *Game_pagodaData, err error) {
_v = &Game_pagodaData{}
{ 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["pagoda_type"].(float64); !_ok_ { err = errors.New("pagoda_type error"); return }; _v.PagodaType = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["Level_type"].(float64); !_ok_ { err = errors.New("Level_type error"); return }; _v.LevelType = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["PreLevel"].(float64); !_ok_ { err = errors.New("PreLevel error"); return }; _v.PreLevel = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["layer_num"].(float64); !_ok_ { err = errors.New("layer_num error"); return }; _v.LayerNum = int32(_tempNum_) }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["monster_lv"].([]interface{}); !_ok_ { err = errors.New("monster_lv error"); return }
_v.MonsterLv = make([]int32, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ int32
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) }
_v.MonsterLv = append(_v.MonsterLv, _list_v_)
}
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["monster_hp"].([]interface{}); !_ok_ { err = errors.New("monster_hp error"); return }
_v.MonsterHp = make([]float32, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ float32
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = float32(_x_) }
_v.MonsterHp = append(_v.MonsterHp, _list_v_)
}
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["monster_atk"].([]interface{}); !_ok_ { err = errors.New("monster_atk error"); return }
_v.MonsterAtk = make([]float32, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ float32
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = float32(_x_) }
_v.MonsterAtk = append(_v.MonsterAtk, _list_v_)
}
}
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["monster_def"].(float64); !_ok_ { err = errors.New("monster_def error"); return }; _v.MonsterDef = float32(_tempNum_) }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["batch1"].([]interface{}); !_ok_ { err = errors.New("batch1 error"); return }
_v.Batch1 = make([]int32, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ int32
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) }
_v.Batch1 = append(_v.Batch1, _list_v_)
}
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["batch2"].([]interface{}); !_ok_ { err = errors.New("batch2 error"); return }
_v.Batch2 = make([]int32, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ int32
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) }
_v.Batch2 = append(_v.Batch2, _list_v_)
}
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["batch3"].([]interface{}); !_ok_ { err = errors.New("batch3 error"); return }
_v.Batch3 = make([]int32, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ int32
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) }
_v.Batch3 = append(_v.Batch3, _list_v_)
}
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["proportion1"].([]interface{}); !_ok_ { err = errors.New("proportion1 error"); return }
_v.Proportion1 = make([]float32, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ float32
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = float32(_x_) }
_v.Proportion1 = append(_v.Proportion1, _list_v_)
}
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["proportion2"].([]interface{}); !_ok_ { err = errors.New("proportion2 error"); return }
_v.Proportion2 = make([]float32, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ float32
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = float32(_x_) }
_v.Proportion2 = append(_v.Proportion2, _list_v_)
}
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["proportion3"].([]interface{}); !_ok_ { err = errors.New("proportion3 error"); return }
_v.Proportion3 = make([]float32, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ float32
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = float32(_x_) }
_v.Proportion3 = append(_v.Proportion3, _list_v_)
}
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["reward"].([]interface{}); !_ok_ { err = errors.New("reward error"); return }
_v.Reward = 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.Reward = append(_v.Reward, _list_v_)
}
}
{ var _ok_ bool; if _v.FightScene, _ok_ = _buf["fight_scene"].(string); !_ok_ { err = errors.New("fight_scene error"); return } }
{ var _ok_ bool; if _v.NameDisplay, _ok_ = _buf["name_display"].(string); !_ok_ { err = errors.New("name_display error"); return } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["model_display"].(float64); !_ok_ { err = errors.New("model_display error"); return }; _v.ModelDisplay = int32(_tempNum_) }
return
}

View File

@ -0,0 +1,42 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
type Game_pagodaSeasonReward struct {
_dataMap map[int32]*Game_pagodaSeasonRewardData
_dataList []*Game_pagodaSeasonRewardData
}
func NewGame_pagodaSeasonReward(_buf []map[string]interface{}) (*Game_pagodaSeasonReward, error) {
_dataList := make([]*Game_pagodaSeasonRewardData, 0, len(_buf))
dataMap := make(map[int32]*Game_pagodaSeasonRewardData)
for _, _ele_ := range _buf {
if _v, err2 := NewGame_pagodaSeasonRewardData(_ele_); err2 != nil {
return nil, err2
} else {
_dataList = append(_dataList, _v)
dataMap[_v.Key] = _v
}
}
return &Game_pagodaSeasonReward{_dataList:_dataList, _dataMap:dataMap}, nil
}
func (table *Game_pagodaSeasonReward) GetDataMap() map[int32]*Game_pagodaSeasonRewardData {
return table._dataMap
}
func (table *Game_pagodaSeasonReward) GetDataList() []*Game_pagodaSeasonRewardData {
return table._dataList
}
func (table *Game_pagodaSeasonReward) Get(key int32) *Game_pagodaSeasonRewardData {
return table._dataMap[key]
}

View File

@ -0,0 +1,55 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
import "errors"
type Game_pagodaSeasonRewardData struct {
Key int32
Ranking []int32
Reward []*Game_atn
}
func (Game_pagodaSeasonRewardData) GetTypeId() int {
return -1585398482
}
func NewGame_pagodaSeasonRewardData(_buf map[string]interface{}) (_v *Game_pagodaSeasonRewardData, err error) {
_v = &Game_pagodaSeasonRewardData{}
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["key"].(float64); !_ok_ { err = errors.New("key error"); return }; _v.Key = int32(_tempNum_) }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["ranking"].([]interface{}); !_ok_ { err = errors.New("ranking error"); return }
_v.Ranking = make([]int32, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ int32
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) }
_v.Ranking = append(_v.Ranking, _list_v_)
}
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["reward"].([]interface{}); !_ok_ { err = errors.New("reward error"); return }
_v.Reward = 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.Reward = append(_v.Reward, _list_v_)
}
}
return
}

View File

@ -0,0 +1,42 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
type Game_pagodaTaskReward struct {
_dataMap map[int32]*Game_pagodaTaskRewardData
_dataList []*Game_pagodaTaskRewardData
}
func NewGame_pagodaTaskReward(_buf []map[string]interface{}) (*Game_pagodaTaskReward, error) {
_dataList := make([]*Game_pagodaTaskRewardData, 0, len(_buf))
dataMap := make(map[int32]*Game_pagodaTaskRewardData)
for _, _ele_ := range _buf {
if _v, err2 := NewGame_pagodaTaskRewardData(_ele_); err2 != nil {
return nil, err2
} else {
_dataList = append(_dataList, _v)
dataMap[_v.Key] = _v
}
}
return &Game_pagodaTaskReward{_dataList:_dataList, _dataMap:dataMap}, nil
}
func (table *Game_pagodaTaskReward) GetDataMap() map[int32]*Game_pagodaTaskRewardData {
return table._dataMap
}
func (table *Game_pagodaTaskReward) GetDataList() []*Game_pagodaTaskRewardData {
return table._dataList
}
func (table *Game_pagodaTaskReward) Get(key int32) *Game_pagodaTaskRewardData {
return table._dataMap[key]
}

View File

@ -0,0 +1,57 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
import "errors"
type Game_pagodaTaskRewardData struct {
Key int32
PagodaType int32
LayerNum []int32
Reward []*Game_atn
}
func (Game_pagodaTaskRewardData) GetTypeId() int {
return 530520528
}
func NewGame_pagodaTaskRewardData(_buf map[string]interface{}) (_v *Game_pagodaTaskRewardData, err error) {
_v = &Game_pagodaTaskRewardData{}
{ 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["pagoda_type"].(float64); !_ok_ { err = errors.New("pagoda_type error"); return }; _v.PagodaType = int32(_tempNum_) }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["layer_num"].([]interface{}); !_ok_ { err = errors.New("layer_num error"); return }
_v.LayerNum = make([]int32, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ int32
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) }
_v.LayerNum = append(_v.LayerNum, _list_v_)
}
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["reward"].([]interface{}); !_ok_ { err = errors.New("reward error"); return }
_v.Reward = 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.Reward = append(_v.Reward, _list_v_)
}
}
return
}