需求调整,能同时打不同页签的塔
This commit is contained in:
parent
bd21f7ee76
commit
53999edfbe
File diff suppressed because it is too large
Load Diff
@ -3,11 +3,7 @@ package pagoda
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"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"
|
||||
)
|
||||
|
||||
@ -27,43 +23,13 @@ func (this *apiComp) Activate(session comm.IUserSession, req *pb.PagodaActivateR
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
Nomalcfg := this.module.configure.GetPagodaConfigData(comm.PagodaType, list.PagodaId+1)
|
||||
Nomalcfg := this.module.configure.GetPagodaConfigData(list.PagodaId + 1)
|
||||
if Nomalcfg == nil && !list.Complete {
|
||||
list.Complete = true
|
||||
this.module.ModifyPagodaData(session.GetUserId(), map[string]interface{}{
|
||||
"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})
|
||||
return
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
|
||||
//参数校验
|
||||
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
|
||||
return
|
||||
}
|
||||
@ -27,7 +27,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PagodaChalleng
|
||||
return // 参数校验失败直接返回
|
||||
}
|
||||
|
||||
conf := this.module.configure.GetPagodaConfigData(req.PagodaType, req.LevelID)
|
||||
conf := this.module.configure.GetPagodaConfigData(req.Cid)
|
||||
if conf == nil {
|
||||
code = pb.ErrorCode_PagodaNotFound
|
||||
return
|
||||
@ -38,17 +38,21 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PagodaChalleng
|
||||
code = pb.ErrorCode_PagodaNotFound
|
||||
return
|
||||
}
|
||||
if pagoda.Complete {
|
||||
pagoda, err = this.module.modelSeasonPagoda.getSeasonPagodaList(session.GetUserId())
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_PagodaNotFound
|
||||
return
|
||||
}
|
||||
}
|
||||
if pagoda.Type != conf.PagodaType || conf.LayerNum-1 != pagoda.PagodaId {
|
||||
|
||||
if v, ok := pagoda.Data[req.Cid]; !ok {
|
||||
if conf.LayerNum == 1 {
|
||||
pagoda.Data[req.Cid] = 0
|
||||
} else {
|
||||
code = pb.ErrorCode_PagodaLevlErr // 挑战关卡数据不匹配
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if conf.LayerNum-1 != v {
|
||||
code = pb.ErrorCode_PagodaLevlErr // 挑战关卡数据不匹配
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// 校验条件
|
||||
if conf.Unlock != 0 {
|
||||
if !this.mline.CheckCommpleteStage(session.GetUserId(), conf.Unlock) {
|
||||
@ -67,8 +71,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PagodaChalleng
|
||||
}
|
||||
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},
|
||||
LevelID: req.LevelID,
|
||||
PagodaType: req.PagodaType,
|
||||
Cid: req.Cid,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
|
||||
//参数校验
|
||||
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
|
||||
return
|
||||
}
|
||||
@ -29,7 +29,6 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
|
||||
costTime int32 // 本次战斗消耗的时间
|
||||
isWin bool
|
||||
err error
|
||||
bSeason bool
|
||||
)
|
||||
mapData = make(map[string]interface{}, 0)
|
||||
code = this.ChallengeOverCheck(session, req)
|
||||
@ -37,7 +36,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
|
||||
return // 参数校验失败直接返回
|
||||
}
|
||||
|
||||
conf := this.module.configure.GetPagodaConfigData(req.PagodaType, req.LevelID)
|
||||
conf := this.module.configure.GetPagodaConfigData(req.Cid)
|
||||
if conf == nil {
|
||||
code = pb.ErrorCode_PagodaNotFound
|
||||
return
|
||||
@ -48,19 +47,26 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
|
||||
return
|
||||
}
|
||||
|
||||
if pagoda.Complete {
|
||||
// 塔数据校验
|
||||
pagoda, err = this.module.modelSeasonPagoda.getSeasonPagodaList(session.GetUserId())
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_PagodaNotFound
|
||||
return
|
||||
}
|
||||
bSeason = true
|
||||
}
|
||||
if pagoda.Type != conf.PagodaType || conf.LayerNum-1 != pagoda.PagodaId {
|
||||
if v, ok := pagoda.Data[req.Cid]; !ok {
|
||||
if conf.LayerNum == 1 {
|
||||
pagoda.Data[req.Cid] = 0
|
||||
} else {
|
||||
code = pb.ErrorCode_PagodaLevlErr // 挑战关卡数据不匹配
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if conf.LayerNum-1 != v {
|
||||
code = pb.ErrorCode_PagodaLevlErr // 挑战关卡数据不匹配
|
||||
return
|
||||
}
|
||||
}
|
||||
// 校验条件
|
||||
if conf.Unlock != 0 {
|
||||
if !this.mline.CheckCommpleteStage(session.GetUserId(), conf.Unlock) {
|
||||
code = pb.ErrorCode_PagodaUnlock
|
||||
return
|
||||
}
|
||||
}
|
||||
// 校验通过
|
||||
code, isWin = this.module.battle.CheckBattleReport(session, req.Report)
|
||||
if code != pb.ErrorCode_Success {
|
||||
@ -79,21 +85,18 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
|
||||
}
|
||||
}
|
||||
}
|
||||
if !bSeason { // 普通塔
|
||||
pagoda.Type = req.PagodaType
|
||||
mapData["pagodaId"] = conf.LayerNum
|
||||
|
||||
pagoda.Data[req.Cid] += 1
|
||||
|
||||
mapData["pagodaId"] = pagoda.PagodaId
|
||||
mapData["type"] = pagoda.Type
|
||||
mapData["data"] = pagoda.Data
|
||||
|
||||
this.module.modulerank.AddPagodaRecord(session.GetUserId(), costTime, pagoda.PagodaId, conf.PagodaType)
|
||||
|
||||
// 普通塔通关了
|
||||
Nomalcfg := this.module.configure.GetPagodaConfigData(comm.PagodaType, pagoda.PagodaId+1)
|
||||
if Nomalcfg == nil {
|
||||
pagoda.Complete = true
|
||||
mapData["complete"] = pagoda.Complete
|
||||
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 { // 发系统公告
|
||||
@ -101,9 +104,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
|
||||
} else {
|
||||
this.module.Errorf("no found userdata uid:%s", session.GetUserId())
|
||||
}
|
||||
} else {
|
||||
pagoda.PagodaId = conf.LayerNum
|
||||
mapData["pagodaId"] = conf.LayerNum
|
||||
|
||||
// 记录爬塔明细数据
|
||||
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
|
||||
sz := make([]*pb.LineUp, 5)
|
||||
@ -142,24 +143,15 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
|
||||
this.module.SetPagodaRankList("pagodaSeasonRank", score, session.GetUserId())
|
||||
}
|
||||
}
|
||||
code = this.module.ModifySeasonPagodaData(session.GetUserId(), mapData)
|
||||
if user := this.module.ModuleUser.GetUser(session.GetUserId()); user != nil {
|
||||
this.chat.SendSysChatToWorld(comm.ChatSystem6, nil, pagoda.PagodaId, 0, user.Name)
|
||||
} else {
|
||||
this.module.Errorf("no found userdata uid:%s", session.GetUserId())
|
||||
}
|
||||
|
||||
session.SendMsg(string(this.module.GetType()), PagodaChallengeOverResp, &pb.PagodaChallengeOverResp{Data: pagoda})
|
||||
}
|
||||
// 通关奖励
|
||||
code = this.module.DispenseRes(session, conf.Reward, true)
|
||||
if code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
// 任务相关
|
||||
if req.PagodaType == comm.PagodaType {
|
||||
|
||||
this.module.ModuleRtask.SendToRtask(session, comm.Rtype58, 1)
|
||||
this.module.ModuleRtask.SendToRtask(session, comm.Rtype59, pagoda.PagodaId)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -33,10 +33,10 @@ func (this *apiComp) RankList(session comm.IUserSession, req *pb.PagodaRankListR
|
||||
var (
|
||||
pipe *pipe.RedisPipe = conn.Redis.RedisPipe(context.TODO())
|
||||
)
|
||||
if req.FloorId == 0 {
|
||||
if req.Cid == 0 {
|
||||
rd = pipe.ZRevRange("pagodaSeasonRank", 0, comm.MaxRankList)
|
||||
} 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 {
|
||||
|
@ -22,7 +22,7 @@ type configureComp struct {
|
||||
modules.MCompConfigure
|
||||
module *Pagoda
|
||||
hlock sync.RWMutex
|
||||
_pagodaMap map[int64]*cfg.GamePagodaData
|
||||
|
||||
_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_pagodaseasonreward: cfg.NewGamePagodaSeasonReward,
|
||||
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)
|
||||
configure.RegisterConfigure(game_passcheck, cfg.NewGamePassCheck, this.LoadPassCheck)
|
||||
|
||||
@ -46,12 +46,6 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
|
||||
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) {
|
||||
for k, v := range confs {
|
||||
@ -147,22 +141,6 @@ func (this *configureComp) GetPagodaSeasonReward() []*cfg.GamePagodaSeasonReward
|
||||
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() {
|
||||
var err error
|
||||
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)
|
||||
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
|
||||
}
|
||||
|
@ -36,6 +36,7 @@ func (this *ModelPagoda) getPagodaList(uid string) (result *pb.DBPagoda, err err
|
||||
result.Uid = uid
|
||||
result.PagodaId = 0 // 初始数据0层
|
||||
result.Reward = make(map[int32]bool, 0)
|
||||
result.Data = make(map[int32]int32, 0)
|
||||
result.Type = comm.PagodaType
|
||||
err = this.module.modelPagoda.addNewPagoda(uid, result)
|
||||
|
||||
|
@ -96,7 +96,7 @@ func (this *Pagoda) ModifyPagodaFloor(session comm.IUserSession, level int32) (c
|
||||
mapData := make(map[string]interface{}, 0)
|
||||
mapData["pagodaId"] = level
|
||||
// 通关校验
|
||||
Nomalcfg := this.configure.GetPagodaConfigData(comm.PagodaType, level+1)
|
||||
Nomalcfg := this.configure.GetPagodaConfigData(level + 1)
|
||||
if Nomalcfg == nil {
|
||||
list.Complete = true
|
||||
mapData["complete"] = true
|
||||
|
@ -33,6 +33,7 @@ type DBPagoda struct {
|
||||
Complete bool `protobuf:"varint,6,opt,name=complete,proto3" json:"complete"` // 是否通关
|
||||
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
|
||||
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() {
|
||||
@ -123,6 +124,13 @@ func (x *DBPagoda) GetVipPassCheckID() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DBPagoda) GetData() map[int32]int32 {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 爬塔数据明细
|
||||
type DBPagodaRecord struct {
|
||||
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,
|
||||
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,
|
||||
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, 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,
|
||||
@ -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,
|
||||
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,
|
||||
0x65, 0x63, 0x6b, 0x49, 0x44, 0x1a, 0x39, 0x0a, 0x0b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x45,
|
||||
0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01,
|
||||
0x22, 0xf5, 0x01, 0x0a, 0x0e, 0x44, 0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 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, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x49,
|
||||
0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x49,
|
||||
0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d,
|
||||
0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d,
|
||||
0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x07, 0x20, 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,
|
||||
0x65, 0x63, 0x6b, 0x49, 0x44, 0x12, 0x27, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x09, 0x20,
|
||||
0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x44, 0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x2e, 0x44,
|
||||
0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x39,
|
||||
0x0a, 0x0b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a,
|
||||
0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12,
|
||||
0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05,
|
||||
0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x37, 0x0a, 0x09, 0x44, 0x61, 0x74,
|
||||
0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75,
|
||||
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02,
|
||||
0x38, 0x01, 0x22, 0xf5, 0x01, 0x0a, 0x0e, 0x44, 0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 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, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x6f, 0x64,
|
||||
0x61, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x6f, 0x64,
|
||||
0x61, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e,
|
||||
0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e,
|
||||
0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x07, 0x20,
|
||||
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 (
|
||||
@ -299,21 +313,23 @@ func file_pagoda_pagoda_db_proto_rawDescGZIP() []byte {
|
||||
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{}{
|
||||
(*DBPagoda)(nil), // 0: DBPagoda
|
||||
(*DBPagodaRecord)(nil), // 1: DBPagodaRecord
|
||||
nil, // 2: DBPagoda.RewardEntry
|
||||
(*LineUp)(nil), // 3: LineUp
|
||||
nil, // 3: DBPagoda.DataEntry
|
||||
(*LineUp)(nil), // 4: LineUp
|
||||
}
|
||||
var file_pagoda_pagoda_db_proto_depIdxs = []int32{
|
||||
2, // 0: DBPagoda.reward:type_name -> DBPagoda.RewardEntry
|
||||
3, // 1: DBPagodaRecord.line:type_name -> LineUp
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
3, // 1: DBPagoda.data:type_name -> DBPagoda.DataEntry
|
||||
4, // 2: DBPagodaRecord.line:type_name -> LineUp
|
||||
3, // [3:3] is the sub-list for method output_type
|
||||
3, // [3:3] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_pagoda_pagoda_db_proto_init() }
|
||||
@ -354,7 +370,7 @@ func file_pagoda_pagoda_db_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_pagoda_pagoda_db_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
@ -207,8 +207,7 @@ type PagodaChallengeReq struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
LevelID int32 `protobuf:"varint,1,opt,name=levelID,proto3" json:"levelID"` // 挑战层数
|
||||
PagodaType int32 `protobuf:"varint,2,opt,name=PagodaType,proto3" json:"PagodaType"` // 塔类型
|
||||
Cid int32 `protobuf:"varint,1,opt,name=cid,proto3" json:"cid"` // 塔的配置id
|
||||
Battle *BattleFormation `protobuf:"bytes,3,opt,name=battle,proto3" json:"battle"`
|
||||
}
|
||||
|
||||
@ -244,16 +243,9 @@ func (*PagodaChallengeReq) Descriptor() ([]byte, []int) {
|
||||
return file_pagoda_pagoda_msg_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *PagodaChallengeReq) GetLevelID() int32 {
|
||||
func (x *PagodaChallengeReq) GetCid() int32 {
|
||||
if x != nil {
|
||||
return x.LevelID
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PagodaChallengeReq) GetPagodaType() int32 {
|
||||
if x != nil {
|
||||
return x.PagodaType
|
||||
return x.Cid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
@ -271,8 +263,7 @@ type PagodaChallengeResp struct {
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Info *BattleInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info"`
|
||||
LevelID int32 `protobuf:"varint,2,opt,name=levelID,proto3" json:"levelID"` // 挑战层数
|
||||
PagodaType int32 `protobuf:"varint,3,opt,name=PagodaType,proto3" json:"PagodaType"` // 塔类型
|
||||
Cid int32 `protobuf:"varint,2,opt,name=cid,proto3" json:"cid"` // 塔的配置id
|
||||
}
|
||||
|
||||
func (x *PagodaChallengeResp) Reset() {
|
||||
@ -314,16 +305,9 @@ func (x *PagodaChallengeResp) GetInfo() *BattleInfo {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *PagodaChallengeResp) GetLevelID() int32 {
|
||||
func (x *PagodaChallengeResp) GetCid() int32 {
|
||||
if x != nil {
|
||||
return x.LevelID
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PagodaChallengeResp) GetPagodaType() int32 {
|
||||
if x != nil {
|
||||
return x.PagodaType
|
||||
return x.Cid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
@ -334,8 +318,7 @@ type PagodaChallengeOverReq struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
LevelID int32 `protobuf:"varint,1,opt,name=levelID,proto3" json:"levelID"` // 挑战层数
|
||||
PagodaType int32 `protobuf:"varint,2,opt,name=PagodaType,proto3" json:"PagodaType"` // 塔类型
|
||||
Cid int32 `protobuf:"varint,1,opt,name=cid,proto3" json:"cid"` // 塔的配置id
|
||||
Report *BattleReport `protobuf:"bytes,3,opt,name=report,proto3" json:"report"` //战报
|
||||
}
|
||||
|
||||
@ -371,16 +354,9 @@ func (*PagodaChallengeOverReq) Descriptor() ([]byte, []int) {
|
||||
return file_pagoda_pagoda_msg_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *PagodaChallengeOverReq) GetLevelID() int32 {
|
||||
func (x *PagodaChallengeOverReq) GetCid() int32 {
|
||||
if x != nil {
|
||||
return x.LevelID
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PagodaChallengeOverReq) GetPagodaType() int32 {
|
||||
if x != nil {
|
||||
return x.PagodaType
|
||||
return x.Cid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
@ -445,7 +421,7 @@ type PagodaRankListReq struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
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 好友榜
|
||||
}
|
||||
|
||||
@ -481,9 +457,9 @@ func (*PagodaRankListReq) Descriptor() ([]byte, []int) {
|
||||
return file_pagoda_pagoda_msg_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
func (x *PagodaRankListReq) GetFloorId() int32 {
|
||||
func (x *PagodaRankListReq) GetCid() int32 {
|
||||
if x != nil {
|
||||
return x.FloorId
|
||||
return x.Cid
|
||||
}
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
0x12, 0x18, 0x0a, 0x07, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x44, 0x18, 0x01, 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, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a,
|
||||
0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x06, 0x62, 0x61,
|
||||
0x74, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x42, 0x61, 0x74,
|
||||
0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x62, 0x61,
|
||||
0x74, 0x74, 0x6c, 0x65, 0x22, 0x70, 0x0a, 0x13, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x43, 0x68,
|
||||
0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x69,
|
||||
0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74,
|
||||
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,
|
||||
0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x63,
|
||||
0x69, 0x64, 0x12, 0x28, 0x0a, 0x06, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x10, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x22, 0x48, 0x0a, 0x13,
|
||||
0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52,
|
||||
0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04,
|
||||
0x69, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x03, 0x63, 0x69, 0x64, 0x22, 0x51, 0x0a, 0x16, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61,
|
||||
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,
|
||||
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, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a,
|
||||
0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65,
|
||||
0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x74,
|
||||
0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72,
|
||||
0x74, 0x22, 0x38, 0x0a, 0x17, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x43, 0x68, 0x61, 0x6c, 0x6c,
|
||||
0x65, 0x6e, 0x67, 0x65, 0x4f, 0x76, 0x65, 0x72, 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, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x45, 0x0a, 0x11, 0x50,
|
||||
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,
|
||||
0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x63,
|
||||
0x69, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72,
|
||||
0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x38, 0x0a, 0x17, 0x50, 0x61, 0x67,
|
||||
0x6f, 0x64, 0x61, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x4f, 0x76, 0x65, 0x72,
|
||||
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, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x04, 0x64,
|
||||
0x61, 0x74, 0x61, 0x22, 0x3d, 0x0a, 0x11, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x61, 0x6e,
|
||||
0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x72,
|
||||
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,
|
||||
0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x25, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x6b,
|
||||
|
@ -9,26 +9,34 @@
|
||||
package cfg
|
||||
|
||||
type GamePagoda struct {
|
||||
_dataMap map[int32]*GamePagodaData
|
||||
_dataList []*GamePagodaData
|
||||
}
|
||||
|
||||
func NewGamePagoda(_buf []map[string]interface{}) (*GamePagoda, error) {
|
||||
_dataList := make([]*GamePagodaData, 0, len(_buf))
|
||||
dataMap := make(map[int32]*GamePagodaData)
|
||||
for _, _ele_ := range _buf {
|
||||
if _v, err2 := DeserializeGamePagodaData(_ele_); err2 != nil {
|
||||
return nil, err2
|
||||
} else {
|
||||
_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 {
|
||||
return table._dataList
|
||||
}
|
||||
|
||||
func (table *GamePagoda) Get(index int) *GamePagodaData {
|
||||
return table._dataList[index]
|
||||
func (table *GamePagoda) Get(key int32) *GamePagodaData {
|
||||
return table._dataMap[key]
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user