世界任务
This commit is contained in:
parent
c7617c4a96
commit
de8ca6e90a
File diff suppressed because it is too large
Load Diff
@ -32,6 +32,7 @@ func (this *WorldtaskMineView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
this.itemList.ItemList = this.itemList.CreateList()
|
||||
|
||||
this.mineReq = func() {
|
||||
this.itemList.Reset()
|
||||
if err := service.GetPttService().SendToClient(
|
||||
t.MainType,
|
||||
worldtask.WorldtaskSubtypeMine,
|
||||
@ -71,14 +72,45 @@ func (this *WorldtaskMineView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
logrus.Error(err)
|
||||
}
|
||||
dconf.Hide()
|
||||
this.mineReq()
|
||||
// this.mineReq()
|
||||
}
|
||||
form.SubmitText = "确定"
|
||||
dconf.Resize(fyne.NewSize(400, 200))
|
||||
dconf.Show()
|
||||
})
|
||||
|
||||
barBtn := container.NewHBox(refreshBtn, this.juqingBtn)
|
||||
// 战斗完成
|
||||
battleBtn := widget.NewButton("战斗完成", func() {
|
||||
confId := widget.NewEntry()
|
||||
confId.PlaceHolder = "战斗配置ID"
|
||||
taskIdEntry := widget.NewEntry()
|
||||
taskIdEntry.PlaceHolder = "任务ID"
|
||||
form := widget.NewForm(
|
||||
widget.NewFormItem("战斗配置ID", confId),
|
||||
widget.NewFormItem("任务ID", taskIdEntry),
|
||||
)
|
||||
|
||||
dconf := dialog.NewCustom("接取任务", "关闭", form, this.w)
|
||||
|
||||
form.OnSubmit = func() {
|
||||
if err := service.GetPttService().SendToClient(
|
||||
t.MainType,
|
||||
worldtask.WorldtaskBattleFinish,
|
||||
&pb.WorldtaskBattleFinishReq{
|
||||
BattleConfId: cast.ToInt32(confId.Text),
|
||||
TaskId: cast.ToInt32(taskIdEntry.Text),
|
||||
Report: &pb.BattleReport{},
|
||||
}); 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, battleBtn)
|
||||
|
||||
c := container.NewBorder(barBtn, nil, nil, nil, this.itemList.ItemList)
|
||||
this.mineData()
|
||||
|
@ -397,8 +397,7 @@ const (
|
||||
Rtype68 TaskType = 68 //任意渠道消耗xx金币
|
||||
Rtype69 TaskType = 69 //与其他玩家切磋xx次
|
||||
Rtype70 TaskType = 70 //通关世界任务XX关卡
|
||||
Rtype71 TaskType = 71 //主角等级达到X级
|
||||
Rtype72 TaskType = 72 //完成一次捏人
|
||||
Rtype71 TaskType = 71 //完成一次捏人
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -253,6 +253,8 @@ type (
|
||||
// 世界任务
|
||||
IWorldtask interface {
|
||||
// 任务条件达成通知
|
||||
TaskcondNotify(uid string, condId int32) error
|
||||
TaskcondNotify(session IUserSession, condId int32) error
|
||||
// bingo任务
|
||||
BingoJumpTask(session IUserSession, groupId, rtaskId int32) error
|
||||
}
|
||||
)
|
||||
|
@ -165,7 +165,7 @@ func (this *ModuleRtask) initRtaskVerifyHandle() {
|
||||
comm.Rtype26, comm.Rtype27, comm.Rtype28, comm.Rtype38,
|
||||
comm.Rtype39, comm.Rtype50, comm.Rtype51, comm.Rtype53,
|
||||
comm.Rtype54, comm.Rtype57, comm.Rtype58, comm.Rtype60,
|
||||
comm.Rtype62, comm.Rtype64, comm.Rtype69, comm.Rtype72:
|
||||
comm.Rtype62, comm.Rtype64, comm.Rtype69, comm.Rtype71:
|
||||
this.registerVerifyHandle(v.Id, &rtaskCondi{
|
||||
cfg: typeCfg,
|
||||
find: this.modelRtaskRecord.lessEqualFirstParam,
|
||||
@ -286,7 +286,7 @@ func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.T
|
||||
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 {
|
||||
if err := worldtask.TaskcondNotify(session, v.cfg.Id); err != nil {
|
||||
log.Errorf("任务条件达成通知 失败 err:%v", err)
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// 战斗结束的请求
|
||||
func (this *apiComp) BattlefinishCheck(session comm.IUserSession, req *pb.WorldtaskBattleFinishReq) (code pb.ErrorCode) {
|
||||
if req.TaskId == 0 || req.Report == nil {
|
||||
if req.BattleConfId == 0 || req.TaskId == 0 || req.Report == nil {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
}
|
||||
return
|
||||
@ -40,7 +40,7 @@ func (this *apiComp) Battlefinish(session comm.IUserSession, req *pb.WorldtaskBa
|
||||
// var isWin bool
|
||||
if code, _ = ibattle.CheckBattleReport(session, req.Report); code == pb.ErrorCode_Success {
|
||||
//触发任务
|
||||
this.module.ModuleRtask.SendToRtask(session, comm.Rtype70, 1, taskConf.Completetask)
|
||||
go this.module.ModuleRtask.SendToRtask(session, comm.Rtype70, 1, req.BattleConfId)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,11 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
rsp := &pb.WorldtaskFinishResp{}
|
||||
|
||||
if curTaskConf.Group != req.GroupId {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
return
|
||||
}
|
||||
|
||||
// 判断玩家等级要求
|
||||
if user.Lv < curTaskConf.Lock {
|
||||
@ -54,9 +58,14 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe
|
||||
userTask.Uid = uid
|
||||
}
|
||||
|
||||
// 前置任务ID
|
||||
if !this.module.modelWorldtask.IsPreFinished(userTask, curTaskConf) {
|
||||
code = pb.ErrorCode_WorldtaskLastUnFinished
|
||||
return
|
||||
}
|
||||
|
||||
//判断任务是否已完成
|
||||
for _, t := range userTask.TaskList {
|
||||
// TODO 上个任务是否完成
|
||||
if t.TaskId == req.TaskId && t.Status == 1 {
|
||||
code = pb.ErrorCode_WorldtaskFinihed
|
||||
return
|
||||
@ -66,6 +75,7 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe
|
||||
if curTaskConf.Completetask != 0 {
|
||||
if code = this.module.ModuleRtask.CheckCondi(uid, curTaskConf.Completetask); code != pb.ErrorCode_Success {
|
||||
code = pb.ErrorCode_WorldtaskNoComplete
|
||||
this.module.Debugf("任务条件:%v 未完成", curTaskConf.Completetask)
|
||||
return
|
||||
}
|
||||
}
|
||||
@ -76,20 +86,26 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe
|
||||
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)
|
||||
}
|
||||
|
||||
rsp := &pb.WorldtaskFinishResp{
|
||||
GroupId: req.GroupId,
|
||||
TaskId: req.TaskId,
|
||||
}
|
||||
|
||||
if err := session.SendMsg(string(this.module.GetType()), WorldtaskSubtypeFinish, rsp); err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
}
|
||||
|
||||
// 任务完成推送
|
||||
if err := session.SendMsg(string(this.module.GetType()), WorldtaskNexttaskPush, &pb.WorldtaskNexttaskPush{
|
||||
NextTaskId: curTaskConf.IdAfter,
|
||||
}); err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import (
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
)
|
||||
@ -13,15 +14,18 @@ import (
|
||||
type ModelWorldtask struct {
|
||||
modules.MCompModel
|
||||
moduleWorldtask *Worldtask
|
||||
service core.IService
|
||||
}
|
||||
|
||||
func (this *ModelWorldtask) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
err = this.MCompModel.Init(service, module, comp, options)
|
||||
this.TableName = comm.TableWorldtask
|
||||
this.moduleWorldtask = module.(*Worldtask)
|
||||
this.service = service
|
||||
return
|
||||
}
|
||||
|
||||
// 获取玩家世界任务
|
||||
func (this *ModelWorldtask) getWorldtask(uid string) (*pb.DBWorldtask, error) {
|
||||
d := &pb.DBWorldtask{}
|
||||
if err := this.Get(uid, d); err != nil {
|
||||
@ -32,13 +36,25 @@ func (this *ModelWorldtask) getWorldtask(uid string) (*pb.DBWorldtask, error) {
|
||||
return d, nil
|
||||
}
|
||||
|
||||
// 接取任务
|
||||
func (this *ModelWorldtask) acceptTask(groupId, taskId int32, task *pb.DBWorldtask) error {
|
||||
if task == nil {
|
||||
return errors.New("worldtask is nil")
|
||||
//判断前置任务是否完成
|
||||
func(this *ModelWorldtask) IsPreFinished(userTask *pb.DBWorldtask, curTaskConf *cfg.GameWorldTaskData)bool{
|
||||
var (
|
||||
lastTaskId int32
|
||||
preTaskFinished bool
|
||||
)
|
||||
if curTaskConf.Ontxe == 0 {
|
||||
preTaskFinished = true
|
||||
} else {
|
||||
lastTaskId = curTaskConf.Ontxe
|
||||
}
|
||||
|
||||
return nil
|
||||
for _, t := range userTask.TaskList {
|
||||
if lastTaskId == t.TaskId && t.Status == 1 {
|
||||
preTaskFinished = true
|
||||
}
|
||||
}
|
||||
|
||||
return preTaskFinished
|
||||
}
|
||||
|
||||
// 完成任务
|
||||
@ -57,7 +73,7 @@ func (this *ModelWorldtask) finishTask(groupId, taskId int32, task *pb.DBWorldta
|
||||
Status: 1, //完成
|
||||
})
|
||||
task.LastTaskIds[groupId] = taskId
|
||||
|
||||
|
||||
update["taskList"] = task.TaskList
|
||||
update["lastTaskIds"] = task.LastTaskIds
|
||||
return this.Change(task.Uid, update)
|
||||
|
@ -25,6 +25,7 @@ func NewModule() core.IModule {
|
||||
}
|
||||
func (this *Worldtask) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
||||
err = this.ModuleBase.Init(service, module, options)
|
||||
this.service = service.(base.IRPCXService)
|
||||
return
|
||||
}
|
||||
|
||||
@ -40,7 +41,8 @@ func (this *Worldtask) GetType() core.M_Modules {
|
||||
}
|
||||
|
||||
// 任务条件达成通知
|
||||
func (this *Worldtask) TaskcondNotify(uid string, condId int32) error {
|
||||
func (this *Worldtask) TaskcondNotify(session comm.IUserSession, condId int32) error {
|
||||
uid := session.GetUserId()
|
||||
//下一个任务ID
|
||||
var nextTaskId int32
|
||||
// 获取用户信息
|
||||
@ -49,38 +51,65 @@ func (this *Worldtask) TaskcondNotify(uid string, condId int32) error {
|
||||
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 {
|
||||
//查找任务ID根据condId 可能会找出不同的任务
|
||||
// 遍历配置表
|
||||
conf, err := this.configure.getWorldtaskCfg()
|
||||
if err != nil || conf == nil {
|
||||
return err
|
||||
}
|
||||
|
||||
finishedTaskIds := make(map[int32]int32) //达成的任务条件
|
||||
for _, c := range conf.GetDataList() {
|
||||
if c.Completetask == condId && c.Completetask != 0 {
|
||||
finishedTaskIds[c.Group] = c.Key
|
||||
}
|
||||
}
|
||||
|
||||
for k, id := range finishedTaskIds {
|
||||
taskConf, err := this.configure.getWorldtaskById(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if taskConf != nil {
|
||||
if !this.modelWorldtask.IsPreFinished(userTask, taskConf) {
|
||||
return nil
|
||||
}
|
||||
if taskConf.AutoAccept == 1 { //自动截取,返回下一个任务
|
||||
nextTaskId = taskConf.IdAfter
|
||||
if nextTaskId == 0 {
|
||||
this.Debug("已经是最后一个任务了")
|
||||
return nil
|
||||
|
||||
// 判断玩家等级要求
|
||||
if user.Lv < taskConf.Lock {
|
||||
return fmt.Errorf("等级不满足 uid:%v 要求lv:%v", uid, taskConf.Lock)
|
||||
}
|
||||
nexttaskConf, err := this.configure.getWorldtaskById(nextTaskId)
|
||||
if err != nil {
|
||||
|
||||
//完成任务
|
||||
if err := this.modelWorldtask.finishTask(k, id, userTask); err != nil {
|
||||
this.Errorf("世界任务完成失败 err:%v", err)
|
||||
return err
|
||||
}
|
||||
// 判断玩家等级要求
|
||||
if user.Lv < nexttaskConf.Lock {
|
||||
return fmt.Errorf("等级不满足 uid:%v 要求lv:%v", uid, nexttaskConf.Lock)
|
||||
|
||||
//发奖
|
||||
if code := this.DispenseRes(session, taskConf.Reword, true); code != pb.ErrorCode_Success {
|
||||
this.Errorf("资源发放失败 err:%v", err)
|
||||
}
|
||||
//推送
|
||||
if err := this.SendMsgToUser(string(this.GetType()), "nexttask", &pb.WorldtaskNexttaskPush{
|
||||
NextTaskId: nextTaskId,
|
||||
}, uid); err != nil {
|
||||
log.Errorf("任务条件达成推送失败 err:%v", err)
|
||||
|
||||
if nextTaskId != 0 {
|
||||
if err := session.SendMsg(string(this.GetType()), "nexttask", &pb.WorldtaskNexttaskPush{
|
||||
NextTaskId: nextTaskId,
|
||||
}); err != nil {
|
||||
log.Errorf("任务条件达成推送失败 err:%v", err)
|
||||
}
|
||||
} else {
|
||||
this.Debugf("已经是最后一个任务了 taskId:%v", taskConf.Key)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -89,3 +118,9 @@ func (this *Worldtask) TaskcondNotify(uid string, condId int32) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// bingo世界任务跳跃 支持回退
|
||||
func (this *Worldtask) BingoJumpTask(session comm.IUserSession, groupId, rtaskId int32) error {
|
||||
// d, err := this.modelWorldtask.getWorldtask(session.GetUserId())
|
||||
return nil
|
||||
}
|
||||
|
@ -382,8 +382,9 @@ type WorldtaskBattleFinishReq struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
TaskId int32 `protobuf:"varint,1,opt,name=taskId,proto3" json:"taskId"` //任务ID
|
||||
Report *BattleReport `protobuf:"bytes,2,opt,name=report,proto3" json:"report"` //战报
|
||||
TaskId int32 `protobuf:"varint,1,opt,name=taskId,proto3" json:"taskId"` //任务ID
|
||||
BattleConfId int32 `protobuf:"varint,2,opt,name=battleConfId,proto3" json:"battleConfId"` //战斗配表ID
|
||||
Report *BattleReport `protobuf:"bytes,3,opt,name=report,proto3" json:"report"` //战报
|
||||
}
|
||||
|
||||
func (x *WorldtaskBattleFinishReq) Reset() {
|
||||
@ -425,6 +426,13 @@ func (x *WorldtaskBattleFinishReq) GetTaskId() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *WorldtaskBattleFinishReq) GetBattleConfId() int32 {
|
||||
if x != nil {
|
||||
return x.BattleConfId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *WorldtaskBattleFinishReq) GetReport() *BattleReport {
|
||||
if x != nil {
|
||||
return x.Report
|
||||
@ -479,6 +487,101 @@ func (x *WorldtaskBattleFinishResp) GetTaskId() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// 当前完成的任务列表推送
|
||||
type WorldtaskList struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
TaskId []int32 `protobuf:"varint,1,rep,packed,name=taskId,proto3" json:"taskId"` //任务ID
|
||||
}
|
||||
|
||||
func (x *WorldtaskList) Reset() {
|
||||
*x = WorldtaskList{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_worldtask_worldtask_msg_proto_msgTypes[9]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *WorldtaskList) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*WorldtaskList) ProtoMessage() {}
|
||||
|
||||
func (x *WorldtaskList) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_worldtask_worldtask_msg_proto_msgTypes[9]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use WorldtaskList.ProtoReflect.Descriptor instead.
|
||||
func (*WorldtaskList) Descriptor() ([]byte, []int) {
|
||||
return file_worldtask_worldtask_msg_proto_rawDescGZIP(), []int{9}
|
||||
}
|
||||
|
||||
func (x *WorldtaskList) GetTaskId() []int32 {
|
||||
if x != nil {
|
||||
return x.TaskId
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type WorldtaskFinishIdsPush struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Tasks map[int32]*WorldtaskList `protobuf:"bytes,1,rep,name=tasks,proto3" json:"tasks" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` //完成的任务 key:groupId val:任务ID
|
||||
}
|
||||
|
||||
func (x *WorldtaskFinishIdsPush) Reset() {
|
||||
*x = WorldtaskFinishIdsPush{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_worldtask_worldtask_msg_proto_msgTypes[10]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *WorldtaskFinishIdsPush) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*WorldtaskFinishIdsPush) ProtoMessage() {}
|
||||
|
||||
func (x *WorldtaskFinishIdsPush) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_worldtask_worldtask_msg_proto_msgTypes[10]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use WorldtaskFinishIdsPush.ProtoReflect.Descriptor instead.
|
||||
func (*WorldtaskFinishIdsPush) Descriptor() ([]byte, []int) {
|
||||
return file_worldtask_worldtask_msg_proto_rawDescGZIP(), []int{10}
|
||||
}
|
||||
|
||||
func (x *WorldtaskFinishIdsPush) GetTasks() map[int32]*WorldtaskList {
|
||||
if x != nil {
|
||||
return x.Tasks
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_worldtask_worldtask_msg_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_worldtask_worldtask_msg_proto_rawDesc = []byte{
|
||||
@ -515,17 +618,32 @@ var file_worldtask_worldtask_msg_proto_rawDesc = []byte{
|
||||
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,
|
||||
0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x7d, 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,
|
||||
0x22, 0x0a, 0x0c, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x49, 0x64, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6e,
|
||||
0x66, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f,
|
||||
0x72, 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x22, 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, 0x22,
|
||||
0x27, 0x0a, 0x0d, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74,
|
||||
0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05,
|
||||
0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x9c, 0x01, 0x0a, 0x16, 0x57, 0x6f, 0x72,
|
||||
0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x49, 0x64, 0x73, 0x50,
|
||||
0x75, 0x73, 0x68, 0x12, 0x38, 0x0a, 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03,
|
||||
0x28, 0x0b, 0x32, 0x22, 0x2e, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x46, 0x69,
|
||||
0x6e, 0x69, 0x73, 0x68, 0x49, 0x64, 0x73, 0x50, 0x75, 0x73, 0x68, 0x2e, 0x54, 0x61, 0x73, 0x6b,
|
||||
0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x1a, 0x48, 0x0a,
|
||||
0x0a, 0x54, 0x61, 0x73, 0x6b, 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, 0x24, 0x0a,
|
||||
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x57,
|
||||
0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x05, 0x76, 0x61,
|
||||
0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -540,7 +658,7 @@ func file_worldtask_worldtask_msg_proto_rawDescGZIP() []byte {
|
||||
return file_worldtask_worldtask_msg_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_worldtask_worldtask_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
|
||||
var file_worldtask_worldtask_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
|
||||
var file_worldtask_worldtask_msg_proto_goTypes = []interface{}{
|
||||
(*WorldtaskMineReq)(nil), // 0: WorldtaskMineReq
|
||||
(*WorldtaskMineResp)(nil), // 1: WorldtaskMineResp
|
||||
@ -551,19 +669,24 @@ var file_worldtask_worldtask_msg_proto_goTypes = []interface{}{
|
||||
(*WorldtaskBattleStartResp)(nil), // 6: WorldtaskBattleStartResp
|
||||
(*WorldtaskBattleFinishReq)(nil), // 7: WorldtaskBattleFinishReq
|
||||
(*WorldtaskBattleFinishResp)(nil), // 8: WorldtaskBattleFinishResp
|
||||
(*DBWorldtask)(nil), // 9: DBWorldtask
|
||||
(*BattleInfo)(nil), // 10: BattleInfo
|
||||
(*BattleReport)(nil), // 11: BattleReport
|
||||
(*WorldtaskList)(nil), // 9: WorldtaskList
|
||||
(*WorldtaskFinishIdsPush)(nil), // 10: WorldtaskFinishIdsPush
|
||||
nil, // 11: WorldtaskFinishIdsPush.TasksEntry
|
||||
(*DBWorldtask)(nil), // 12: DBWorldtask
|
||||
(*BattleInfo)(nil), // 13: BattleInfo
|
||||
(*BattleReport)(nil), // 14: BattleReport
|
||||
}
|
||||
var file_worldtask_worldtask_msg_proto_depIdxs = []int32{
|
||||
9, // 0: WorldtaskMineResp.task:type_name -> DBWorldtask
|
||||
10, // 1: WorldtaskBattleStartResp.info:type_name -> BattleInfo
|
||||
11, // 2: WorldtaskBattleFinishReq.report:type_name -> BattleReport
|
||||
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
|
||||
12, // 0: WorldtaskMineResp.task:type_name -> DBWorldtask
|
||||
13, // 1: WorldtaskBattleStartResp.info:type_name -> BattleInfo
|
||||
14, // 2: WorldtaskBattleFinishReq.report:type_name -> BattleReport
|
||||
11, // 3: WorldtaskFinishIdsPush.tasks:type_name -> WorldtaskFinishIdsPush.TasksEntry
|
||||
9, // 4: WorldtaskFinishIdsPush.TasksEntry.value:type_name -> WorldtaskList
|
||||
5, // [5:5] is the sub-list for method output_type
|
||||
5, // [5:5] is the sub-list for method input_type
|
||||
5, // [5:5] is the sub-list for extension type_name
|
||||
5, // [5:5] is the sub-list for extension extendee
|
||||
0, // [0:5] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_worldtask_worldtask_msg_proto_init() }
|
||||
@ -682,6 +805,30 @@ func file_worldtask_worldtask_msg_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_worldtask_worldtask_msg_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*WorldtaskList); 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[10].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*WorldtaskFinishIdsPush); 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{
|
||||
@ -689,7 +836,7 @@ func file_worldtask_worldtask_msg_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_worldtask_worldtask_msg_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 9,
|
||||
NumMessages: 12,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
@ -21,7 +21,7 @@ type GameWorldTaskData struct {
|
||||
TaskName string
|
||||
TaskDisplay string
|
||||
Npc []string
|
||||
GetafterEvent []string
|
||||
GetafterEvent []int32
|
||||
Completetask int32
|
||||
AutoAccept int32
|
||||
Overtips int32
|
||||
@ -63,11 +63,11 @@ func (_v *GameWorldTaskData)Deserialize(_buf map[string]interface{}) (err error)
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["getafter_event"].([]interface{}); !_ok_ { err = errors.New("getafter_event error"); return }
|
||||
|
||||
_v.GetafterEvent = make([]string, 0, len(_arr_))
|
||||
_v.GetafterEvent = make([]int32, 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 } }
|
||||
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.GetafterEvent = append(_v.GetafterEvent, _list_v_)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user