This commit is contained in:
meixiongfeng 2023-07-26 14:44:09 +08:00
commit fa0acb2647
19 changed files with 1462 additions and 401 deletions

View File

@ -123,6 +123,11 @@ func (this *MCompModel) Gets(ids []string, data interface{}, opt ...db.DBOption)
return this.DBModel.Gets(ids, data, opt...)
}
// 读取多个数据对象 by 用户id
func (this *MCompModel) GetByUids(uids []string, data interface{}, opt ...db.DBOption) (onfound []string, err error) {
return this.DBModel.GetByUids(uids, data, opt...)
}
// 获取列表数据 注意 data 必须是 切片的指针 *[]type
func (this *MCompModel) GetList(uid string, data interface{}) (err error) {
return this.DBModel.GetList(uid, data)

View File

@ -18,6 +18,7 @@ func (this *apiComp) ChallengeFinishCheck(session comm.IUserSession, req *pb.Gui
// 获取工会boos战信息
func (this *apiComp) ChallengeFinish(session comm.IUserSession, req *pb.GuildGveChallengeFinishReq) (errdata *pb.ErrorData) {
var (
user *pb.DBUser
conf *cfg.GameGuildBossData
member *pb.DBGuildMember
score *cfg.GameGuildBossScoreData
@ -63,11 +64,18 @@ func (this *apiComp) ChallengeFinish(session comm.IUserSession, req *pb.GuildGve
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
Message: fmt.Sprintf("Boosticket is ", member.Boosticket),
Message: fmt.Sprintf("Boosticket is %d", member.Boosticket),
}
return
}
if user = this.module.ModuleUser.GetUser(session.GetUserId()); user != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: "no found user data!",
}
return
}
lock, _ := this.module.modelGuildGve.userlock(req.Guildid)
err = lock.Lock()
if err != nil {
@ -89,15 +97,30 @@ func (this *apiComp) ChallengeFinish(session comm.IUserSession, req *pb.GuildGve
if v.Hp > 0 {
ok = true
v.Hp -= score.Hp
record := &pb.DBGveRecord{
Uid: session.GetUserId(),
Formation: make([]string, 0),
User: &pb.DBSimpleUser{
Uid: session.GetUserId(),
Nickname: user.Name,
Skin: user.CurSkin,
Sex: user.Gender,
Lv: user.Lv,
},
Formation: make([]*pb.DBSimpleHero, 0),
Time: configure.Now().Unix(),
Rating: score.Id,
Harm: req.Report.Harm,
}
member.Record[req.Boosid] = record
for i, v := range req.Report.Info.Redflist[0].Team {
record.Formation[i] = ""
if int32(i) == req.Report.Info.Redflist[0].Leadpos && v != nil {
record.CaptainHeroId = v.HeroID
}
if v != nil {
record.Formation[i] = v.HeroID
record.Formation = append(record.Formation, &pb.DBSimpleHero{
HeroId: v.HeroID,
Star: v.Star,
Level: v.Lv,
})
}
}
v.Record = append(v.Record)

View File

@ -0,0 +1,48 @@
package guildgve
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
)
// 参数校验
func (this *apiComp) FriendsRecordCheck(session comm.IUserSession, req *pb.GuildGveFriendsRecordReq) (errdata *pb.ErrorData) {
if len(req.Friends) == 0 || len(req.Friends) > 50 {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
Message: req.String(),
}
}
return
}
// 获取工会boos战信息
func (this *apiComp) FriendsRecord(session comm.IUserSession, req *pb.GuildGveFriendsRecordReq) (errdata *pb.ErrorData) {
var (
member []*pb.DBGuildMember
record []*pb.DBGveRecord
err error
)
if errdata = this.FriendsRecordCheck(session, req); errdata != nil {
return
}
if member, err = this.module.modelGuildMember.inquireGuildMembers(req.Friends); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return
}
for _, v := range member {
if r, ok := v.Record[req.Boosid]; ok {
record = append(record, r)
}
}
session.SendMsg(string(this.module.GetType()), "friendsrecord", &pb.GuildGveFriendsRecordResp{Boosid: req.Boosid, Record: record})
return
}

View File

@ -62,6 +62,7 @@ func (this *ModelGuildMember) getGuildMember(guild, uid string) (results *pb.DBG
Guild: guild,
Boosticket: conf.GuildBossCeiling,
Refreshtime: configure.Now().Unix(),
Record: make(map[int32]*pb.DBGveRecord),
}
err = this.Add(uid, results)
}
@ -76,9 +77,20 @@ func (this *ModelGuildMember) updateGuildMember(data *pb.DBGuildMember) (err err
"guild": data.Guild,
"boosticket": data.Boosticket,
"refreshtime": data.Refreshtime,
"record": data.Record,
}); err != nil {
this.module.Error("更新工会成员信息 错误!", log.Field{Key: "err", Value: err.Error()})
return
}
return
}
// 查询多个用户的数据
func (this *ModelGuildMember) inquireGuildMembers(uids []string) (results []*pb.DBGuildMember, err error) {
results = make([]*pb.DBGuildMember, 0)
if _, err = this.GetByUids(uids, &results); err != nil && err != mgo.MongodbNil {
this.module.Errorln(err)
return
}
return
}

View File

@ -5,14 +5,6 @@ import (
"go_dreamfactory/modules"
)
const (
MlineGetListResp = "getlist"
MlineChallengeResp = "challenge"
MlineCleanStageResp = "cleanstage"
MlineChallengeOverResp = "challengeover"
MlineGetRewardResp = "getreward"
)
type apiComp struct {
modules.MCompGate
service core.IService

View File

@ -69,7 +69,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.MainlineChalle
if errdata != nil {
return
}
session.SendMsg(string(this.module.GetType()), MlineChallengeResp, &pb.MainlineChallengeResp{
session.SendMsg(string(this.module.GetType()), "challenge", &pb.MainlineChallengeResp{
Info: &pb.BattleInfo{
Id: record.Id,
Title: record.Title,

View File

@ -53,6 +53,15 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MainlineCh
}
}
if err = this.module.modelMline.checklevel(req.Level, info); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
Message: err.Error(),
}
return
}
// 校验通过
errdata, isWin = this.module.battle.CheckBattleReport(session, req.Report)
if errdata != nil {
@ -62,7 +71,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MainlineCh
if errdata = this.module.DispenseRes(session, conf.PsConsume, true); errdata != nil { // 返还预扣体力
return
}
session.SendMsg(string(this.module.GetType()), MlineChallengeOverResp, &pb.MainlineChallengeOverResp{
session.SendMsg(string(this.module.GetType()), "challengeover", &pb.MainlineChallengeOverResp{
Level: req.Level,
}) // 数据推送
return
@ -100,8 +109,9 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MainlineCh
first = true
info.Level[req.Level] = star
}
info.Lastlevel = req.Level
this.module.modelMline.updateprogress(info)
if first { // 发奖
if errdata = this.module.DispenseRes(session, conf.Firstaward, true); errdata != nil {
this.module.Debugf("Mline first DispenseRes err:+%v", conf.Firstaward)
@ -149,41 +159,26 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MainlineCh
}
}
}
userExp, _ = this.module.ModuleUser.ConsumePsAddExp(session, consumPs)
session.SendMsg(string(this.module.GetType()), MlineChallengeOverResp, &pb.MainlineChallengeOverResp{
if userExp, errdata = this.module.ModuleUser.ConsumePsAddExp(session, consumPs); errdata != nil {
return
}
if err = this.module.modelMline.updateMainlineData(session.GetUserId(), info); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return
}
session.SendMsg(string(this.module.GetType()), "challengeover", &pb.MainlineChallengeOverResp{
Level: req.Level,
Star: star,
HeroExp: conf.HeroExp,
UserExp: userExp,
}) // 数据推送
})
// // 校验功能开启
// module, err2 := this.module.service.GetModule(comm.ModuleSys)
// if err2 == nil {
// if isys, ok := module.(comm.ISys); ok {
// isys.CheckLvUpCond(session, req.Level) // 校验新功能是否开启
// }
// }
// 主线任务统计 Rtype60
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype60, 1))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype61, 1, int32(req.Level)))
// var (
// ChapterStar int32
// allStar int32
// )
// tasks = append(tasks, comm.GetBuriedParam(comm.Rtype158, ChapterStar, curChapter.ChapterId, curChapter.CType))
// for _, v2 := range list {
// for _, v1 := range v2.Star {
// for _, v := range szStar {
// if v1&v == v {
// allStar++
// }
// }
// }
// }
// this.module.ModuleRtask.SendToRtask(session, comm.Rtype160, allStar)
// tasks = append(tasks, comm.GetBuriedParam(comm.Rtype160, allStar, conf.Chapterid))
go this.module.ModuleBuried.TriggerBuried(session.Clone(), tasks...)
return
}

View File

@ -31,6 +31,6 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.MainlineInfoReq) (e
}
return
}
session.SendMsg(string(this.module.GetType()), MlineGetListResp, &pb.MainlineInfoResp{Info: info})
session.SendMsg(string(this.module.GetType()), "info", &pb.MainlineInfoResp{Info: info})
return
}

View File

