主线章节挑战完成后推送新的章节
This commit is contained in:
parent
448875978a
commit
fe5fae9ca8
@ -8,6 +8,8 @@ import (
|
||||
const (
|
||||
MainlineGetListResp = "getlist"
|
||||
MainlineChallengeResp = "challenge"
|
||||
MainlineGetRewardResp = "getreward"
|
||||
PushNewChapterPush = "newchapter"
|
||||
)
|
||||
|
||||
type apiComp struct {
|
||||
|
@ -2,9 +2,7 @@ package mainline
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/sys/redis"
|
||||
"go_dreamfactory/pb"
|
||||
"sort"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"google.golang.org/protobuf/proto"
|
||||
@ -12,7 +10,7 @@ import (
|
||||
|
||||
//参数校验
|
||||
func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.MainlineChallengeReq) (code pb.ErrorCode) {
|
||||
if req.ChapterId == 0 || req.MainlineId == 0 {
|
||||
if req.MainlineId == 0 {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
return
|
||||
}
|
||||
@ -31,20 +29,15 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.MainlineChalle
|
||||
if code != pb.ErrorCode_Success {
|
||||
return // 参数校验失败直接返回
|
||||
}
|
||||
list, err := this.module.modelMainline.getMainlineList(session.GetUserId())
|
||||
if err != nil && err != redis.RedisNil {
|
||||
code = pb.ErrorCode_DBError
|
||||
// 校验关卡存不存在
|
||||
curChapter = this.module.modelMainline.getOneChapterInfo(session.GetUserId(), req.ChapterObj)
|
||||
if curChapter == nil {
|
||||
code = pb.ErrorCode_MainlineNotFound
|
||||
return
|
||||
}
|
||||
sort.SliceStable(list, func(i, j int) bool { // 倒序排序
|
||||
return list[i].ChapterId > list[j].ChapterId
|
||||
})
|
||||
if len(list) > 0 {
|
||||
curChapter = list[0] // 取第一条(第一条肯定是最新的)
|
||||
}
|
||||
|
||||
// 先校验是不是分支
|
||||
chaptConfig := this.module.configure.GetMainlineChapter(int32(req.ChapterId)) // 根据配置文件找
|
||||
chaptConfig := this.module.configure.GetMainlineChapter(int32(curChapter.ChapterId)) // 根据配置文件找
|
||||
if chaptConfig == nil {
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
@ -59,26 +52,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.MainlineChalle
|
||||
code = pb.ErrorCode_ReqParameterError // 不是该章节的关卡
|
||||
return
|
||||
}
|
||||
if curChapter == nil {
|
||||
if len(chaptConfig.Episode) <= 0 {
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
if int32(req.ChapterId) != 1 {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
return
|
||||
}
|
||||
_data := &pb.DBMainline{}
|
||||
_data.Id = primitive.NewObjectID().Hex()
|
||||
_data.ChapterId = int32(req.ChapterId)
|
||||
_mData := make(map[string]interface{}, 0)
|
||||
_data.Uid = session.GetUserId()
|
||||
_mData[_data.Id] = _data
|
||||
|
||||
this.module.modelMainline.addNewChapter(session.GetUserId(), _mData)
|
||||
curChapter = _data
|
||||
//curChapter.MainlineId = chaptConfig.Fubendata[0] // 第一次挑战
|
||||
}
|
||||
// 根据难度找对应的配置文件
|
||||
if chaptConfig.Intensity == comm.MailLineEasy {
|
||||
con := this.module.configure.GetMainlineEasyChapter(int32(req.MainlineId)) // 根据配置文件找
|
||||
@ -86,32 +60,51 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.MainlineChalle
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
if con.Route == 2 { //分支
|
||||
if con.Route == 1 {
|
||||
if con.Previoustage != curChapter.MainlineId { // 前置关卡校验
|
||||
code = pb.ErrorCode_MainlinePreNotFound
|
||||
}
|
||||
} else if con.Route == 2 { //分支
|
||||
bBranch = true
|
||||
// 只需要校验小关ID 是不是大于当前ID就可以
|
||||
if curChapter.MainlineId < int32(req.MainlineId) { //必须大于前置关卡才可以挑战
|
||||
code = pb.ErrorCode_MainlineIDFailed
|
||||
return
|
||||
}
|
||||
//if curChapter.MainlineId < int32(req.MainlineId) { //必须大于前置关卡才可以挑战
|
||||
// code = pb.ErrorCode_MainlineIDFailed
|
||||
// return
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO 调用战斗逻辑
|
||||
// 挑战成功
|
||||
curChapter.MainlineId = int32(req.MainlineId)
|
||||
if bBranch {
|
||||
curChapter.BranchID = append(curChapter.BranchID, int32(req.ChapterId)) // 记录分支关卡
|
||||
curChapter.BranchID = append(curChapter.BranchID, int32(req.MainlineId)) // 记录分支关卡
|
||||
}
|
||||
if curChapter.ChapterId == int32(req.ChapterId) && curChapter.MainlineId == int32(req.MainlineId) {
|
||||
|
||||
update := map[string]interface{}{
|
||||
"mainlineId": req.MainlineId,
|
||||
"ChapterId": req.ChapterId,
|
||||
"ChapterId": curChapter.ChapterId,
|
||||
"branchID": curChapter.BranchID,
|
||||
}
|
||||
err = this.module.modelMainline.modifyMainlineData(session.GetUserId(), curChapter.Id, update)
|
||||
} else {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
err := this.module.modelMainline.modifyMainlineData(session.GetUserId(), curChapter.Id, update)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
// 如果本章节打完 则创建新的章节
|
||||
if chaptConfig.Episode[len(chaptConfig.Episode)-1] == int32(req.MainlineId) {
|
||||
_data := &pb.DBMainline{}
|
||||
_data.Id = primitive.NewObjectID().Hex()
|
||||
_data.ChapterId = curChapter.ChapterId + 1
|
||||
_mData := make(map[string]interface{}, 0)
|
||||
_data.Uid = session.GetUserId()
|
||||
_mData[_data.Id] = _data
|
||||
|
||||
this.module.modelMainline.addNewChapter(session.GetUserId(), _mData)
|
||||
// 推送新的章节
|
||||
session.SendMsg(string(this.module.GetType()), PushNewChapterPush, &pb.PushNewChapterPush{Data: _data})
|
||||
|
||||
}
|
||||
// 发奖 (奖励数据还没配置,后续补充)
|
||||
session.SendMsg(string(this.module.GetType()), MainlineChallengeResp, &pb.MainlineChallengeResp{Data: curChapter})
|
||||
return
|
||||
|
35
modules/mainline/api_getReward.go
Normal file
35
modules/mainline/api_getReward.go
Normal file
@ -0,0 +1,35 @@
|
||||
package mainline
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
//参数校验
|
||||
func (this *apiComp) GetRewardCheck(session comm.IUserSession, req *pb.MainlineGetRewardReq) (code pb.ErrorCode) {
|
||||
if req.ChapterObj == "" {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
///获取主线关卡信息
|
||||
func (this *apiComp) GetReward(session comm.IUserSession, req *pb.MainlineGetRewardReq) (code pb.ErrorCode, data proto.Message) {
|
||||
rsp := &pb.MainlineGetRewardResp{}
|
||||
|
||||
code = this.GetRewardCheck(session, req)
|
||||
if code != pb.ErrorCode_Success {
|
||||
return // 参数校验失败直接返回
|
||||
}
|
||||
|
||||
_obj := this.module.modelMainline.getOneChapterInfo(session.GetUserId(), req.ChapterObj)
|
||||
if _obj != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
rsp.Data = _obj
|
||||
session.SendMsg(string(this.module.GetType()), MainlineGetRewardResp, rsp)
|
||||
return
|
||||
}
|
@ -4,6 +4,7 @@ import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
@ -27,6 +28,17 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.MainlineGetListR
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
if len(list) == 0 { // 如果数量为0 则默认创建一条数据
|
||||
_data := &pb.DBMainline{}
|
||||
_data.Id = primitive.NewObjectID().Hex()
|
||||
_data.ChapterId = 0
|
||||
_mData := make(map[string]interface{}, 0)
|
||||
_data.Uid = session.GetUserId()
|
||||
_mData[_data.Id] = _data
|
||||
|
||||
this.module.modelMainline.addNewChapter(session.GetUserId(), _mData)
|
||||
list = append(list, _data)
|
||||
}
|
||||
rsp.Data = list
|
||||
|
||||
session.SendMsg(string(this.module.GetType()), MainlineGetListResp, &pb.MainlineGetListResp{Data: rsp.Data})
|
||||
|
@ -43,3 +43,13 @@ func (this *ModelMainline) addNewChapter(uId string, data map[string]interface{}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 获取指定章节数据
|
||||
func (this *ModelMainline) getOneChapterInfo(uid, obj string) *pb.DBMainline {
|
||||
data := &pb.DBMainline{}
|
||||
err := this.module.modelMainline.GetListObj(uid, obj, data)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ func (this *Mainline) ModifyMainlineData(uid string, objId string, data map[stri
|
||||
}
|
||||
|
||||
// 校验是否能挑战该关卡
|
||||
func (this *Mainline) CheckChallengeChapter(stroyId int32, uid string, zhangjieID int32) (code pb.ErrorCode) {
|
||||
func (this *Mainline) CheckChallengeChapter(stroyId int32, uid string, zhangjieID int32, Intensity string) (code pb.ErrorCode) {
|
||||
var (
|
||||
curChapter *pb.DBMainline
|
||||
)
|
||||
@ -66,8 +66,7 @@ func (this *Mainline) CheckChallengeChapter(stroyId int32, uid string, zhangjieI
|
||||
return
|
||||
}
|
||||
// 获取关卡难度用来取配置文件
|
||||
switch curChapter.Intensity {
|
||||
case 1:
|
||||
if Intensity == comm.MailLineEasy {
|
||||
configData := this.configure.GetMainlineEasyChapter(curChapter.MainlineId)
|
||||
if configData != nil { // 校验章节
|
||||
if configData.Chapter != zhangjieID {
|
||||
@ -84,8 +83,7 @@ func (this *Mainline) CheckChallengeChapter(stroyId int32, uid string, zhangjieI
|
||||
return
|
||||
}
|
||||
}
|
||||
break
|
||||
case 2:
|
||||
} else if Intensity == comm.MailLineHard {
|
||||
configData := this.configure.GetMainlineHardChapter(curChapter.MainlineId)
|
||||
if configData != nil { // 校验章节
|
||||
if configData.Chapter != zhangjieID {
|
||||
@ -98,7 +96,19 @@ func (this *Mainline) CheckChallengeChapter(stroyId int32, uid string, zhangjieI
|
||||
return
|
||||
}
|
||||
}
|
||||
break
|
||||
} else {
|
||||
configData := this.configure.GetMainlinePurgatoryChapter(curChapter.MainlineId)
|
||||
if configData != nil { // 校验章节
|
||||
if configData.Chapter != zhangjieID {
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
// 判断下一关是不是当前传入的值
|
||||
if configData.Previoustage != stroyId {
|
||||
code = pb.ErrorCode_MainlineIDFailed
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -100,6 +100,8 @@ const (
|
||||
// mainMainline
|
||||
ErrorCode_MainlineNotFindChapter ErrorCode = 1500 // 没有找到主线关卡信息
|
||||
ErrorCode_MainlineIDFailed ErrorCode = 1501 // 关卡ID 错误
|
||||
ErrorCode_MainlineNotFound ErrorCode = 1502 // 主线关卡不存在
|
||||
ErrorCode_MainlinePreNotFound ErrorCode = 1503 // 前置关卡不匹配
|
||||
// task
|
||||
ErrorCode_TaskInit ErrorCode = 1600 //初始化失败
|
||||
ErrorCode_TaskReset ErrorCode = 1601 //重置任务失败
|
||||
@ -186,6 +188,8 @@ var (
|
||||
1401: "EquipmentLvlimitReached",
|
||||
1500: "MainlineNotFindChapter",
|
||||
1501: "MainlineIDFailed",
|
||||
1502: "MainlineNotFound",
|
||||
1503: "MainlinePreNotFound",
|
||||
1600: "TaskInit",
|
||||
1601: "TaskReset",
|
||||
1602: "TaskHandle",
|
||||
@ -268,6 +272,8 @@ var (
|
||||
"EquipmentLvlimitReached": 1401,
|
||||
"MainlineNotFindChapter": 1500,
|
||||
"MainlineIDFailed": 1501,
|
||||
"MainlineNotFound": 1502,
|
||||
"MainlinePreNotFound": 1503,
|
||||
"TaskInit": 1600,
|
||||
"TaskReset": 1601,
|
||||
"TaskHandle": 1602,
|
||||
@ -311,7 +317,7 @@ var File_errorcode_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_errorcode_proto_rawDesc = []byte{
|
||||
0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x2a, 0x80, 0x0d, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
|
||||
0x6f, 0x2a, 0xb1, 0x0d, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
|
||||
0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d,
|
||||
0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12,
|
||||
0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||
@ -404,19 +410,22 @@ var file_errorcode_proto_rawDesc = []byte{
|
||||
0x1b, 0x0a, 0x16, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x69,
|
||||
0x6e, 0x64, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x10, 0xdc, 0x0b, 0x12, 0x15, 0x0a, 0x10,
|
||||
0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x44, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64,
|
||||
0x10, 0xdd, 0x0b, 0x12, 0x0d, 0x0a, 0x08, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x6e, 0x69, 0x74, 0x10,
|
||||
0xc0, 0x0c, 0x12, 0x0e, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x65, 0x74, 0x10,
|
||||
0xc1, 0x0c, 0x12, 0x0f, 0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65,
|
||||
0x10, 0xc2, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x65, 0x69,
|
||||
0x76, 0x65, 0x64, 0x10, 0xc3, 0x0c, 0x12, 0x13, 0x0a, 0x0e, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63,
|
||||
0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x69, 0x74, 0x10, 0xc4, 0x0c, 0x12, 0x16, 0x0a, 0x11, 0x54,
|
||||
0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x6f, 0x66, 0x6f, 0x75, 0x6e, 0x64,
|
||||
0x10, 0xc5, 0x0c, 0x12, 0x17, 0x0a, 0x12, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76,
|
||||
0x65, 0x4e, 0x6f, 0x65, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xc6, 0x0c, 0x12, 0x13, 0x0a, 0x0e,
|
||||
0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0xc7,
|
||||
0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65,
|
||||
0x64, 0x10, 0xc8, 0x0c, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
0x10, 0xdd, 0x0b, 0x12, 0x15, 0x0a, 0x10, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4e,
|
||||
0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xde, 0x0b, 0x12, 0x18, 0x0a, 0x13, 0x4d, 0x61,
|
||||
0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e,
|
||||
0x64, 0x10, 0xdf, 0x0b, 0x12, 0x0d, 0x0a, 0x08, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x6e, 0x69, 0x74,
|
||||
0x10, 0xc0, 0x0c, 0x12, 0x0e, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x65, 0x74,
|
||||
0x10, 0xc1, 0x0c, 0x12, 0x0f, 0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, 0x48, 0x61, 0x6e, 0x64, 0x6c,
|
||||
0x65, 0x10, 0xc2, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x65,
|
||||
0x69, 0x76, 0x65, 0x64, 0x10, 0xc3, 0x0c, 0x12, 0x13, 0x0a, 0x0e, 0x54, 0x61, 0x73, 0x6b, 0x41,
|
||||
0x63, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x69, 0x74, 0x10, 0xc4, 0x0c, 0x12, 0x16, 0x0a, 0x11,
|
||||
0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x6f, 0x66, 0x6f, 0x75, 0x6e,
|
||||
0x64, 0x10, 0xc5, 0x0c, 0x12, 0x17, 0x0a, 0x12, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69,
|
||||
0x76, 0x65, 0x4e, 0x6f, 0x65, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xc6, 0x0c, 0x12, 0x13, 0x0a,
|
||||
0x0e, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10,
|
||||
0xc7, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68,
|
||||
0x65, 0x64, 0x10, 0xc8, 0x0c, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
@ -29,11 +29,8 @@ type DBMainline struct {
|
||||
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID
|
||||
ChapterId int32 `protobuf:"varint,3,opt,name=chapterId,proto3" json:"chapterId" bson:"chapterId"` //章节ID
|
||||
MainlineId int32 `protobuf:"varint,4,opt,name=mainlineId,proto3" json:"mainlineId" bson:"mainlineId"` //主线关卡ID
|
||||
Intensity int32 `protobuf:"varint,5,opt,name=intensity,proto3" json:"intensity" bson:"intensity"` //难度类型
|
||||
AwaredID int32 `protobuf:"varint,6,opt,name=awaredID,proto3" json:"awaredID" bson:"awaredID"` //领奖ID
|
||||
Progress int32 `protobuf:"varint,7,opt,name=progress,proto3" json:"progress" bson:"progress"` // 通关进度(打了多少主关卡)
|
||||
TotalBox int32 `protobuf:"varint,8,opt,name=totalBox,proto3" json:"totalBox" bson:"totalBox"` // 总关卡数量
|
||||
BranchID []int32 `protobuf:"varint,9,rep,packed,name=branchID,proto3" json:"branchID" bson:"branchID"` // 记录分支通关的情况
|
||||
AwaredID int32 `protobuf:"varint,5,opt,name=awaredID,proto3" json:"awaredID" bson:"awaredID"` //是否领奖(设置int是考虑后续扩展有多个宝箱情况)
|
||||
BranchID []int32 `protobuf:"varint,6,rep,packed,name=branchID,proto3" json:"branchID" bson:"branchID"` // 记录分支通关的情况
|
||||
}
|
||||
|
||||
func (x *DBMainline) Reset() {
|
||||
@ -96,13 +93,6 @@ func (x *DBMainline) GetMainlineId() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DBMainline) GetIntensity() int32 {
|
||||
if x != nil {
|
||||
return x.Intensity
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DBMainline) GetAwaredID() int32 {
|
||||
if x != nil {
|
||||
return x.AwaredID
|
||||
@ -110,20 +100,6 @@ func (x *DBMainline) GetAwaredID() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DBMainline) GetProgress() int32 {
|
||||
if x != nil {
|
||||
return x.Progress
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DBMainline) GetTotalBox() int32 {
|
||||
if x != nil {
|
||||
return x.TotalBox
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DBMainline) GetBranchID() []int32 {
|
||||
if x != nil {
|
||||
return x.BranchID
|
||||
@ -135,24 +111,19 @@ var File_mainline_mainline_db_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_mainline_mainline_db_proto_rawDesc = []byte{
|
||||
0x0a, 0x1a, 0x6d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x2f, 0x6d, 0x61, 0x69, 0x6e, 0x6c,
|
||||
0x69, 0x6e, 0x65, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xfa, 0x01, 0x0a,
|
||||
0x69, 0x6e, 0x65, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa4, 0x01, 0x0a,
|
||||
0x0a, 0x44, 0x42, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69,
|
||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75,
|
||||
0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a,
|
||||
0x09, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x09, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x6d,
|
||||
0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x0a, 0x6d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x69,
|
||||
0x6e, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09,
|
||||
0x69, 0x6e, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x77, 0x61,
|
||||
0x72, 0x65, 0x64, 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x61, 0x77, 0x61,
|
||||
0x72, 0x65, 0x64, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73,
|
||||
0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73,
|
||||
0x73, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x6f, 0x78, 0x18, 0x08, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x08, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x6f, 0x78, 0x12, 0x1a, 0x0a,
|
||||
0x08, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x49, 0x44, 0x18, 0x09, 0x20, 0x03, 0x28, 0x05, 0x52,
|
||||
0x08, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x49, 0x44, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70,
|
||||
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x0a, 0x6d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x61,
|
||||
0x77, 0x61, 0x72, 0x65, 0x64, 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x61,
|
||||
0x77, 0x61, 0x72, 0x65, 0x64, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x72, 0x61, 0x6e, 0x63,
|
||||
0x68, 0x49, 0x44, 0x18, 0x06, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x62, 0x72, 0x61, 0x6e, 0x63,
|
||||
0x68, 0x49, 0x44, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
@ -108,16 +108,16 @@ func (x *MainlineGetListResp) GetData() []*DBMainline {
|
||||
}
|
||||
|
||||
// 领取关卡宝箱
|
||||
type MainlineGetRewrdReq struct {
|
||||
type MainlineGetRewardReq struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ChapterId uint32 `protobuf:"varint,1,opt,name=chapterId,proto3" json:"chapterId"` // 章节ID
|
||||
ChapterObj string `protobuf:"bytes,1,opt,name=chapterObj,proto3" json:"chapterObj"` // 章节唯一对象id
|
||||
}
|
||||
|
||||
func (x *MainlineGetRewrdReq) Reset() {
|
||||
*x = MainlineGetRewrdReq{}
|
||||
func (x *MainlineGetRewardReq) Reset() {
|
||||
*x = MainlineGetRewardReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_mainline_mainline_msg_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@ -125,13 +125,13 @@ func (x *MainlineGetRewrdReq) Reset() {
|
||||
}
|
||||
}
|
||||
|
||||
func (x *MainlineGetRewrdReq) String() string {
|
||||
func (x *MainlineGetRewardReq) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*MainlineGetRewrdReq) ProtoMessage() {}
|
||||
func (*MainlineGetRewardReq) ProtoMessage() {}
|
||||
|
||||
func (x *MainlineGetRewrdReq) ProtoReflect() protoreflect.Message {
|
||||
func (x *MainlineGetRewardReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mainline_mainline_msg_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@ -143,19 +143,19 @@ func (x *MainlineGetRewrdReq) ProtoReflect() protoreflect.Message {
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use MainlineGetRewrdReq.ProtoReflect.Descriptor instead.
|
||||
func (*MainlineGetRewrdReq) Descriptor() ([]byte, []int) {
|
||||
// Deprecated: Use MainlineGetRewardReq.ProtoReflect.Descriptor instead.
|
||||
func (*MainlineGetRewardReq) Descriptor() ([]byte, []int) {
|
||||
return file_mainline_mainline_msg_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *MainlineGetRewrdReq) GetChapterId() uint32 {
|
||||
func (x *MainlineGetRewardReq) GetChapterObj() string {
|
||||
if x != nil {
|
||||
return x.ChapterId
|
||||
return x.ChapterObj
|
||||
}
|
||||
return 0
|
||||
return ""
|
||||
}
|
||||
|
||||
type MainlineGetRewrdResp struct {
|
||||
type MainlineGetRewardResp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
@ -163,8 +163,8 @@ type MainlineGetRewrdResp struct {
|
||||
Data *DBMainline `protobuf:"bytes,1,opt,name=data,proto3" json:"data"` //当前章节信息
|
||||
}
|
||||
|
||||
func (x *MainlineGetRewrdResp) Reset() {
|
||||
*x = MainlineGetRewrdResp{}
|
||||
func (x *MainlineGetRewardResp) Reset() {
|
||||
*x = MainlineGetRewardResp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_mainline_mainline_msg_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@ -172,13 +172,13 @@ func (x *MainlineGetRewrdResp) Reset() {
|
||||
}
|
||||
}
|
||||
|
||||
func (x *MainlineGetRewrdResp) String() string {
|
||||
func (x *MainlineGetRewardResp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*MainlineGetRewrdResp) ProtoMessage() {}
|
||||
func (*MainlineGetRewardResp) ProtoMessage() {}
|
||||
|
||||
func (x *MainlineGetRewrdResp) ProtoReflect() protoreflect.Message {
|
||||
func (x *MainlineGetRewardResp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mainline_mainline_msg_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@ -190,12 +190,12 @@ func (x *MainlineGetRewrdResp) ProtoReflect() protoreflect.Message {
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use MainlineGetRewrdResp.ProtoReflect.Descriptor instead.
|
||||
func (*MainlineGetRewrdResp) Descriptor() ([]byte, []int) {
|
||||
// Deprecated: Use MainlineGetRewardResp.ProtoReflect.Descriptor instead.
|
||||
func (*MainlineGetRewardResp) Descriptor() ([]byte, []int) {
|
||||
return file_mainline_mainline_msg_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *MainlineGetRewrdResp) GetData() *DBMainline {
|
||||
func (x *MainlineGetRewardResp) GetData() *DBMainline {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
@ -208,7 +208,7 @@ type MainlineChallengeReq struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ChapterId uint32 `protobuf:"varint,1,opt,name=chapterId,proto3" json:"chapterId"` // 章节ID
|
||||
ChapterObj string `protobuf:"bytes,1,opt,name=chapterObj,proto3" json:"chapterObj"` // 章节唯一对象id
|
||||
MainlineId uint32 `protobuf:"varint,2,opt,name=mainlineId,proto3" json:"mainlineId"` // 小关ID
|
||||
}
|
||||
|
||||
@ -244,11 +244,11 @@ func (*MainlineChallengeReq) Descriptor() ([]byte, []int) {
|
||||
return file_mainline_mainline_msg_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *MainlineChallengeReq) GetChapterId() uint32 {
|
||||
func (x *MainlineChallengeReq) GetChapterObj() string {
|
||||
if x != nil {
|
||||
return x.ChapterId
|
||||
return x.ChapterObj
|
||||
}
|
||||
return 0
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *MainlineChallengeReq) GetMainlineId() uint32 {
|
||||
@ -305,6 +305,54 @@ func (x *MainlineChallengeResp) GetData() *DBMainline {
|
||||
return nil
|
||||
}
|
||||
|
||||
// 推送新章节
|
||||
type PushNewChapterPush struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Data *DBMainline `protobuf:"bytes,1,opt,name=data,proto3" json:"data"`
|
||||
}
|
||||
|
||||
func (x *PushNewChapterPush) Reset() {
|
||||
*x = PushNewChapterPush{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_mainline_mainline_msg_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *PushNewChapterPush) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*PushNewChapterPush) ProtoMessage() {}
|
||||
|
||||
func (x *PushNewChapterPush) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mainline_mainline_msg_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 PushNewChapterPush.ProtoReflect.Descriptor instead.
|
||||
func (*PushNewChapterPush) Descriptor() ([]byte, []int) {
|
||||
return file_mainline_mainline_msg_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *PushNewChapterPush) GetData() *DBMainline {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_mainline_mainline_msg_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_mainline_mainline_msg_proto_rawDesc = []byte{
|
||||
@ -316,24 +364,28 @@ var file_mainline_mainline_msg_proto_rawDesc = []byte{
|
||||
0x36, 0x0a, 0x13, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x47, 0x65, 0x74, 0x4c, 0x69,
|
||||
0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01,
|
||||
0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x44, 0x42, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e,
|
||||
0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x33, 0x0a, 0x13, 0x4d, 0x61, 0x69, 0x6e, 0x6c,
|
||||
0x69, 0x6e, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x1c,
|
||||
0x0a, 0x09, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x0d, 0x52, 0x09, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x37, 0x0a, 0x14,
|
||||
0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x72, 0x64,
|
||||
0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x44, 0x42, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x52,
|
||||
0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x54, 0x0a, 0x14, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e,
|
||||
0x65, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a,
|
||||
0x09, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d,
|
||||
0x52, 0x09, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x6d,
|
||||
0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52,
|
||||
0x0a, 0x6d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x22, 0x38, 0x0a, 0x15, 0x4d,
|
||||
0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65,
|
||||
0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x44, 0x42, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x52,
|
||||
0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x36, 0x0a, 0x14, 0x4d, 0x61, 0x69, 0x6e, 0x6c,
|
||||
0x69, 0x6e, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12,
|
||||
0x1e, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x4f, 0x62, 0x6a, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x4f, 0x62, 0x6a, 0x22,
|
||||
0x38, 0x0a, 0x15, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65,
|
||||
0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x44, 0x42, 0x4d, 0x61, 0x69, 0x6e, 0x6c,
|
||||
0x69, 0x6e, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x56, 0x0a, 0x14, 0x4d, 0x61, 0x69,
|
||||
0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65,
|
||||
0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x4f, 0x62, 0x6a, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x4f, 0x62,
|
||||
0x6a, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x49,
|
||||
0x64, 0x22, 0x38, 0x0a, 0x15, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x68, 0x61,
|
||||
0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x64, 0x61,
|
||||
0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x44, 0x42, 0x4d, 0x61, 0x69,
|
||||
0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x35, 0x0a, 0x12, 0x50,
|
||||
0x75, 0x73, 0x68, 0x4e, 0x65, 0x77, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x50, 0x75, 0x73,
|
||||
0x68, 0x12, 0x1f, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x0b, 0x2e, 0x44, 0x42, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x04, 0x64, 0x61,
|
||||
0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -348,25 +400,27 @@ 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, 6)
|
||||
var file_mainline_mainline_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||
var file_mainline_mainline_msg_proto_goTypes = []interface{}{
|
||||
(*MainlineGetListReq)(nil), // 0: MainlineGetListReq
|
||||
(*MainlineGetListResp)(nil), // 1: MainlineGetListResp
|
||||
(*MainlineGetRewrdReq)(nil), // 2: MainlineGetRewrdReq
|
||||
(*MainlineGetRewrdResp)(nil), // 3: MainlineGetRewrdResp
|
||||
(*MainlineGetRewardReq)(nil), // 2: MainlineGetRewardReq
|
||||
(*MainlineGetRewardResp)(nil), // 3: MainlineGetRewardResp
|
||||
(*MainlineChallengeReq)(nil), // 4: MainlineChallengeReq
|
||||
(*MainlineChallengeResp)(nil), // 5: MainlineChallengeResp
|
||||
(*DBMainline)(nil), // 6: DBMainline
|
||||
(*PushNewChapterPush)(nil), // 6: PushNewChapterPush
|
||||
(*DBMainline)(nil), // 7: DBMainline
|
||||
}
|
||||
var file_mainline_mainline_msg_proto_depIdxs = []int32{
|
||||
6, // 0: MainlineGetListResp.data:type_name -> DBMainline
|
||||
6, // 1: MainlineGetRewrdResp.data:type_name -> DBMainline
|
||||
6, // 2: MainlineChallengeResp.data:type_name -> DBMainline
|
||||
3, // [3:3] is the sub-list for method output_type
|
||||
3, // [3:3] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
7, // 0: MainlineGetListResp.data:type_name -> DBMainline
|
||||
7, // 1: MainlineGetRewardResp.data:type_name -> DBMainline
|
||||
7, // 2: MainlineChallengeResp.data:type_name -> DBMainline
|
||||
7, // 3: PushNewChapterPush.data:type_name -> DBMainline
|
||||
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
|
||||
}
|
||||
|
||||
func init() { file_mainline_mainline_msg_proto_init() }
|
||||
@ -401,7 +455,7 @@ func file_mainline_mainline_msg_proto_init() {
|
||||
}
|
||||
}
|
||||
file_mainline_mainline_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*MainlineGetRewrdReq); i {
|
||||
switch v := v.(*MainlineGetRewardReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
@ -413,7 +467,7 @@ func file_mainline_mainline_msg_proto_init() {
|
||||
}
|
||||
}
|
||||
file_mainline_mainline_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*MainlineGetRewrdResp); i {
|
||||
switch v := v.(*MainlineGetRewardResp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
@ -448,6 +502,18 @@ func file_mainline_mainline_msg_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_mainline_mainline_msg_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PushNewChapterPush); 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{
|
||||
@ -455,7 +521,7 @@ func file_mainline_mainline_msg_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_mainline_mainline_msg_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 6,
|
||||
NumMessages: 7,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
@ -84,6 +84,8 @@ enum ErrorCode {
|
||||
// mainMainline
|
||||
MainlineNotFindChapter = 1500; // 没有找到主线关卡信息
|
||||
MainlineIDFailed = 1501; // 关卡ID 错误
|
||||
MainlineNotFound = 1502; // 主线关卡不存在
|
||||
MainlinePreNotFound = 1503; // 前置关卡不匹配
|
||||
|
||||
// task
|
||||
TaskInit = 1600; //初始化失败
|
||||
|
@ -6,9 +6,6 @@ message DBMainline {
|
||||
string uid = 2; //@go_tags(`bson:"uid"`) 用户ID
|
||||
int32 chapterId = 3; //@go_tags(`bson:"chapterId"`) 章节ID
|
||||
int32 mainlineId = 4; //@go_tags(`bson:"mainlineId"`) 主线关卡ID
|
||||
int32 intensity = 5; //@go_tags(`bson:"intensity"`) 难度类型
|
||||
int32 awaredID = 6; //@go_tags(`bson:"awaredID"`) 领奖ID
|
||||
int32 progress = 7; // @go_tags(`bson:"progress"`) 通关进度(打了多少主关卡)
|
||||
int32 totalBox = 8; // @go_tags(`bson:"totalBox"`) 总关卡数量
|
||||
repeated int32 branchID = 9; // @go_tags(`bson:"branchID"`) 记录分支通关的情况
|
||||
int32 awaredID = 5; //@go_tags(`bson:"awaredID"`) 是否领奖(设置int是考虑后续扩展有多个宝箱情况)
|
||||
repeated int32 branchID = 6; // @go_tags(`bson:"branchID"`) 记录分支通关的情况
|
||||
}
|
@ -12,20 +12,25 @@ message MainlineGetListResp {
|
||||
}
|
||||
|
||||
// 领取关卡宝箱
|
||||
message MainlineGetRewrdReq {
|
||||
uint32 chapterId = 1; // 章节ID
|
||||
message MainlineGetRewardReq {
|
||||
string chapterObj = 1; // 章节唯一对象id
|
||||
}
|
||||
|
||||
message MainlineGetRewrdResp {
|
||||
message MainlineGetRewardResp {
|
||||
DBMainline data = 1; //当前章节信息
|
||||
}
|
||||
|
||||
// 挑战关卡
|
||||
message MainlineChallengeReq {
|
||||
uint32 chapterId = 1; // 章节ID
|
||||
string chapterObj = 1; // 章节唯一对象id
|
||||
uint32 mainlineId = 2; // 小关ID
|
||||
}
|
||||
|
||||
message MainlineChallengeResp {
|
||||
DBMainline data = 1; //当前章节信息
|
||||
}
|
||||
|
||||
// 推送新章节
|
||||
message PushNewChapterPush{
|
||||
DBMainline data = 1;
|
||||
}
|
Loading…
Reference in New Issue
Block a user