世界任务

This commit is contained in:
wh_zcy 2022-11-09 19:49:19 +08:00
parent 0c06225cf9
commit a7fa2e31f5
24 changed files with 2842 additions and 312 deletions

View File

@ -0,0 +1,9 @@
[
{
"id": 101,
"FormatList": [
700011
],
"captainId": "250011"
}
]

File diff suppressed because it is too large Load Diff

View File

@ -4,5 +4,5 @@ Website = "http://legu.cc"
Icon = "app.png" Icon = "app.png"
Name = "RobotGUI" Name = "RobotGUI"
ID = "cc.legu.app" ID = "cc.legu.app"
Version = "1.0.19" Version = "1.0.20"
Build = 22 Build = 23

View File

@ -19,6 +19,7 @@ import (
"go_dreamfactory/modules/sys" "go_dreamfactory/modules/sys"
"go_dreamfactory/modules/task" "go_dreamfactory/modules/task"
"go_dreamfactory/modules/user" "go_dreamfactory/modules/user"
"go_dreamfactory/modules/worldtask"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"strings" "strings"
@ -121,6 +122,8 @@ var (
ff(comm.ModuleTroll, "getlist"): &formview.TrollGetlistView{}, ff(comm.ModuleTroll, "getlist"): &formview.TrollGetlistView{},
// growtask // growtask
ff(comm.ModuleGrowtask, growtask.GrowtaskSubTypeList): &formview.GrowtaskListView{}, ff(comm.ModuleGrowtask, growtask.GrowtaskSubTypeList): &formview.GrowtaskListView{},
//worldtask
ff(comm.ModuleWorldtask, worldtask.WorldtaskSubtypeMine): &formview.WorldtaskMineView{},
} }
) )
@ -146,6 +149,7 @@ var (
string(comm.ModuleSociaty), string(comm.ModuleSociaty),
string(comm.ModuleTroll), string(comm.ModuleTroll),
string(comm.ModuleGrowtask), string(comm.ModuleGrowtask),
string(comm.ModuleWorldtask),
}, },
"gm": {ff(comm.ModuleGM, "cmd")}, "gm": {ff(comm.ModuleGM, "cmd")},
"sys": { "sys": {
@ -246,6 +250,9 @@ var (
"growtask": { "growtask": {
ff(comm.ModuleGrowtask, growtask.GrowtaskSubTypeList), ff(comm.ModuleGrowtask, growtask.GrowtaskSubTypeList),
}, },
"worldtask": {
ff(comm.ModuleWorldtask, worldtask.WorldtaskSubtypeMine),
},
} }
) )
@ -896,6 +903,19 @@ var (
SubType: growtask.GrowtaskSubTypeList, SubType: growtask.GrowtaskSubTypeList,
Enabled: true, Enabled: true,
}, },
// worldtask
string(comm.ModuleWorldtask): {
NavLabel: "世界任务",
MainType: string(comm.ModuleWorldtask),
Enabled: true,
},
ff(comm.ModuleWorldtask, worldtask.WorldtaskSubtypeMine): {
NavLabel: "我的任务",
Desc: "世界任务剧情",
MainType: string(comm.ModuleWorldtask),
SubType: worldtask.WorldtaskSubtypeMine,
Enabled: true,
},
} }
) )

View File

@ -0,0 +1,119 @@
package formview
import (
"fmt"
"go_dreamfactory/cmd/v2/lib/common"
"go_dreamfactory/cmd/v2/model"
"go_dreamfactory/cmd/v2/service"
"go_dreamfactory/cmd/v2/service/observer"
"go_dreamfactory/comm"
"go_dreamfactory/modules/worldtask"
"go_dreamfactory/pb"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/dialog"
"fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget"
"github.com/sirupsen/logrus"
"github.com/spf13/cast"
)
type WorldtaskMineView struct {
mineReq func()
BaseformView
itemList *common.ItemList
flag bool
juqingBtn *widget.Button
}
func (this *WorldtaskMineView) CreateView(t *model.TestCase) fyne.CanvasObject {
this.itemList = common.NewItemList()
this.itemList.ItemList = this.itemList.CreateList()
this.mineReq = func() {
if err := service.GetPttService().SendToClient(
t.MainType,
worldtask.WorldtaskSubtypeMine,
&pb.WorldtaskMineReq{}); err != nil {
logrus.Error(err)
}
}
defer this.mineReq()
// 刷新
refreshBtn := widget.NewButtonWithIcon("", theme.ViewRefreshIcon(), func() {
this.itemList.Reset()
this.mineReq()
})
// 接取任务
this.juqingBtn = widget.NewButton("接取任务", func() {
taskIdEntry := widget.NewEntry()
taskIdEntry.PlaceHolder = "任务ID"
form := widget.NewForm(
widget.NewFormItem("任务ID", taskIdEntry),
)
dconf := dialog.NewCustom("接取任务", "关闭", form, this.w)
form.OnSubmit = func() {
if err := service.GetPttService().SendToClient(
t.MainType,
worldtask.WorldtaskSubtypeFinish,
&pb.WorldtaskFinishReq{
TaskId: cast.ToInt32(taskIdEntry.Text),
}); err != nil {
logrus.Error(err)
}
dconf.Hide()
this.mineReq()
}
form.SubmitText = "确定"
dconf.Resize(fyne.NewSize(400, 200))
dconf.Show()
})
barBtn := container.NewHBox(refreshBtn, this.juqingBtn)
c := container.NewBorder(barBtn, nil, nil, nil, this.itemList.ItemList)
this.mineData()
return c
}
func (this *WorldtaskMineView) mineData() {
if this.flag {
return
}
this.obs.AddListener(observer.EVENT_REQ_RSP, observer.Listener{
OnNotify: func(d interface{}, args ...interface{}) {
data := d.(*pb.UserMessage)
if !(data.MainType == string(comm.ModuleWorldtask) &&
data.SubType == worldtask.WorldtaskSubtypeMine) {
return
}
rsp := &pb.WorldtaskMineResp{}
if !comm.ProtoUnmarshal(data, rsp) {
logrus.Error("unmarshal err")
return
}
if rsp.Task == nil {
logrus.Debug(rsp.Task)
return
}
for _, v := range rsp.Task.TaskList {
item := common.Item{
Id: cast.ToString(v.TaskId),
Text: fmt.Sprintf("%d - 状态:%v", v.TaskId, v.Status),
}
this.itemList.AddItem(item)
}
this.juqingBtn.Disabled()
this.juqingBtn.Refresh()
},
})
this.flag = true
}

View File

