Merge branch 'meixiongfeng' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev

This commit is contained in:
meixiongfeng 2022-09-14 19:07:47 +08:00
commit 5d888f3400
17 changed files with 632 additions and 317 deletions

View File

@ -116,7 +116,7 @@ const (
TableRtaskRecord = "rrecord"
///记录用户爬塔排行数据
TablePagodaRecord = "pagodarecord"
///有序的爬塔排行 (正的排行榜 最多只有50条)
///有序的爬塔排行 (正的排行榜 最多只有50条)
TablePagodaRankList = "pagodaranklist"
/// 美食馆
TableSmithy = "smithy"
@ -323,4 +323,5 @@ const (
const (
MaxMainlineIntensity = 3 // 最大难度
MaxRankNum = 3
)

View File

@ -37,16 +37,16 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (c
return
}
awakenData = this.module.configure.GetHeroAwakenConfig(_hero.HeroID, _hero.JuexingLv)
awakenData = this.module.configure.GetHeroAwakenConfig(_hero.HeroID, _hero.JuexingLv+1)
if awakenData == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
nextAwaken := this.module.configure.GetHeroAwakenConfig(_hero.HeroID, _hero.JuexingLv+1)
if nextAwaken == nil {
code = pb.ErrorCode_HeroMaxAwaken // 达到最大觉醒等级
return
}
// nextAwaken := this.module.configure.GetHeroAwakenConfig(_hero.HeroID, _hero.JuexingLv+1)
// if nextAwaken == nil {
// code = pb.ErrorCode_HeroMaxAwaken // 达到最大觉醒等级
// return
// }
if len(awakenData.Phasebonus) < 2 { // 配置校验
code = pb.ErrorCode_ConfigNoFound

View File

@ -21,7 +21,7 @@ func (this *apiComp) StrengthenUpStarCheck(session comm.IUserSession, req *pb.He
/// 英雄升星
func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStrengthenUpStarReq) (code pb.ErrorCode, data proto.Message) {
var (
target *cfg.GameHeroStarupData // 配置表目标升星英雄信息
starConf *cfg.GameHeroStarupData // 配置表目标升星英雄信息
costNeedHeroCount int32 // 消耗指定英雄的数量
costRaceHeroCount int32 // 消耗种族英雄的数量
_hero *pb.DBHero // 目标英雄
@ -51,8 +51,8 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr
}
// 校验指定英雄
tagHeroConfig := this.module.configure.GetHeroStarupConfig(_hero.HeroID, _hero.Star)
if tagHeroConfig == nil {
starConf = this.module.configure.GetHeroStarupConfig(_hero.HeroID, _hero.Star)
if starConf == nil {
code = pb.ErrorCode_ReqParameterError
return
}
@ -63,7 +63,7 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr
}
// 优先校验数量对不对
if target.Needheronum != costNeedHeroCount || target.Needracenum != costRaceHeroCount {
if starConf.Needheronum != costNeedHeroCount || starConf.Needracenum != costRaceHeroCount {
code = pb.ErrorCode_ReqParameterError
return
}
@ -83,11 +83,11 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr
return
}
if tagHero.HeroID == target.Needhero && tagHero.Star == target.Needherostar && tagHero.SameCount >= target.Needheronum {
if tagHero.HeroID == starConf.Needhero && tagHero.Star == starConf.Needherostar && tagHero.SameCount >= starConf.Needheronum {
costNeedHeroCount += v
}
for _, value := range target.Needrace { // 阵营校验
for _, value := range starConf.Needrace { // 阵营校验
// 获取配置表英雄阵营
cfg := this.module.configure.GetHero(tagHero.HeroID)
if cfg != nil {
@ -100,22 +100,22 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr
CostHeroObj[k] = tagHero
}
if target.Needheronum > costNeedHeroCount || target.Needracenum > costRaceHeroCount {
if starConf.Needheronum > costNeedHeroCount || starConf.Needracenum > costRaceHeroCount {
code = pb.ErrorCode_ReqParameterError
return
}
// 金币消耗判断
curGold := this.module.ModuleUser.QueryAttributeValue(session.GetUserId(), comm.ResGold)
if curGold < target.Gold { // 金币不足
if curGold < starConf.Gold { // 金币不足
code = pb.ErrorCode_GoldNoEnough
return
}
// 消耗道具
code = this.module.ModuleUser.AddAttributeValue(session, comm.ResGold, -target.Gold, true) // 减少金币
code = this.module.ModuleUser.AddAttributeValue(session, comm.ResGold, -starConf.Gold, true) // 减少金币
if code != pb.ErrorCode_Success {
this.module.Errorf("cost gold failed ,count = %d", target.Gold)
this.module.Errorf("cost gold failed ,count = %d", starConf.Gold)
code = pb.ErrorCode_GoldNoEnough
return
}
@ -124,7 +124,7 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr
if c != pb.ErrorCode_Success {
code = pb.ErrorCode_DBError
this.module.Errorf("del hero err card:%s,count = %d", k, v)
this.module.ModuleUser.AddAttributeValue(session, comm.ResGold, target.Gold, true) // 回退金币
this.module.ModuleUser.AddAttributeValue(session, comm.ResGold, starConf.Gold, true) // 回退金币
return
}

View File

@ -22,10 +22,10 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PagodaChalleng
if code != pb.ErrorCode_Success {
return // 参数校验失败直接返回
}
pagoda, err := this.module.modelPagoda.getPagodaList(session.GetUserId())
// 校验是不是通关了普通塔
expand, err := this.module.ModuleUser.GetUserExpand(session.GetUserId())
if err != nil {
code = pb.ErrorCode_PagodaNotFound
code = pb.ErrorCode_DBError
return
}
conf := this.module.configure.GetPagodaConfigData(req.PagodaType, req.LevelID)
@ -33,33 +33,27 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PagodaChalleng
code = pb.ErrorCode_PagodaNotFound
return
}
if req.PagodaType == comm.PagodaType { // 普通塔
if !expand.CompletePagoda {
pagoda, err := this.module.modelPagoda.getPagodaList(session.GetUserId())
if err != nil {
code = pb.ErrorCode_PagodaNotFound
return
}
if pagoda.Type != conf.PagodaType || conf.PreLevel != pagoda.PagodaId {
code = pb.ErrorCode_PagodaLevlErr // 挑战关卡数据不匹配
return
}
} else {
// 普通塔通关了
Nomalcfg := this.module.configure.GetPagodaConfigData(comm.PagodaType, pagoda.PagodaId+1)
if Nomalcfg != nil {
// 塔数据校验
seasonPagoda, err := this.module.modelSeasonPagoda.getSeasonPagodaList(session.GetUserId())
if err != nil {
code = pb.ErrorCode_PagodaNotFound
return
}
// 塔数据校验
seasonPagoda, _ := this.module.modelSeasonPagoda.getSeasonPagodaList(session.GetUserId())
if seasonPagoda == nil {
if req.LevelID != 1 {
code = pb.ErrorCode_PagodaLevlErr // 挑战关卡数据不匹配
return
}
} else {
if seasonPagoda.Type != req.PagodaType || conf.PreLevel != seasonPagoda.PagodaId {
code = pb.ErrorCode_PagodaLevlErr // 挑战关卡数据不匹配
return
}
if seasonPagoda.Type != req.PagodaType || conf.PreLevel != seasonPagoda.PagodaId {
code = pb.ErrorCode_PagodaLevlErr // 挑战关卡数据不匹配
return
}
}
code, record := this.module.battle.CreatePveBattle(session, &pb.BattlePVEReq{

View File

@ -20,7 +20,9 @@ func (this *apiComp) ChallengeOverCheck(session comm.IUserSession, req *pb.Pagod
///挑战主线关卡
func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChallengeOverReq) (code pb.ErrorCode, data proto.Message) {
var (
mapData map[string]interface{}
mapData map[string]interface{}
pagoda *pb.DBPagoda
seasonPagoda *pb.DBSeasonPagoda
)
mapData = make(map[string]interface{}, 0)
code = this.ChallengeOverCheck(session, req)
@ -28,78 +30,78 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
return // 参数校验失败直接返回
}
pagoda, err := this.module.modelPagoda.getPagodaList(session.GetUserId())
// 校验是不是通关了普通塔
expand, err := this.module.ModuleUser.GetUserExpand(session.GetUserId())
if err != nil {
code = pb.ErrorCode_DBError
return
}
conf := this.module.configure.GetPagodaConfigData(req.PagodaType, req.LevelID)
if conf == nil {
code = pb.ErrorCode_PagodaNotFound
return
}
cfg := this.module.configure.GetPagodaConfigData(req.PagodaType, req.LevelID)
if cfg == nil {
code = pb.ErrorCode_PagodaNotFound
return
}
if req.PagodaType == comm.PagodaType { // 普通塔
if pagoda.Type != cfg.PagodaType || cfg.PreLevel != pagoda.PagodaId {
if !expand.CompletePagoda {
pagoda, err = this.module.modelPagoda.getPagodaList(session.GetUserId())
if err != nil {
code = pb.ErrorCode_PagodaNotFound
return
}
if pagoda.Type != conf.PagodaType || conf.PreLevel != pagoda.PagodaId {
code = pb.ErrorCode_PagodaLevlErr // 挑战关卡数据不匹配
return
}
//// todo 战斗相关
pagoda.Type = req.PagodaType
mapData["pagodaId"] = cfg.LayerNum
mapData["type"] = pagoda.Type
this.module.modulerank.ChangeUserRank(session.GetUserId(), mapData)
// 通关奖励
code = this.module.DispenseRes(session, cfg.Reward, true)
if code != pb.ErrorCode_Success {
return
}
pagoda.PagodaId = cfg.LayerNum // 更新层数
mapData["pagodaId"] = cfg.LayerNum
code = this.module.ModifyPagodaData(session.GetUserId(), mapData)
session.SendMsg(string(this.module.GetType()), PagodaChallengeOverResp, &pb.PagodaChallengeOverResp{Data: pagoda})
return
} else {
// 普通塔通关了
Nomalcfg := this.module.configure.GetPagodaConfigData(comm.PagodaType, pagoda.PagodaId+1)
if Nomalcfg != nil {
// 塔数据校验
seasonPagoda, err = this.module.modelSeasonPagoda.getSeasonPagodaList(session.GetUserId())
if err != nil {
code = pb.ErrorCode_PagodaNotFound
return
}
// 塔数据校验
seasonPagoda, _ := this.module.modelSeasonPagoda.getSeasonPagodaList(session.GetUserId())
if seasonPagoda == nil {
if req.LevelID != 1 {
code = pb.ErrorCode_PagodaLevlErr // 挑战关卡数据不匹配
return
}
} else {
if seasonPagoda.Type != req.PagodaType || cfg.PreLevel != seasonPagoda.PagodaId {
code = pb.ErrorCode_PagodaLevlErr // 挑战关卡数据不匹配
return
}
if seasonPagoda.Type != req.PagodaType || conf.PreLevel != seasonPagoda.PagodaId {
code = pb.ErrorCode_PagodaLevlErr // 挑战关卡数据不匹配
return
}
// 挑战处理
if seasonPagoda == nil {
seasonPagoda = &pb.DBSeasonPagoda{}
}
// 校验通过
if !expand.CompletePagoda { // 普通塔
pagoda.Type = req.PagodaType
mapData["pagodaId"] = conf.LayerNum
mapData["type"] = pagoda.Type
// 通关奖励
code = this.module.DispenseRes(session, conf.Reward, true)
if code != pb.ErrorCode_Success {
return
}
pagoda.PagodaId = conf.LayerNum // 更新层数
mapData["pagodaId"] = conf.LayerNum
code = this.module.ModifyPagodaData(session.GetUserId(), mapData)
session.SendMsg(string(this.module.GetType()), PagodaChallengeOverResp, &pb.PagodaChallengeOverResp{Data: pagoda})
// 普通塔通关了
Nomalcfg := this.module.configure.GetPagodaConfigData(comm.PagodaType, pagoda.PagodaId+1)
if Nomalcfg == nil { // 创建赛季塔数据
// 修改expand 数据
update := map[string]interface{}{
"completePagoda": true,
}
this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), update)
seasonPagoda := &pb.DBSeasonPagoda{}
seasonPagoda.Id = primitive.NewObjectID().Hex()
seasonPagoda.Uid = session.GetUserId()
seasonPagoda.PagodaId = 1 // 初始数据1层
seasonPagoda.Type = req.PagodaType
seasonPagoda.PagodaId = 0 // 初始数据0
seasonPagoda.Type = 201
this.module.modelSeasonPagoda.addNewSeasonPagoda(session.GetUserId(), seasonPagoda)
} else {
seasonPagoda.PagodaId = cfg.LayerNum
mapData["pagodaId"] = cfg.LayerNum
code = this.module.ModifySeasonPagodaData(session.GetUserId(), mapData)
// 推送新的
pagoda.PagodaId = seasonPagoda.PagodaId
pagoda.Type = seasonPagoda.Type
session.SendMsg(string(this.module.GetType()), PagodaGetListResp, &pb.PagodaGetListResp{Data: pagoda})
}
} else {
// 记录爬塔明细数据
if req.Report != nil && len(req.Report.Info.Redflist) > 0 {
sz := make([]*pb.LineUp, 5)
@ -112,15 +114,15 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
}
}
}
this.module.modulerank.addPagodaRankList(session, seasonPagoda, req.Report.Info.Redflist[0].Leadpos, sz)
this.module.modulerank.addPagodaRankList(session, seasonPagoda, req.Report.Info.Redflist[0].Leadpos, sz, req.Report.Costtime)
}
pagoda.PagodaId = seasonPagoda.PagodaId
pagoda.Type = seasonPagoda.Type
pagoda.Reward = seasonPagoda.Reward
// 挑战处理
seasonPagoda.PagodaId = conf.LayerNum
mapData["pagodaId"] = conf.LayerNum
code = this.module.ModifySeasonPagodaData(session.GetUserId(), mapData)
session.SendMsg(string(this.module.GetType()), PagodaChallengeOverResp, &pb.PagodaChallengeOverResp{Data: pagoda})
}
// 任务相关
if req.PagodaType == comm.PagodaType {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype58, 1)
this.module.ModuleRtask.SendToRtask(session, comm.Rtype59, pagoda.PagodaId)

View File

@ -19,31 +19,31 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.PagodaGetListReq
var (
list *pb.DBPagoda
)
code = this.GetListCheck(session, req)
if code != pb.ErrorCode_Success {
return // 参数校验失败直接返回
}
list, _ = this.module.modelPagoda.getPagodaList(session.GetUserId())
defer func() {
session.SendMsg(string(this.module.GetType()), PagodaGetListResp, &pb.PagodaGetListResp{Data: list})
}()
if list == nil { // redis没有数据
list = &pb.DBPagoda{}
list.Id = primitive.NewObjectID().Hex()
list.Uid = session.GetUserId()
list.PagodaId = 0 // 初始数据1层
list.Type = comm.PagodaType
this.module.modelPagoda.addNewPagoda(session.GetUserId(), list)
expand, err := this.module.ModuleUser.GetUserExpand(session.GetUserId())
if err != nil {
code = pb.ErrorCode_DBError
return
}
season, _ := this.module.modelSeasonPagoda.getSeasonPagodaList(session.GetUserId())
if season != nil {
list.PagodaId = season.PagodaId
list.Type = season.Type
list.Reward = season.Reward
if !expand.CompletePagoda { // 普通塔
list, _ = this.module.modelPagoda.getPagodaList(session.GetUserId())
if list == nil { // redis没有数据
list = &pb.DBPagoda{}
list.Id = primitive.NewObjectID().Hex()
list.Uid = session.GetUserId()
list.PagodaId = 0 // 初始数据0层
list.Type = comm.PagodaType
this.module.modelPagoda.addNewPagoda(session.GetUserId(), list)
}
} else {
season, _ := this.module.modelSeasonPagoda.getSeasonPagodaList(session.GetUserId())
if season != nil {
list.PagodaId = season.PagodaId
list.Type = season.Type
list.Reward = season.Reward
}
}
session.SendMsg(string(this.module.GetType()), PagodaGetListResp, &pb.PagodaGetListResp{Data: list})
return
}

View File

@ -15,7 +15,7 @@ func (this *apiComp) RankListCheck(session comm.IUserSession, req *pb.PagodaRank
func (this *apiComp) RankList(session comm.IUserSession, req *pb.PagodaRankListReq) (code pb.ErrorCode, data proto.Message) {
var (
szRank []*pb.DBPagodaRank
szRank []*pb.DBPagodaRecord
err error
)
code = this.RankListCheck(session, req)

View File

@ -1,15 +1,21 @@
package pagoda
import (
"fmt"
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/lego/sys/redis"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
"sort"
"time"
"go.mongodb.org/mongo-driver/bson/primitive"
)
var floorRankKey = "pagoda:floor"
type ModelRank struct {
modules.MCompModel
modulePagoda *Pagoda
@ -22,7 +28,7 @@ func (this *ModelRank) Init(service core.IService, module core.IModule, comp cor
return
}
func (this *ModelRank) AddRank(uId string, data *pb.DBPagodaRank) (err error) {
func (this *ModelRank) AddRank(uId string, data *pb.DBPagodaRecord) (err error) {
if err = this.Add(uId, data); err != nil {
//this.Errorf("err:%v", err)
return
@ -31,8 +37,8 @@ func (this *ModelRank) AddRank(uId string, data *pb.DBPagodaRank) (err error) {
}
//获取用户通过扩展表
func (this *ModelRank) GetUserRandData(uid string) (result *pb.DBPagodaRank, err error) {
result = &pb.DBPagodaRank{}
func (this *ModelRank) GetUserRandData(uid string) (result *pb.DBPagodaRecord, err error) {
result = &pb.DBPagodaRecord{}
if err = this.Get(uid, result); err != nil && redis.RedisNil != err {
return
}
@ -47,14 +53,14 @@ func (this *ModelRank) ChangeUserRank(uid string, value map[string]interface{})
return this.Change(uid, value)
}
func (this *ModelRank) GetRankData() (data []*pb.DBPagodaRank, err error) {
data = make([]*pb.DBPagodaRank, 0)
func (this *ModelRank) GetRankData() (data []*pb.DBPagodaRecord, err error) {
data = make([]*pb.DBPagodaRecord, 0)
err = this.Redis.LRange(comm.TablePagodaRankList, 0, -1, &data)
return
}
func (this *ModelRank) getPagodaRankList(uid string) []*pb.DBPagodaRank {
pagodaRank := make([]*pb.DBPagodaRank, 0)
func (this *ModelRank) getPagodaRankList(uid string) []*pb.DBPagodaRecord {
pagodaRank := make([]*pb.DBPagodaRecord, 0)
err := this.GetList(uid, &pagodaRank)
if err != nil {
return nil
@ -63,18 +69,84 @@ func (this *ModelRank) getPagodaRankList(uid string) []*pb.DBPagodaRank {
}
// 插入新的排行数据
func (this *ModelRank) addPagodaRankList(session comm.IUserSession, data *pb.DBSeasonPagoda, Leadpos int32, line []*pb.LineUp) {
func (this *ModelRank) addPagodaRankList(session comm.IUserSession, data *pb.DBSeasonPagoda, Leadpos int32, line []*pb.LineUp, costTime int32) {
userinfo := this.modulePagoda.ModuleUser.GetUser(session.GetUserId())
new := &pb.DBPagodaRank{
new := &pb.DBPagodaRecord{
Id: primitive.NewObjectID().Hex(),
Uid: session.GetUserId(),
PagodaId: data.PagodaId,
Type: data.Type,
Nickname: userinfo.Name,
Icon: "",
Icon: "", // icon 暂无
Lv: userinfo.Lv,
CostTime: 0,
CostTime: costTime,
}
this.AddList(session.GetUserId(), new.Id, new) //写爬塔记录
// 查询本层是否上榜
rankData, ilen, err1 := this.GetFloorLastRankData(data.PagodaId)
if err1 != nil {
if rankData.CostTime < costTime || ilen < comm.MaxRankNum {
this.ChangeFloorRankList(session, data.PagodaId, new)
}
}
return
}
// 读取某一层排行数据
func (this *ModelRank) GetFloorRankList(floor int32) (result []*pb.DBPagodaRecord, err error) {
key := fmt.Sprintf("%s-%d-rank", floorRankKey, floor)
temp := make([]*pb.DBPagodaRecord, 0)
if err = this.Redis.LRange(key, 0, -1, &temp); err != nil {
this.modulePagoda.Errorf("err:%v", err)
return
}
result = make([]*pb.DBPagodaRecord, len(temp))
for n, v := range temp {
result[n] = v
n++
}
return
}
// 获取排行榜最后一个元素
func (this *ModelRank) GetFloorLastRankData(floor int32) (curData *pb.DBPagodaRecord, len int, err error) {
key := fmt.Sprintf("%s-%d-rank", floorRankKey, floor)
len, err = this.Redis.Llen(key)
if this.Redis.Lindex(key, -1, curData); err != nil {
this.modulePagoda.Errorf("err:%v", err)
return
}
return
}
// 修改某一层排行数据
func (this *ModelRank) ChangeFloorRankList(session comm.IUserSession, floor int32, curData *pb.DBPagodaRecord) (err error) {
key := fmt.Sprintf("%s-%d-rank", floorRankKey, floor)
lockkey := fmt.Sprintf("%s-%d-lock", floorRankKey, floor)
this.Redis.Lock(lockkey, time.Now().Second()*5)
defer this.Redis.UnLock(lockkey)
if this.Redis.RPush(key, curData); err != nil {
this.modulePagoda.Errorf("err:%v", err)
return
}
temp := make([]*pb.DBPagodaRecord, 0)
if err = this.Redis.LRange(key, 0, -1, &temp); err != nil {
this.modulePagoda.Errorf("err:%v", err)
return
}
sort.SliceStable(temp, func(i, j int) bool {
return temp[i].CostTime < temp[j].CostTime
})
if this.Redis.RPush(key, temp); err != nil {
this.modulePagoda.Errorf("err:%v", err)
return
}
err = this.Redis.Ltrim(key, -1*comm.MaxRankNum, -1) //对一个列表进行修剪
if err != nil {
log.Errorf("delete failed")
}
this.AddList(session.GetUserId(), new.Id, new)
return
}

View File

@ -48,13 +48,13 @@ func (this *ModelSeasonPagoda) modifySeasonPagodaDataByObjId(uid string, data ma
return this.Change(uid, data)
}
// 创建一个新的塔数据
// 创建一个新的赛季塔数据
func (this *ModelSeasonPagoda) addNewSeasonPagoda(uId string, data *pb.DBSeasonPagoda) (err error) {
err = this.InsertModelLogs(this.TableName, uId, []interface{}{data}) // 不需要经过redis
// if err = this.Add(uId, data); err != nil {
// this.module.Errorf("err:%v", err)
// return
// }
//err = this.InsertModelLogs(this.TableName, uId, []interface{}{data}) // 不需要经过redis
if err = this.Add(uId, data); err != nil {
this.module.Errorf("err:%v", err)
return
}
return nil
}

View File

@ -0,0 +1,93 @@
package pagoda_test
import (
"context"
"fmt"
"go_dreamfactory/comm"
"go_dreamfactory/lego"
"go_dreamfactory/lego/base/rpcx"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/modules/equipment"
"go_dreamfactory/modules/hero"
"go_dreamfactory/modules/items"
"go_dreamfactory/modules/pagoda"
"go_dreamfactory/modules/task"
"go_dreamfactory/modules/user"
"go_dreamfactory/pb"
"go_dreamfactory/services"
"go_dreamfactory/sys/configure"
"go_dreamfactory/sys/db"
"testing"
"time"
"github.com/golang/protobuf/ptypes"
)
var service core.IService
var s_gateComp comm.ISC_GateRouteComp = services.NewGateRouteComp()
var module = new(hero.Hero)
type TestService struct {
rpcx.RPCXService
}
func newService(ops ...rpcx.Option) core.IService {
s := new(TestService)
s.Configure(ops...)
return s
}
//初始化相关系统
func (this *TestService) InitSys() {
this.RPCXService.InitSys()
if err := db.OnInit(this.GetSettings().Sys["db"]); err != nil {
panic(fmt.Sprintf("init sys.db err: %s", err.Error()))
} else {
log.Infof("init sys.db success!")
}
if err := configure.OnInit(this.GetSettings().Sys["configure"], configure.SetConfigPath("F:/work/go/go_dreamfactory/bin/json")); err != nil {
panic(fmt.Sprintf("init sys.configure err: %s", err.Error()))
} else {
log.Infof("init sys.configure success!")
}
}
func Test_Main(t *testing.T) {
service = newService(
rpcx.SetConfPath("../../bin/conf/worker_1.yaml"),
)
service.OnInstallComp( //装备组件
s_gateComp, //此服务需要接受用户的消息 需要装备网关组件
)
go func() {
lego.Run(service, //运行模块
module,
items.NewModule(),
user.NewModule(),
equipment.NewModule(),
task.NewModule(),
pagoda.NewModule(),
)
}()
time.Sleep(time.Second * 2)
}
func GetMap() map[int32]int32 {
return nil
}
func Test_Modules(t *testing.T) {
data, _ := ptypes.MarshalAny(&pb.HeroListReq{})
reply := &pb.RPCMessageReply{}
s_gateComp.ReceiveMsg(context.Background(), &pb.AgentMessage{UserId: "0_62c79d66acc7aa239b07c21e", MainType: "hero", SubType: "list", Message: data}, reply)
log.Debugf("reply:%v", reply)
}
func TestXxx(t *testing.T) {
}

View File

@ -37,9 +37,9 @@ func (this *PagodaRank) Start() (err error) {
// 处理排行榜排序
func (this *PagodaRank) Timer() {
data := make([]interface{}, 0) // options.Find().SetLimit(comm.MaxRankList)
if _data, err := this.DB.Find(comm.TablePagodaRecord, bson.M{}, options.Find().SetSort(bson.M{"pagodaId": -1}).SetLimit(comm.MaxRankList)); err == nil {
if _data, err := this.DB.Find(comm.TableSeasonPagoda, bson.M{}, options.Find().SetSort(bson.M{"pagodaId": -1}).SetLimit(comm.MaxRankList)); err == nil {
for _data.Next(context.TODO()) {
temp := &pb.DBPagodaRank{}
temp := &pb.DBPagodaRecord{}
if err = _data.Decode(temp); err == nil {
data = append(data, temp)
}

View File

@ -23,8 +23,6 @@ func (this *ModelExpand) Init(service core.IService, module core.IModule, comp c
return
}
//获取用户通过扩展表
func (this *ModelExpand) GetUserExpand(uid string) (result *pb.DBUserExpand, err error) {
result = &pb.DBUserExpand{}
@ -61,3 +59,13 @@ func (this *ModelExpand) updateLoginDay(uid string, timestamp int64) (err error)
}
return
}
// 通关了普通塔
func (this *ModelExpand) CompleteNormalPagoda(uid string) (err error) {
update := map[string]interface{}{
"completePagoda": true,
}
err = this.ChangeUserExpand(uid, update)
return
}

View File

@ -181,7 +181,7 @@ func (x *DBSeasonPagoda) GetType() int32 {
}
// 爬塔数据明细
type DBPagodaRank struct {
type DBPagodaRecord struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@ -198,8 +198,8 @@ type DBPagodaRank struct {
CostTime int32 `protobuf:"varint,10,opt,name=costTime,proto3" json:"costTime" bson:"costTime"` //闯关耗时 单位s
}
func (x *DBPagodaRank) Reset() {
*x = DBPagodaRank{}
func (x *DBPagodaRecord) Reset() {
*x = DBPagodaRecord{}
if protoimpl.UnsafeEnabled {
mi := &file_pagoda_pagoda_db_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -207,13 +207,13 @@ func (x *DBPagodaRank) Reset() {
}
}
func (x *DBPagodaRank) String() string {
func (x *DBPagodaRecord) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DBPagodaRank) ProtoMessage() {}
func (*DBPagodaRecord) ProtoMessage() {}
func (x *DBPagodaRank) ProtoReflect() protoreflect.Message {
func (x *DBPagodaRecord) ProtoReflect() protoreflect.Message {
mi := &file_pagoda_pagoda_db_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -225,75 +225,75 @@ func (x *DBPagodaRank) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use DBPagodaRank.ProtoReflect.Descriptor instead.
func (*DBPagodaRank) Descriptor() ([]byte, []int) {
// Deprecated: Use DBPagodaRecord.ProtoReflect.Descriptor instead.
func (*DBPagodaRecord) Descriptor() ([]byte, []int) {
return file_pagoda_pagoda_db_proto_rawDescGZIP(), []int{2}
}
func (x *DBPagodaRank) GetId() string {
func (x *DBPagodaRecord) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *DBPagodaRank) GetUid() string {
func (x *DBPagodaRecord) GetUid() string {
if x != nil {
return x.Uid
}
return ""
}
func (x *DBPagodaRank) GetPagodaId() int32 {
func (x *DBPagodaRecord) GetPagodaId() int32 {
if x != nil {
return x.PagodaId
}
return 0
}
func (x *DBPagodaRank) GetType() int32 {
func (x *DBPagodaRecord) GetType() int32 {
if x != nil {
return x.Type
}
return 0
}
func (x *DBPagodaRank) GetNickname() string {
func (x *DBPagodaRecord) GetNickname() string {
if x != nil {
return x.Nickname
}
return ""
}
func (x *DBPagodaRank) GetIcon() string {
func (x *DBPagodaRecord) GetIcon() string {
if x != nil {
return x.Icon
}
return ""
}
func (x *DBPagodaRank) GetLv() int32 {
func (x *DBPagodaRecord) GetLv() int32 {
if x != nil {
return x.Lv
}
return 0
}
func (x *DBPagodaRank) GetLeadpos() int32 {
func (x *DBPagodaRecord) GetLeadpos() int32 {
if x != nil {
return x.Leadpos
}
return 0
}
func (x *DBPagodaRank) GetLine() []*LineUp {
func (x *DBPagodaRecord) GetLine() []*LineUp {
if x != nil {
return x.Line
}
return nil
}
func (x *DBPagodaRank) GetCostTime() int32 {
func (x *DBPagodaRecord) GetCostTime() int32 {
if x != nil {
return x.CostTime
}
@ -332,23 +332,23 @@ var file_pagoda_pagoda_db_proto_rawDesc = []byte{
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,
0xf3, 0x01, 0x0a, 0x0c, 0x44, 0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x61, 0x6e, 0x6b,
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,
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 (
@ -367,7 +367,7 @@ var file_pagoda_pagoda_db_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_pagoda_pagoda_db_proto_goTypes = []interface{}{
(*DBPagoda)(nil), // 0: DBPagoda
(*DBSeasonPagoda)(nil), // 1: DBSeasonPagoda
(*DBPagodaRank)(nil), // 2: DBPagodaRank
(*DBPagodaRecord)(nil), // 2: DBPagodaRecord
nil, // 3: DBPagoda.RewardEntry
nil, // 4: DBSeasonPagoda.RewardEntry
(*LineUp)(nil), // 5: LineUp
@ -375,7 +375,7 @@ var file_pagoda_pagoda_db_proto_goTypes = []interface{}{
var file_pagoda_pagoda_db_proto_depIdxs = []int32{
3, // 0: DBPagoda.reward:type_name -> DBPagoda.RewardEntry
4, // 1: DBSeasonPagoda.reward:type_name -> DBSeasonPagoda.RewardEntry
5, // 2: DBPagodaRank.line:type_name -> LineUp
5, // 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
@ -415,7 +415,7 @@ func file_pagoda_pagoda_db_proto_init() {
}
}
file_pagoda_pagoda_db_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBPagodaRank); i {
switch v := v.(*DBPagodaRecord); i {
case 0:
return &v.state
case 1:

View File

@ -492,7 +492,7 @@ type PagodaRankListResp struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Ranks []*DBPagodaRank `protobuf:"bytes,1,rep,name=ranks,proto3" json:"ranks"`
Ranks []*DBPagodaRecord `protobuf:"bytes,1,rep,name=ranks,proto3" json:"ranks"`
}
func (x *PagodaRankListResp) Reset() {
@ -527,7 +527,7 @@ func (*PagodaRankListResp) Descriptor() ([]byte, []int) {
return file_pagoda_pagoda_msg_proto_rawDescGZIP(), []int{9}
}
func (x *PagodaRankListResp) GetRanks() []*DBPagodaRank {
func (x *PagodaRankListResp) GetRanks() []*DBPagodaRecord {
if x != nil {
return x.Ranks
}
@ -579,12 +579,12 @@ var file_pagoda_pagoda_msg_proto_rawDesc = []byte{
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, 0x6e, 0x64, 0x22, 0x39, 0x0a, 0x12, 0x50, 0x61, 0x67, 0x6f, 0x64,
0x61, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a,
0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44,
0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x05, 0x72, 0x61, 0x6e,
0x6b, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
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, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x44,
0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x05, 0x72,
0x61, 0x6e, 0x6b, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -614,7 +614,7 @@ var file_pagoda_pagoda_msg_proto_goTypes = []interface{}{
(*DBPagoda)(nil), // 10: DBPagoda
(*BattleInfo)(nil), // 11: BattleInfo
(*BattleReport)(nil), // 12: BattleReport
(*DBPagodaRank)(nil), // 13: DBPagodaRank
(*DBPagodaRecord)(nil), // 13: DBPagodaRecord
}
var file_pagoda_pagoda_msg_proto_depIdxs = []int32{
10, // 0: PagodaGetListResp.data:type_name -> DBPagoda
@ -622,7 +622,7 @@ var file_pagoda_pagoda_msg_proto_depIdxs = []int32{
11, // 2: PagodaChallengeResp.info:type_name -> BattleInfo
12, // 3: PagodaChallengeOverReq.report:type_name -> BattleReport
10, // 4: PagodaChallengeOverResp.data:type_name -> DBPagoda
13, // 5: PagodaRankListResp.ranks:type_name -> DBPagodaRank
13, // 5: PagodaRankListResp.ranks:type_name -> DBPagodaRecord
6, // [6:6] is the sub-list for method output_type
6, // [6:6] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name

View File

@ -504,22 +504,131 @@ func (x *RtaskGetRewardResp) GetRtaskSubId() int32 {
return 0
}
// 开始战斗
type RtaskBattleStartReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
BattleConfId int32 `protobuf:"varint,1,opt,name=battleConfId,proto3" json:"battleConfId"` //战斗配表ID
Leadpos int32 `protobuf:"varint,3,opt,name=leadpos,proto3" json:"leadpos"` //队长位置
Teamids []string `protobuf:"bytes,4,rep,name=teamids,proto3" json:"teamids"` //阵容信息
}
func (x *RtaskBattleStartReq) Reset() {
*x = RtaskBattleStartReq{}
if protoimpl.UnsafeEnabled {
mi := &file_rtask_rtask_msg_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RtaskBattleStartReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RtaskBattleStartReq) ProtoMessage() {}
func (x *RtaskBattleStartReq) ProtoReflect() protoreflect.Message {
mi := &file_rtask_rtask_msg_proto_msgTypes[9]
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 RtaskBattleStartReq.ProtoReflect.Descriptor instead.
func (*RtaskBattleStartReq) Descriptor() ([]byte, []int) {
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{9}
}
func (x *RtaskBattleStartReq) GetBattleConfId() int32 {
if x != nil {
return x.BattleConfId
}
return 0
}
func (x *RtaskBattleStartReq) GetLeadpos() int32 {
if x != nil {
return x.Leadpos
}
return 0
}
func (x *RtaskBattleStartReq) GetTeamids() []string {
if x != nil {
return x.Teamids
}
return nil
}
type RtaskBattleStartResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Info *BattleInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info"` //战斗信息
}
func (x *RtaskBattleStartResp) Reset() {
*x = RtaskBattleStartResp{}
if protoimpl.UnsafeEnabled {
mi := &file_rtask_rtask_msg_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RtaskBattleStartResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RtaskBattleStartResp) ProtoMessage() {}
func (x *RtaskBattleStartResp) ProtoReflect() protoreflect.Message {
mi := &file_rtask_rtask_msg_proto_msgTypes[10]
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 RtaskBattleStartResp.ProtoReflect.Descriptor instead.
func (*RtaskBattleStartResp) Descriptor() ([]byte, []int) {
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{10}
}
func (x *RtaskBattleStartResp) GetInfo() *BattleInfo {
if x != nil {
return x.Info
}
return nil
}
// 战斗完成
type RtaskBattleFinishReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RtaskId int32 `protobuf:"varint,1,opt,name=rtaskId,proto3" json:"rtaskId"` //任务ID
ChooseId int32 `protobuf:"varint,2,opt,name=chooseId,proto3" json:"chooseId"` //选项配置ID
RtaskSubId int32 `protobuf:"varint,3,opt,name=rtaskSubId,proto3" json:"rtaskSubId"` //支线任务ID
Result int32 `protobuf:"varint,4,opt,name=result,proto3" json:"result"`
RtaskId int32 `protobuf:"varint,1,opt,name=rtaskId,proto3" json:"rtaskId"` //任务ID
Report *BattleReport `protobuf:"bytes,4,opt,name=report,proto3" json:"report"` //战报
}
func (x *RtaskBattleFinishReq) Reset() {
*x = RtaskBattleFinishReq{}
if protoimpl.UnsafeEnabled {
mi := &file_rtask_rtask_msg_proto_msgTypes[9]
mi := &file_rtask_rtask_msg_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -532,7 +641,7 @@ func (x *RtaskBattleFinishReq) String() string {
func (*RtaskBattleFinishReq) ProtoMessage() {}
func (x *RtaskBattleFinishReq) ProtoReflect() protoreflect.Message {
mi := &file_rtask_rtask_msg_proto_msgTypes[9]
mi := &file_rtask_rtask_msg_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -545,7 +654,7 @@ func (x *RtaskBattleFinishReq) ProtoReflect() protoreflect.Message {
// Deprecated: Use RtaskBattleFinishReq.ProtoReflect.Descriptor instead.
func (*RtaskBattleFinishReq) Descriptor() ([]byte, []int) {
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{9}
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{11}
}
func (x *RtaskBattleFinishReq) GetRtaskId() int32 {
@ -555,25 +664,11 @@ func (x *RtaskBattleFinishReq) GetRtaskId() int32 {
return 0
}
func (x *RtaskBattleFinishReq) GetChooseId() int32 {
func (x *RtaskBattleFinishReq) GetReport() *BattleReport {
if x != nil {
return x.ChooseId
return x.Report
}
return 0
}
func (x *RtaskBattleFinishReq) GetRtaskSubId() int32 {
if x != nil {
return x.RtaskSubId
}
return 0
}
func (x *RtaskBattleFinishReq) GetResult() int32 {
if x != nil {
return x.Result
}
return 0
return nil
}
type RtaskBattleFinishResp struct {
@ -581,14 +676,14 @@ type RtaskBattleFinishResp struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Bid int32 `protobuf:"varint,1,opt,name=bid,proto3" json:"bid"` //战斗配置ID
RtaskId int32 `protobuf:"varint,2,opt,name=rtaskId,proto3" json:"rtaskId"` //任务ID
RtaskId int32 `protobuf:"varint,1,opt,name=rtaskId,proto3" json:"rtaskId"` //任务ID
IsWin bool `protobuf:"varint,2,opt,name=isWin,proto3" json:"isWin"` //战斗结果
}
func (x *RtaskBattleFinishResp) Reset() {
*x = RtaskBattleFinishResp{}
if protoimpl.UnsafeEnabled {
mi := &file_rtask_rtask_msg_proto_msgTypes[10]
mi := &file_rtask_rtask_msg_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -601,7 +696,7 @@ func (x *RtaskBattleFinishResp) String() string {
func (*RtaskBattleFinishResp) ProtoMessage() {}
func (x *RtaskBattleFinishResp) ProtoReflect() protoreflect.Message {
mi := &file_rtask_rtask_msg_proto_msgTypes[10]
mi := &file_rtask_rtask_msg_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -614,14 +709,7 @@ func (x *RtaskBattleFinishResp) ProtoReflect() protoreflect.Message {
// Deprecated: Use RtaskBattleFinishResp.ProtoReflect.Descriptor instead.
func (*RtaskBattleFinishResp) Descriptor() ([]byte, []int) {
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{10}
}
func (x *RtaskBattleFinishResp) GetBid() int32 {
if x != nil {
return x.Bid
}
return 0
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{12}
}
func (x *RtaskBattleFinishResp) GetRtaskId() int32 {
@ -631,6 +719,13 @@ func (x *RtaskBattleFinishResp) GetRtaskId() int32 {
return 0
}
func (x *RtaskBattleFinishResp) GetIsWin() bool {
if x != nil {
return x.IsWin
}
return false
}
// 测试使用
type RtaskTestReq struct {
state protoimpl.MessageState
@ -645,7 +740,7 @@ type RtaskTestReq struct {
func (x *RtaskTestReq) Reset() {
*x = RtaskTestReq{}
if protoimpl.UnsafeEnabled {
mi := &file_rtask_rtask_msg_proto_msgTypes[11]
mi := &file_rtask_rtask_msg_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -658,7 +753,7 @@ func (x *RtaskTestReq) String() string {
func (*RtaskTestReq) ProtoMessage() {}
func (x *RtaskTestReq) ProtoReflect() protoreflect.Message {
mi := &file_rtask_rtask_msg_proto_msgTypes[11]
mi := &file_rtask_rtask_msg_proto_msgTypes[13]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -671,7 +766,7 @@ func (x *RtaskTestReq) ProtoReflect() protoreflect.Message {
// Deprecated: Use RtaskTestReq.ProtoReflect.Descriptor instead.
func (*RtaskTestReq) Descriptor() ([]byte, []int) {
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{11}
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{13}
}
func (x *RtaskTestReq) GetRtaskType() int32 {
@ -706,7 +801,7 @@ type RtaskTestResp struct {
func (x *RtaskTestResp) Reset() {
*x = RtaskTestResp{}
if protoimpl.UnsafeEnabled {
mi := &file_rtask_rtask_msg_proto_msgTypes[12]
mi := &file_rtask_rtask_msg_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -719,7 +814,7 @@ func (x *RtaskTestResp) String() string {
func (*RtaskTestResp) ProtoMessage() {}
func (x *RtaskTestResp) ProtoReflect() protoreflect.Message {
mi := &file_rtask_rtask_msg_proto_msgTypes[12]
mi := &file_rtask_rtask_msg_proto_msgTypes[14]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -732,7 +827,7 @@ func (x *RtaskTestResp) ProtoReflect() protoreflect.Message {
// Deprecated: Use RtaskTestResp.ProtoReflect.Descriptor instead.
func (*RtaskTestResp) Descriptor() ([]byte, []int) {
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{12}
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{14}
}
func (x *RtaskTestResp) GetFlag() bool {
@ -746,68 +841,77 @@ var File_rtask_rtask_msg_proto protoreflect.FileDescriptor
var file_rtask_rtask_msg_proto_rawDesc = []byte{
0x0a, 0x15, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x6d, 0x73,
0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x49, 0x0a, 0x0d, 0x52, 0x74, 0x61, 0x73, 0x6b,
0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73,
0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b,
0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64,
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62,
0x49, 0x64, 0x22, 0x2a, 0x0a, 0x0e, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x41, 0x70, 0x70, 0x6c, 0x79,
0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x28,
0x0a, 0x0c, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x18,
0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x2b, 0x0a, 0x0d, 0x52, 0x74, 0x61, 0x73,
0x6b, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x74, 0x61,
0x73, 0x6b, 0x49, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x72, 0x74, 0x61,
0x73, 0x6b, 0x49, 0x64, 0x73, 0x22, 0x66, 0x0a, 0x0e, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x68,
0x6f, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b,
0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49,
0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20,
0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a,
0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
0x05, 0x52, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x22, 0x67, 0x0a,
0x0f, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70,
0x67, 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, 0x49, 0x0a, 0x0d, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65,
0x71, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72,
0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x22, 0x2a, 0x0a, 0x0e, 0x52,
0x74, 0x61, 0x73, 0x6b, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a,
0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07,
0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x28, 0x0a, 0x0c, 0x52, 0x74, 0x61, 0x73, 0x6b,
0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70,
0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49,
0x64, 0x22, 0x2b, 0x0a, 0x0d, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65,
0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x18, 0x01,
0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x22, 0x66,
0x0a, 0x0e, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x71,
0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68,
0x6f, 0x6f, 0x73, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x68,
0x6f, 0x6f, 0x73, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53,
0x75, 0x62, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x74, 0x61, 0x73,
0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x22, 0x2b, 0x0a, 0x0f, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x46,
0x69, 0x6e, 0x69, 0x73, 0x68, 0x50, 0x75, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61,
0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x22, 0x67, 0x0a, 0x0f, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x43,
0x68, 0x6f, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61,
0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73,
0x6b, 0x49, 0x64, 0x22, 0x4d, 0x0a, 0x11, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x47, 0x65, 0x74, 0x52,
0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73,
0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b,
0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64,
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62,
0x49, 0x64, 0x22, 0x4e, 0x0a, 0x12, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x47, 0x65, 0x74, 0x52, 0x65,
0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73,
0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b,
0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64,
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62,
0x49, 0x64, 0x22, 0x84, 0x01, 0x0a, 0x14, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74,
0x6b, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x49, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x49, 0x64, 0x12,
0x1e, 0x0a, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x18, 0x03, 0x20,
0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x22,
0x2b, 0x0a, 0x0f, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x50, 0x75,
0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x4d, 0x0a, 0x11,
0x52, 0x74, 0x61, 0x73, 0x6b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65,
0x71, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72,
0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x22, 0x4e, 0x0a, 0x12, 0x52,
0x74, 0x61, 0x73, 0x6b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73,
0x70, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72,
0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x22, 0x6d, 0x0a, 0x13, 0x52,
0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52,
0x65, 0x71, 0x12, 0x22, 0x0a, 0x0c, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x66,
0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65,
0x43, 0x6f, 0x6e, 0x66, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f,
0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73,
0x12, 0x18, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28,
0x09, 0x52, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x69, 0x64, 0x73, 0x22, 0x37, 0x0a, 0x14, 0x52, 0x74,
0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 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, 0x22, 0x57, 0x0a, 0x14, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74,
0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x72,
0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74,
0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x49,
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x49,
0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x18,
0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49,
0x64, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28,
0x05, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x43, 0x0a, 0x15, 0x52, 0x74, 0x61,
0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65,
0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x03, 0x62, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x5e,
0x0a, 0x0c, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1c,
0x0a, 0x09, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x05, 0x52, 0x09, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06,
0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x70, 0x61,
0x72, 0x61, 0x6d, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x18,
0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x22, 0x23,
0x0a, 0x0d, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12,
0x12, 0x0a, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x66,
0x6c, 0x61, 0x67, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18,
0x04, 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, 0x47, 0x0a, 0x15,
0x52, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73,
0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12,
0x14, 0x0a, 0x05, 0x69, 0x73, 0x57, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05,
0x69, 0x73, 0x57, 0x69, 0x6e, 0x22, 0x5e, 0x0a, 0x0c, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x65,
0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x79,
0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x54,
0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20,
0x03, 0x28, 0x05, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63,
0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x6f,
0x6e, 0x64, 0x69, 0x49, 0x64, 0x22, 0x23, 0x0a, 0x0d, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x65,
0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x18, 0x01,
0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b,
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -822,7 +926,7 @@ func file_rtask_rtask_msg_proto_rawDescGZIP() []byte {
return file_rtask_rtask_msg_proto_rawDescData
}
var file_rtask_rtask_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
var file_rtask_rtask_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
var file_rtask_rtask_msg_proto_goTypes = []interface{}{
(*RtaskApplyReq)(nil), // 0: RtaskApplyReq
(*RtaskApplyResp)(nil), // 1: RtaskApplyResp
@ -833,17 +937,23 @@ var file_rtask_rtask_msg_proto_goTypes = []interface{}{
(*RtaskFinishPush)(nil), // 6: RtaskFinishPush
(*RtaskGetRewardReq)(nil), // 7: RtaskGetRewardReq
(*RtaskGetRewardResp)(nil), // 8: RtaskGetRewardResp
(*RtaskBattleFinishReq)(nil), // 9: RtaskBattleFinishReq
(*RtaskBattleFinishResp)(nil), // 10: RtaskBattleFinishResp
(*RtaskTestReq)(nil), // 11: RtaskTestReq
(*RtaskTestResp)(nil), // 12: RtaskTestResp
(*RtaskBattleStartReq)(nil), // 9: RtaskBattleStartReq
(*RtaskBattleStartResp)(nil), // 10: RtaskBattleStartResp
(*RtaskBattleFinishReq)(nil), // 11: RtaskBattleFinishReq
(*RtaskBattleFinishResp)(nil), // 12: RtaskBattleFinishResp
(*RtaskTestReq)(nil), // 13: RtaskTestReq
(*RtaskTestResp)(nil), // 14: RtaskTestResp
(*BattleInfo)(nil), // 15: BattleInfo
(*BattleReport)(nil), // 16: BattleReport
}
var file_rtask_rtask_msg_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
15, // 0: RtaskBattleStartResp.info:type_name -> BattleInfo
16, // 1: RtaskBattleFinishReq.report:type_name -> BattleReport
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
}
func init() { file_rtask_rtask_msg_proto_init() }
@ -851,6 +961,7 @@ func file_rtask_rtask_msg_proto_init() {
if File_rtask_rtask_msg_proto != nil {
return
}
file_battle_battle_msg_proto_init()
if !protoimpl.UnsafeEnabled {
file_rtask_rtask_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RtaskApplyReq); i {
@ -961,7 +1072,7 @@ func file_rtask_rtask_msg_proto_init() {
}
}
file_rtask_rtask_msg_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RtaskBattleFinishReq); i {
switch v := v.(*RtaskBattleStartReq); i {
case 0:
return &v.state
case 1:
@ -973,7 +1084,7 @@ func file_rtask_rtask_msg_proto_init() {
}
}
file_rtask_rtask_msg_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RtaskBattleFinishResp); i {
switch v := v.(*RtaskBattleStartResp); i {
case 0:
return &v.state
case 1:
@ -985,7 +1096,7 @@ func file_rtask_rtask_msg_proto_init() {
}
}
file_rtask_rtask_msg_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RtaskTestReq); i {
switch v := v.(*RtaskBattleFinishReq); i {
case 0:
return &v.state
case 1:
@ -997,6 +1108,30 @@ func file_rtask_rtask_msg_proto_init() {
}
}
file_rtask_rtask_msg_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RtaskBattleFinishResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_rtask_rtask_msg_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RtaskTestReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_rtask_rtask_msg_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RtaskTestResp); i {
case 0:
return &v.state
@ -1015,7 +1150,7 @@ func file_rtask_rtask_msg_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_rtask_rtask_msg_proto_rawDesc,
NumEnums: 0,
NumMessages: 13,
NumMessages: 15,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -390,6 +390,7 @@ type DBUserExpand struct {
MoonfantasyLastTrigger int64 `protobuf:"varint,18,opt,name=moonfantasyLastTrigger,proto3" json:"moonfantasyLastTrigger" bson:"moonfantasyTriggerlast"` // 月之秘境最后触发时间
LoginAddCount int32 `protobuf:"varint,19,opt,name=loginAddCount,proto3" json:"loginAddCount"` //@go_tasgs(`bson:"loginAddCount"`) 累计登录天数
LoginContinueCount int32 `protobuf:"varint,20,opt,name=loginContinueCount,proto3" json:"loginContinueCount"` //@go_tasgs(`bson:"loginContinueCount"`) 连续登录天数
CompletePagoda bool `protobuf:"varint,21,opt,name=completePagoda,proto3" json:"completePagoda" bson:"completePagoda"` //通关普通塔
}
func (x *DBUserExpand) Reset() {
@ -564,6 +565,13 @@ func (x *DBUserExpand) GetLoginContinueCount() int32 {
return 0
}
func (x *DBUserExpand) GetCompletePagoda() bool {
if x != nil {
return x.CompletePagoda
}
return false
}
var File_userexpand_proto protoreflect.FileDescriptor
var file_userexpand_proto_rawDesc = []byte{
@ -592,7 +600,7 @@ var file_userexpand_proto_rawDesc = []byte{
0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2b, 0x0a, 0x0a, 0x63, 0x6f, 0x6d,
0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e,
0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70,
0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x22, 0x93, 0x07, 0x0a, 0x0c, 0x44, 0x42, 0x55, 0x73, 0x65,
0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x22, 0xbb, 0x07, 0x0a, 0x0c, 0x44, 0x42, 0x55, 0x73, 0x65,
0x72, 0x45, 0x78, 0x70, 0x61, 0x6e, 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, 0x2c, 0x0a, 0x11, 0x6c, 0x61, 0x73,
@ -641,16 +649,19 @@ var file_userexpand_proto_rawDesc = []byte{
0x6e, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x12, 0x6c, 0x6f, 0x67,
0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18,
0x14, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x74,
0x69, 0x6e, 0x75, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x39, 0x0a, 0x0b, 0x54, 0x75, 0x6a,
0x69, 0x61, 0x6e, 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, 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, 0x46, 0x0a, 0x0f, 0x50, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61,
0x6c, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x05, 0x76, 0x61, 0x6c,
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72,
0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04,
0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x69, 0x6e, 0x75, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6d,
0x70, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x18, 0x15, 0x20, 0x01, 0x28,
0x08, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x67, 0x6f, 0x64,
0x61, 0x1a, 0x39, 0x0a, 0x0b, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e, 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, 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, 0x46, 0x0a, 0x0f,
0x50, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12,
0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65,
0x79, 0x12, 0x1d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x07, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -1,7 +1,6 @@
package db
import (
"context"
"time"
)
@ -35,7 +34,7 @@ func OnInit(config map[string]interface{}, option ...Option) (err error) {
}
defsys, err = newSys(options)
defsys.Local().Redis.GetClient().FlushAll(context.TODO())
// defsys.Local().Redis.GetClient().FlushAll(context.TODO())
return
}