需求调整,能同时打不同页签的塔

This commit is contained in:
meixiongfeng 2023-03-20 18:19:31 +08:00
parent bd21f7ee76
commit 53999edfbe
11 changed files with 300 additions and 2256 deletions

File diff suppressed because it is too large Load Diff

View File

@ -3,11 +3,7 @@ package pagoda
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/sys/db"
"time"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
@ -27,43 +23,13 @@ func (this *apiComp) Activate(session comm.IUserSession, req *pb.PagodaActivateR
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
return return
} }
Nomalcfg := this.module.configure.GetPagodaConfigData(comm.PagodaType, list.PagodaId+1) Nomalcfg := this.module.configure.GetPagodaConfigData(list.PagodaId + 1)
if Nomalcfg == nil && !list.Complete { if Nomalcfg == nil && !list.Complete {
list.Complete = true list.Complete = true
this.module.ModifyPagodaData(session.GetUserId(), map[string]interface{}{ this.module.ModifyPagodaData(session.GetUserId(), map[string]interface{}{
"complete": true, "complete": true,
}) })
} }
if list.Complete {
season, _ := this.module.modelSeasonPagoda.getSeasonPagodaList(session.GetUserId())
if season.Id == "" {
season.Id = primitive.NewObjectID().Hex()
season.Uid = session.GetUserId()
season.PagodaId = 0 // 初始数据0层
if conn, err := db.Cross(); err == nil {
rst := conn.Mgo.FindOne(comm.TableSeasonData, bson.M{})
server := &pb.DBServerData{}
rst.Decode(server)
season.Type = server.SeasonType
dbModel := db.NewDBModel(comm.TableSeasonRecord, time.Hour, conn)
if err = dbModel.Add(session.GetUserId(), season); err != nil {
this.module.Errorf("err:%v", err)
return
}
}
this.module.modelSeasonPagoda.addNewSeasonPagoda(session.GetUserId(), season)
}
list = &pb.DBPagoda{
Id: season.Id,
Uid: season.Uid,
PagodaId: season.PagodaId,
Reward: season.Reward,
Type: season.Type,
}
}
session.SendMsg(string(this.module.GetType()), PagodaActivateResp, &pb.PagodaActivateResp{Data: list}) session.SendMsg(string(this.module.GetType()), PagodaActivateResp, &pb.PagodaActivateResp{Data: list})
return return

View File

@ -9,7 +9,7 @@ import (
//参数校验 //参数校验
func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.PagodaChallengeReq) (code pb.ErrorCode) { func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.PagodaChallengeReq) (code pb.ErrorCode) {
if req.LevelID <= 0 && req.PagodaType != 0 { if req.Cid <= 0 {
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
return return
} }
@ -27,7 +27,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PagodaChalleng
return // 参数校验失败直接返回 return // 参数校验失败直接返回
} }
conf := this.module.configure.GetPagodaConfigData(req.PagodaType, req.LevelID) conf := this.module.configure.GetPagodaConfigData(req.Cid)
if conf == nil { if conf == nil {
code = pb.ErrorCode_PagodaNotFound code = pb.ErrorCode_PagodaNotFound
return return
@ -38,17 +38,21 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PagodaChalleng
code = pb.ErrorCode_PagodaNotFound code = pb.ErrorCode_PagodaNotFound
return return
} }
if pagoda.Complete {
pagoda, err = this.module.modelSeasonPagoda.getSeasonPagodaList(session.GetUserId()) if v, ok := pagoda.Data[req.Cid]; !ok {
if err != nil { if conf.LayerNum == 1 {
code = pb.ErrorCode_PagodaNotFound pagoda.Data[req.Cid] = 0
} else {
code = pb.ErrorCode_PagodaLevlErr // 挑战关卡数据不匹配
return
}
} else {
if conf.LayerNum-1 != v {
code = pb.ErrorCode_PagodaLevlErr // 挑战关卡数据不匹配
return return
} }
} }
if pagoda.Type != conf.PagodaType || conf.LayerNum-1 != pagoda.PagodaId {
code = pb.ErrorCode_PagodaLevlErr // 挑战关卡数据不匹配
return
}
// 校验条件 // 校验条件
if conf.Unlock != 0 { if conf.Unlock != 0 {
if !this.mline.CheckCommpleteStage(session.GetUserId(), conf.Unlock) { if !this.mline.CheckCommpleteStage(session.GetUserId(), conf.Unlock) {
@ -66,9 +70,8 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PagodaChalleng
return return
} }
session.SendMsg(string(this.module.GetType()), PagodaChallengeResp, &pb.PagodaChallengeResp{ session.SendMsg(string(this.module.GetType()), PagodaChallengeResp, &pb.PagodaChallengeResp{
Info: &pb.BattleInfo{Id: record.Id, Title: record.Title, Btype: record.Btype, Ptype: record.Ptype, RedCompId: record.RedCompId, Redflist: record.Redflist, BlueCompId: record.BlueCompId, Buleflist: record.Buleflist}, Info: &pb.BattleInfo{Id: record.Id, Title: record.Title, Btype: record.Btype, Ptype: record.Ptype, RedCompId: record.RedCompId, Redflist: record.Redflist, BlueCompId: record.BlueCompId, Buleflist: record.Buleflist},
LevelID: req.LevelID, Cid: req.Cid,
PagodaType: req.PagodaType,
}) })
return return
} }