@ -384,7 +384,9 @@ const (
Rtype67 TaskType = 67 //商店购物消耗xx货币xx个 Rtype67 TaskType = 67 //商店购物消耗xx货币xx个
Rtype68 TaskType = 68 //任意渠道消耗xx金币 Rtype68 TaskType = 68 //任意渠道消耗xx金币
Rtype69 TaskType = 69 //与其他玩家切磋xx次 Rtype69 TaskType = 69 //与其他玩家切磋xx次
Rtype70 TaskType = 70 //通关随机任务XX关卡 Rtype70 TaskType = 70 //通关世界任务XX关卡
Rtype71 TaskType = 71 //主角等级达到X级
Rtype72 TaskType = 72 //完成一次捏人
) )
const ( const (

View File

@ -246,4 +246,9 @@ type (
IMartialhall interface { IMartialhall interface {
Reddot(uid string) bool Reddot(uid string) bool
} }
// 世界任务
IWorldtask interface {
// 任务条件达成通知
TaskcondNotify(uid string, condId int32) error
}
) )

View File

@ -268,13 +268,21 @@ func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.T
//任务完成则推送 //任务完成则推送
if code := this.CheckCondi(uid, v.cfg.Id); code == pb.ErrorCode_Success { if code := this.CheckCondi(uid, v.cfg.Id); code == pb.ErrorCode_Success {
//任务条件达成推送
if err := this.SendMsgToUser("taskcond", "finished", &pb.TaskcondFinishedPush{ if err := this.SendMsgToUser("taskcond", "finished", &pb.TaskcondFinishedPush{
CondId: v.cfg.Id, CondId: v.cfg.Id,
}, uid); err != nil { }, uid); err != nil {
log.Errorf("任务条件达成推送失败 err:%v", err) log.Errorf("任务条件达成推送失败 err:%v", err)
} }
module, err := this.service.GetModule(comm.ModuleWorldtask)
if err == nil {
if worldtask, ok := module.(comm.IWorldtask); ok {
if err := worldtask.TaskcondNotify(uid, v.cfg.Id); err != nil {
log.Errorf("任务条件达成通知 失败 err:%v", err)
}
}
}
} }
} }
return return

View File

@ -53,6 +53,7 @@ func (this *apiComp) Sign(session comm.IUserSession, req *pb.SociatySignReq) (co
if code = this.module.DispenseRes(session, v.Reward, true); code == pb.ErrorCode_Success { if code = this.module.DispenseRes(session, v.Reward, true); code == pb.ErrorCode_Success {
signCfgId = v.Id signCfgId = v.Id
} }
break
} }
} }

View File

@ -7,8 +7,12 @@ import (
) )
const ( const (
WorldtaskSubtypeStory = "story" WorldtaskSubtypeMine = "mine"
WorldtaskSubtypeVerifycondPush = "verifycond" WorldtaskSubtypeAccept = "accept"
WorldtaskSubtypeFinish = "finish"
WorldtaskNexttaskPush = "nexttask"
WorldtaskBattleStart = "battlestart"
WorldtaskBattleFinish = "battlefinish"
) )
type apiComp struct { type apiComp struct {

View File

@ -9,9 +9,43 @@ import (
// 战斗结束的请求 // 战斗结束的请求
func (this *apiComp) BattlefinishCheck(session comm.IUserSession, req *pb.WorldtaskBattleFinishReq) (code pb.ErrorCode) { func (this *apiComp) BattlefinishCheck(session comm.IUserSession, req *pb.WorldtaskBattleFinishReq) (code pb.ErrorCode) {
if req.TaskId == 0 || req.Report == nil {
code = pb.ErrorCode_ReqParameterError
}
return return
} }
func (this *apiComp) Battlefinish(session comm.IUserSession, req *pb.WorldtaskBattleFinishReq) (code pb.ErrorCode, data proto.Message) { func (this *apiComp) Battlefinish(session comm.IUserSession, req *pb.WorldtaskBattleFinishReq) (code pb.ErrorCode, data proto.Message) {
if code = this.BattlefinishCheck(session, req); code != pb.ErrorCode_Success {
return
}
taskConf, err := this.module.configure.getWorldtaskById(req.TaskId)
if err != nil || taskConf == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
rsp := &pb.WorldtaskBattleFinishResp{
TaskId: req.TaskId,
}
battleModule, err := this.module.service.GetModule(comm.ModuleBattle)
if err != nil {
code = pb.ErrorCode_SystemError
return
}
if ibattle, ok := battleModule.(comm.IBattle); ok {
// var isWin bool
if code, _ = ibattle.CheckBattleReport(session, req.Report); code == pb.ErrorCode_Success {
//触发任务
this.module.ModuleRtask.SendToRtask(session, comm.Rtype70, 1, taskConf.Completetask)
}
}
if err := session.SendMsg(string(this.module.GetType()), WorldtaskBattleFinish, rsp); err != nil {
code = pb.ErrorCode_SystemError
}
return return
} }

View File

@ -0,0 +1,71 @@
package worldtask
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
// 战斗开始
func (this *apiComp) BattlestartCheck(session comm.IUserSession, req *pb.WorldtaskBattleStartReq) (code pb.ErrorCode) {
return
}
func (this *apiComp) Battlestart(session comm.IUserSession, req *pb.WorldtaskBattleStartReq) (code pb.ErrorCode, data proto.Message) {
if code = this.BattlestartCheck(session, req); code != pb.ErrorCode_Success {
return
}
battleConf, err := this.module.configure.getWorldtaskBattleById(req.BattleConfId)
if err != nil || battleConf == nil {
code = pb.ErrorCode_ConfigNoFound
log.Errorf("world_battle %v no found", req.BattleConfId)
return
}
iBattle, err := this.module.service.GetModule(comm.ModuleBattle)
if err != nil {
code = pb.ErrorCode_SystemError
return
}
if b, y := iBattle.(comm.IBattle); y {
var (
record *pb.DBBattleRecord
resp *pb.WorldtaskBattleStartResp
)
code, record = b.CreatePveBattle(session, &pb.BattlePVEReq{
Ptype: pb.PlayType_rtask,
Format: &pb.BattleFormation{
Leadpos: req.Leadpos,
Format: req.Teamids,
},
Mformat: battleConf.FormatList,
})
if code != pb.ErrorCode_Success {
return
}
if record != nil {
resp = &pb.WorldtaskBattleStartResp{
Info: &pb.BattleInfo{
Id: record.Id,
Btype: record.Btype,
Ptype: record.Ptype,
RedCompId: record.RedCompId,
Redflist: record.Redflist,
BlueCompId: record.BlueCompId,
Buleflist: record.Buleflist,
},
}
}
if err := session.SendMsg(string(this.module.GetType()), WorldtaskBattleStart, resp); err != nil {
code = pb.ErrorCode_SystemError
}
}
return
}

View File

@ -0,0 +1,79 @@
package worldtask
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
// 任务完成
func (this *apiComp) FinishCheck(session comm.IUserSession, req *pb.WorldtaskFinishReq) (code pb.ErrorCode) {
if req.TaskId == 0 {
code = pb.ErrorCode_ReqParameterError
}
return
}
func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishReq) (code pb.ErrorCode, data proto.Message) {
if code = this.FinishCheck(session, req); code != pb.ErrorCode_Success {
return
}
uid := session.GetUserId()
// 获取用户信息
user := this.module.ModuleUser.GetUser(uid)
if user == nil {
code = pb.ErrorCode_UserSessionNobeing
return
}
// 当前任务配置
curTaskConf, err := this.module.configure.getWorldtaskById(req.TaskId)
if err != nil || curTaskConf == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
rsp := &pb.WorldtaskFinishResp{}
// 判断玩家等级要求
if user.Lv < curTaskConf.Lock {
code = pb.ErrorCode_WorldtaskLvNotEnough
return
}
// 当前玩家世界任务
userTask, err := this.module.modelWorldtask.getWorldtask(uid)
if err != nil {
code = pb.ErrorCode_DBError
return
}
if userTask.Uid == "" {
userTask.Uid = uid
}
// 完成任务
if err := this.module.modelWorldtask.finishTask(req.GroupId, req.TaskId, userTask); err != nil {
code = pb.ErrorCode_WorldtaskFinish
return
}
// 任务完成推送
if err := this.module.SendMsgToUser(string(this.module.GetType()), WorldtaskNexttaskPush, &pb.WorldtaskNexttaskPush{
NextTaskId: curTaskConf.IdAfter,
}, uid); err != nil {
this.module.Errorf("WorldtaskNexttaskPush err:%v", err)
}
// 发奖
if code = this.module.DispenseRes(session, curTaskConf.Reword, true); code != pb.ErrorCode_Success {
this.module.Errorf("资源发放失败 err:%v", err)
}
if err := session.SendMsg(string(this.module.GetType()), WorldtaskSubtypeFinish, rsp); err != nil {
code = pb.ErrorCode_SystemError
}
return
}

View File

@ -0,0 +1,31 @@
package worldtask
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
// 我的世界任务
func (this *apiComp) MineCheck(session comm.IUserSession, req *pb.WorldtaskMineReq) (code pb.ErrorCode) {
return
}
func (this *apiComp) Mine(session comm.IUserSession, req *pb.WorldtaskMineReq) (code pb.ErrorCode, data proto.Message) {
uid := session.GetUserId()
myWorldtask, err := this.module.modelWorldtask.getWorldtask(uid)
if err != nil {
code = pb.ErrorCode_DBError
return
}
rsp := &pb.WorldtaskMineResp{
Task: myWorldtask,
}
if err := session.SendMsg(string(this.module.GetType()), WorldtaskSubtypeMine, rsp); err != nil {
code = pb.ErrorCode_SystemError
}
return
}

View File

@ -1,79 +0,0 @@
package worldtask
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
// 剧情对话
func (this *apiComp) StoryCheck(session comm.IUserSession, req *pb.WorldtaskStoryReq) (code pb.ErrorCode) {
if req.TaskId == 0 {
code = pb.ErrorCode_ReqParameterError
}
return
}
func (this *apiComp) Story(session comm.IUserSession, req *pb.WorldtaskStoryReq) (code pb.ErrorCode, data proto.Message) {
if code = this.StoryCheck(session, req); code != pb.ErrorCode_Success {
return
}
uid := session.GetUserId()
gwtConf, err := this.module.configure.getWorldtaskCfg()
if err != nil || gwtConf == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
// 获取用户信息
user := this.module.ModuleUser.GetUser(uid)
if user == nil {
code = pb.ErrorCode_UserSessionNobeing
return
}
// 当前任务配置
curTaskConf, ok := gwtConf.GetDataMap()[req.TaskId]
if !ok {
code = pb.ErrorCode_ConfigNoFound
return
}
rsp := &pb.WorldtaskStoryResp{}
// 判断玩家等级要求
if user.Lv < curTaskConf.Lock {
code = pb.ErrorCode_WorldtaskLvNotEnough
return
}
// 下一个任务
if curTaskConf.Ontxe == 0 && curTaskConf.AutoAccept == 0 {
rsp.NextTaskId = 0
} else if curTaskConf.Ontxe != 0 && curTaskConf.AutoAccept == 1 {
rsp.NextTaskId = curTaskConf.IdAfter
}
// 当前玩家世界任务
userTask, err := this.module.modelWorldtask.getWorldtask(uid)
if err != nil {
code = pb.ErrorCode_DBError
return
}
if userTask.Uid == "" {
userTask.Uid = uid
}
// 完成任务
if err := this.module.modelWorldtask.finishTask(req.TaskId, userTask); err != nil {
code = pb.ErrorCode_WorldtaskStory
return
}
if err := session.SendMsg(string(this.module.GetType()), WorldtaskSubtypeStory, rsp); err != nil {
code = pb.ErrorCode_SystemError
}
return
}

View File

@ -9,6 +9,7 @@ import (
const ( const (
gameWorldTask = "game_worldtask.json" gameWorldTask = "game_worldtask.json"
gameWorldtaskBattle = "game_worldbattle.json"
) )
type configureComp struct { type configureComp struct {
@ -19,6 +20,7 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
err = this.MCompConfigure.Init(service, module, comp, options) err = this.MCompConfigure.Init(service, module, comp, options)
err = this.LoadMultiConfigure(map[string]interface{}{ err = this.LoadMultiConfigure(map[string]interface{}{
gameWorldTask: cfg.NewGameWorldTask, gameWorldTask: cfg.NewGameWorldTask,
gameWorldtaskBattle: cfg.NewGameWorldBattle,
}) })
return return
} }
@ -38,3 +40,41 @@ func (this *configureComp) getWorldtaskCfg() (data *cfg.GameWorldTask, err error
} }
return return
} }
func (this *configureComp) getWorldtaskById(taskId int32) (*cfg.GameWorldTaskData, error) {
gwt, err := this.getWorldtaskCfg()
if err != nil {
return nil, err
}
if data, ok := gwt.GetDataMap()[taskId]; ok {
return data, nil
}
return nil, fmt.Errorf("GameWorldTask config id:%v not found", taskId)
}
func (this *configureComp) getWorldtaskBattleCfg() (data *cfg.GameWorldBattle, err error) {
var (
v interface{}
ok bool
)
if v, err = this.GetConfigure(gameWorldtaskBattle); err != nil {
return
} else {
if data, ok = v.(*cfg.GameWorldBattle); !ok {
err = fmt.Errorf("%T is *cfg.GameWorldBattle", v)
return
}
}
return
}
func (this *configureComp) getWorldtaskBattleById(confId int32) (*cfg.GameWorldBattleData, error) {
gwt, err := this.getWorldtaskBattleCfg()
if err != nil {
return nil, err
}
if data, ok := gwt.GetDataMap()[confId]; ok {
return data, nil
}
return nil, fmt.Errorf("GameWorldBattleData config id:%v not found", confId)
}