@ -24,8 +24,7 @@ func (this *apiComp) LevelPass(session comm.IUserSession, req *pb.MainlineLevelP
var (
conf *cfg.GameMainStageData
info *pb.DBMainline
aeward []*pb.UserAssets = make([]*pb.UserAssets, 0)
isWin bool
aeward []*pb.UserAssets = make([]*pb.UserAssets, 0)
first bool // 判断是否是首通
star int32 // 评星
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
@ -53,20 +52,15 @@ func (this *apiComp) LevelPass(session comm.IUserSession, req *pb.MainlineLevelP
}
}
// 校验通过
errdata, isWin = this.module.battle.CheckBattleReport(session, req.Report)
if errdata != nil {
return
}
if !isWin { // 战斗失败返还扣除的体力
if errdata = this.module.DispenseRes(session, conf.PsConsume, true); errdata != nil { // 返还预扣体力
return
if err = this.module.modelMline.checklevel(req.Level, info); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
Message: err.Error(),
}
session.SendMsg(string(this.module.GetType()), MlineChallengeOverResp, &pb.MainlineChallengeOverResp{
Level: req.Level,
}) // 数据推送
return
}
// 评星规则
if len(conf.Star) != len(conf.StarType) || len(conf.Star) != len(conf.StarValue) || len(conf.StarValue) != len(conf.StarType) {
this.module.Errorf("配置错误, 参数数量不一致,StageId: %d", req.Level)
@ -77,31 +71,13 @@ func (this *apiComp) LevelPass(session comm.IUserSession, req *pb.MainlineLevelP
return
}
var szStar []int32
szStar = append(szStar, 1<<0)
szStar = append(szStar, 1<<1)
szStar = append(szStar, 1<<2)
for i, v := range conf.StarType {
if v == comm.MainStarType1 {
star ^= szStar[i]
} else if v == comm.MainStarType2 {
if req.Report.Death <= conf.StarValue[i] {
star ^= szStar[i]
}
} else if v == comm.MainStarType3 {
if req.Report.Round <= conf.StarValue[i] {
star ^= szStar[i]
}
}
}
// 判断是不是首通
if _, ok := info.Level[req.Level]; !ok {
first = true
info.Level[req.Level] = star
info.Level[req.Level] = 1
}
info.Lastlevel = req.Level
this.module.modelMline.updateprogress(info)
if first { // 发奖
if errdata = this.module.DispenseRes(session, conf.Firstaward, true); errdata != nil {
this.module.Debugf("Mline first DispenseRes err:+%v", conf.Firstaward)
@ -138,19 +114,8 @@ func (this *apiComp) LevelPass(session comm.IUserSession, req *pb.MainlineLevelP
})
}
}
// 加英雄经验
if conf.HeroExp > 0 {
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
for _, v := range req.Report.Info.Redflist[0].Team {
if !v.Ishelp { // 助战英雄不加经验
this.module.ModuleHero.AddHeroExp(session, v.Oid, conf.HeroExp)
}
}
}
}
userExp, _ = this.module.ModuleUser.ConsumePsAddExp(session, consumPs)
session.SendMsg(string(this.module.GetType()), MlineChallengeOverResp, &pb.MainlineChallengeOverResp{
session.SendMsg(string(this.module.GetType()), "levelpass", &pb.MainlineLevelPassResp{
Level: req.Level,
Star: star,
HeroExp: conf.HeroExp,

View File

@ -0,0 +1,117 @@
package mainline
import (
"fmt"
"go_dreamfactory/comm"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
)
// 参数校验
func (this *apiComp) ReceiveAwardCheck(session comm.IUserSession, req *pb.MainlineReceiveAwardReq) (errdata *pb.ErrorData) {
return
}
// /获取主线关卡信息
func (this *apiComp) ReceiveAward(session comm.IUserSession, req *pb.MainlineReceiveAwardReq) (errdata *pb.ErrorData) {
var (
info *pb.DBMainline
award *pb.DBMainlineAward
chapterconf *cfg.GameMainChapterData
awardConfs []*cfg.GameMainStarrewardData
awardid int32
pass int32
ok bool
err error
)
errdata = this.ReceiveAwardCheck(session, req)
if errdata != nil {
return // 参数校验失败直接返回
}
info, err = this.module.modelMline.getMainlineData(session.GetUserId())
if err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return
}
if req.Rtype == 0 {
if award, ok = info.Chapteraward[req.Chapter]; !ok || award.Stage < req.Stage {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
Message: fmt.Sprintf("chapter:%d stage:%d no arrive", req.Chapter, req.Stage),
}
return
}
if chapterconf, err = this.module.configure.GetMainChapterConf(req.Chapter); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound,
Title: pb.ErrorCode_ConfigNoFound.ToString(),
Message: err.Error(),
}
return
}
awardid = (chapterconf.Starreward)
} else if req.Rtype == 1 {
if award, ok = info.Exploreaward[req.Chapter]; !ok || award.Stage < req.Stage {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
Message: fmt.Sprintf("chapter:%d stage:%d no arrive", req.Chapter, req.Stage),
}
return
}
if chapterconf, err = this.module.configure.GetMainChapterConf(req.Chapter); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound,
Title: pb.ErrorCode_ConfigNoFound.ToString(),
Message: err.Error(),
}
return
}
awardid = (chapterconf.Starreward)
} else {
if award, ok = info.Groupaward[req.Group]; !ok || award.Stage < req.Stage {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
Message: fmt.Sprintf("group:%d stage:%d no arrive", req.Group, req.Stage),
}
return
}
}
if pass, ok = award.Award[req.Stage]; ok && pass == 2 {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_MainlineRepeatReward,
Title: pb.ErrorCode_MainlineRepeatReward.ToString(),
Message: fmt.Sprintf("progress:%d stage:%d repeatreward", req.Chapter, req.Stage),
}
return
}
if awardConfs, ok = this.module.configure.getrewardMap()[awardid]; !ok {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound,
Title: pb.ErrorCode_ConfigNoFound.ToString(),
Message: fmt.Sprintf("no found awardid:%d", awardid),
}
return
}
ok = false
for _, v := range awardConfs {
if v.Starnum == req.Stage {
ok = true
}
}
session.SendMsg(string(this.module.GetType()), "receiveaward", &pb.MainlineReceiveAwardResp{})
return
}

View File