View File

@ -14,7 +14,7 @@ import (
//参数校验 //参数校验
func (this *apiComp) ChallengeOverCheck(session comm.IUserSession, req *pb.PagodaChallengeOverReq) (code pb.ErrorCode) { func (this *apiComp) ChallengeOverCheck(session comm.IUserSession, req *pb.PagodaChallengeOverReq) (code pb.ErrorCode) {
if req.LevelID <= 0 && req.PagodaType != 0 { if req.Cid <= 0 {
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
return return
} }
@ -29,7 +29,6 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
costTime int32 // 本次战斗消耗的时间 costTime int32 // 本次战斗消耗的时间
isWin bool isWin bool
err error err error
bSeason bool
) )
mapData = make(map[string]interface{}, 0) mapData = make(map[string]interface{}, 0)
code = this.ChallengeOverCheck(session, req) code = this.ChallengeOverCheck(session, req)
@ -37,7 +36,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
return // 参数校验失败直接返回 return // 参数校验失败直接返回
} }
conf := this.module.configure.GetPagodaConfigData(req.PagodaType, req.LevelID) conf := this.module.configure.GetPagodaConfigData(req.Cid)
if conf == nil { if conf == nil {
code = pb.ErrorCode_PagodaNotFound code = pb.ErrorCode_PagodaNotFound
return return
@ -48,18 +47,25 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
return return
} }
if pagoda.Complete { if v, ok := pagoda.Data[req.Cid]; !ok {
// 塔数据校验 if conf.LayerNum == 1 {
pagoda, err = this.module.modelSeasonPagoda.getSeasonPagodaList(session.GetUserId()) pagoda.Data[req.Cid] = 0
if err != nil { } else {
code = pb.ErrorCode_PagodaNotFound code = pb.ErrorCode_PagodaLevlErr // 挑战关卡数据不匹配
return
}
} else {
if conf.LayerNum-1 != v {
code = pb.ErrorCode_PagodaLevlErr // 挑战关卡数据不匹配
return return
} }
bSeason = true
} }
if pagoda.Type != conf.PagodaType || conf.LayerNum-1 != pagoda.PagodaId { // 校验条件
code = pb.ErrorCode_PagodaLevlErr // 挑战关卡数据不匹配 if conf.Unlock != 0 {
return if !this.mline.CheckCommpleteStage(session.GetUserId(), conf.Unlock) {
code = pb.ErrorCode_PagodaUnlock
return
}
} }
// 校验通过 // 校验通过
code, isWin = this.module.battle.CheckBattleReport(session, req.Report) code, isWin = this.module.battle.CheckBattleReport(session, req.Report)
@ -79,87 +85,73 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
} }
} }
} }
if !bSeason { // 普通塔
pagoda.Type = req.PagodaType
mapData["pagodaId"] = conf.LayerNum
mapData["type"] = pagoda.Type
this.module.modulerank.AddPagodaRecord(session.GetUserId(), costTime, pagoda.PagodaId, conf.PagodaType) pagoda.Data[req.Cid] += 1
// 普通塔通关了 mapData["pagodaId"] = pagoda.PagodaId
Nomalcfg := this.module.configure.GetPagodaConfigData(comm.PagodaType, pagoda.PagodaId+1) mapData["type"] = pagoda.Type
if Nomalcfg == nil { mapData["data"] = pagoda.Data
pagoda.Complete = true
mapData["complete"] = pagoda.Complete
}
this.module.modulerank.AddPagodaRecord(session.GetUserId(), costTime, pagoda.PagodaId, conf.PagodaType)
if conf.LayerNum > pagoda.PagodaId {
pagoda.PagodaId = conf.LayerNum // 更新层数 pagoda.PagodaId = conf.LayerNum // 更新层数
code = this.module.ModifyPagodaData(session.GetUserId(), mapData) }
session.SendMsg(string(this.module.GetType()), PagodaChallengeOverResp, &pb.PagodaChallengeOverResp{Data: pagoda})
if user := this.module.ModuleUser.GetUser(session.GetUserId()); user != nil { // 发系统公告 code = this.module.ModifyPagodaData(session.GetUserId(), mapData)
this.chat.SendSysChatToWorld(comm.ChatSystem4, nil, pagoda.PagodaId, 0, user.Name) session.SendMsg(string(this.module.GetType()), PagodaChallengeOverResp, &pb.PagodaChallengeOverResp{Data: pagoda})
} else { if user := this.module.ModuleUser.GetUser(session.GetUserId()); user != nil { // 发系统公告
this.module.Errorf("no found userdata uid:%s", session.GetUserId()) this.chat.SendSysChatToWorld(comm.ChatSystem4, nil, pagoda.PagodaId, 0, user.Name)
}
} else { } else {
pagoda.PagodaId = conf.LayerNum this.module.Errorf("no found userdata uid:%s", session.GetUserId())
mapData["pagodaId"] = conf.LayerNum }
// 记录爬塔明细数据
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 { // 记录爬塔明细数据
sz := make([]*pb.LineUp, 5) if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
for i, v := range req.Report.Info.Redflist[0].Team { sz := make([]*pb.LineUp, 5)
if v != nil { for i, v := range req.Report.Info.Redflist[0].Team {
sz[i] = &pb.LineUp{ if v != nil {
Cid: v.HeroID, sz[i] = &pb.LineUp{
Star: v.Star, Cid: v.HeroID,
Lv: v.Lv, Star: v.Star,
} Lv: v.Lv,
} }
} }
// 数据直接插入跨服数据库中
uid := session.GetUserId()
userinfo := this.module.ModuleUser.GetUser(session.GetUserId())
newData := &pb.DBPagodaRecord{
Id: primitive.NewObjectID().Hex(),
Uid: session.GetUserId(),
PagodaId: pagoda.PagodaId,
Type: pagoda.Type,
Nickname: userinfo.Name,
Icon: "", // icon 暂无
Lv: userinfo.Lv,
CostTime: req.Report.Costtime,
}
costTime = newData.CostTime
// 数据写到跨服中
conn_, err := db.Cross()
dbModel := db.NewDBModel(comm.TableSeasonRecord, time.Hour, conn_)
dbModel.AddList(uid, newData.Id, newData)
this.module.SetPagodaRankList("pagodaList"+strconv.Itoa(int(newData.PagodaId)), int64(math.MaxInt32-newData.CostTime), newData.Id)
dbModelTable := db.NewDBModel(comm.TableSeasonPagoda, time.Hour, conn_)
if err = dbModelTable.Get(session.GetUserId(), pagoda); err == nil {
dbModelTable.Change(session.GetUserId(), mapData) // 修改跨服数据
score := int64(pagoda.PagodaId)<<31 + int64(math.MaxInt32-costTime)
this.module.SetPagodaRankList("pagodaSeasonRank", score, session.GetUserId())
}
} }
code = this.module.ModifySeasonPagodaData(session.GetUserId(), mapData) // 数据直接插入跨服数据库中
if user := this.module.ModuleUser.GetUser(session.GetUserId()); user != nil { uid := session.GetUserId()
this.chat.SendSysChatToWorld(comm.ChatSystem6, nil, pagoda.PagodaId, 0, user.Name) userinfo := this.module.ModuleUser.GetUser(session.GetUserId())
} else { newData := &pb.DBPagodaRecord{
this.module.Errorf("no found userdata uid:%s", session.GetUserId()) Id: primitive.NewObjectID().Hex(),
Uid: session.GetUserId(),
PagodaId: pagoda.PagodaId,
Type: pagoda.Type,
Nickname: userinfo.Name,
Icon: "", // icon 暂无
Lv: userinfo.Lv,
CostTime: req.Report.Costtime,
}
costTime = newData.CostTime
// 数据写到跨服中
conn_, err := db.Cross()
dbModel := db.NewDBModel(comm.TableSeasonRecord, time.Hour, conn_)
dbModel.AddList(uid, newData.Id, newData)
this.module.SetPagodaRankList("pagodaList"+strconv.Itoa(int(newData.PagodaId)), int64(math.MaxInt32-newData.CostTime), newData.Id)
dbModelTable := db.NewDBModel(comm.TableSeasonPagoda, time.Hour, conn_)
if err = dbModelTable.Get(session.GetUserId(), pagoda); err == nil {
dbModelTable.Change(session.GetUserId(), mapData) // 修改跨服数据
score := int64(pagoda.PagodaId)<<31 + int64(math.MaxInt32-costTime)
this.module.SetPagodaRankList("pagodaSeasonRank", score, session.GetUserId())
} }
session.SendMsg(string(this.module.GetType()), PagodaChallengeOverResp, &pb.PagodaChallengeOverResp{Data: pagoda})
} }
// 通关奖励 // 通关奖励
code = this.module.DispenseRes(session, conf.Reward, true) code = this.module.DispenseRes(session, conf.Reward, true)
if code != pb.ErrorCode_Success { if code != pb.ErrorCode_Success {
return return
} }
// 任务相关 // 任务相关
if req.PagodaType == comm.PagodaType {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype58, 1) this.module.ModuleRtask.SendToRtask(session, comm.Rtype58, 1)
this.module.ModuleRtask.SendToRtask(session, comm.Rtype59, pagoda.PagodaId) this.module.ModuleRtask.SendToRtask(session, comm.Rtype59, pagoda.PagodaId)
}
return return
} }