View File

@ -1,6 +1,7 @@
package worldtask package worldtask
import ( import (
"errors"
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
"go_dreamfactory/modules" "go_dreamfactory/modules"
@ -31,23 +32,41 @@ func (this *ModelWorldtask) getWorldtask(uid string) (*pb.DBWorldtask, error) {
return d, nil return d, nil
} }
// 接取任务
func (this *ModelWorldtask) acceptTask(groupId, taskId int32, task *pb.DBWorldtask) error {
if task == nil {
return errors.New("worldtask is nil")
}
return nil
}
// 完成任务 // 完成任务
func (this *ModelWorldtask) finishTask(taskId int32, task *pb.DBWorldtask) error { func (this *ModelWorldtask) finishTask(groupId, taskId int32, task *pb.DBWorldtask) error {
if task == nil {
return errors.New("worldtask is nil")
}
update := map[string]interface{}{}
if task.LastTaskIds == nil {
task.LastTaskIds = make(map[int32]int32)
}
if len(task.TaskList) == 0 { if len(task.TaskList) == 0 {
update["uid"] = task.Uid
task.TaskList = append(task.TaskList, &pb.Worldtask{ task.TaskList = append(task.TaskList, &pb.Worldtask{
TaskId: taskId, TaskId: taskId,
Status: 1, //完成 Status: 1, //完成
}) })
task.LastTaskIds[groupId] = taskId
} else { } else {
for _, v := range task.TaskList { for _, v := range task.TaskList {
if v.TaskId == taskId { if v.TaskId == taskId {
v.Status = 1 //完成 v.Status = 1 //完成
task.LastTaskIds[groupId] = taskId
break
} }
} }
} }
update["taskList"] = task.TaskList
update := map[string]interface{}{ update["lastTaskIds"] = task.LastTaskIds
"taskList": task.TaskList,
}
return this.Change(task.Uid, update) return this.Change(task.Uid, update)
} }

View File

@ -1,12 +1,17 @@
package worldtask package worldtask
import ( import (
"fmt"
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/base" "go_dreamfactory/lego/base"
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/modules" "go_dreamfactory/modules"
"go_dreamfactory/pb"
) )
var _ comm.IWorldtask = (*Worldtask)(nil)
type Worldtask struct { type Worldtask struct {
modules.ModuleBase modules.ModuleBase
api *apiComp api *apiComp
@ -33,3 +38,54 @@ func (this *Worldtask) OnInstallComp() {
func (this *Worldtask) GetType() core.M_Modules { func (this *Worldtask) GetType() core.M_Modules {
return comm.ModuleWorldtask return comm.ModuleWorldtask
} }
// 任务条件达成通知
func (this *Worldtask) TaskcondNotify(uid string, condId int32) error {
//下一个任务ID
var nextTaskId int32
// 获取用户信息
user := this.ModuleUser.GetUser(uid)
if user == nil {
return fmt.Errorf("玩家uid:%v not found", uid)
}
userTask, err := this.modelWorldtask.getWorldtask(uid)
if err != nil {
return err
}
if userTask.Uid != "" {
for _, id := range userTask.LastTaskIds {
taskConf, err := this.configure.getWorldtaskById(id)
if err != nil {
return err
}
if taskConf != nil {
if taskConf.AutoAccept == 1 { //自动截取,返回下一个任务
nextTaskId = taskConf.IdAfter
if nextTaskId == 0 {
this.Debug("已经是最后一个任务了")
return nil
}
nexttaskConf, err := this.configure.getWorldtaskById(nextTaskId)
if err != nil {
return err
}
// 判断玩家等级要求
if user.Lv < nexttaskConf.Lock {
return fmt.Errorf("等级不满足 uid:%v 要求lv:%v", uid, nexttaskConf.Lock)
}
//推送
if err := this.SendMsgToUser(string(this.GetType()), "nexttask", &pb.WorldtaskNexttaskPush{
NextTaskId: nextTaskId,
}, uid); err != nil {
log.Errorf("任务条件达成推送失败 err:%v", err)
}
}
}
}
}
return nil
}

View File

@ -260,8 +260,9 @@ const (
// pay // pay
ErrorCode_PayBuyNumNotEnough ErrorCode = 3701 //支付次数不足 ErrorCode_PayBuyNumNotEnough ErrorCode = 3701 //支付次数不足
// worldtask // worldtask
ErrorCode_WorldtaskStory ErrorCode = 3801 //剧情任务失败 ErrorCode_WorldtaskFinish ErrorCode = 3801 //任务完成失败
ErrorCode_WorldtaskLvNotEnough ErrorCode = 3802 //等级不满足 ErrorCode_WorldtaskLvNotEnough ErrorCode = 3802 //等级不满足
ErrorCode_WorldtaskNoAccept ErrorCode = 3803 //不能接取
) )
// Enum value maps for ErrorCode. // Enum value maps for ErrorCode.
@ -477,8 +478,9 @@ var (
3601: "GrowtaskReceive", 3601: "GrowtaskReceive",
3602: "GrowtaskAdvReceive", 3602: "GrowtaskAdvReceive",
3701: "PayBuyNumNotEnough", 3701: "PayBuyNumNotEnough",
3801: "WorldtaskStory", 3801: "WorldtaskFinish",
3802: "WorldtaskLvNotEnough", 3802: "WorldtaskLvNotEnough",
3803: "WorldtaskNoAccept",
} }
ErrorCode_value = map[string]int32{ ErrorCode_value = map[string]int32{
"Success": 0, "Success": 0,
@ -691,8 +693,9 @@ var (
"GrowtaskReceive": 3601, "GrowtaskReceive": 3601,
"GrowtaskAdvReceive": 3602, "GrowtaskAdvReceive": 3602,
"PayBuyNumNotEnough": 3701, "PayBuyNumNotEnough": 3701,
"WorldtaskStory": 3801, "WorldtaskFinish": 3801,
"WorldtaskLvNotEnough": 3802, "WorldtaskLvNotEnough": 3802,
"WorldtaskNoAccept": 3803,
} }
) )
@ -727,7 +730,7 @@ var File_errorcode_proto protoreflect.FileDescriptor
var file_errorcode_proto_rawDesc = []byte{ var file_errorcode_proto_rawDesc = []byte{
0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x2a, 0xd3, 0x25, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x6f, 0x2a, 0xec, 0x25, 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, 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, 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, 0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
@ -1025,11 +1028,12 @@ var file_errorcode_proto_rawDesc = []byte{
0x76, 0x65, 0x10, 0x91, 0x1c, 0x12, 0x17, 0x0a, 0x12, 0x47, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x76, 0x65, 0x10, 0x91, 0x1c, 0x12, 0x17, 0x0a, 0x12, 0x47, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73,
0x6b, 0x41, 0x64, 0x76, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x10, 0x92, 0x1c, 0x12, 0x17, 0x6b, 0x41, 0x64, 0x76, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x10, 0x92, 0x1c, 0x12, 0x17,
0x0a, 0x12, 0x50, 0x61, 0x79, 0x42, 0x75, 0x79, 0x4e, 0x75, 0x6d, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x0a, 0x12, 0x50, 0x61, 0x79, 0x42, 0x75, 0x79, 0x4e, 0x75, 0x6d, 0x4e, 0x6f, 0x74, 0x45, 0x6e,
0x6f, 0x75, 0x67, 0x68, 0x10, 0xf5, 0x1c, 0x12, 0x13, 0x0a, 0x0e, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xf5, 0x1c, 0x12, 0x14, 0x0a, 0x0f, 0x57, 0x6f, 0x72, 0x6c, 0x64,
0x74, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x6f, 0x72, 0x79, 0x10, 0xd9, 0x1d, 0x12, 0x19, 0x0a, 0x14, 0x74, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x10, 0xd9, 0x1d, 0x12, 0x19, 0x0a,
0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x76, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x14, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x76, 0x4e, 0x6f, 0x74, 0x45,
0x6f, 0x75, 0x67, 0x68, 0x10, 0xda, 0x1d, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xda, 0x1d, 0x12, 0x16, 0x0a, 0x11, 0x57, 0x6f, 0x72, 0x6c,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x10, 0xdb, 0x1d,
0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (

View File

@ -26,7 +26,8 @@ type DBWorldtask struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid" bson:"uid"` //玩家ID Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid" bson:"uid"` //玩家ID
TaskList []*Worldtask `protobuf:"bytes,2,rep,name=taskList,proto3" json:"taskList" bson:"taskList"` // 任务列表 LastTaskIds map[int32]int32 `protobuf:"bytes,2,rep,name=lastTaskIds,proto3" json:"lastTaskIds" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3" bson:"lastTaskId"` //上一次完成的任务 key:groupId val:任务ID
TaskList []*Worldtask `protobuf:"bytes,3,rep,name=taskList,proto3" json:"taskList" bson:"taskList"` // 任务列表
} }
func (x *DBWorldtask) Reset() { func (x *DBWorldtask) Reset() {
@ -68,6 +69,13 @@ func (x *DBWorldtask) GetUid() string {
return "" return ""
} }
func (x *DBWorldtask) GetLastTaskIds() map[int32]int32 {
if x != nil {
return x.LastTaskIds
}
return nil
}
func (x *DBWorldtask) GetTaskList() []*Worldtask { func (x *DBWorldtask) GetTaskList() []*Worldtask {
if x != nil { if x != nil {
return x.TaskList return x.TaskList
@ -134,17 +142,25 @@ var File_worldtask_worldtask_db_proto protoreflect.FileDescriptor
var file_worldtask_worldtask_db_proto_rawDesc = []byte{ var file_worldtask_worldtask_db_proto_rawDesc = []byte{
0x0a, 0x1c, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x77, 0x6f, 0x72, 0x6c, 0x0a, 0x1c, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x77, 0x6f, 0x72, 0x6c,
0x64, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x47, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc8,
0x0a, 0x0b, 0x44, 0x42, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x12, 0x10, 0x0a, 0x01, 0x0a, 0x0b, 0x44, 0x42, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x12, 0x10,
0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64,
0x26, 0x0a, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x12, 0x3f, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x18,
0x0b, 0x32, 0x0a, 0x2e, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x08, 0x74, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x44, 0x42, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74,
0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x3b, 0x0a, 0x09, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x61, 0x73, 0x6b, 0x2e, 0x4c, 0x61, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x45,
0x74, 0x61, 0x73, 0x6b, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x64,
0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x12, 0x26, 0x0a, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20,
0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x52,
0x61, 0x74, 0x75, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x3e, 0x0a, 0x10, 0x4c, 0x61, 0x73,
0x6f, 0x74, 0x6f, 0x33, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a,
0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12,
0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05,
0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x3b, 0x0a, 0x09, 0x57, 0x6f, 0x72,
0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x16,
0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06,
0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -159,18 +175,20 @@ func file_worldtask_worldtask_db_proto_rawDescGZIP() []byte {
return file_worldtask_worldtask_db_proto_rawDescData return file_worldtask_worldtask_db_proto_rawDescData
} }
var file_worldtask_worldtask_db_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_worldtask_worldtask_db_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_worldtask_worldtask_db_proto_goTypes = []interface{}{ var file_worldtask_worldtask_db_proto_goTypes = []interface{}{
(*DBWorldtask)(nil), // 0: DBWorldtask (*DBWorldtask)(nil), // 0: DBWorldtask
(*Worldtask)(nil), // 1: Worldtask (*Worldtask)(nil), // 1: Worldtask
nil, // 2: DBWorldtask.LastTaskIdsEntry
} }
var file_worldtask_worldtask_db_proto_depIdxs = []int32{ var file_worldtask_worldtask_db_proto_depIdxs = []int32{
1, // 0: DBWorldtask.taskList:type_name -> Worldtask 2, // 0: DBWorldtask.lastTaskIds:type_name -> DBWorldtask.LastTaskIdsEntry
1, // [1:1] is the sub-list for method output_type 1, // 1: DBWorldtask.taskList:type_name -> Worldtask
1, // [1:1] is the sub-list for method input_type 2, // [2:2] is the sub-list for method output_type
1, // [1:1] is the sub-list for extension type_name 2, // [2:2] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension extendee 2, // [2:2] is the sub-list for extension type_name
0, // [0:1] is the sub-list for field type_name 2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
} }
func init() { file_worldtask_worldtask_db_proto_init() } func init() { file_worldtask_worldtask_db_proto_init() }
@ -210,7 +228,7 @@ func file_worldtask_worldtask_db_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_worldtask_worldtask_db_proto_rawDesc, RawDescriptor: file_worldtask_worldtask_db_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 2, NumMessages: 3,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },

View File

@ -20,17 +20,15 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
) )
// 剧情对话结束请求 // 我的世界任务
type WorldtaskStoryReq struct { type WorldtaskMineReq struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
TaskId int32 `protobuf:"varint,1,opt,name=taskId,proto3" json:"taskId"` //任务ID
} }
func (x *WorldtaskStoryReq) Reset() { func (x *WorldtaskMineReq) Reset() {
*x = WorldtaskStoryReq{} *x = WorldtaskMineReq{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_worldtask_worldtask_msg_proto_msgTypes[0] mi := &file_worldtask_worldtask_msg_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -38,13 +36,13 @@ func (x *WorldtaskStoryReq) Reset() {
} }
} }
func (x *WorldtaskStoryReq) String() string { func (x *WorldtaskMineReq) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*WorldtaskStoryReq) ProtoMessage() {} func (*WorldtaskMineReq) ProtoMessage() {}
func (x *WorldtaskStoryReq) ProtoReflect() protoreflect.Message { func (x *WorldtaskMineReq) ProtoReflect() protoreflect.Message {
mi := &file_worldtask_worldtask_msg_proto_msgTypes[0] mi := &file_worldtask_worldtask_msg_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -56,43 +54,140 @@ func (x *WorldtaskStoryReq) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use WorldtaskStoryReq.ProtoReflect.Descriptor instead. // Deprecated: Use WorldtaskMineReq.ProtoReflect.Descriptor instead.
func (*WorldtaskStoryReq) Descriptor() ([]byte, []int) { func (*WorldtaskMineReq) Descriptor() ([]byte, []int) {
return file_worldtask_worldtask_msg_proto_rawDescGZIP(), []int{0} return file_worldtask_worldtask_msg_proto_rawDescGZIP(), []int{0}
} }
func (x *WorldtaskStoryReq) GetTaskId() int32 { type WorldtaskMineResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Task *DBWorldtask `protobuf:"bytes,1,opt,name=task,proto3" json:"task"`
}
func (x *WorldtaskMineResp) Reset() {
*x = WorldtaskMineResp{}
if protoimpl.UnsafeEnabled {
mi := &file_worldtask_worldtask_msg_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *WorldtaskMineResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*WorldtaskMineResp) ProtoMessage() {}
func (x *WorldtaskMineResp) ProtoReflect() protoreflect.Message {
mi := &file_worldtask_worldtask_msg_proto_msgTypes[1]
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 WorldtaskMineResp.ProtoReflect.Descriptor instead.
func (*WorldtaskMineResp) Descriptor() ([]byte, []int) {
return file_worldtask_worldtask_msg_proto_rawDescGZIP(), []int{1}
}
func (x *WorldtaskMineResp) GetTask() *DBWorldtask {
if x != nil {
return x.Task
}
return nil
}
// 完成任务
type WorldtaskFinishReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
GroupId int32 `protobuf:"varint,1,opt,name=groupId,proto3" json:"groupId"` //分组ID
TaskId int32 `protobuf:"varint,2,opt,name=taskId,proto3" json:"taskId"` //任务ID
}
func (x *WorldtaskFinishReq) Reset() {
*x = WorldtaskFinishReq{}
if protoimpl.UnsafeEnabled {
mi := &file_worldtask_worldtask_msg_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *WorldtaskFinishReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*WorldtaskFinishReq) ProtoMessage() {}
func (x *WorldtaskFinishReq) ProtoReflect() protoreflect.Message {
mi := &file_worldtask_worldtask_msg_proto_msgTypes[2]
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 WorldtaskFinishReq.ProtoReflect.Descriptor instead.
func (*WorldtaskFinishReq) Descriptor() ([]byte, []int) {
return file_worldtask_worldtask_msg_proto_rawDescGZIP(), []int{2}
}
func (x *WorldtaskFinishReq) GetGroupId() int32 {
if x != nil {
return x.GroupId
}
return 0
}
func (x *WorldtaskFinishReq) GetTaskId() int32 {
if x != nil { if x != nil {
return x.TaskId return x.TaskId
} }
return 0 return 0
} }
type WorldtaskStoryResp struct { type WorldtaskFinishResp struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
NextTaskId int32 `protobuf:"varint,1,opt,name=nextTaskId,proto3" json:"nextTaskId"` //任务ID GroupId int32 `protobuf:"varint,1,opt,name=groupId,proto3" json:"groupId"`
TaskId int32 `protobuf:"varint,2,opt,name=taskId,proto3" json:"taskId"`
} }
func (x *WorldtaskStoryResp) Reset() { func (x *WorldtaskFinishResp) Reset() {
*x = WorldtaskStoryResp{} *x = WorldtaskFinishResp{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_worldtask_worldtask_msg_proto_msgTypes[1] mi := &file_worldtask_worldtask_msg_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
} }
func (x *WorldtaskStoryResp) String() string { func (x *WorldtaskFinishResp) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*WorldtaskStoryResp) ProtoMessage() {} func (*WorldtaskFinishResp) ProtoMessage() {}
func (x *WorldtaskStoryResp) ProtoReflect() protoreflect.Message { func (x *WorldtaskFinishResp) ProtoReflect() protoreflect.Message {
mi := &file_worldtask_worldtask_msg_proto_msgTypes[1] mi := &file_worldtask_worldtask_msg_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -103,33 +198,198 @@ func (x *WorldtaskStoryResp) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use WorldtaskStoryResp.ProtoReflect.Descriptor instead. // Deprecated: Use WorldtaskFinishResp.ProtoReflect.Descriptor instead.
func (*WorldtaskStoryResp) Descriptor() ([]byte, []int) { func (*WorldtaskFinishResp) Descriptor() ([]byte, []int) {
return file_worldtask_worldtask_msg_proto_rawDescGZIP(), []int{1} return file_worldtask_worldtask_msg_proto_rawDescGZIP(), []int{3}
} }
func (x *WorldtaskStoryResp) GetNextTaskId() int32 { func (x *WorldtaskFinishResp) GetGroupId() int32 {
if x != nil {
return x.GroupId
}
return 0
}
func (x *WorldtaskFinishResp) GetTaskId() int32 {
if x != nil {
return x.TaskId
}
return 0
}
//任务完成条件达成的推送
type WorldtaskNexttaskPush struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
NextTaskId int32 `protobuf:"varint,1,opt,name=nextTaskId,proto3" json:"nextTaskId"` //下一个任务ID
}
func (x *WorldtaskNexttaskPush) Reset() {
*x = WorldtaskNexttaskPush{}
if protoimpl.UnsafeEnabled {
mi := &file_worldtask_worldtask_msg_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *WorldtaskNexttaskPush) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*WorldtaskNexttaskPush) ProtoMessage() {}
func (x *WorldtaskNexttaskPush) ProtoReflect() protoreflect.Message {
mi := &file_worldtask_worldtask_msg_proto_msgTypes[4]
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 WorldtaskNexttaskPush.ProtoReflect.Descriptor instead.
func (*WorldtaskNexttaskPush) Descriptor() ([]byte, []int) {
return file_worldtask_worldtask_msg_proto_rawDescGZIP(), []int{4}
}
func (x *WorldtaskNexttaskPush) GetNextTaskId() int32 {
if x != nil { if x != nil {
return x.NextTaskId return x.NextTaskId
} }
return 0 return 0
} }
// 开始战斗
type WorldtaskBattleStartReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
BattleConfId int32 `protobuf:"varint,1,opt,name=battleConfId,proto3" json:"battleConfId"` //战斗配表ID
Leadpos int32 `protobuf:"varint,2,opt,name=leadpos,proto3" json:"leadpos"` //队长位置
Teamids []string `protobuf:"bytes,3,rep,name=teamids,proto3" json:"teamids"` //阵容信息
}
func (x *WorldtaskBattleStartReq) Reset() {
*x = WorldtaskBattleStartReq{}
if protoimpl.UnsafeEnabled {
mi := &file_worldtask_worldtask_msg_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *WorldtaskBattleStartReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*WorldtaskBattleStartReq) ProtoMessage() {}
func (x *WorldtaskBattleStartReq) ProtoReflect() protoreflect.Message {
mi := &file_worldtask_worldtask_msg_proto_msgTypes[5]
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 WorldtaskBattleStartReq.ProtoReflect.Descriptor instead.
func (*WorldtaskBattleStartReq) Descriptor() ([]byte, []int) {
return file_worldtask_worldtask_msg_proto_rawDescGZIP(), []int{5}
}
func (x *WorldtaskBattleStartReq) GetBattleConfId() int32 {
if x != nil {
return x.BattleConfId
}
return 0
}
func (x *WorldtaskBattleStartReq) GetLeadpos() int32 {
if x != nil {
return x.Leadpos
}
return 0
}
func (x *WorldtaskBattleStartReq) GetTeamids() []string {
if x != nil {
return x.Teamids
}
return nil
}
type WorldtaskBattleStartResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Info *BattleInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info"` //战斗信息
}
func (x *WorldtaskBattleStartResp) Reset() {
*x = WorldtaskBattleStartResp{}
if protoimpl.UnsafeEnabled {
mi := &file_worldtask_worldtask_msg_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *WorldtaskBattleStartResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*WorldtaskBattleStartResp) ProtoMessage() {}
func (x *WorldtaskBattleStartResp) ProtoReflect() protoreflect.Message {
mi := &file_worldtask_worldtask_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 WorldtaskBattleStartResp.ProtoReflect.Descriptor instead.
func (*WorldtaskBattleStartResp) Descriptor() ([]byte, []int) {
return file_worldtask_worldtask_msg_proto_rawDescGZIP(), []int{6}
}
func (x *WorldtaskBattleStartResp) GetInfo() *BattleInfo {
if x != nil {
return x.Info
}
return nil
}
// 战斗完成 // 战斗完成
type WorldtaskBattleFinishReq struct { type WorldtaskBattleFinishReq struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
RtaskId int32 `protobuf:"varint,1,opt,name=rtaskId,proto3" json:"rtaskId"` //任务ID TaskId int32 `protobuf:"varint,1,opt,name=taskId,proto3" json:"taskId"` //任务ID
RtaskSubId int32 `protobuf:"varint,2,opt,name=rtaskSubId,proto3" json:"rtaskSubId"` //支线任务ID Report *BattleReport `protobuf:"bytes,2,opt,name=report,proto3" json:"report"` //战报
ChooseId int32 `protobuf:"varint,3,opt,name=chooseId,proto3" json:"chooseId"` //选项配置ID
} }
func (x *WorldtaskBattleFinishReq) Reset() { func (x *WorldtaskBattleFinishReq) Reset() {
*x = WorldtaskBattleFinishReq{} *x = WorldtaskBattleFinishReq{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_worldtask_worldtask_msg_proto_msgTypes[2] mi := &file_worldtask_worldtask_msg_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -142,7 +402,7 @@ func (x *WorldtaskBattleFinishReq) String() string {
func (*WorldtaskBattleFinishReq) ProtoMessage() {} func (*WorldtaskBattleFinishReq) ProtoMessage() {}
func (x *WorldtaskBattleFinishReq) ProtoReflect() protoreflect.Message { func (x *WorldtaskBattleFinishReq) ProtoReflect() protoreflect.Message {
mi := &file_worldtask_worldtask_msg_proto_msgTypes[2] mi := &file_worldtask_worldtask_msg_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -155,28 +415,21 @@ func (x *WorldtaskBattleFinishReq) ProtoReflect() protoreflect.Message {
// Deprecated: Use WorldtaskBattleFinishReq.ProtoReflect.Descriptor instead. // Deprecated: Use WorldtaskBattleFinishReq.ProtoReflect.Descriptor instead.
func (*WorldtaskBattleFinishReq) Descriptor() ([]byte, []int) { func (*WorldtaskBattleFinishReq) Descriptor() ([]byte, []int) {
return file_worldtask_worldtask_msg_proto_rawDescGZIP(), []int{2} return file_worldtask_worldtask_msg_proto_rawDescGZIP(), []int{7}
} }
func (x *WorldtaskBattleFinishReq) GetRtaskId() int32 { func (x *WorldtaskBattleFinishReq) GetTaskId() int32 {
if x != nil { if x != nil {
return x.RtaskId return x.TaskId
} }
return 0 return 0
} }
func (x *WorldtaskBattleFinishReq) GetRtaskSubId() int32 { func (x *WorldtaskBattleFinishReq) GetReport() *BattleReport {
if x != nil { if x != nil {
return x.RtaskSubId return x.Report
} }
return 0 return nil
}
func (x *WorldtaskBattleFinishReq) GetChooseId() int32 {
if x != nil {
return x.ChooseId
}
return 0
} }
type WorldtaskBattleFinishResp struct { type WorldtaskBattleFinishResp struct {
@ -184,14 +437,13 @@ type WorldtaskBattleFinishResp struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
RtaskId int32 `protobuf:"varint,1,opt,name=rtaskId,proto3" json:"rtaskId"` //任务ID TaskId int32 `protobuf:"varint,1,opt,name=taskId,proto3" json:"taskId"` //任务ID
RtaskSubId int32 `protobuf:"varint,2,opt,name=rtaskSubId,proto3" json:"rtaskSubId"` //支线任务ID
} }
func (x *WorldtaskBattleFinishResp) Reset() { func (x *WorldtaskBattleFinishResp) Reset() {
*x = WorldtaskBattleFinishResp{} *x = WorldtaskBattleFinishResp{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_worldtask_worldtask_msg_proto_msgTypes[3] mi := &file_worldtask_worldtask_msg_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -204,7 +456,7 @@ func (x *WorldtaskBattleFinishResp) String() string {
func (*WorldtaskBattleFinishResp) ProtoMessage() {} func (*WorldtaskBattleFinishResp) ProtoMessage() {}
func (x *WorldtaskBattleFinishResp) ProtoReflect() protoreflect.Message { func (x *WorldtaskBattleFinishResp) ProtoReflect() protoreflect.Message {
mi := &file_worldtask_worldtask_msg_proto_msgTypes[3] mi := &file_worldtask_worldtask_msg_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -217,19 +469,12 @@ func (x *WorldtaskBattleFinishResp) ProtoReflect() protoreflect.Message {
// Deprecated: Use WorldtaskBattleFinishResp.ProtoReflect.Descriptor instead. // Deprecated: Use WorldtaskBattleFinishResp.ProtoReflect.Descriptor instead.
func (*WorldtaskBattleFinishResp) Descriptor() ([]byte, []int) { func (*WorldtaskBattleFinishResp) Descriptor() ([]byte, []int) {
return file_worldtask_worldtask_msg_proto_rawDescGZIP(), []int{3} return file_worldtask_worldtask_msg_proto_rawDescGZIP(), []int{8}
} }
func (x *WorldtaskBattleFinishResp) GetRtaskId() int32 { func (x *WorldtaskBattleFinishResp) GetTaskId() int32 {
if x != nil { if x != nil {
return x.RtaskId return x.TaskId
}
return 0
}
func (x *WorldtaskBattleFinishResp) GetRtaskSubId() int32 {
if x != nil {
return x.RtaskSubId
} }
return 0 return 0
} }
@ -238,26 +483,48 @@ var File_worldtask_worldtask_msg_proto protoreflect.FileDescriptor
var file_worldtask_worldtask_msg_proto_rawDesc = []byte{ var file_worldtask_worldtask_msg_proto_rawDesc = []byte{
0x0a, 0x1d, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x77, 0x6f, 0x72, 0x6c, 0x0a, 0x1d, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x77, 0x6f, 0x72, 0x6c,
0x64, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x2b, 0x0a, 0x11, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x6f, 0x72, 0x17, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x2f, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x5f, 0x6d,
0x79, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x74,
0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x34, 0x0a, 0x12, 0x61, 0x73, 0x6b, 0x2f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x64, 0x62,
0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x12, 0x0a, 0x10, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74,
0x73, 0x70, 0x12, 0x1e, 0x0a, 0x0a, 0x6e, 0x65, 0x78, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x61, 0x73, 0x6b, 0x4d, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x22, 0x35, 0x0a, 0x11, 0x57, 0x6f,
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6e, 0x65, 0x78, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x4d, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12,
0x49, 0x64, 0x22, 0x70, 0x0a, 0x18, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x20, 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e,
0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x12, 0x18, 0x44, 0x42, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x04, 0x74, 0x61, 0x73,
0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x6b, 0x22, 0x46, 0x0a, 0x12, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x46, 0x69,
0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70,
0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49,
0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x6f, 0x6f, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
0x73, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x68, 0x6f, 0x6f, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x47, 0x0a, 0x13, 0x57, 0x6f, 0x72,
0x73, 0x65, 0x49, 0x64, 0x22, 0x55, 0x0a, 0x19, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70,
0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x70, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x05, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61,
0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b,
0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x49, 0x64, 0x22, 0x37, 0x0a, 0x15, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x4e,
0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x65, 0x78, 0x74, 0x74, 0x61, 0x73, 0x6b, 0x50, 0x75, 0x73, 0x68, 0x12, 0x1e, 0x0a, 0x0a, 0x6e,
0x65, 0x78, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x0a, 0x6e, 0x65, 0x78, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x71, 0x0a, 0x17, 0x57,
0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74,
0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x12, 0x22, 0x0a, 0x0c, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65,
0x43, 0x6f, 0x6e, 0x66, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x62, 0x61,
0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x65,
0x61, 0x64, 0x70, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x65, 0x61,
0x64, 0x70, 0x6f, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x69, 0x64, 0x73, 0x18,
0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x69, 0x64, 0x73, 0x22, 0x3b,
0x0a, 0x18, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c,
0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e,
0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c,
0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x59, 0x0a, 0x18, 0x57,
0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x69,
0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 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, 0x33, 0x0a, 0x19, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74,
0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52,
0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e,
0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
@ -273,19 +540,30 @@ func file_worldtask_worldtask_msg_proto_rawDescGZIP() []byte {
return file_worldtask_worldtask_msg_proto_rawDescData return file_worldtask_worldtask_msg_proto_rawDescData
} }
var file_worldtask_worldtask_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_worldtask_worldtask_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
var file_worldtask_worldtask_msg_proto_goTypes = []interface{}{ var file_worldtask_worldtask_msg_proto_goTypes = []interface{}{
(*WorldtaskStoryReq)(nil), // 0: WorldtaskStoryReq (*WorldtaskMineReq)(nil), // 0: WorldtaskMineReq
(*WorldtaskStoryResp)(nil), // 1: WorldtaskStoryResp (*WorldtaskMineResp)(nil), // 1: WorldtaskMineResp
(*WorldtaskBattleFinishReq)(nil), // 2: WorldtaskBattleFinishReq (*WorldtaskFinishReq)(nil), // 2: WorldtaskFinishReq
(*WorldtaskBattleFinishResp)(nil), // 3: WorldtaskBattleFinishResp (*WorldtaskFinishResp)(nil), // 3: WorldtaskFinishResp
(*WorldtaskNexttaskPush)(nil), // 4: WorldtaskNexttaskPush
(*WorldtaskBattleStartReq)(nil), // 5: WorldtaskBattleStartReq
(*WorldtaskBattleStartResp)(nil), // 6: WorldtaskBattleStartResp
(*WorldtaskBattleFinishReq)(nil), // 7: WorldtaskBattleFinishReq
(*WorldtaskBattleFinishResp)(nil), // 8: WorldtaskBattleFinishResp
(*DBWorldtask)(nil), // 9: DBWorldtask
(*BattleInfo)(nil), // 10: BattleInfo
(*BattleReport)(nil), // 11: BattleReport
} }
var file_worldtask_worldtask_msg_proto_depIdxs = []int32{ var file_worldtask_worldtask_msg_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type 9, // 0: WorldtaskMineResp.task:type_name -> DBWorldtask
0, // [0:0] is the sub-list for method input_type 10, // 1: WorldtaskBattleStartResp.info:type_name -> BattleInfo
0, // [0:0] is the sub-list for extension type_name 11, // 2: WorldtaskBattleFinishReq.report:type_name -> BattleReport
0, // [0:0] is the sub-list for extension extendee 3, // [3:3] is the sub-list for method output_type
0, // [0:0] is the sub-list for field type_name 3, // [3:3] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
} }
func init() { file_worldtask_worldtask_msg_proto_init() } func init() { file_worldtask_worldtask_msg_proto_init() }
@ -293,9 +571,11 @@ func file_worldtask_worldtask_msg_proto_init() {
if File_worldtask_worldtask_msg_proto != nil { if File_worldtask_worldtask_msg_proto != nil {
return return
} }
file_battle_battle_msg_proto_init()
file_worldtask_worldtask_db_proto_init()
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_worldtask_worldtask_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_worldtask_worldtask_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*WorldtaskStoryReq); i { switch v := v.(*WorldtaskMineReq); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -307,7 +587,7 @@ func file_worldtask_worldtask_msg_proto_init() {
} }
} }
file_worldtask_worldtask_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_worldtask_worldtask_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*WorldtaskStoryResp); i { switch v := v.(*WorldtaskMineResp); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -319,7 +599,7 @@ func file_worldtask_worldtask_msg_proto_init() {
} }
} }
file_worldtask_worldtask_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { file_worldtask_worldtask_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*WorldtaskBattleFinishReq); i { switch v := v.(*WorldtaskFinishReq); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -331,6 +611,66 @@ func file_worldtask_worldtask_msg_proto_init() {
} }
} }
file_worldtask_worldtask_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { file_worldtask_worldtask_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*WorldtaskFinishResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_worldtask_worldtask_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*WorldtaskNexttaskPush); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_worldtask_worldtask_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*WorldtaskBattleStartReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_worldtask_worldtask_msg_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*WorldtaskBattleStartResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_worldtask_worldtask_msg_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*WorldtaskBattleFinishReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_worldtask_worldtask_msg_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*WorldtaskBattleFinishResp); i { switch v := v.(*WorldtaskBattleFinishResp); i {
case 0: case 0:
return &v.state return &v.state
@ -349,7 +689,7 @@ func file_worldtask_worldtask_msg_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_worldtask_worldtask_msg_proto_rawDesc, RawDescriptor: file_worldtask_worldtask_msg_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 4, NumMessages: 9,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },

View File

@ -0,0 +1,42 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
type GameWorldBattle struct {
_dataMap map[int32]*GameWorldBattleData
_dataList []*GameWorldBattleData
}
func NewGameWorldBattle(_buf []map[string]interface{}) (*GameWorldBattle, error) {
_dataList := make([]*GameWorldBattleData, 0, len(_buf))
dataMap := make(map[int32]*GameWorldBattleData)
for _, _ele_ := range _buf {
if _v, err2 := DeserializeGameWorldBattleData(_ele_); err2 != nil {
return nil, err2
} else {
_dataList = append(_dataList, _v)
dataMap[_v.Id] = _v
}
}
return &GameWorldBattle{_dataList:_dataList, _dataMap:dataMap}, nil
}
func (table *GameWorldBattle) GetDataMap() map[int32]*GameWorldBattleData {
return table._dataMap
}
func (table *GameWorldBattle) GetDataList() []*GameWorldBattleData {
return table._dataList
}
func (table *GameWorldBattle) Get(key int32) *GameWorldBattleData {
return table._dataMap[key]
}

View File

@ -0,0 +1,52 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
import "errors"
type GameWorldBattleData struct {
Id int32
FormatList []int32
CaptainId string
}
const TypeId_GameWorldBattleData = 1096332216
func (*GameWorldBattleData) GetTypeId() int32 {
return 1096332216
}
func (_v *GameWorldBattleData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = 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_)
}
}
{ var _ok_ bool; if _v.CaptainId, _ok_ = _buf["captainId"].(string); !_ok_ { err = errors.New("captainId error"); return } }
return
}
func DeserializeGameWorldBattleData(_buf map[string]interface{}) (*GameWorldBattleData, error) {
v := &GameWorldBattleData{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
return nil, err
}
}

View File

@ -15,11 +15,12 @@ type GameWorldTaskData struct {
Lock int32 Lock int32
Ontxe int32 Ontxe int32
IdAfter int32 IdAfter int32
Group int32
Des int32 Des int32
Icon string Icon string
TaskName string TaskName string
TaskDisplay string TaskDisplay string
Npc string Npc []string
GetafterEvent []string GetafterEvent []string
Completetask int32 Completetask int32
AutoAccept int32 AutoAccept int32
@ -38,11 +39,25 @@ func (_v *GameWorldTaskData)Deserialize(_buf map[string]interface{}) (err error)
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["lock"].(float64); !_ok_ { err = errors.New("lock error"); return }; _v.Lock = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["lock"].(float64); !_ok_ { err = errors.New("lock error"); return }; _v.Lock = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["ontxe"].(float64); !_ok_ { err = errors.New("ontxe error"); return }; _v.Ontxe = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["ontxe"].(float64); !_ok_ { err = errors.New("ontxe error"); return }; _v.Ontxe = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id_after"].(float64); !_ok_ { err = errors.New("id_after error"); return }; _v.IdAfter = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id_after"].(float64); !_ok_ { err = errors.New("id_after error"); return }; _v.IdAfter = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["group"].(float64); !_ok_ { err = errors.New("group error"); return }; _v.Group = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["des"].(float64); !_ok_ { err = errors.New("des error"); return }; _v.Des = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["des"].(float64); !_ok_ { err = errors.New("des error"); return }; _v.Des = int32(_tempNum_) }
{ var _ok_ bool; if _v.Icon, _ok_ = _buf["icon"].(string); !_ok_ { err = errors.New("icon error"); return } } { var _ok_ bool; if _v.Icon, _ok_ = _buf["icon"].(string); !_ok_ { err = errors.New("icon error"); return } }
{ var _ok_ bool; if _v.TaskName, _ok_ = _buf["task_name"].(string); !_ok_ { err = errors.New("task_name error"); return } } { var _ok_ bool; if _v.TaskName, _ok_ = _buf["task_name"].(string); !_ok_ { err = errors.New("task_name error"); return } }
{ var _ok_ bool; if _v.TaskDisplay, _ok_ = _buf["task_display"].(string); !_ok_ { err = errors.New("task_display error"); return } } { var _ok_ bool; if _v.TaskDisplay, _ok_ = _buf["task_display"].(string); !_ok_ { err = errors.New("task_display error"); return } }
{ var _ok_ bool; if _v.Npc, _ok_ = _buf["npc"].(string); !_ok_ { err = errors.New("npc error"); return } } {
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["npc"].([]interface{}); !_ok_ { err = errors.New("npc error"); return }
_v.Npc = make([]string, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ string
{ if _list_v_, _ok_ = _e_.(string); !_ok_ { err = errors.New("_list_v_ error"); return } }
_v.Npc = append(_v.Npc, _list_v_)
}
}
{ {
var _arr_ []interface{} var _arr_ []interface{}
var _ok_ bool var _ok_ bool