@ -19,10 +19,10 @@ const (
// /配置管理基础组件
type configureComp struct {
modules.MCompConfigure
module *Mainline
hlock sync.RWMutex
_mapMilne map[int32][]int32 // key 章节id value cid
module *Mainline
lock sync.RWMutex
chapterMap map[int32][]*cfg.GameMainStageData
rewardMap map[int32][]*cfg.GameMainStarrewardData
}
// 组件初始化接口
@ -30,42 +30,94 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
err = this.MCompConfigure.Init(service, module, comp, options)
this.module = module.(*Mainline)
err = this.LoadMultiConfigure(map[string]interface{}{
game_mainchapter: cfg.NewGameMainChapter,
game_mainstage: cfg.NewGameMainStage,
game_mainstarreward: cfg.NewGameMainStarreward,
game_mainchapter: cfg.NewGameMainChapter,
})
configure.RegisterConfigure(game_mainstage, cfg.NewGameMainStage, this.LoadMlineStage)
this.chapterMap = make(map[int32][]*cfg.GameMainStageData)
configure.RegisterConfigure(game_mainstage, cfg.NewGameMainStage, this.updateMlineStage)
configure.RegisterConfigure(game_mainstarreward, cfg.NewGameMainStarreward, this.updateMlineReward)
return
}
// 读取配置数据
func (this *configureComp) GetConfigure(name string) (v interface{}, err error) {
return configure.GetConfigure(name)
func (this *configureComp) getchapterMap() map[int32][]*cfg.GameMainStageData {
this.lock.Lock()
chapterMap := this.chapterMap
this.lock.RUnlock()
return chapterMap
}
func (this *configureComp) GetMainChapterConf(id int32) (data *cfg.GameMainChapterData) {
if v, err := this.GetConfigure(game_mainchapter); err == nil {
if configure, ok := v.(*cfg.GameMainChapter); ok {
return configure.Get(id)
func (this *configureComp) getrewardMap() map[int32][]*cfg.GameMainStarrewardData {
this.lock.Lock()
rewardMap := this.rewardMap
this.lock.RUnlock()
return rewardMap
}
func (this *configureComp) updateMlineStage() {
var (
v interface{}
configure *cfg.GameMainStage
chapterMap map[int32][]*cfg.GameMainStageData
err error
ok bool
)
if v, err = this.GetConfigure(game_mainstage); err == nil {
this.module.Errorln(err)
return
}
if configure, ok = v.(*cfg.GameMainStage); ok {
chapterMap = make(map[int32][]*cfg.GameMainStageData)
for _, v := range configure.GetDataList() {
if _, ok = chapterMap[v.Chapterid]; !ok {
chapterMap[v.Chapterid] = make([]*cfg.GameMainStageData, 0)
}
chapterMap[v.Chapterid] = append(chapterMap[v.Chapterid], v)
}
}
this.module.Errorf("GameMainChapterData conf not found key :%d", id)
this.lock.Lock()
this.chapterMap = chapterMap
this.lock.Unlock()
return
}
func (this *configureComp) GetMainStarRewardConf(boxId int32) (data []*cfg.GameMainStarrewardData) {
if v, err := this.GetConfigure(game_mainstarreward); err == nil {
if configure, ok := v.(*cfg.GameMainStarreward); ok {
for _, v1 := range configure.GetDataList() {
if v1.Boxid == boxId {
data = append(data, v1)
}
func (this *configureComp) updateMlineReward() {
var (
v interface{}
configure *cfg.GameMainStarreward
rewardMap map[int32][]*cfg.GameMainStarrewardData
err error
ok bool
)
if v, err = this.GetConfigure(game_mainstarreward); err == nil {
this.module.Errorln(err)
return
}
if configure, ok = v.(*cfg.GameMainStarreward); ok {
rewardMap = make(map[int32][]*cfg.GameMainStarrewardData)
for _, v := range configure.GetDataList() {
if _, ok = rewardMap[v.Boxid]; !ok {
rewardMap[v.Boxid] = make([]*cfg.GameMainStarrewardData, 0)
}
rewardMap[v.Boxid] = append(rewardMap[v.Boxid], v)
}
}
this.lock.Lock()
this.rewardMap = rewardMap
this.lock.Unlock()
return
}
func (this *configureComp) GetMainChapterConf(id int32) (conf *cfg.GameMainChapterData, err error) {
var (
v interface{}
ok bool
)
if v, err = this.GetConfigure(game_mainchapter); err == nil {
this.module.Errorln(err)
return
}
if conf, ok = v.(*cfg.GameMainChapter).GetDataMap()[id]; !ok {
err = comm.NewNotFoundConfErr(string(this.module.GetType()), game_mainchapter, id)
}
return
}
@ -84,98 +136,3 @@ func (this *configureComp) GetMainStageConf(id int32) (data *cfg.GameMainStageDa
err = comm.NewNotFoundConfErr(moduleName, game_mainstage, id)
return
}
// 获取上一关卡信息
func (this *configureComp) GetPreMainChapter(stageId int32) (preStageID int32) {
if v, err := this.GetConfigure(game_mainstage); err == nil {
if configure, ok := v.(*cfg.GameMainStage); ok {
for _, v1 := range configure.GetDataList() {
if v1.Previoustage == stageId {
preStageID = v1.Id
break
}
}
}
}
return
}
func (this *configureComp) GetFirstChapterIDByType(iType int32) (conf *cfg.GameMainChapterData, err error) {
var (
v interface{}
)
if v, err = this.GetConfigure(game_mainchapter); err == nil {
if configure, ok := v.(*cfg.GameMainChapter); ok {
for _, conf = range configure.GetDataList() {
if conf.ChapterType == iType {
return
}
}
}
}
err = comm.NewNotFoundConfErr(moduleName, game_mainchapter, iType)
return
}
func (this *configureComp) GetFirstStageIDByChapter(chapterID int32) *cfg.GameMainStageData {
if v, err := this.GetConfigure(game_mainstage); err == nil {
if configure, ok := v.(*cfg.GameMainStage); ok {
for _, v := range configure.GetDataList() {
if v.Chapterid == chapterID {
return v
}
}
}
}
return nil
}
// 红点用 获取所有章节数据
func (this *configureComp) GetAllChapterID() (chapter []int32) {
if v, err := this.GetConfigure(game_mainchapter); err == nil {
if configure, ok := v.(*cfg.GameMainChapter); ok {
for _, v1 := range configure.GetDataList() {
chapter = append(chapter, v1.Id)
}
}
}
return
}
func (this *configureComp) GetAllStageByChapterID(chapterID int32) (stage []int32) {
return this._mapMilne[chapterID]
}
func (this *configureComp) LoadMlineStage() {
if v, err := this.GetConfigure(game_mainstage); err == nil {
if configure, ok := v.(*cfg.GameMainStage); ok {
this.hlock.Lock()
defer this.hlock.Unlock()
this._mapMilne = make(map[int32][]int32)
for _, v1 := range configure.GetDataList() {
this._mapMilne[v1.Chapterid] = append(this._mapMilne[v1.Chapterid], v1.Id)
}
}
}
return
}
// GM 专用 获取这个章节之前的所有章节信息
func (this *configureComp) GMGetPreStage(chapterID int32) (chapter []int32) {
curChapter := this.GetMainChapterConf(chapterID)
if curChapter == nil {
return
}
if v, err := this.GetConfigure(game_mainchapter); err == nil {
if configure, ok := v.(*cfg.GameMainChapter); ok {
for _, conf := range configure.GetDataList() {
if chapterID == conf.Id {
break
}
chapter = append(chapter, conf.Id)
}
}
}
return
}

View File

@ -1,12 +1,14 @@
package mainline
import (
"fmt"
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/lego/sys/mgo"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
"go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo"
@ -65,3 +67,91 @@ func (this *ModelMline) updateMainlineData(uid string, data *pb.DBMainline) (err
}
return
}
// 更新主线进度
func (this *ModelMline) updateprogress(data *pb.DBMainline) {
var (
conf *cfg.GameMainStageData
chapteraward map[int32]*pb.DBMainlineAward = make(map[int32]*pb.DBMainlineAward)
exploreaward map[int32]*pb.DBMainlineAward = make(map[int32]*pb.DBMainlineAward)
groupaward map[int32]*pb.DBMainlineAward = make(map[int32]*pb.DBMainlineAward)
err error
ok bool
)
for k, v := range data.Level {
if conf, err = this.module.configure.GetMainStageConf(k); err != nil { // 配置文件校验
this.module.Errorln(err)
return
}
if conf.Progress == 1 {
if _, ok = chapteraward[conf.Chapterid]; !ok {
chapteraward[conf.Chapterid] = &pb.DBMainlineAward{}
}
chapteraward[conf.Chapterid].Stage++
} else {
if _, ok = exploreaward[conf.Chapterid]; !ok && conf.Episodetype != 8 {
exploreaward[conf.Chapterid] = &pb.DBMainlineAward{}
}
exploreaward[conf.Chapterid].Stage++
}
if _, ok = groupaward[conf.GroupId]; !ok {
groupaward[conf.GroupId] = &pb.DBMainlineAward{}
}
for i := 0; i < len(conf.Star); i++ {
if (1<<i)&v > 0 {
groupaward[conf.GroupId].Stage++
}
}
}
for k, v := range chapteraward {
if _, ok = data.Chapteraward[k]; !ok {
data.Chapteraward[k] = v
} else {
data.Chapteraward[k].Stage = v.Stage
}
}
for k, v := range exploreaward {
if _, ok = data.Exploreaward[k]; !ok {
data.Exploreaward[k] = v
} else {
data.Exploreaward[k].Stage = v.Stage
}
}
for k, v := range groupaward {
if _, ok = data.Groupaward[k]; !ok {
data.Groupaward[k] = v
} else {
data.Groupaward[k].Stage = v.Stage
}
}
}
// 校验管卡是否触发
func (this *ModelMline) checklevel(level int32, data *pb.DBMainline) (err error) {
var (
conf *cfg.GameMainStageData
ok bool
)
if conf, err = this.module.configure.GetMainStageConf(level); err != nil { // 配置文件校验
this.module.Errorln(err)
return
}
if conf.Previoustage != 0 {
if _, ok = data.Level[conf.Previoustage]; !ok {
err = fmt.Errorf("previoustage:%d no pass", conf.Previoustage)
return
}
}
if conf.PreviousGroupId != nil && len(conf.PreviousGroupId) > 0 {
for _, gid := range conf.PreviousGroupId {
if _, ok = data.Groupaward[gid]; !ok {
err = fmt.Errorf("PreviousGroupId:%d no pass", gid)
return
}
}
}
return
}

View File

@ -202,11 +202,12 @@ type DBGuildMember struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"`
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid"` //用户id
Guild string `protobuf:"bytes,3,opt,name=guild,proto3" json:"guild"` //工会id
Boosticket int32 `protobuf:"varint,4,opt,name=boosticket,proto3" json:"boosticket"` //工会boos战门票
Refreshtime int64 `protobuf:"varint,5,opt,name=refreshtime,proto3" json:"refreshtime"` //门票刷新时间
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"`
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid"` //用户id
Guild string `protobuf:"bytes,3,opt,name=guild,proto3" json:"guild"` //工会id
Boosticket int32 `protobuf:"varint,4,opt,name=boosticket,proto3" json:"boosticket"` //工会boos战门票
Refreshtime int64 `protobuf:"varint,5,opt,name=refreshtime,proto3" json:"refreshtime"` //门票刷新时间
Record map[int32]*DBGveRecord `protobuf:"bytes,6,rep,name=record,proto3" json:"record" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` //战斗记录
}
func (x *DBGuildMember) Reset() {
@ -276,6 +277,13 @@ func (x *DBGuildMember) GetRefreshtime() int64 {
return 0
}
func (x *DBGuildMember) GetRecord() map[int32]*DBGveRecord {
if x != nil {
return x.Record
}
return nil
}
//工会轮盘记录
type DBGuildRouletteRecord struct {
state protoimpl.MessageState
@ -402,10 +410,12 @@ type DBGveRecord struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"` //uid
Formation []string `protobuf:"bytes,2,rep,name=formation,proto3" json:"formation"` //阵型
Rating int32 `protobuf:"varint,3,opt,name=rating,proto3" json:"rating"` //评级
Harm int32 `protobuf:"varint,4,opt,name=harm,proto3" json:"harm"` //伤害血量
User *DBSimpleUser `protobuf:"bytes,1,opt,name=user,proto3" json:"user"`
Time int64 `protobuf:"varint,2,opt,name=time,proto3" json:"time"` //战斗发生时间
CaptainHeroId string `protobuf:"bytes,3,opt,name=captainHeroId,proto3" json:"captainHeroId"` //阵型中的队长
Formation []*DBSimpleHero `protobuf:"bytes,4,rep,name=formation,proto3" json:"formation"` //阵型
Rating int32 `protobuf:"varint,5,opt,name=rating,proto3" json:"rating"` //评级配置ID
Harm int32 `protobuf:"varint,6,opt,name=harm,proto3" json:"harm"` //伤害血量
}
func (x *DBGveRecord) Reset() {
@ -440,14 +450,28 @@ func (*DBGveRecord) Descriptor() ([]byte, []int) {
return file_guildgve_guildgve_db_proto_rawDescGZIP(), []int{5}
}
func (x *DBGveRecord) GetUid() string {
func (x *DBGveRecord) GetUser() *DBSimpleUser {
if x != nil {
return x.Uid
return x.User
}
return nil
}
func (x *DBGveRecord) GetTime() int64 {
if x != nil {
return x.Time
}
return 0
}
func (x *DBGveRecord) GetCaptainHeroId() string {
if x != nil {
return x.CaptainHeroId
}
return ""
}
func (x *DBGveRecord) GetFormation() []string {
func (x *DBGveRecord) GetFormation() []*DBSimpleHero {
if x != nil {
return x.Formation
}
@ -468,6 +492,148 @@ func (x *DBGveRecord) GetHarm() int32 {
return 0
}
type DBSimpleUser struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"` //uid
Nickname string `protobuf:"bytes,2,opt,name=nickname,proto3" json:"nickname"` //昵称
Skin string `protobuf:"bytes,3,opt,name=skin,proto3" json:"skin"` //皮肤
Sex int32 `protobuf:"varint,4,opt,name=sex,proto3" json:"sex"` //性别
Lv int32 `protobuf:"varint,5,opt,name=lv,proto3" json:"lv"` //等级
}
func (x *DBSimpleUser) Reset() {
*x = DBSimpleUser{}
if protoimpl.UnsafeEnabled {
mi := &file_guildgve_guildgve_db_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DBSimpleUser) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DBSimpleUser) ProtoMessage() {}
func (x *DBSimpleUser) ProtoReflect() protoreflect.Message {
mi := &file_guildgve_guildgve_db_proto_msgTypes[6]
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 DBSimpleUser.ProtoReflect.Descriptor instead.
func (*DBSimpleUser) Descriptor() ([]byte, []int) {
return file_guildgve_guildgve_db_proto_rawDescGZIP(), []int{6}
}
func (x *DBSimpleUser) GetUid() string {
if x != nil {
return x.Uid
}
return ""
}
func (x *DBSimpleUser) GetNickname() string {
if x != nil {
return x.Nickname
}
return ""
}
func (x *DBSimpleUser) GetSkin() string {
if x != nil {
return x.Skin
}
return ""
}
func (x *DBSimpleUser) GetSex() int32 {
if x != nil {
return x.Sex
}
return 0
}
func (x *DBSimpleUser) GetLv() int32 {
if x != nil {
return x.Lv
}
return 0
}
type DBSimpleHero struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
HeroId string `protobuf:"bytes,1,opt,name=heroId,proto3" json:"heroId"` //英雄ID
Level int32 `protobuf:"varint,2,opt,name=level,proto3" json:"level"` //等级
Star int32 `protobuf:"varint,3,opt,name=star,proto3" json:"star"` //星级
}
func (x *DBSimpleHero) Reset() {
*x = DBSimpleHero{}
if protoimpl.UnsafeEnabled {
mi := &file_guildgve_guildgve_db_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DBSimpleHero) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DBSimpleHero) ProtoMessage() {}
func (x *DBSimpleHero) ProtoReflect() protoreflect.Message {
mi := &file_guildgve_guildgve_db_proto_msgTypes[7]
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 DBSimpleHero.ProtoReflect.Descriptor instead.
func (*DBSimpleHero) Descriptor() ([]byte, []int) {
return file_guildgve_guildgve_db_proto_rawDescGZIP(), []int{7}
}
func (x *DBSimpleHero) GetHeroId() string {
if x != nil {
return x.HeroId
}
return ""
}
func (x *DBSimpleHero) GetLevel() int32 {
if x != nil {
return x.Level
}
return 0
}
func (x *DBSimpleHero) GetStar() int32 {
if x != nil {
return x.Star
}
return 0
}
type DBGveRouletteRecord struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -480,7 +646,7 @@ type DBGveRouletteRecord struct {
func (x *DBGveRouletteRecord) Reset() {
*x = DBGveRouletteRecord{}
if protoimpl.UnsafeEnabled {
mi := &file_guildgve_guildgve_db_proto_msgTypes[6]
mi := &file_guildgve_guildgve_db_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -493,7 +659,7 @@ func (x *DBGveRouletteRecord) String() string {
func (*DBGveRouletteRecord) ProtoMessage() {}
func (x *DBGveRouletteRecord) ProtoReflect() protoreflect.Message {
mi := &file_guildgve_guildgve_db_proto_msgTypes[6]
mi := &file_guildgve_guildgve_db_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -506,7 +672,7 @@ func (x *DBGveRouletteRecord) ProtoReflect() protoreflect.Message {
// Deprecated: Use DBGveRouletteRecord.ProtoReflect.Descriptor instead.
func (*DBGveRouletteRecord) Descriptor() ([]byte, []int) {
return file_guildgve_guildgve_db_proto_rawDescGZIP(), []int{6}
return file_guildgve_guildgve_db_proto_rawDescGZIP(), []int{8}
}
func (x *DBGveRouletteRecord) GetUid() string {
@ -549,7 +715,7 @@ var file_guildgve_guildgve_db_proto_rawDesc = []byte{
0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e,
0x6b, 0x12, 0x23, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x0f, 0x2e, 0x44, 0x42, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x47, 0x76, 0x65, 0x42, 0x6f, 0x73, 0x73,
0x52, 0x04, 0x62, 0x6f, 0x6f, 0x73, 0x22, 0x89, 0x01, 0x0a, 0x0d, 0x44, 0x42, 0x47, 0x75, 0x69,
0x52, 0x04, 0x62, 0x6f, 0x6f, 0x73, 0x22, 0x86, 0x02, 0x0a, 0x0d, 0x44, 0x42, 0x47, 0x75, 0x69,
0x6c, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 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, 0x14, 0x0a, 0x05, 0x67, 0x75,
@ -558,31 +724,57 @@ var file_guildgve_guildgve_db_proto_rawDesc = []byte{
0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x62, 0x6f, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74,
0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x74, 0x69, 0x6d, 0x65, 0x18,
0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x74, 0x69,
0x6d, 0x65, 0x22, 0x63, 0x0a, 0x15, 0x44, 0x42, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x6f, 0x75,
0x6c, 0x65, 0x74, 0x74, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x47,
0x75, 0x69, 0x6c, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x47, 0x75,
0x69, 0x6c, 0x64, 0x69, 0x64, 0x12, 0x30, 0x0a, 0x08, 0x72, 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74,
0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x44, 0x42, 0x47, 0x76, 0x65, 0x52,
0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x08, 0x72,
0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x22, 0x5e, 0x0a, 0x0e, 0x44, 0x42, 0x47, 0x75, 0x69,
0x6c, 0x64, 0x47, 0x76, 0x65, 0x42, 0x6f, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x6f, 0x6f,
0x73, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69,
0x64, 0x12, 0x0e, 0x0a, 0x02, 0x68, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x68,
0x70, 0x12, 0x24, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x0c, 0x2e, 0x44, 0x42, 0x47, 0x76, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52,
0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x69, 0x0a, 0x0b, 0x44, 0x42, 0x47, 0x76, 0x65,
0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x6f, 0x72, 0x6d,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x66, 0x6f, 0x72,
0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67,
0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x12,
0x0a, 0x04, 0x68, 0x61, 0x72, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x68, 0x61,
0x72, 0x6d, 0x22, 0x4a, 0x0a, 0x13, 0x44, 0x42, 0x47, 0x76, 0x65, 0x52, 0x6f, 0x75, 0x6c, 0x65,
0x74, 0x74, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x05, 0x61,
0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65,
0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x42, 0x06,
0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x6d, 0x65, 0x12, 0x32, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x06, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x44, 0x42, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x4d, 0x65, 0x6d, 0x62,
0x65, 0x72, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06,
0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x1a, 0x47, 0x0a, 0x0b, 0x52, 0x65, 0x63, 0x6f, 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, 0x22, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x44, 0x42, 0x47, 0x76, 0x65, 0x52, 0x65,
0x63, 0x6f, 0x72, 0x64, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22,
0x63, 0x0a, 0x15, 0x44, 0x42, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x6f, 0x75, 0x6c, 0x65, 0x74,
0x74, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x75, 0x69, 0x6c,
0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x47, 0x75, 0x69, 0x6c, 0x64,
0x69, 0x64, 0x12, 0x30, 0x0a, 0x08, 0x72, 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x18, 0x07,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x44, 0x42, 0x47, 0x76, 0x65, 0x52, 0x6f, 0x75, 0x6c,
0x65, 0x74, 0x74, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x08, 0x72, 0x6f, 0x75, 0x6c,
0x65, 0x74, 0x74, 0x65, 0x22, 0x5e, 0x0a, 0x0e, 0x44, 0x42, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x47,
0x76, 0x65, 0x42, 0x6f, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x12, 0x0e,
0x0a, 0x02, 0x68, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x68, 0x70, 0x12, 0x24,
0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c,
0x2e, 0x44, 0x42, 0x47, 0x76, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65,
0x63, 0x6f, 0x72, 0x64, 0x22, 0xc3, 0x01, 0x0a, 0x0b, 0x44, 0x42, 0x47, 0x76, 0x65, 0x52, 0x65,
0x63, 0x6f, 0x72, 0x64, 0x12, 0x21, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x55, 0x73, 0x65,
0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18,
0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x63,
0x61, 0x70, 0x74, 0x61, 0x69, 0x6e, 0x48, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x0d, 0x63, 0x61, 0x70, 0x74, 0x61, 0x69, 0x6e, 0x48, 0x65, 0x72, 0x6f, 0x49,
0x64, 0x12, 0x2b, 0x0a, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x48,
0x65, 0x72, 0x6f, 0x52, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16,
0x0a, 0x06, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06,
0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x72, 0x6d, 0x18, 0x06,
0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x68, 0x61, 0x72, 0x6d, 0x22, 0x72, 0x0a, 0x0c, 0x44, 0x42,
0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08,
0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6b, 0x69, 0x6e,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6b, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03,
0x73, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x73, 0x65, 0x78, 0x12, 0x0e,
0x0a, 0x02, 0x6c, 0x76, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x22, 0x50,
0x0a, 0x0c, 0x44, 0x42, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x48, 0x65, 0x72, 0x6f, 0x12, 0x16,
0x0a, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18,
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x04,
0x73, 0x74, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x74, 0x61, 0x72,
0x22, 0x4a, 0x0a, 0x13, 0x44, 0x42, 0x47, 0x76, 0x65, 0x52, 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74,
0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x05, 0x61, 0x77, 0x61,
0x72, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41,
0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x42, 0x06, 0x5a, 0x04,
0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -597,7 +789,7 @@ func file_guildgve_guildgve_db_proto_rawDescGZIP() []byte {
return file_guildgve_guildgve_db_proto_rawDescData
}
var file_guildgve_guildgve_db_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_guildgve_guildgve_db_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
var file_guildgve_guildgve_db_proto_goTypes = []interface{}{
(*DBGuildGveBossConf)(nil), // 0: DBGuildGveBossConf
(*DBGuildGve)(nil), // 1: DBGuildGve
@ -605,19 +797,26 @@ var file_guildgve_guildgve_db_proto_goTypes = []interface{}{
(*DBGuildRouletteRecord)(nil), // 3: DBGuildRouletteRecord
(*DBGuildGveBoss)(nil), // 4: DBGuildGveBoss
(*DBGveRecord)(nil), // 5: DBGveRecord
(*DBGveRouletteRecord)(nil), // 6: DBGveRouletteRecord
(*UserAssets)(nil), // 7: UserAssets
(*DBSimpleUser)(nil), // 6: DBSimpleUser
(*DBSimpleHero)(nil), // 7: DBSimpleHero
(*DBGveRouletteRecord)(nil), // 8: DBGveRouletteRecord
nil, // 9: DBGuildMember.RecordEntry
(*UserAssets)(nil), // 10: UserAssets
}
var file_guildgve_guildgve_db_proto_depIdxs = []int32{
4, // 0: DBGuildGve.boos:type_name -> DBGuildGveBoss
6, // 1: DBGuildRouletteRecord.roulette:type_name -> DBGveRouletteRecord
5, // 2: DBGuildGveBoss.record:type_name -> DBGveRecord
7, // 3: DBGveRouletteRecord.award:type_name -> UserAssets
4, // [4:4] is the sub-list for method output_type
4, // [4:4] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
4, // 0: DBGuildGve.boos:type_name -> DBGuildGveBoss
9, // 1: DBGuildMember.record:type_name -> DBGuildMember.RecordEntry
8, // 2: DBGuildRouletteRecord.roulette:type_name -> DBGveRouletteRecord
5, // 3: DBGuildGveBoss.record:type_name -> DBGveRecord
6, // 4: DBGveRecord.user:type_name -> DBSimpleUser
7, // 5: DBGveRecord.formation:type_name -> DBSimpleHero
10, // 6: DBGveRouletteRecord.award:type_name -> UserAssets
5, // 7: DBGuildMember.RecordEntry.value:type_name -> DBGveRecord
8, // [8:8] is the sub-list for method output_type
8, // [8:8] is the sub-list for method input_type
8, // [8:8] is the sub-list for extension type_name
8, // [8:8] is the sub-list for extension extendee
0, // [0:8] is the sub-list for field type_name
}
func init() { file_guildgve_guildgve_db_proto_init() }
@ -700,6 +899,30 @@ func file_guildgve_guildgve_db_proto_init() {
}
}
file_guildgve_guildgve_db_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBSimpleUser); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_guildgve_guildgve_db_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBSimpleHero); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_guildgve_guildgve_db_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBGveRouletteRecord); i {
case 0:
return &v.state
@ -718,7 +941,7 @@ func file_guildgve_guildgve_db_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_guildgve_guildgve_db_proto_rawDesc,
NumEnums: 0,
NumMessages: 7,
NumMessages: 10,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -970,6 +970,118 @@ func (x *GuildGveRouletteChangePush) GetRecord() *DBGuildRouletteRecord {
return nil
}
//好友战斗记录请求
type GuildGveFriendsRecordReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Boosid int32 `protobuf:"varint,1,opt,name=boosid,proto3" json:"boosid"`
Friends []string `protobuf:"bytes,2,rep,name=friends,proto3" json:"friends"` //奖励
}
func (x *GuildGveFriendsRecordReq) Reset() {
*x = GuildGveFriendsRecordReq{}
if protoimpl.UnsafeEnabled {
mi := &file_guildgve_guildgve_msg_proto_msgTypes[17]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GuildGveFriendsRecordReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GuildGveFriendsRecordReq) ProtoMessage() {}
func (x *GuildGveFriendsRecordReq) ProtoReflect() protoreflect.Message {
mi := &file_guildgve_guildgve_msg_proto_msgTypes[17]
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 GuildGveFriendsRecordReq.ProtoReflect.Descriptor instead.
func (*GuildGveFriendsRecordReq) Descriptor() ([]byte, []int) {
return file_guildgve_guildgve_msg_proto_rawDescGZIP(), []int{17}
}
func (x *GuildGveFriendsRecordReq) GetBoosid() int32 {
if x != nil {
return x.Boosid
}
return 0
}
func (x *GuildGveFriendsRecordReq) GetFriends() []string {
if x != nil {
return x.Friends
}
return nil
}
//好友战斗记录请求 回应
type GuildGveFriendsRecordResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Boosid int32 `protobuf:"varint,1,opt,name=boosid,proto3" json:"boosid"`
Record []*DBGveRecord `protobuf:"bytes,2,rep,name=record,proto3" json:"record"`
}
func (x *GuildGveFriendsRecordResp) Reset() {
*x = GuildGveFriendsRecordResp{}
if protoimpl.UnsafeEnabled {
mi := &file_guildgve_guildgve_msg_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GuildGveFriendsRecordResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GuildGveFriendsRecordResp) ProtoMessage() {}
func (x *GuildGveFriendsRecordResp) ProtoReflect() protoreflect.Message {
mi := &file_guildgve_guildgve_msg_proto_msgTypes[18]
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 GuildGveFriendsRecordResp.ProtoReflect.Descriptor instead.
func (*GuildGveFriendsRecordResp) Descriptor() ([]byte, []int) {
return file_guildgve_guildgve_msg_proto_rawDescGZIP(), []int{18}
}
func (x *GuildGveFriendsRecordResp) GetBoosid() int32 {
if x != nil {
return x.Boosid
}
return 0
}
func (x *GuildGveFriendsRecordResp) GetRecord() []*DBGveRecord {
if x != nil {
return x.Record
}
return nil
}
var File_guildgve_guildgve_msg_proto protoreflect.FileDescriptor
var file_guildgve_guildgve_msg_proto_rawDesc = []byte{
@ -1066,8 +1178,18 @@ var file_guildgve_guildgve_msg_proto_rawDesc = []byte{
0x50, 0x75, 0x73, 0x68, 0x12, 0x2e, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x44, 0x42, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x6f,
0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65,
0x63, 0x6f, 0x72, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
0x63, 0x6f, 0x72, 0x64, 0x22, 0x4c, 0x0a, 0x18, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x47, 0x76, 0x65,
0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71,
0x12, 0x16, 0x0a, 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x52, 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x72, 0x69, 0x65,
0x6e, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x66, 0x72, 0x69, 0x65, 0x6e,
0x64, 0x73, 0x22, 0x59, 0x0a, 0x19, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x47, 0x76, 0x65, 0x46, 0x72,
0x69, 0x65, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12,
0x16, 0x0a, 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x12, 0x24, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72,
0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x44, 0x42, 0x47, 0x76, 0x65, 0x52,
0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x42, 0x06, 0x5a,
0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -1082,7 +1204,7 @@ func file_guildgve_guildgve_msg_proto_rawDescGZIP() []byte {
return file_guildgve_guildgve_msg_proto_rawDescData
}
var file_guildgve_guildgve_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 17)
var file_guildgve_guildgve_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 19)
var file_guildgve_guildgve_msg_proto_goTypes = []interface{}{
(*GuildGveInfoReq)(nil), // 0: GuildGveInfoReq
(*GuildGveInfoResp)(nil), // 1: GuildGveInfoResp
@ -1101,30 +1223,34 @@ var file_guildgve_guildgve_msg_proto_goTypes = []interface{}{
(*GuildGveStageChangePush)(nil), // 14: GuildGveStageChangePush
(*GuildGveBoosChangePush)(nil), // 15: GuildGveBoosChangePush
(*GuildGveRouletteChangePush)(nil), // 16: GuildGveRouletteChangePush
(*DBGuildGve)(nil), // 17: DBGuildGve
(*UserAssets)(nil), // 18: UserAssets
(*BattleFormation)(nil), // 19: BattleFormation
(*BattleInfo)(nil), // 20: BattleInfo
(*BattleReport)(nil), // 21: BattleReport
(*DBGuildRouletteRecord)(nil), // 22: DBGuildRouletteRecord
(*GuildGveFriendsRecordReq)(nil), // 17: GuildGveFriendsRecordReq
(*GuildGveFriendsRecordResp)(nil), // 18: GuildGveFriendsRecordResp
(*DBGuildGve)(nil), // 19: DBGuildGve
(*UserAssets)(nil), // 20: UserAssets
(*BattleFormation)(nil), // 21: BattleFormation
(*BattleInfo)(nil), // 22: BattleInfo
(*BattleReport)(nil), // 23: BattleReport
(*DBGuildRouletteRecord)(nil), // 24: DBGuildRouletteRecord
(*DBGveRecord)(nil), // 25: DBGveRecord
}
var file_guildgve_guildgve_msg_proto_depIdxs = []int32{
17, // 0: GuildGveInfoResp.info:type_name -> DBGuildGve
19, // 0: GuildGveInfoResp.info:type_name -> DBGuildGve
5, // 1: GuildGveRankResp.list:type_name -> GuildGveRankItem
18, // 2: GuildGveRouletteResp.award:type_name -> UserAssets
19, // 3: GuildGveChallengeReq.battle:type_name -> BattleFormation
20, // 4: GuildGveChallengeResp.info:type_name -> BattleInfo
21, // 5: GuildGveChallengeFinishReq.report:type_name -> BattleReport
18, // 6: GuildGveChallengeFinishResp.award:type_name -> UserAssets
17, // 7: GuildGveInfoChangePush.info:type_name -> DBGuildGve
17, // 8: GuildGveStageChangePush.info:type_name -> DBGuildGve
17, // 9: GuildGveBoosChangePush.info:type_name -> DBGuildGve
22, // 10: GuildGveRouletteChangePush.record:type_name -> DBGuildRouletteRecord
11, // [11:11] is the sub-list for method output_type
11, // [11:11] is the sub-list for method input_type
11, // [11:11] is the sub-list for extension type_name
11, // [11:11] is the sub-list for extension extendee
0, // [0:11] is the sub-list for field type_name
20, // 2: GuildGveRouletteResp.award:type_name -> UserAssets
21, // 3: GuildGveChallengeReq.battle:type_name -> BattleFormation
22, // 4: GuildGveChallengeResp.info:type_name -> BattleInfo
23, // 5: GuildGveChallengeFinishReq.report:type_name -> BattleReport
20, // 6: GuildGveChallengeFinishResp.award:type_name -> UserAssets
19, // 7: GuildGveInfoChangePush.info:type_name -> DBGuildGve
19, // 8: GuildGveStageChangePush.info:type_name -> DBGuildGve
19, // 9: GuildGveBoosChangePush.info:type_name -> DBGuildGve
24, // 10: GuildGveRouletteChangePush.record:type_name -> DBGuildRouletteRecord
25, // 11: GuildGveFriendsRecordResp.record:type_name -> DBGveRecord
12, // [12:12] is the sub-list for method output_type
12, // [12:12] is the sub-list for method input_type
12, // [12:12] is the sub-list for extension type_name
12, // [12:12] is the sub-list for extension extendee
0, // [0:12] is the sub-list for field type_name
}
func init() { file_guildgve_guildgve_msg_proto_init() }
@ -1340,6 +1466,30 @@ func file_guildgve_guildgve_msg_proto_init() {
return nil
}
}
file_guildgve_guildgve_msg_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GuildGveFriendsRecordReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_guildgve_guildgve_msg_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GuildGveFriendsRecordResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
@ -1347,7 +1497,7 @@ func file_guildgve_guildgve_msg_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_guildgve_guildgve_msg_proto_rawDesc,
NumEnums: 0,
NumMessages: 17,
NumMessages: 19,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -359,8 +359,7 @@ type MainlineLevelPassReq struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Level int32 `protobuf:"varint,1,opt,name=level,proto3" json:"level"` // 小关ID
Report *BattleReport `protobuf:"bytes,2,opt,name=report,proto3" json:"report"` //战报
Level int32 `protobuf:"varint,1,opt,name=level,proto3" json:"level"` // 小关ID
}
func (x *MainlineLevelPassReq) Reset() {
@ -402,13 +401,6 @@ func (x *MainlineLevelPassReq) GetLevel() int32 {
return 0
}
func (x *MainlineLevelPassReq) GetReport() *BattleReport {
if x != nil {
return x.Report
}
return nil
}
type MainlineLevelPassResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -488,6 +480,158 @@ func (x *MainlineLevelPassResp) GetHeroExp() int32 {
return 0
}
//奖励领取
type MainlineReceiveAwardReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Rtype int32 `protobuf:"varint,1,opt,name=rtype,proto3" json:"rtype"` // 0 进度奖励 1 探索奖励 2组奖励
Chapter int32 `protobuf:"varint,2,opt,name=chapter,proto3" json:"chapter"` //章节id
Group int32 `protobuf:"varint,3,opt,name=group,proto3" json:"group"` //章节id
Stage int32 `protobuf:"varint,4,opt,name=stage,proto3" json:"stage"` //目标阶段
}
func (x *MainlineReceiveAwardReq) Reset() {
*x = MainlineReceiveAwardReq{}
if protoimpl.UnsafeEnabled {
mi := &file_mainline_mainline_msg_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MainlineReceiveAwardReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MainlineReceiveAwardReq) ProtoMessage() {}
func (x *MainlineReceiveAwardReq) ProtoReflect() protoreflect.Message {
mi := &file_mainline_mainline_msg_proto_msgTypes[8]
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 MainlineReceiveAwardReq.ProtoReflect.Descriptor instead.
func (*MainlineReceiveAwardReq) Descriptor() ([]byte, []int) {
return file_mainline_mainline_msg_proto_rawDescGZIP(), []int{8}
}
func (x *MainlineReceiveAwardReq) GetRtype() int32 {
if x != nil {
return x.Rtype
}
return 0
}
func (x *MainlineReceiveAwardReq) GetChapter() int32 {
if x != nil {
return x.Chapter
}
return 0
}
func (x *MainlineReceiveAwardReq) GetGroup() int32 {
if x != nil {
return x.Group
}
return 0
}
func (x *MainlineReceiveAwardReq) GetStage() int32 {
if x != nil {
return x.Stage
}
return 0
}
//奖励领取
type MainlineReceiveAwardResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Rtype int32 `protobuf:"varint,1,opt,name=rtype,proto3" json:"rtype"` // 0 进度奖励 1 探索奖励 2组奖励
Chapter int32 `protobuf:"varint,2,opt,name=chapter,proto3" json:"chapter"` //章节id
Group int32 `protobuf:"varint,3,opt,name=group,proto3" json:"group"` //章节id
Stage int32 `protobuf:"varint,4,opt,name=stage,proto3" json:"stage"` //目标阶段
Reward []*UserAssets `protobuf:"bytes,5,rep,name=reward,proto3" json:"reward"` //奖励
}
func (x *MainlineReceiveAwardResp) Reset() {
*x = MainlineReceiveAwardResp{}
if protoimpl.UnsafeEnabled {
mi := &file_mainline_mainline_msg_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MainlineReceiveAwardResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MainlineReceiveAwardResp) ProtoMessage() {}
func (x *MainlineReceiveAwardResp) ProtoReflect() protoreflect.Message {
mi := &file_mainline_mainline_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 MainlineReceiveAwardResp.ProtoReflect.Descriptor instead.
func (*MainlineReceiveAwardResp) Descriptor() ([]byte, []int) {
return file_mainline_mainline_msg_proto_rawDescGZIP(), []int{9}
}
func (x *MainlineReceiveAwardResp) GetRtype() int32 {
if x != nil {
return x.Rtype
}
return 0
}
func (x *MainlineReceiveAwardResp) GetChapter() int32 {
if x != nil {
return x.Chapter
}
return 0
}
func (x *MainlineReceiveAwardResp) GetGroup() int32 {
if x != nil {
return x.Group
}
return 0
}
func (x *MainlineReceiveAwardResp) GetStage() int32 {
if x != nil {
return x.Stage
}
return 0
}
func (x *MainlineReceiveAwardResp) GetReward() []*UserAssets {
if x != nil {
return x.Reward
}
return nil
}
var File_mainline_mainline_msg_proto protoreflect.FileDescriptor
var file_mainline_mainline_msg_proto_rawDesc = []byte{
@ -527,23 +671,38 @@ var file_mainline_mainline_msg_proto_rawDesc = []byte{
0x77, 0x61, 0x72, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70, 0x18,
0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70, 0x12, 0x18,
0x0a, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x45, 0x78, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52,
0x07, 0x68, 0x65, 0x72, 0x6f, 0x45, 0x78, 0x70, 0x22, 0x53, 0x0a, 0x14, 0x4d, 0x61, 0x69, 0x6e,
0x07, 0x68, 0x65, 0x72, 0x6f, 0x45, 0x78, 0x70, 0x22, 0x2c, 0x0a, 0x14, 0x4d, 0x61, 0x69, 0x6e,
0x6c, 0x69, 0x6e, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x50, 0x61, 0x73, 0x73, 0x52, 0x65, 0x71,
0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74,
0x18, 0x02, 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, 0x9a, 0x01,
0x0a, 0x15, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x50,
0x61, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c,
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x12, 0x0a,
0x04, 0x73, 0x74, 0x61, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x74, 0x61,
0x72, 0x12, 0x23, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x06,
0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78,
0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70,
0x12, 0x18, 0x0a, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x45, 0x78, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28,
0x05, 0x52, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x45, 0x78, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b,
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x9a, 0x01, 0x0a, 0x15, 0x4d, 0x61, 0x69, 0x6e, 0x6c,
0x69, 0x6e, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x50, 0x61, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70,
0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x61, 0x72, 0x18, 0x02,
0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x74, 0x61, 0x72, 0x12, 0x23, 0x0a, 0x06, 0x72, 0x65,
0x77, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65,
0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12,
0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05,
0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x65, 0x72,
0x6f, 0x45, 0x78, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x68, 0x65, 0x72, 0x6f,
0x45, 0x78, 0x70, 0x22, 0x75, 0x0a, 0x17, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x52,
0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x41, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x14,
0x0a, 0x05, 0x72, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72,
0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x18,
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x12, 0x14,
0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x67,
0x72, 0x6f, 0x75, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20,
0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x67, 0x65, 0x22, 0x9b, 0x01, 0x0a, 0x18, 0x4d,
0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x41, 0x77,
0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x74, 0x79, 0x70, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a,
0x07, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07,
0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70,
0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x14, 0x0a,
0x05, 0x73, 0x74, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74,
0x61, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x05, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73,
0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -558,7 +717,7 @@ func file_mainline_mainline_msg_proto_rawDescGZIP() []byte {
return file_mainline_mainline_msg_proto_rawDescData
}
var file_mainline_mainline_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_mainline_mainline_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
var file_mainline_mainline_msg_proto_goTypes = []interface{}{
(*MainlineInfoReq)(nil), // 0: MainlineInfoReq
(*MainlineInfoResp)(nil), // 1: MainlineInfoResp
@ -568,20 +727,22 @@ var file_mainline_mainline_msg_proto_goTypes = []interface{}{
(*MainlineChallengeOverResp)(nil), // 5: MainlineChallengeOverResp
(*MainlineLevelPassReq)(nil), // 6: MainlineLevelPassReq
(*MainlineLevelPassResp)(nil), // 7: MainlineLevelPassResp
(*DBMainline)(nil), // 8: DBMainline
(*BattleFormation)(nil), // 9: BattleFormation
(*BattleInfo)(nil), // 10: BattleInfo
(*BattleReport)(nil), // 11: BattleReport
(*UserAssets)(nil), // 12: UserAssets
(*MainlineReceiveAwardReq)(nil), // 8: MainlineReceiveAwardReq
(*MainlineReceiveAwardResp)(nil), // 9: MainlineReceiveAwardResp
(*DBMainline)(nil), // 10: DBMainline
(*BattleFormation)(nil), // 11: BattleFormation
(*BattleInfo)(nil), // 12: BattleInfo
(*BattleReport)(nil), // 13: BattleReport
(*UserAssets)(nil), // 14: UserAssets
}
var file_mainline_mainline_msg_proto_depIdxs = []int32{
8, // 0: MainlineInfoResp.info:type_name -> DBMainline
9, // 1: MainlineChallengeReq.battle:type_name -> BattleFormation
10, // 2: MainlineChallengeResp.info:type_name -> BattleInfo
11, // 3: MainlineChallengeOverReq.report:type_name -> BattleReport
12, // 4: MainlineChallengeOverResp.reward:type_name -> UserAssets
11, // 5: MainlineLevelPassReq.report:type_name -> BattleReport
12, // 6: MainlineLevelPassResp.reward:type_name -> UserAssets
10, // 0: MainlineInfoResp.info:type_name -> DBMainline
11, // 1: MainlineChallengeReq.battle:type_name -> BattleFormation
12, // 2: MainlineChallengeResp.info:type_name -> BattleInfo
13, // 3: MainlineChallengeOverReq.report:type_name -> BattleReport
14, // 4: MainlineChallengeOverResp.reward:type_name -> UserAssets
14, // 5: MainlineLevelPassResp.reward:type_name -> UserAssets
14, // 6: MainlineReceiveAwardResp.reward:type_name -> UserAssets
7, // [7:7] is the sub-list for method output_type
7, // [7:7] is the sub-list for method input_type
7, // [7:7] is the sub-list for extension type_name
@ -694,6 +855,30 @@ func file_mainline_mainline_msg_proto_init() {
return nil
}
}
file_mainline_mainline_msg_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MainlineReceiveAwardReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_mainline_mainline_msg_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MainlineReceiveAwardResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
@ -701,7 +886,7 @@ func file_mainline_mainline_msg_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_mainline_mainline_msg_proto_rawDesc,
NumEnums: 0,
NumMessages: 8,
NumMessages: 10,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -89,10 +89,10 @@ type DBQuestionGroup struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Group int32 `protobuf:"varint,1,opt,name=group,proto3" json:"group"`
Questions []int32 `protobuf:"varint,2,rep,packed,name=questions,proto3" json:"questions"`
Answer []int32 `protobuf:"varint,3,rep,packed,name=answer,proto3" json:"answer"` //采用位运算记录多选情况 0 表示为回答 1,2,4,8 分别表示1,2,3,4的答案的值
Fraction int32 `protobuf:"varint,4,opt,name=fraction,proto3" json:"fraction"` //分值
Group int32 `protobuf:"varint,1,opt,name=group,proto3" json:"group"` //ask.xlsx ask_all 组id
Questions []int32 `protobuf:"varint,2,rep,packed,name=questions,proto3" json:"questions"` //ask.xlsx ask_library 题目id
Answer []int32 `protobuf:"varint,3,rep,packed,name=answer,proto3" json:"answer"` //采用位运算记录多选情况 0 表示为回答 1,2,4,8 分别表示1,2,3,4的答案的值
Fraction int32 `protobuf:"varint,4,opt,name=fraction,proto3" json:"fraction"` //分值
}
func (x *DBQuestionGroup) Reset() {

View File

@ -11,56 +11,139 @@ package cfg
import "errors"
type GameStoneBattleData struct {
BattleStageId int32
EnemyShowIcon int32
Atk int32
Hp int32
Def int32
SpeedValue int32
EffreValue int32
BattleReadyID int32
FormatList []int32
RewardLottery int32
BattleStageId int32
EnemyShowIcon int32
Atk int32
Hp int32
Def int32
SpeedValue int32
EffreValue int32
BattleReadyID int32
FormatList []int32
RewardLottery int32
}
const TypeId_GameStoneBattleData = 469689547
func (*GameStoneBattleData) GetTypeId() int32 {
return 469689547
return 469689547
}
func (_v *GameStoneBattleData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["BattleStageId"].(float64); !_ok_ { err = errors.New("BattleStageId error"); return }; _v.BattleStageId = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["EnemyShowIcon"].(float64); !_ok_ { err = errors.New("EnemyShowIcon error"); return }; _v.EnemyShowIcon = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["Atk"].(float64); !_ok_ { err = errors.New("Atk error"); return }; _v.Atk = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["Hp"].(float64); !_ok_ { err = errors.New("Hp error"); return }; _v.Hp = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["Def"].(float64); !_ok_ { err = errors.New("Def error"); return }; _v.Def = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["SpeedValue"].(float64); !_ok_ { err = errors.New("SpeedValue error"); return }; _v.SpeedValue = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["EffreValue"].(float64); !_ok_ { err = errors.New("EffreValue error"); return }; _v.EffreValue = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["BattleReadyID"].(float64); !_ok_ { err = errors.New("BattleReadyID error"); return }; _v.BattleReadyID = int32(_tempNum_) }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["FormatList"].([]interface{}); !_ok_ { err = errors.New("FormatList error"); return }
func (_v *GameStoneBattleData) Deserialize(_buf map[string]interface{}) (err error) {
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["BattleStageId"].(float64); !_ok_ {
err = errors.New("BattleStageId error")
return
}
_v.BattleStageId = int32(_tempNum_)
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["EnemyShowIcon"].(float64); !_ok_ {
err = errors.New("EnemyShowIcon error")
return
}
_v.EnemyShowIcon = int32(_tempNum_)
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["Atk"].(float64); !_ok_ {
err = errors.New("Atk error")
return
}
_v.Atk = int32(_tempNum_)
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["Hp"].(float64); !_ok_ {
err = errors.New("Hp error")
return
}
_v.Hp = int32(_tempNum_)
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["Def"].(float64); !_ok_ {
err = errors.New("Def error")
return
}
_v.Def = int32(_tempNum_)
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["SpeedValue"].(float64); !_ok_ {
err = errors.New("SpeedValue error")
return
}
_v.SpeedValue = int32(_tempNum_)
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["EffreValue"].(float64); !_ok_ {
err = errors.New("EffreValue error")
return
}
_v.EffreValue = int32(_tempNum_)
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["BattleReadyID"].(float64); !_ok_ {
err = errors.New("BattleReadyID error")
return
}
_v.BattleReadyID = int32(_tempNum_)
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["FormatList"].([]interface{}); !_ok_ {
err = errors.New("FormatList error")
return
}
_v.FormatList = make([]int32, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ int32
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) }
_v.FormatList = append(_v.FormatList, _list_v_)
}
}
_v.FormatList = make([]int32, 0, len(_arr_))
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["RewardLottery"].(float64); !_ok_ { err = errors.New("RewardLottery error"); return }; _v.RewardLottery = int32(_tempNum_) }
return
for _, _e_ := range _arr_ {
var _list_v_ int32
{
var _ok_ bool
var _x_ float64
if _x_, _ok_ = _e_.(float64); !_ok_ {
err = errors.New("_list_v_ error")
return
}
_list_v_ = int32(_x_)
}
_v.FormatList = append(_v.FormatList, _list_v_)
}
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["RewardLottery"].(float64); !_ok_ {
err = errors.New("RewardLottery error")
return
}
_v.RewardLottery = int32(_tempNum_)
}
return
}
func DeserializeGameStoneBattleData(_buf map[string]interface{}) (*GameStoneBattleData, error) {
v := &GameStoneBattleData{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
return nil, err
}
v := &GameStoneBattleData{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
return nil, err
}
}

View File

@ -11,41 +11,128 @@ package cfg
import "errors"
type GameStoneBuffData struct {
BuffId int32
Type int32
SkillId int32
BuffLevel int32
Quality int32
BuffIcon string
BuffStory string
BuffUpgradeCost *Gameatn
BuffSell *Gameatn
BuffId int32
Type int32
SkillId int32
BuffLevel int32
Quality int32
BuffIcon string
BuffStory string
BuffUpgradeCost *Gameatn
BuffSell *Gameatn
}
const TypeId_GameStoneBuffData = -1457644250
func (*GameStoneBuffData) GetTypeId() int32 {
return -1457644250
return -1457644250
}
func (_v *GameStoneBuffData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["BuffId"].(float64); !_ok_ { err = errors.New("BuffId error"); return }; _v.BuffId = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["Type"].(float64); !_ok_ { err = errors.New("Type error"); return }; _v.Type = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["SkillId"].(float64); !_ok_ { err = errors.New("SkillId error"); return }; _v.SkillId = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["BuffLevel"].(float64); !_ok_ { err = errors.New("BuffLevel error"); return }; _v.BuffLevel = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["Quality"].(float64); !_ok_ { err = errors.New("Quality error"); return }; _v.Quality = int32(_tempNum_) }
{ var _ok_ bool; if _v.BuffIcon, _ok_ = _buf["BuffIcon"].(string); !_ok_ { err = errors.New("BuffIcon error"); return } }
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["BuffStory"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.BuffStory error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.BuffStory, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["BuffUpgradeCost"].(map[string]interface{}); !_ok_ { err = errors.New("BuffUpgradeCost error"); return }; if _v.BuffUpgradeCost, err = DeserializeGameatn(_x_); err != nil { return } }
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["BuffSell"].(map[string]interface{}); !_ok_ { err = errors.New("BuffSell error"); return }; if _v.BuffSell, err = DeserializeGameatn(_x_); err != nil { return } }
return
func (_v *GameStoneBuffData) Deserialize(_buf map[string]interface{}) (err error) {
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["BuffId"].(float64); !_ok_ {
err = errors.New("BuffId error")
return
}
_v.BuffId = int32(_tempNum_)
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["Type"].(float64); !_ok_ {
err = errors.New("Type error")
return
}
_v.Type = int32(_tempNum_)
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["SkillId"].(float64); !_ok_ {
err = errors.New("SkillId error")
return
}
_v.SkillId = int32(_tempNum_)
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["BuffLevel"].(float64); !_ok_ {
err = errors.New("BuffLevel error")
return
}
_v.BuffLevel = int32(_tempNum_)
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["Quality"].(float64); !_ok_ {
err = errors.New("Quality error")
return
}
_v.Quality = int32(_tempNum_)
}
{
var _ok_ bool
if _v.BuffIcon, _ok_ = _buf["BuffIcon"].(string); !_ok_ {
err = errors.New("BuffIcon error")
return
}
}
{
var _ok_ bool
var __json_text__ map[string]interface{}
if __json_text__, _ok_ = _buf["BuffStory"].(map[string]interface{}); !_ok_ {
err = errors.New("_v.BuffStory error")
return
}
{
var _ok_ bool
if _, _ok_ = __json_text__["key"].(string); !_ok_ {
err = errors.New("key error")
return
}
}
{
var _ok_ bool
if _v.BuffStory, _ok_ = __json_text__["text"].(string); !_ok_ {
err = errors.New("text error")
return
}
}
}
{
var _ok_ bool
var _x_ map[string]interface{}
if _x_, _ok_ = _buf["BuffUpgradeCost"].(map[string]interface{}); !_ok_ {
err = errors.New("BuffUpgradeCost error")
return
}
if _v.BuffUpgradeCost, err = DeserializeGameatn(_x_); err != nil {
return
}
}
{
var _ok_ bool
var _x_ map[string]interface{}
if _x_, _ok_ = _buf["BuffSell"].(map[string]interface{}); !_ok_ {
err = errors.New("BuffSell error")
return
}
if _v.BuffSell, err = DeserializeGameatn(_x_); err != nil {
return
}
}
return
}
func DeserializeGameStoneBuffData(_buf map[string]interface{}) (*GameStoneBuffData, error) {
v := &GameStoneBuffData{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
return nil, err
}
v := &GameStoneBuffData{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
return nil, err
}
}

View File

@ -386,6 +386,135 @@ func (this *DBModel) Get(uid string, data interface{}, opt ...DBOption) (err err
return
}
// 读取全部数据
func (this *DBModel) GetByUids(uids []string, data interface{}, opt ...DBOption) (onfound []string, err error) {
//defer log.Debug("DBModel GetListObjs", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "uid", Value: uid}, log.Field{Key: "ids", Value: ids}, log.Field{Key: "data", Value: data})
defer func() { //程序异常 收集异常信息传递给前端显示
if r := recover(); r != nil {
buf := make([]byte, 4096)
l := runtime.Stack(buf, false)
err = fmt.Errorf("%v: %s", r, buf[:l])
log.Errorf("[DB Gets] TableName:%s ids:%v", this.TableName, uids)
}
}()
var (
dtype reflect2.Type
dkind reflect.Kind
sType reflect2.Type
sliceType *reflect2.UnsafeSliceType
sliceelemType reflect2.Type
decoder codecore.IDecoderMapJson
encoder codecore.IEncoderMapJson
dptr unsafe.Pointer
elemPtr unsafe.Pointer
n int
ok bool
keys map[string]string = make(map[string]string)
tempdata map[string]string
pipe *pipe.RedisPipe = this.Redis.RedisPipe(context.TODO())
result []*redis.StringStringMapCmd = make([]*redis.StringStringMapCmd, len(uids))
c *mongo.Cursor
)
onfound = make([]string, 0, len(uids))
dptr = reflect2.PtrOf(data)
dtype = reflect2.TypeOf(data)
dkind = dtype.Kind()
if dkind != reflect.Ptr {
err = fmt.Errorf("MCompModel: GetList(non-pointer %T)", data)
return
}
sType = dtype.(*reflect2.UnsafePtrType).Elem()
if sType.Kind() != reflect.Slice {
err = fmt.Errorf("MCompModel: GetList(data no slice %T)", data)
return
}
sliceType = sType.(*reflect2.UnsafeSliceType)
sliceelemType = sliceType.Elem()
if sliceelemType.Kind() != reflect.Ptr {
err = fmt.Errorf("MCompModel: GetList(sliceelemType non-pointer %T)", data)
return
}
if decoder, ok = codec.DecoderOf(sliceelemType, defconf).(codecore.IDecoderMapJson); !ok {
err = fmt.Errorf("MCompModel: GetList(data not support MarshalMapJson %T)", data)
return
}
sliceelemType = sliceelemType.(*reflect2.UnsafePtrType).Elem()
for i, v := range uids {
result[i] = pipe.HGetAllToMapString(this.ukey(v))
}
if _, err = pipe.Exec(); err == nil {
for i, v := range result {
if tempdata, err = v.Result(); err == nil && len(tempdata) > 0 {
sliceType.UnsafeGrow(dptr, n+1)
elemPtr = sliceType.UnsafeGetIndex(dptr, n)
if *((*unsafe.Pointer)(elemPtr)) == nil {
newPtr := sliceelemType.UnsafeNew()
if err = decoder.DecodeForMapJson(newPtr, json.GetReader([]byte{}), tempdata); err != nil {
log.Errorf("err:%v", err)
return
}
*((*unsafe.Pointer)(elemPtr)) = newPtr
} else {
decoder.DecodeForMapJson(*((*unsafe.Pointer)(elemPtr)), json.GetReader([]byte{}), tempdata)
}
n++
} else {
onfound = append(onfound, uids[i])
}
}
} else {
onfound = uids
}
if len(onfound) > 0 {
if c, err = this.DB.Find(core.SqlTable(this.TableName), bson.M{"uid": bson.M{"$in": onfound}}); err != nil {
return
} else {
if encoder, ok = codec.EncoderOf(sliceelemType, defconf).(codecore.IEncoderMapJson); !ok {
err = fmt.Errorf("MCompModel: GetList(data not support UnMarshalMapJson %T)", data)
return
}
pipe := this.Redis.RedisPipe(context.TODO())
for c.Next(context.Background()) {
_id := c.Current.Lookup("_id").StringValue()
sliceType.UnsafeGrow(dptr, n+1)
elemPtr = sliceType.UnsafeGetIndex(dptr, n)
if *((*unsafe.Pointer)(elemPtr)) == nil {
newPtr := sliceelemType.UnsafeNew()
*((*unsafe.Pointer)(elemPtr)) = newPtr
}
elem := sliceType.GetIndex(data, n)
if err = c.Decode(elem); err != nil {
return
}
if tempdata, err = encoder.EncodeToMapJson(*((*unsafe.Pointer)(elemPtr)), json.GetWriter()); err != nil {
return
}
key := this.ukey(_id)
pipe.HMSetForMap(key, tempdata)
keys[_id] = key
n++
for i, v := range onfound {
if v == _id {
onfound = append(onfound[:i], onfound[i+1:]...)
break
}
}
}
if len(keys) > 0 {
_, err = pipe.Exec()
}
}
}
if this.Expired > 0 {
for _, v := range uids {
this.conn.UpDateModelExpired(this.ukey(v), nil, this.Expired)
}
}
return
}
// 读取全部数据
func (this *DBModel) GetByID(id string, data interface{}, opt ...DBOption) (err error) {
//defer log.Debug("DBModel Get", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "uid", Value: uid}, log.Field{Key: "data", Value: data})