View File

@ -33,10 +33,10 @@ func (this *apiComp) RankList(session comm.IUserSession, req *pb.PagodaRankListR
var ( var (
pipe *pipe.RedisPipe = conn.Redis.RedisPipe(context.TODO()) pipe *pipe.RedisPipe = conn.Redis.RedisPipe(context.TODO())
) )
if req.FloorId == 0 { if req.Cid == 0 {
rd = pipe.ZRevRange("pagodaSeasonRank", 0, comm.MaxRankList) rd = pipe.ZRevRange("pagodaSeasonRank", 0, comm.MaxRankList)
} else { } else {
rd = pipe.ZRange("pagodaList"+strconv.Itoa(int(req.FloorId)), 0, comm.MaxRankList) rd = pipe.ZRange("pagodaList"+strconv.Itoa(int(req.Cid)), 0, comm.MaxRankList)
} }
if _, err = pipe.Exec(); err != nil { if _, err = pipe.Exec(); err != nil {

View File

@ -20,9 +20,9 @@ const (
///配置管理基础组件 ///配置管理基础组件
type configureComp struct { type configureComp struct {
modules.MCompConfigure modules.MCompConfigure
module *Pagoda module *Pagoda
hlock sync.RWMutex hlock sync.RWMutex
_pagodaMap map[int64]*cfg.GamePagodaData
_checkType map[int32][]*cfg.GamePassCheckData // key type _checkType map[int32][]*cfg.GamePassCheckData // key type
} }
@ -34,10 +34,10 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
//game_pagoda: cfg.NewGame_pagoda, //game_pagoda: cfg.NewGame_pagoda,
game_pagodaseasonreward: cfg.NewGamePagodaSeasonReward, game_pagodaseasonreward: cfg.NewGamePagodaSeasonReward,
game_pagodataskreward: cfg.NewGamePagodaTaskReward, game_pagodataskreward: cfg.NewGamePagodaTaskReward,
game_pagoda: cfg.NewGamePagoda,
}) })
this._pagodaMap = make(map[int64]*cfg.GamePagodaData, 0) //configure.RegisterConfigure(game_pagoda, cfg.NewGamePagoda, this.LoadPagodaData)
configure.RegisterConfigure(game_pagoda, cfg.NewGamePagoda, this.LoadPagodaData)
this._checkType = make(map[int32][]*cfg.GamePassCheckData, 0) this._checkType = make(map[int32][]*cfg.GamePassCheckData, 0)
configure.RegisterConfigure(game_passcheck, cfg.NewGamePassCheck, this.LoadPassCheck) configure.RegisterConfigure(game_passcheck, cfg.NewGamePassCheck, this.LoadPassCheck)
@ -46,12 +46,6 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
return return
} }
// 获取爬塔信息 参数1 塔类型 参数2 层数
func (this *configureComp) GetPagodaConfigData(PagodaType int32, floorId int32) (data *cfg.GamePagodaData) {
return this._pagodaMap[int64(PagodaType<<16)+int64(floorId)]
}
//加载多个配置文件 //加载多个配置文件
func (this *configureComp) LoadMultiConfigure(confs map[string]interface{}) (err error) { func (this *configureComp) LoadMultiConfigure(confs map[string]interface{}) (err error) {
for k, v := range confs { for k, v := range confs {
@ -147,22 +141,6 @@ func (this *configureComp) GetPagodaSeasonReward() []*cfg.GamePagodaSeasonReward
return nil return nil
} }
func (this *configureComp) LoadPagodaData() {
var err error
if v, err := this.GetConfigure(game_pagoda); err == nil {
if configure, ok := v.(*cfg.GamePagoda); ok {
this.hlock.Lock()
defer this.hlock.Unlock()
for _, value := range configure.GetDataList() {
this._pagodaMap[int64(value.PagodaType<<16)+int64(value.LayerNum)] = value
}
return
}
}
log.Errorf("get game_pagoda conf err:%v", err)
return
}
func (this *configureComp) LoadPassCheck() { func (this *configureComp) LoadPassCheck() {
var err error var err error
if v, err := this.GetConfigure(game_passcheck); err == nil { if v, err := this.GetConfigure(game_passcheck); err == nil {
@ -178,3 +156,15 @@ func (this *configureComp) LoadPassCheck() {
log.Errorf("get game_pagoda conf err:%v", err) log.Errorf("get game_pagoda conf err:%v", err)
return return
} }
func (this *configureComp) GetPagodaConfigData(id int32) (data *cfg.GamePagodaData) {
var err error
if v, err := this.GetConfigure(game_pagoda); err == nil {
if configure, ok := v.(*cfg.GamePagoda); ok {
return configure.Get(id)
}
}
log.Errorf("get game_pagoda conf err:%v", err)
return
}

View File

@ -36,6 +36,7 @@ func (this *ModelPagoda) getPagodaList(uid string) (result *pb.DBPagoda, err err
result.Uid = uid result.Uid = uid
result.PagodaId = 0 // 初始数据0层 result.PagodaId = 0 // 初始数据0层
result.Reward = make(map[int32]bool, 0) result.Reward = make(map[int32]bool, 0)
result.Data = make(map[int32]int32, 0)
result.Type = comm.PagodaType result.Type = comm.PagodaType
err = this.module.modelPagoda.addNewPagoda(uid, result) err = this.module.modelPagoda.addNewPagoda(uid, result)

View File

@ -96,7 +96,7 @@ func (this *Pagoda) ModifyPagodaFloor(session comm.IUserSession, level int32) (c
mapData := make(map[string]interface{}, 0) mapData := make(map[string]interface{}, 0)
mapData["pagodaId"] = level mapData["pagodaId"] = level
// 通关校验 // 通关校验
Nomalcfg := this.configure.GetPagodaConfigData(comm.PagodaType, level+1) Nomalcfg := this.configure.GetPagodaConfigData(level + 1)
if Nomalcfg == nil { if Nomalcfg == nil {
list.Complete = true list.Complete = true
mapData["complete"] = true mapData["complete"] = true

View File

@ -25,14 +25,15 @@ type DBPagoda struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID
PagodaId int32 `protobuf:"varint,3,opt,name=pagodaId,proto3" json:"pagodaId" bson:"pagodaId"` //塔层 PagodaId int32 `protobuf:"varint,3,opt,name=pagodaId,proto3" json:"pagodaId" bson:"pagodaId"` //塔层
Reward map[int32]bool `protobuf:"bytes,4,rep,name=reward,proto3" json:"reward" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 是否领奖 Reward map[int32]bool `protobuf:"bytes,4,rep,name=reward,proto3" json:"reward" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 是否领奖
Type int32 `protobuf:"varint,5,opt,name=type,proto3" json:"type"` Type int32 `protobuf:"varint,5,opt,name=type,proto3" json:"type"`
Complete bool `protobuf:"varint,6,opt,name=complete,proto3" json:"complete"` // 是否通关 Complete bool `protobuf:"varint,6,opt,name=complete,proto3" json:"complete"` // 是否通关
PassCheckID int32 `protobuf:"varint,7,opt,name=passCheckID,proto3" json:"passCheckID"` // 战令领奖ID PassCheckID int32 `protobuf:"varint,7,opt,name=passCheckID,proto3" json:"passCheckID"` // 战令领奖ID
VipPassCheckID int32 `protobuf:"varint,8,opt,name=vipPassCheckID,proto3" json:"vipPassCheckID"` // vip战令领奖ID VipPassCheckID int32 `protobuf:"varint,8,opt,name=vipPassCheckID,proto3" json:"vipPassCheckID"` // vip战令领奖ID
Data map[int32]int32 `protobuf:"bytes,9,rep,name=data,proto3" json:"data" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key 页签 value 层数
} }
func (x *DBPagoda) Reset() { func (x *DBPagoda) Reset() {
@ -123,6 +124,13 @@ func (x *DBPagoda) GetVipPassCheckID() int32 {
return 0 return 0
} }
func (x *DBPagoda) GetData() map[int32]int32 {
if x != nil {
return x.Data
}
return nil
}
// 爬塔数据明细 // 爬塔数据明细
type DBPagodaRecord struct { type DBPagodaRecord struct {
state protoimpl.MessageState state protoimpl.MessageState
@ -249,7 +257,7 @@ var file_pagoda_pagoda_db_proto_rawDesc = []byte{
0x0a, 0x16, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x2f, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x5f, 0x0a, 0x16, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x2f, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x5f,
0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65,
0x2f, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x2f, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x22, 0xac, 0x02, 0x0a, 0x08, 0x44, 0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x12, 0x0e, 0x6f, 0x22, 0x8e, 0x03, 0x0a, 0x08, 0x44, 0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x12, 0x0e,
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 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, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64,
0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01,
@ -264,27 +272,33 @@ var file_pagoda_pagoda_db_proto_rawDesc = []byte{
0x52, 0x0b, 0x70, 0x61, 0x73, 0x73, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x44, 0x12, 0x26, 0x0a, 0x52, 0x0b, 0x70, 0x61, 0x73, 0x73, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x44, 0x12, 0x26, 0x0a,
0x0e, 0x76, 0x69, 0x70, 0x50, 0x61, 0x73, 0x73, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x44, 0x18, 0x0e, 0x76, 0x69, 0x70, 0x50, 0x61, 0x73, 0x73, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x44, 0x18,
0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x76, 0x69, 0x70, 0x50, 0x61, 0x73, 0x73, 0x43, 0x68, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x76, 0x69, 0x70, 0x50, 0x61, 0x73, 0x73, 0x43, 0x68,
0x65, 0x63, 0x6b, 0x49, 0x44, 0x1a, 0x39, 0x0a, 0x0b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x45, 0x65, 0x63, 0x6b, 0x49, 0x44, 0x12, 0x27, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x09, 0x20,
0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x44, 0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x2e, 0x44,
0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x39,
0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x0a, 0x0b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a,
0x22, 0xf5, 0x01, 0x0a, 0x0e, 0x44, 0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x65, 0x63, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12,
0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05,
0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x37, 0x0a, 0x09, 0x44, 0x61, 0x74,
0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x49, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20,
0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x49, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75,
0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02,
0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x38, 0x01, 0x22, 0xf5, 0x01, 0x0a, 0x0e, 0x44, 0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52,
0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01,
0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x07, 0x20, 0x01, 0x28, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x6f, 0x64,
0x05, 0x52, 0x02, 0x6c, 0x76, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x61, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x6f, 0x64,
0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x12, 0x61, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
0x1b, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e,
0x4c, 0x69, 0x6e, 0x65, 0x55, 0x70, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e,
0x63, 0x6f, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28,
0x63, 0x6f, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x07, 0x20,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70,
0x6f, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f,
0x73, 0x12, 0x1b, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x07, 0x2e, 0x4c, 0x69, 0x6e, 0x65, 0x55, 0x70, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x1a,
0x0a, 0x08, 0x63, 0x6f, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05,
0x52, 0x08, 0x63, 0x6f, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b,
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -299,21 +313,23 @@ func file_pagoda_pagoda_db_proto_rawDescGZIP() []byte {
return file_pagoda_pagoda_db_proto_rawDescData return file_pagoda_pagoda_db_proto_rawDescData
} }
var file_pagoda_pagoda_db_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_pagoda_pagoda_db_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_pagoda_pagoda_db_proto_goTypes = []interface{}{ var file_pagoda_pagoda_db_proto_goTypes = []interface{}{
(*DBPagoda)(nil), // 0: DBPagoda (*DBPagoda)(nil), // 0: DBPagoda
(*DBPagodaRecord)(nil), // 1: DBPagodaRecord (*DBPagodaRecord)(nil), // 1: DBPagodaRecord
nil, // 2: DBPagoda.RewardEntry nil, // 2: DBPagoda.RewardEntry
(*LineUp)(nil), // 3: LineUp nil, // 3: DBPagoda.DataEntry
(*LineUp)(nil), // 4: LineUp
} }
var file_pagoda_pagoda_db_proto_depIdxs = []int32{ var file_pagoda_pagoda_db_proto_depIdxs = []int32{
2, // 0: DBPagoda.reward:type_name -> DBPagoda.RewardEntry 2, // 0: DBPagoda.reward:type_name -> DBPagoda.RewardEntry
3, // 1: DBPagodaRecord.line:type_name -> LineUp 3, // 1: DBPagoda.data:type_name -> DBPagoda.DataEntry
2, // [2:2] is the sub-list for method output_type 4, // 2: DBPagodaRecord.line:type_name -> LineUp
2, // [2:2] is the sub-list for method input_type 3, // [3:3] is the sub-list for method output_type
2, // [2:2] is the sub-list for extension type_name 3, // [3:3] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension extendee 3, // [3:3] is the sub-list for extension type_name
0, // [0:2] is the sub-list for field 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_pagoda_pagoda_db_proto_init() } func init() { file_pagoda_pagoda_db_proto_init() }
@ -354,7 +370,7 @@ func file_pagoda_pagoda_db_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_pagoda_pagoda_db_proto_rawDesc, RawDescriptor: file_pagoda_pagoda_db_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 3, NumMessages: 4,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },

View File

@ -207,9 +207,8 @@ type PagodaChallengeReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
LevelID int32 `protobuf:"varint,1,opt,name=levelID,proto3" json:"levelID"` // 挑战层数 Cid int32 `protobuf:"varint,1,opt,name=cid,proto3" json:"cid"` // 塔的配置id
PagodaType int32 `protobuf:"varint,2,opt,name=PagodaType,proto3" json:"PagodaType"` // 塔类型 Battle *BattleFormation `protobuf:"bytes,3,opt,name=battle,proto3" json:"battle"`
Battle *BattleFormation `protobuf:"bytes,3,opt,name=battle,proto3" json:"battle"`
} }
func (x *PagodaChallengeReq) Reset() { func (x *PagodaChallengeReq) Reset() {
@ -244,16 +243,9 @@ func (*PagodaChallengeReq) Descriptor() ([]byte, []int) {
return file_pagoda_pagoda_msg_proto_rawDescGZIP(), []int{4} return file_pagoda_pagoda_msg_proto_rawDescGZIP(), []int{4}
} }
func (x *PagodaChallengeReq) GetLevelID() int32 { func (x *PagodaChallengeReq) GetCid() int32 {
if x != nil { if x != nil {
return x.LevelID return x.Cid
}
return 0
}
func (x *PagodaChallengeReq) GetPagodaType() int32 {
if x != nil {
return x.PagodaType
} }
return 0 return 0
} }
@ -270,9 +262,8 @@ type PagodaChallengeResp struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Info *BattleInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info"` Info *BattleInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info"`
LevelID int32 `protobuf:"varint,2,opt,name=levelID,proto3" json:"levelID"` // 挑战层数 Cid int32 `protobuf:"varint,2,opt,name=cid,proto3" json:"cid"` // 塔的配置id
PagodaType int32 `protobuf:"varint,3,opt,name=PagodaType,proto3" json:"PagodaType"` // 塔类型
} }
func (x *PagodaChallengeResp) Reset() { func (x *PagodaChallengeResp) Reset() {
@ -314,16 +305,9 @@ func (x *PagodaChallengeResp) GetInfo() *BattleInfo {
return nil return nil
} }
func (x *PagodaChallengeResp) GetLevelID() int32 { func (x *PagodaChallengeResp) GetCid() int32 {
if x != nil { if x != nil {
return x.LevelID return x.Cid
}
return 0
}
func (x *PagodaChallengeResp) GetPagodaType() int32 {
if x != nil {
return x.PagodaType
} }
return 0 return 0
} }
@ -334,9 +318,8 @@ type PagodaChallengeOverReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
LevelID int32 `protobuf:"varint,1,opt,name=levelID,proto3" json:"levelID"` // 挑战层数 Cid int32 `protobuf:"varint,1,opt,name=cid,proto3" json:"cid"` // 塔的配置id
PagodaType int32 `protobuf:"varint,2,opt,name=PagodaType,proto3" json:"PagodaType"` // 塔类型 Report *BattleReport `protobuf:"bytes,3,opt,name=report,proto3" json:"report"` //战报
Report *BattleReport `protobuf:"bytes,3,opt,name=report,proto3" json:"report"` //战报
} }
func (x *PagodaChallengeOverReq) Reset() { func (x *PagodaChallengeOverReq) Reset() {
@ -371,16 +354,9 @@ func (*PagodaChallengeOverReq) Descriptor() ([]byte, []int) {
return file_pagoda_pagoda_msg_proto_rawDescGZIP(), []int{6} return file_pagoda_pagoda_msg_proto_rawDescGZIP(), []int{6}
} }
func (x *PagodaChallengeOverReq) GetLevelID() int32 { func (x *PagodaChallengeOverReq) GetCid() int32 {
if x != nil { if x != nil {
return x.LevelID return x.Cid
}
return 0
}
func (x *PagodaChallengeOverReq) GetPagodaType() int32 {
if x != nil {
return x.PagodaType
} }
return 0 return 0
} }
@ -445,8 +421,8 @@ type PagodaRankListReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
FloorId int32 `protobuf:"varint,1,opt,name=floorId,proto3" json:"floorId"` // 层数 0 标识总榜 Cid int32 `protobuf:"varint,1,opt,name=cid,proto3" json:"cid"` //
Friend bool `protobuf:"varint,2,opt,name=friend,proto3" json:"friend"` // true 好友榜 Friend bool `protobuf:"varint,2,opt,name=friend,proto3" json:"friend"` // true 好友榜
} }
func (x *PagodaRankListReq) Reset() { func (x *PagodaRankListReq) Reset() {
@ -481,9 +457,9 @@ func (*PagodaRankListReq) Descriptor() ([]byte, []int) {
return file_pagoda_pagoda_msg_proto_rawDescGZIP(), []int{8} return file_pagoda_pagoda_msg_proto_rawDescGZIP(), []int{8}
} }
func (x *PagodaRankListReq) GetFloorId() int32 { func (x *PagodaRankListReq) GetCid() int32 {
if x != nil { if x != nil {
return x.FloorId return x.Cid
} }
return 0 return 0
} }
@ -826,36 +802,28 @@ var file_pagoda_pagoda_msg_proto_rawDesc = []byte{
0x52, 0x02, 0x69, 0x64, 0x22, 0x34, 0x0a, 0x13, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x47, 0x65, 0x52, 0x02, 0x69, 0x64, 0x22, 0x34, 0x0a, 0x13, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x47, 0x65,
0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64,
0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x50, 0x61, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x50, 0x61,
0x67, 0x6f, 0x64, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x78, 0x0a, 0x12, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x50, 0x0a, 0x12, 0x50, 0x61,
0x67, 0x6f, 0x64, 0x61, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x67, 0x6f, 0x64, 0x61, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71,
0x12, 0x18, 0x0a, 0x07, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x63,
0x05, 0x52, 0x07, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x50, 0x61, 0x69, 0x64, 0x12, 0x28, 0x0a, 0x06, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01,
0x67, 0x6f, 0x64, 0x61, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61,
0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x06, 0x62, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x22, 0x48, 0x0a, 0x13,
0x74, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x42, 0x61, 0x74, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52,
0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x62, 0x61, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28,
0x74, 0x74, 0x6c, 0x65, 0x22, 0x70, 0x0a, 0x13, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x43, 0x68, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04,
0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x05, 0x52, 0x03, 0x63, 0x69, 0x64, 0x22, 0x51, 0x0a, 0x16, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61,
0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07,
0x6c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c,
0x65, 0x76, 0x65, 0x6c, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61,
0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x50, 0x61, 0x67, 0x6f,
0x64, 0x61, 0x54, 0x79, 0x70, 0x65, 0x22, 0x79, 0x0a, 0x16, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61,
0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71,
0x12, 0x18, 0x0a, 0x07, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x63,
0x05, 0x52, 0x07, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x50, 0x61, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01,
0x67, 0x6f, 0x64, 0x61, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72,
0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x38, 0x0a, 0x17, 0x50, 0x61, 0x67,
0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x64, 0x61, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x4f, 0x76, 0x65, 0x72,
0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01,
0x74, 0x22, 0x38, 0x0a, 0x17, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x04, 0x64,
0x65, 0x6e, 0x67, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x61, 0x74, 0x61, 0x22, 0x3d, 0x0a, 0x11, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x61, 0x6e,
0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x50, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18,
0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x45, 0x0a, 0x11, 0x50, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x72,
0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71,
0x12, 0x18, 0x0a, 0x07, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x05, 0x52, 0x07, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x72,
0x69, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x66, 0x72, 0x69, 0x65, 0x69, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x66, 0x72, 0x69, 0x65,
0x6e, 0x64, 0x22, 0x3b, 0x0a, 0x12, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x61, 0x6e, 0x6b, 0x6e, 0x64, 0x22, 0x3b, 0x0a, 0x12, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x61, 0x6e, 0x6b,
0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x25, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x25, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x6b,

View File

@ -9,26 +9,34 @@
package cfg package cfg
type GamePagoda struct { type GamePagoda struct {
_dataMap map[int32]*GamePagodaData
_dataList []*GamePagodaData _dataList []*GamePagodaData
} }
func NewGamePagoda(_buf []map[string]interface{}) (*GamePagoda, error) { func NewGamePagoda(_buf []map[string]interface{}) (*GamePagoda, error) {
_dataList := make([]*GamePagodaData, 0, len(_buf)) _dataList := make([]*GamePagodaData, 0, len(_buf))
dataMap := make(map[int32]*GamePagodaData)
for _, _ele_ := range _buf { for _, _ele_ := range _buf {
if _v, err2 := DeserializeGamePagodaData(_ele_); err2 != nil { if _v, err2 := DeserializeGamePagodaData(_ele_); err2 != nil {
return nil, err2 return nil, err2
} else { } else {
_dataList = append(_dataList, _v) _dataList = append(_dataList, _v)
dataMap[_v.Key] = _v
} }
} }
return &GamePagoda{_dataList:_dataList}, nil return &GamePagoda{_dataList:_dataList, _dataMap:dataMap}, nil
}
func (table *GamePagoda) GetDataMap() map[int32]*GamePagodaData {
return table._dataMap
} }
func (table *GamePagoda) GetDataList() []*GamePagodaData { func (table *GamePagoda) GetDataList() []*GamePagodaData {
return table._dataList return table._dataList
} }
func (table *GamePagoda) Get(index int) *GamePagodaData { func (table *GamePagoda) Get(key int32) *GamePagodaData {
return table._dataList[index] return table._dataMap[key]
} }