This commit is contained in:
meixiongfeng 2023-03-14 09:48:52 +08:00
commit 672be883dd
17 changed files with 469 additions and 236 deletions

View File

@ -123,6 +123,11 @@ func (c *ConnServiceImpl) ListenerPush() {
// SendMsg ....
func (c *ConnServiceImpl) SendMsg(msg *pb.UserMessage, rsp proto.Message) (err error) {
defer func() {
if err := recover(); err != nil {
logrus.Errorf("sendMsg %v", err)
}
}()
// msg.Sec = r.BuildSecStr()
if comm.ProtoMarshal(rsp, msg) {
if data, err := proto.Marshal(msg); err != nil {

View File

@ -137,8 +137,10 @@ func (d *DispatchView) CreateView(t *model.TestCase) fyne.CanvasObject {
weekReceiveBtn := widget.NewButton("周奖励", func() {
if err := service.GetPttService().SendToClient(
t.MainType,
"weekreceive",
&pb.DispatchWeekReciveReq{},
"weekrecive",
&pb.DispatchWeekReciveReq{
Idx: 1,
},
); err != nil {
logrus.Error(err)
return
@ -172,6 +174,10 @@ func (a *DispatchView) noticeList() {
return
}
if rsp.Dispatch == nil {
return
}
a.noticeLabl.SetText(fmt.Sprintf("公告等级:%v 免费次数:%v 刷新次数:%v 任务数:%v 周任务数:%v 周奖励领取:%v",
rsp.Dispatch.Lv,
rsp.Dispatch.FreeCount,

View File

@ -149,7 +149,7 @@ func (this *HeroZhaomuView) CreateView(t *model.TestCase) fyne.CanvasObject {
for i := 0; i < cast.ToInt(loopCount.Text); i++ {
choukaBtnFunc()
time.Sleep(time.Millisecond * 100)
time.Sleep(time.Millisecond * 20)
}
}
@ -201,10 +201,11 @@ func (this *HeroZhaomuView) resListener() {
return
}
write := bufio.NewWriter(this.f)
write := bufio.NewWriterSize(this.f, 1024)
for _, v := range rsp.Data {
for _, o := range v.Atno {
if o.A == "hero" && o.O != "" && o.T != "" {
if o.A == "hero" && o.T != "" {
logrus.Debug(o.T)
write.WriteString(o.T + "\r\n")
}
}

View File

@ -269,7 +269,7 @@ func (this *Battle) CreateRolesByHeros(heros []*pb.DBHero) (roles []*pb.BattleRo
roles = make([]*pb.BattleRole, len(heros))
for i, v := range heros {
if v != nil {
if roles[i], code = this.modelBattle.createBattleRole(v, 100+i, i); code != pb.ErrorCode_Success {
if roles[i], code = this.modelBattle.createBattleRole(v, 200+i, i); code != pb.ErrorCode_Success {
return
}
}

View File

@ -13,15 +13,26 @@ func (a *apiComp) AutoreceiveCheck(session comm.IUserSession, req *pb.DispatchAu
}
func (a *apiComp) Autoreceive(session comm.IUserSession, req *pb.DispatchAutoReceiveReq) (code pb.ErrorCode, data proto.Message) {
rsp := &pb.DispatchAutoReceiveResp{}
d := a.module.modelDispatch.getDBDispatch(session.GetUserId())
if d == nil {
code = pb.ErrorCode_DataNotFound
return
}
var flag bool
for _, v := range d.Nb.Tasks {
if v.Status == 2 {
flag = true
break
}
}
tasks := a.module.modelDispatch.replaceFinishedTask(session.GetUserId(), d)
if !flag {
code = pb.ErrorCode_DispatchNoFinished
return
}
tasks, oldTasks := a.module.modelDispatch.replaceFinishedTask(session.GetUserId(), d)
//更新公告任务
if err := a.module.modelDispatch.updateTasks(session.GetUserId(), d.Nb, tasks); err != nil {
@ -29,6 +40,27 @@ func (a *apiComp) Autoreceive(session comm.IUserSession, req *pb.DispatchAutoRec
return
}
var rss []*pb.DispatchTaskRsp
//奖励
for _, t := range oldTasks {
gd, err := a.module.configure.getDispatchTaskConf(t.TaskId)
if err != nil {
break
}
a.module.DispenseRes(session, gd.Reward, true)
rs := &pb.DispatchTaskRsp{
TaskId: t.TaskId,
}
if t.Exaward {
rs.Exaward = t.Exaward
a.module.DispenseRes(session, gd.Rewardex, true)
}
rss = append(rss, rs)
}
rsp.Task = rss
session.SendMsg(string(a.module.GetType()), "autoreceive", rsp)
return
}

View File

@ -3,6 +3,8 @@ package dispatch
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"go_dreamfactory/sys/configure"
"go_dreamfactory/utils"
"google.golang.org/protobuf/proto"
)
@ -15,16 +17,55 @@ func (a *apiComp) NoticeCheck(session comm.IUserSession, req *pb.DispatchNoticeR
func (a *apiComp) Notice(session comm.IUserSession, req *pb.DispatchNoticeReq) (code pb.ErrorCode, data proto.Message) {
d := a.module.modelDispatch.getDBDispatch(session.GetUserId())
if d == nil {
code = pb.ErrorCode_DataNotFound
return
}
uid := session.GetUserId()
rsp := &pb.DispatchNoticeResp{}
if len(d.Nb.Tasks) == 0 {
rsp.Dispatch = a.module.modelDispatch.initDispatch(session.GetUserId(), d)
tasks, err := a.module.modelDispatch.taskRandom(uid, d)
if err != nil {
return
}
if len(tasks) == 0 {
return
}
freeCount := a.module.configure.GetGlobalConf().DispatchFreecheck
ticketCount := a.module.configure.GetGlobalConf().DispatchNumoftimes
nb := &pb.Noticeboard{
Lv: 1, //公告初始升级
FreeCount: freeCount,
Tasks: tasks,
CreateTime: configure.Now().Unix(),
}
update := map[string]interface{}{
"nb": nb,
"ticket": ticketCount,
}
if err := a.module.modelDispatch.Change(uid, update); err != nil {
code = pb.ErrorCode_DBError
return
}
d.Nb = nb
} else {
a.module.modelDispatch.updateNotice(session.GetUserId(),d)
rsp.Dispatch = d.Nb
//周任务重置
n := utils.DiffDays(d.Nb.CreateTime, configure.Now().Unix())
day := a.module.configure.GetGlobalConf().DispatchWeektaskcheck
if int32(n) >= day {
d.Nb.WeekCount = 0
d.Nb.WeekReceived = []int32{}
}
a.module.modelDispatch.updateNotice(session.GetUserId(), d)
}
rsp.Dispatch = d.Nb
session.SendMsg(string(a.module.GetType()), "notice", rsp)
return
}

View File

@ -23,11 +23,26 @@ func (a *apiComp) Receive(session comm.IUserSession, req *pb.DispatchReceiveReq)
}
d := a.module.modelDispatch.getDBDispatch(session.GetUserId())
if d == nil {
code = pb.ErrorCode_DBError
code = pb.ErrorCode_DataNotFound
return
}
tasks := a.module.modelDispatch.replaceTask(session.GetUserId(), req.TaskId, d)
var flag bool
for _, v := range d.Nb.Tasks {
if v.TaskId == req.TaskId {
if v.Status == 2 {
flag = true
break
}
}
}
if !flag {
code = pb.ErrorCode_DispatchNoFinished
return
}
tasks, oldTask := a.module.modelDispatch.replaceTask(session.GetUserId(), req.TaskId, d)
//更新公告任务
if err := a.module.modelDispatch.updateTasks(session.GetUserId(), d.Nb, tasks); err != nil {
@ -36,23 +51,24 @@ func (a *apiComp) Receive(session comm.IUserSession, req *pb.DispatchReceiveReq)
}
//奖励
for _, t := range d.Nb.Tasks {
if t.TaskId == req.TaskId {
gd, err := a.module.configure.getDispatchTaskConf(t.TaskId)
if err != nil {
break
}
a.module.DispenseRes(session, gd.Reward, true)
if t.Exaward {
a.module.DispenseRes(session, gd.Rewardex, true)
}
break
if oldTask != nil && oldTask.TaskId == req.TaskId {
gd, err := a.module.configure.getDispatchTaskConf(oldTask.TaskId)
if err != nil {
}
a.module.DispenseRes(session, gd.Reward, true)
if oldTask.Exaward {
a.module.DispenseRes(session, gd.Rewardex, true)
}
}
rsp := &pb.DispatchReceiveResp{
TaskId: req.TaskId,
Rsp: &pb.DispatchTaskRsp{
TaskId: req.TaskId,
Exaward: oldTask.Exaward,
},
}
session.SendMsg(string(a.module.GetType()), "receive", rsp)

View File

@ -23,8 +23,8 @@ func (a *apiComp) Refresh(session comm.IUserSession, req *pb.DispatchRefreshReq)
return
}
if d.GetNb() != nil {
if d.GetNb().FreeCount > 0 {
if d.Nb != nil {
if d.Nb.FreeCount > 0 {
//更新刷新次数
if err := a.module.modelDispatch.updateFreeCount(session.GetUserId(), d.Nb); err != nil {
var customer = new(comm.CustomError)
@ -36,12 +36,18 @@ func (a *apiComp) Refresh(session comm.IUserSession, req *pb.DispatchRefreshReq)
return
}
} else {
refreshCount := a.module.configure.GetGlobalConf().DispatchRefreshtimes
if d.Nb.RefreshCount >= refreshCount {
code = pb.ErrorCode_DispatchRefreshMax
return
}
//消耗金币
money := a.module.configure.GetGlobalConf().DispatchCheckmoney
if code = a.module.CheckRes(session, []*cfg.Gameatn{money}); code != pb.ErrorCode_Success {
return
}
if code = a.module.DispenseRes(session, []*cfg.Gameatn{money}, true); code != pb.ErrorCode_Success {
if code = a.module.ConsumeRes(session, []*cfg.Gameatn{money}, true); code != pb.ErrorCode_Success {
return
}
if err := a.module.modelDispatch.updateRefreshCount(session.GetUserId(), d.Nb); err != nil {
@ -57,15 +63,16 @@ func (a *apiComp) Refresh(session comm.IUserSession, req *pb.DispatchRefreshReq)
return
}
a.module.Debug("刷新", log.Field{Key: "taskIds", Value: taskIds})
//更新公告任务
if err := a.module.modelDispatch.updateTasks(session.GetUserId(), d.Nb, taskIds); err != nil {
a.module.Debug("更新公告失败", log.Field{Key: ""})
a.module.Debug("更新公告失败", log.Field{Key: "uid", Value: session.GetUserId()})
return
}
rsp := &pb.DispatchRefreshResp{
FreeCount: d.Nb.FreeCount,
RefreshCount: d.Nb.FreeCount,
RefreshCount: d.Nb.RefreshCount,
}
session.SendMsg(string(a.module.GetType()), "refresh", rsp)

View File

@ -7,14 +7,42 @@ import (
"google.golang.org/protobuf/proto"
)
func (a *apiComp) WeekreceiveCheck(session comm.IUserSession, req *pb.DispatchWeekReciveReq) (code pb.ErrorCode) {
func (a *apiComp) WeekreciveCheck(session comm.IUserSession, req *pb.DispatchWeekReciveReq) (code pb.ErrorCode) {
if req.Idx == 0 {
code = pb.ErrorCode_ReqParameterError
}
return
}
func (a *apiComp) Weekreceive(session comm.IUserSession, req *pb.DispatchWeekReciveReq) (code pb.ErrorCode, data proto.Message) {
func (a *apiComp) Weekrecive(session comm.IUserSession, req *pb.DispatchWeekReciveReq) (code pb.ErrorCode, data proto.Message) {
if code = a.WeekreciveCheck(session, req); code != pb.ErrorCode_Success {
return
}
rsp := &pb.DispatchWeekReciveResp{}
session.SendMsg(string(a.module.GetType()), "weekreceive", rsp)
d := a.module.modelDispatch.getDBDispatch(session.GetUserId())
if d == nil {
code = pb.ErrorCode_DataNotFound
return
}
//派发奖励
wr := a.module.configure.GetGlobalConf().DispatchWeektaskreward
for i, v := range wr {
if req.Idx == int32(i+1) {
if d.Nb.WeekCount >= v.N {
//更新周任务状态
if err := a.module.modelDispatch.updateWeekstatus(session.GetUserId(), req.Idx, d.Nb); err != nil {
code = pb.ErrorCode_DBError
return
}
a.module.DispenseRes(session, v.G, true)
rsp.Idx = req.Idx
break
}
}
}
session.SendMsg(string(a.module.GetType()), "weekrecive", rsp)
return
}

View File

@ -3,6 +3,7 @@ package dispatch
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
"go_dreamfactory/sys/configure"
@ -31,6 +32,7 @@ func (this *modelDispatch) Init(service core.IService, module core.IModule, comp
}
// 初始玩家公告
// Deprecated
func (this *modelDispatch) initDispatch(uid string, dispatch *pb.DBDispatch) *pb.Noticeboard {
tasks, err := this.taskRandom(uid, dispatch)
if err != nil {
@ -46,9 +48,10 @@ func (this *modelDispatch) initDispatch(uid string, dispatch *pb.DBDispatch) *pb
Uid: uid,
Ticket: ticketCount,
Nb: &pb.Noticeboard{
Lv: 1, //公告初始升级
FreeCount: freeCount,
Tasks: tasks,
Lv: 1, //公告初始升级
FreeCount: freeCount,
Tasks: tasks,
CreateTime: configure.Now().Unix(),
},
}
@ -89,11 +92,12 @@ func (this *modelDispatch) getTasksWeight(uid string, noticeLv int32) []int32 {
}
conf, err := this.module.configure.getDispatchLvConf(noticeLv)
if err != nil {
if err != nil || conf == nil {
this.module.Error("配置不存在", log.Field{Key: "error", Value: err})
return []int32{}
}
var items []*comm.WeightItem
items := make([]*comm.WeightItem, 0)
for i, v := range conf.Probability {
items = append(items, &comm.WeightItem{Id: (i + 1), Weight: int(v)})
}
@ -118,20 +122,12 @@ func (this *modelDispatch) getTasksWeight(uid string, noticeLv int32) []int32 {
// 随机任务
func (this *modelDispatch) taskRandom(uid string, dispatch *pb.DBDispatch) (tasks []*pb.DispatchTask, err error) {
// dispatch := this.getDBDispatch(uid)
// if dispatch == nil {
// return nil, errors.New("no data")
// }
// if dispatch.Nb == nil {
// return nil, errors.New("notice is nil")
// }
if dispatch.Nb.Lv == 0 {
dispatch.Nb.Lv = 1
}
conf, err := this.module.configure.getDispatchLvConf(dispatch.Nb.Lv)
if err != nil {
if err != nil || conf == nil {
return nil, err
}
@ -176,33 +172,24 @@ func (this *modelDispatch) taskRandom(uid string, dispatch *pb.DBDispatch) (task
}
} else {
tasks = dispatch.Nb.Tasks
for i, v := range tasks {
var randCount int
for i := 0; i < len(tasks); i++ {
//只随机未接取的任务
if v.Status == 0 {
if tasks[i].Status == 0 {
//删除
tasks = append(tasks[:i], tasks[i+1:]...)
//追加一条随机任务
ids := utils.RandomNumbers(1, len(tIds), 1)
if len(ids) <= 0 {
continue
}
taskId := ids[0]
taskConf, err := this.module.configure.getDispatchTaskConf(v.TaskId)
if err != nil {
continue
}
//公告持续截至时间
duration := configure.Now().Unix() + int64(taskConf.Taskcd)
tasks = append(tasks, &pb.DispatchTask{
TaskId: int32(taskId),
Duration: duration,
})
i--
randCount++
} else {
tasks = append(tasks, v)
tasks = append(tasks, tasks[i])
}
}
//追加随机
for i := 0; i < randCount; i++ {
task := this.addRandomTask(uid, dispatch)
if task != nil {
tasks = append(tasks, task)
}
i--
}
}
@ -211,6 +198,9 @@ func (this *modelDispatch) taskRandom(uid string, dispatch *pb.DBDispatch) (task
func (this *modelDispatch) addRandomTask(uid string, dispatch *pb.DBDispatch) *pb.DispatchTask {
randomTaskIds := this.getTasksWeight(uid, dispatch.Nb.Lv)
if len(randomTaskIds) == 0 {
return nil
}
//追加一条随机任务
ids := utils.RandomNumbers(1, len(randomTaskIds), 1)
if len(ids) <= 0 {
@ -224,74 +214,61 @@ func (this *modelDispatch) addRandomTask(uid string, dispatch *pb.DBDispatch) *p
//公告持续截至时间
duration := configure.Now().Unix() + int64(taskConf.Taskcd)
// 任务截至时间
leftTime := configure.Now().Unix() + int64(taskConf.Tasktime)
return &pb.DispatchTask{
TaskId: int32(taskId),
Duration: duration,
LeftTime: leftTime,
}
}
// 替换指定的已完成任务
func (this *modelDispatch) replaceTask(uid string, taskId int32, dispatch *pb.DBDispatch) (tasks []*pb.DispatchTask) {
func (this *modelDispatch) replaceTask(uid string, taskId int32, dispatch *pb.DBDispatch) (tasks []*pb.DispatchTask, oldTask *pb.DispatchTask) {
tasks = dispatch.Nb.Tasks
for i, v := range tasks {
var randCount int
for i := 0; i < len(tasks); i++ {
//替换状态是完成的任务
if v.Status == 2 {
if taskId != v.TaskId {
if tasks[i].Status == 2 {
if taskId != tasks[i].TaskId {
continue
}
oldTask = tasks[i]
//删除
tasks = append(tasks[:i], tasks[i+1:]...)
i--
tasks = append(tasks, this.addRandomTask(uid, dispatch))
} else {
tasks = append(tasks, v)
randCount++
break
}
}
if randCount > 0 {
task := this.addRandomTask(uid, dispatch)
if task != nil {
tasks = append(tasks, task)
}
}
return
}
// 替换所有完成的任务
func (this *modelDispatch) replaceFinishedTask(uid string, dispatch *pb.DBDispatch) (tasks []*pb.DispatchTask) {
randomTaskIds := this.getTasksWeight(uid, dispatch.Nb.Lv)
for i, v := range dispatch.Nb.Tasks {
func (this *modelDispatch) replaceFinishedTask(uid string, dispatch *pb.DBDispatch) (tasks []*pb.DispatchTask, oldtasks []*pb.DispatchTask) {
var randCount int
tmp := dispatch.Nb.Tasks
for i := 0; i < len(tmp); i++ {
//替换状态是完成的任务
if v.Status == 2 {
if tmp[i].Status == 2 {
//删除
oldtasks = append(oldtasks, tmp[i])
dispatch.Nb.Tasks = append(dispatch.Nb.Tasks[:i], dispatch.Nb.Tasks[i+1:]...)
i--
//追加一条随机任务
ids := utils.RandomNumbers(1, len(randomTaskIds), 1)
if len(ids) <= 0 {
continue
}
taskId := ids[0]
taskConf, err := this.module.configure.getDispatchTaskConf(v.TaskId)
if err != nil {
continue
}
//公告持续截至时间
duration := configure.Now().Unix() + int64(taskConf.Taskcd)
// 任务截至时间
leftTime := configure.Now().Unix() + int64(taskConf.Tasktime)
tasks = append(tasks, &pb.DispatchTask{
TaskId: int32(taskId),
Duration: duration,
LeftTime: leftTime,
})
randCount++
} else {
tasks = append(tasks, v)
tasks = append(tasks, tmp[i])
}
}
for i := 0; i < randCount; i++ {
task := this.addRandomTask(uid, dispatch)
if task != nil {
tasks = append(tasks, task)
}
}
return
@ -369,8 +346,12 @@ func (this *modelDispatch) dispatch(uid string, taskId int32, heroIds []string,
v.Status = 2 //任务结束
v.Exaward = flag
} else {
taskConf, err := this.module.configure.getDispatchTaskConf(v.TaskId)
if err != nil {
continue
}
v.Status = 1 //任务进行中
leftTime := configure.Now().Unix()
leftTime := configure.Now().Unix() + int64(taskConf.Tasktime)
v.LeftTime = leftTime
}
}
@ -378,9 +359,6 @@ func (this *modelDispatch) dispatch(uid string, taskId int32, heroIds []string,
}
}
//周任务数累加
disp.Nb.WeekCount++
update := map[string]interface{}{
"nb": disp.Nb,
"ticket": disp.Ticket - 1,
@ -396,8 +374,9 @@ func (this *modelDispatch) updateFreeCount(uid string, noticeboard *pb.Noticeboa
if noticeboard.FreeCount <= 0 {
return comm.NewCustomError(pb.ErrorCode_DispatchNoFree)
}
noticeboard.FreeCount--
update := map[string]interface{}{
"freeCount": noticeboard.FreeCount - 1,
"nb": noticeboard,
}
return this.Change(uid, update)
}
@ -406,7 +385,7 @@ func (this *modelDispatch) updateFreeCount(uid string, noticeboard *pb.Noticeboa
func (this *modelDispatch) updateRefreshCount(uid string, noticeboard *pb.Noticeboard) error {
noticeboard.RefreshCount++
update := map[string]interface{}{
"refreshCount": noticeboard.RefreshCount,
"nb": noticeboard,
}
return this.Change(uid, update)
}
@ -422,35 +401,68 @@ func (this *modelDispatch) updateTasks(uid string, noticeboard *pb.Noticeboard,
// 更新公告栏任务
func (this *modelDispatch) updateNotice(uid string, dispatch *pb.DBDispatch) error {
for i, v := range dispatch.Nb.Tasks {
if v.Status == 0 {
//判断到期时间
if v.Duration <= configure.Now().Unix() {
//替换到期任务
// dispatch.Nb.Tasks = this.replaceTask(uid, v.TaskId, dispatch)
dispatch.Nb.Tasks = append(dispatch.Nb.Tasks[:i], dispatch.Nb.Tasks[i+1:]...)
i--
//补一条
dispatch.Nb.Tasks = append(dispatch.Nb.Tasks, this.addRandomTask(uid, dispatch))
var randCount int
for i := 0; i < len(dispatch.Nb.Tasks); i++ {
if dispatch.Nb.Tasks[i].Status == 1 {
if dispatch.Nb.Tasks[i].LeftTime != 0 &&
dispatch.Nb.Tasks[i].LeftTime <= configure.Now().Unix() {
//更改次任务状态为
dispatch.Nb.Tasks[i].Status = 2 //任务结束
dispatch.Nb.Tasks[i].LeftTime = 0
//升级
conf, err := this.module.configure.getDispatchLvConf(dispatch.Nb.Lv)
if err != nil || conf == nil {
return err
}
if dispatch.Nb.TaskCount >= conf.Upgrade {
//判断是否有下一等级
nextConf, err := this.module.configure.getDispatchLvConf(dispatch.Nb.Lv + 1)
if err != nil {
return err
}
if nextConf != nil {
dispatch.Nb.Lv++
}
}
//累计任务数
dispatch.Nb.TaskCount++
dispatch.Nb.WeekCount++
}
}
if v.Status == 1 {
if v.LeftTime <= configure.Now().Unix() {
//更改次任务状态为
v.Status = 2 //任务结束
v.LeftTime = 0
//升级
conf, err := this.module.configure.getDispatchLvConf(dispatch.Nb.Lv)
if err != nil {
return err
}
if dispatch.Nb.WeekCount >= conf.Upgrade {
dispatch.Nb.Lv++
}
if dispatch.Nb.Tasks[i].Status == 0 {
//判断到期时间
if dispatch.Nb.Tasks[i].Duration != 0 &&
dispatch.Nb.Tasks[i].Duration <= configure.Now().Unix() {
//替换到期任务
dispatch.Nb.Tasks = append(dispatch.Nb.Tasks[:i], dispatch.Nb.Tasks[i+1:]...)
i--
randCount++
}
}
}
this.module.Debug("随机数量:", log.Field{Key: "count", Value: randCount})
count := len(dispatch.Nb.Tasks)
if count < 6 {
randCount = 6 - count
}
for i := 0; i < randCount; i++ {
task := this.addRandomTask(uid, dispatch)
if task != nil {
dispatch.Nb.Tasks = append(dispatch.Nb.Tasks, task)
}
}
return this.updateTasks(uid, dispatch.Nb, dispatch.Nb.Tasks)
}
// 更新周任务状态
func (this *modelDispatch) updateWeekstatus(uid string, idx int32, noticeboard *pb.Noticeboard) error {
noticeboard.WeekReceived = append(noticeboard.WeekReceived, idx)
update := map[string]interface{}{
"nb": noticeboard,
}
return this.Change(uid, update)
}

View File

@ -31,6 +31,6 @@ func (this *apiComp) GymInfo(session comm.IUserSession, req *pb.PracticeGymInfoR
"gymrefresh": room.Gymrefresh,
})
}
session.SendMsg(string(this.module.GetType()), "confirm", &pb.PracticeGymInfoResp{Lastaction: room.Gymaction, Refreshnum: room.Gymrefresh})
session.SendMsg(string(this.module.GetType()), "gymInfo", &pb.PracticeGymInfoResp{Lastaction: room.Gymaction, Refreshnum: room.Gymrefresh})
return
}

View File

@ -57,6 +57,6 @@ func (this *apiComp) GymRefresh(session comm.IUserSession, req *pb.PracticeGymRe
"gymrefresh": room.Gymrefresh,
"lastrefresh": room.Lastrefresh,
})
session.SendMsg(string(this.module.GetType()), "confirm", &pb.PracticeGymRefreshResp{Lastaction: room.Gymaction, Refreshnum: room.Gymrefresh})
session.SendMsg(string(this.module.GetType()), "gymrefresh", &pb.PracticeGymRefreshResp{Lastaction: room.Gymaction, Refreshnum: room.Gymrefresh})
return
}

View File

@ -33,7 +33,7 @@ func (this *apiComp) NPCBattkle(session comm.IUserSession, req *pb.PracticeNPCBa
}); code != pb.ErrorCode_Success {
return
}
session.SendMsg(string(this.module.GetType()), "npcbattkle", &pb.MoonfantasyBattleResp{
session.SendMsg(string(this.module.GetType()), "npcbattkle", &pb.PracticeNPCBattkleResp{
Info: &pb.BattleInfo{
Id: record.Id,
Title: record.Title,

View File

@ -18,25 +18,24 @@ func (this *apiComp) NPCBattkleFinishCheck(session comm.IUserSession, req *pb.Pr
///npc 战斗结果请求
func (this *apiComp) NPCBattkleFinish(session comm.IUserSession, req *pb.PracticeNPCBattkleFinishReq) (code pb.ErrorCode, data proto.Message) {
var (
err error
room *pb.DBPracticeRoom
conf *cfg.GameDispatch_BattleData
iswin bool
err error
room *pb.DBPracticeRoom
conf *cfg.GameDispatch_BattleData
)
if room, err = this.module.modelPandata.queryUserMartialhall(session.GetUserId()); err != nil {
code = pb.ErrorCode_DBError
return
}
if room.Npcstate != 2 {
if room.Npcstate == 2 || room.Npcstate == 3 {
code = pb.ErrorCode_ReqParameterError
return
}
if code, iswin = this.module.battle.CheckBattleReport(session, req.Report); code != pb.ErrorCode_Success {
if code, _ = this.module.battle.CheckBattleReport(session, req.Report); code != pb.ErrorCode_Success {
return
}
if iswin {
if req.Report.WinSide == 1 {
room.Npcstate = 2
if conf, err = this.module.configure.getDispatchBattleData(room.Currnpc); err != nil {
code = pb.ErrorCode_ConfigNoFound

View File

@ -98,6 +98,7 @@ type Noticeboard struct {
WeekCount int32 `protobuf:"varint,6,opt,name=weekCount,proto3" json:"weekCount" bson:"weekCount"` //周任务数
TaskCount int32 `protobuf:"varint,7,opt,name=taskCount,proto3" json:"taskCount" bson:"taskCount"` //任务数
WeekReceived []int32 `protobuf:"varint,8,rep,packed,name=weekReceived,proto3" json:"weekReceived" bson:"weekReceived"` ////已领取的周任务索引ID
CreateTime int64 `protobuf:"varint,9,opt,name=createTime,proto3" json:"createTime" bson:"createTime"` //创建时间
}
func (x *Noticeboard) Reset() {
@ -188,6 +189,13 @@ func (x *Noticeboard) GetWeekReceived() []int32 {
return nil
}
func (x *Noticeboard) GetCreateTime() int64 {
if x != nil {
return x.CreateTime
}
return 0
}
// 派遣任务
type DispatchTask struct {
state protoimpl.MessageState
@ -286,7 +294,7 @@ var file_dispatch_dispatch_db_proto_rawDesc = []byte{
0x6e, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x63,
0x65, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x52, 0x02, 0x6e, 0x62, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x69,
0x63, 0x6b, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x69, 0x63, 0x6b,
0x65, 0x74, 0x22, 0x84, 0x02, 0x0a, 0x0b, 0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x62, 0x6f, 0x61,
0x65, 0x74, 0x22, 0xa4, 0x02, 0x0a, 0x0b, 0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x62, 0x6f, 0x61,
0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02,
0x6c, 0x76, 0x12, 0x1e, 0x0a, 0x0a, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x54, 0x79,
@ -302,7 +310,9 @@ var file_dispatch_dispatch_db_proto_rawDesc = []byte{
0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x61, 0x73, 0x6b,
0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x77, 0x65, 0x65, 0x6b, 0x52, 0x65, 0x63,
0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x08, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0c, 0x77, 0x65, 0x65,
0x6b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x22, 0xaa, 0x01, 0x0a, 0x0c, 0x44, 0x69,
0x6b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65,
0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63,
0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xaa, 0x01, 0x0a, 0x0c, 0x44, 0x69,
0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x54, 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,

View File

@ -200,6 +200,61 @@ func (x *DispatchRefreshResp) GetRefreshCount() int32 {
return 0
}
type DispatchTaskRsp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
TaskId int32 `protobuf:"varint,1,opt,name=taskId,proto3" json:"taskId"`
Exaward bool `protobuf:"varint,2,opt,name=exaward,proto3" json:"exaward"`
}
func (x *DispatchTaskRsp) Reset() {
*x = DispatchTaskRsp{}
if protoimpl.UnsafeEnabled {
mi := &file_dispatch_dispatch_msg_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DispatchTaskRsp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DispatchTaskRsp) ProtoMessage() {}
func (x *DispatchTaskRsp) ProtoReflect() protoreflect.Message {
mi := &file_dispatch_dispatch_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 DispatchTaskRsp.ProtoReflect.Descriptor instead.
func (*DispatchTaskRsp) Descriptor() ([]byte, []int) {
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{4}
}
func (x *DispatchTaskRsp) GetTaskId() int32 {
if x != nil {
return x.TaskId
}
return 0
}
func (x *DispatchTaskRsp) GetExaward() bool {
if x != nil {
return x.Exaward
}
return false
}
// 领取任务奖励
type DispatchReceiveReq struct {
state protoimpl.MessageState
@ -212,7 +267,7 @@ type DispatchReceiveReq struct {
func (x *DispatchReceiveReq) Reset() {
*x = DispatchReceiveReq{}
if protoimpl.UnsafeEnabled {
mi := &file_dispatch_dispatch_msg_proto_msgTypes[4]
mi := &file_dispatch_dispatch_msg_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -225,7 +280,7 @@ func (x *DispatchReceiveReq) String() string {
func (*DispatchReceiveReq) ProtoMessage() {}
func (x *DispatchReceiveReq) ProtoReflect() protoreflect.Message {
mi := &file_dispatch_dispatch_msg_proto_msgTypes[4]
mi := &file_dispatch_dispatch_msg_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -238,7 +293,7 @@ func (x *DispatchReceiveReq) ProtoReflect() protoreflect.Message {
// Deprecated: Use DispatchReceiveReq.ProtoReflect.Descriptor instead.
func (*DispatchReceiveReq) Descriptor() ([]byte, []int) {
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{4}
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{5}
}
func (x *DispatchReceiveReq) GetTaskId() int32 {
@ -253,13 +308,13 @@ type DispatchReceiveResp struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
TaskId int32 `protobuf:"varint,1,opt,name=taskId,proto3" json:"taskId"`
Rsp *DispatchTaskRsp `protobuf:"bytes,1,opt,name=rsp,proto3" json:"rsp"`
}
func (x *DispatchReceiveResp) Reset() {
*x = DispatchReceiveResp{}
if protoimpl.UnsafeEnabled {
mi := &file_dispatch_dispatch_msg_proto_msgTypes[5]
mi := &file_dispatch_dispatch_msg_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -272,7 +327,7 @@ func (x *DispatchReceiveResp) String() string {
func (*DispatchReceiveResp) ProtoMessage() {}
func (x *DispatchReceiveResp) ProtoReflect() protoreflect.Message {
mi := &file_dispatch_dispatch_msg_proto_msgTypes[5]
mi := &file_dispatch_dispatch_msg_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -285,14 +340,14 @@ func (x *DispatchReceiveResp) ProtoReflect() protoreflect.Message {
// Deprecated: Use DispatchReceiveResp.ProtoReflect.Descriptor instead.
func (*DispatchReceiveResp) Descriptor() ([]byte, []int) {
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{5}
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{6}
}
func (x *DispatchReceiveResp) GetTaskId() int32 {
func (x *DispatchReceiveResp) GetRsp() *DispatchTaskRsp {
if x != nil {
return x.TaskId
return x.Rsp
}
return 0
return nil
}
//一键领取任务奖励
@ -305,7 +360,7 @@ type DispatchAutoReceiveReq struct {
func (x *DispatchAutoReceiveReq) Reset() {
*x = DispatchAutoReceiveReq{}
if protoimpl.UnsafeEnabled {
mi := &file_dispatch_dispatch_msg_proto_msgTypes[6]
mi := &file_dispatch_dispatch_msg_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -318,7 +373,7 @@ func (x *DispatchAutoReceiveReq) String() string {
func (*DispatchAutoReceiveReq) ProtoMessage() {}
func (x *DispatchAutoReceiveReq) ProtoReflect() protoreflect.Message {
mi := &file_dispatch_dispatch_msg_proto_msgTypes[6]
mi := &file_dispatch_dispatch_msg_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -331,7 +386,7 @@ func (x *DispatchAutoReceiveReq) ProtoReflect() protoreflect.Message {
// Deprecated: Use DispatchAutoReceiveReq.ProtoReflect.Descriptor instead.
func (*DispatchAutoReceiveReq) Descriptor() ([]byte, []int) {
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{6}
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{7}
}
type DispatchAutoReceiveResp struct {
@ -339,13 +394,13 @@ type DispatchAutoReceiveResp struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
TaskId []int32 `protobuf:"varint,1,rep,packed,name=taskId,proto3" json:"taskId"` //领取奖励的任务ID
Task []*DispatchTaskRsp `protobuf:"bytes,1,rep,name=task,proto3" json:"task"` //领取奖励的任务ID
}
func (x *DispatchAutoReceiveResp) Reset() {
*x = DispatchAutoReceiveResp{}
if protoimpl.UnsafeEnabled {
mi := &file_dispatch_dispatch_msg_proto_msgTypes[7]
mi := &file_dispatch_dispatch_msg_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -358,7 +413,7 @@ func (x *DispatchAutoReceiveResp) String() string {
func (*DispatchAutoReceiveResp) ProtoMessage() {}
func (x *DispatchAutoReceiveResp) ProtoReflect() protoreflect.Message {
mi := &file_dispatch_dispatch_msg_proto_msgTypes[7]
mi := &file_dispatch_dispatch_msg_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -371,12 +426,12 @@ func (x *DispatchAutoReceiveResp) ProtoReflect() protoreflect.Message {
// Deprecated: Use DispatchAutoReceiveResp.ProtoReflect.Descriptor instead.
func (*DispatchAutoReceiveResp) Descriptor() ([]byte, []int) {
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{7}
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{8}
}
func (x *DispatchAutoReceiveResp) GetTaskId() []int32 {
func (x *DispatchAutoReceiveResp) GetTask() []*DispatchTaskRsp {
if x != nil {
return x.TaskId
return x.Task
}
return nil
}
@ -394,7 +449,7 @@ type DispatchDoReq struct {
func (x *DispatchDoReq) Reset() {
*x = DispatchDoReq{}
if protoimpl.UnsafeEnabled {
mi := &file_dispatch_dispatch_msg_proto_msgTypes[8]
mi := &file_dispatch_dispatch_msg_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -407,7 +462,7 @@ func (x *DispatchDoReq) String() string {
func (*DispatchDoReq) ProtoMessage() {}
func (x *DispatchDoReq) ProtoReflect() protoreflect.Message {
mi := &file_dispatch_dispatch_msg_proto_msgTypes[8]
mi := &file_dispatch_dispatch_msg_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -420,7 +475,7 @@ func (x *DispatchDoReq) ProtoReflect() protoreflect.Message {
// Deprecated: Use DispatchDoReq.ProtoReflect.Descriptor instead.
func (*DispatchDoReq) Descriptor() ([]byte, []int) {
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{8}
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{9}
}
func (x *DispatchDoReq) GetTaskId() int32 {
@ -448,7 +503,7 @@ type DispatchDoResp struct {
func (x *DispatchDoResp) Reset() {
*x = DispatchDoResp{}
if protoimpl.UnsafeEnabled {
mi := &file_dispatch_dispatch_msg_proto_msgTypes[9]
mi := &file_dispatch_dispatch_msg_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -461,7 +516,7 @@ func (x *DispatchDoResp) String() string {
func (*DispatchDoResp) ProtoMessage() {}
func (x *DispatchDoResp) ProtoReflect() protoreflect.Message {
mi := &file_dispatch_dispatch_msg_proto_msgTypes[9]
mi := &file_dispatch_dispatch_msg_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -474,7 +529,7 @@ func (x *DispatchDoResp) ProtoReflect() protoreflect.Message {
// Deprecated: Use DispatchDoResp.ProtoReflect.Descriptor instead.
func (*DispatchDoResp) Descriptor() ([]byte, []int) {
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{9}
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{10}
}
func (x *DispatchDoResp) GetIsSucc() bool {
@ -496,7 +551,7 @@ type DispatchWeekReciveReq struct {
func (x *DispatchWeekReciveReq) Reset() {
*x = DispatchWeekReciveReq{}
if protoimpl.UnsafeEnabled {
mi := &file_dispatch_dispatch_msg_proto_msgTypes[10]
mi := &file_dispatch_dispatch_msg_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -509,7 +564,7 @@ func (x *DispatchWeekReciveReq) String() string {
func (*DispatchWeekReciveReq) ProtoMessage() {}
func (x *DispatchWeekReciveReq) ProtoReflect() protoreflect.Message {
mi := &file_dispatch_dispatch_msg_proto_msgTypes[10]
mi := &file_dispatch_dispatch_msg_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -522,7 +577,7 @@ func (x *DispatchWeekReciveReq) ProtoReflect() protoreflect.Message {
// Deprecated: Use DispatchWeekReciveReq.ProtoReflect.Descriptor instead.
func (*DispatchWeekReciveReq) Descriptor() ([]byte, []int) {
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{10}
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{11}
}
func (x *DispatchWeekReciveReq) GetIdx() int32 {
@ -543,7 +598,7 @@ type DispatchWeekReciveResp struct {
func (x *DispatchWeekReciveResp) Reset() {
*x = DispatchWeekReciveResp{}
if protoimpl.UnsafeEnabled {
mi := &file_dispatch_dispatch_msg_proto_msgTypes[11]
mi := &file_dispatch_dispatch_msg_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -556,7 +611,7 @@ func (x *DispatchWeekReciveResp) String() string {
func (*DispatchWeekReciveResp) ProtoMessage() {}
func (x *DispatchWeekReciveResp) ProtoReflect() protoreflect.Message {
mi := &file_dispatch_dispatch_msg_proto_msgTypes[11]
mi := &file_dispatch_dispatch_msg_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -569,7 +624,7 @@ func (x *DispatchWeekReciveResp) ProtoReflect() protoreflect.Message {
// Deprecated: Use DispatchWeekReciveResp.ProtoReflect.Descriptor instead.
func (*DispatchWeekReciveResp) Descriptor() ([]byte, []int) {
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{11}
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{12}
}
func (x *DispatchWeekReciveResp) GetIdx() int32 {
@ -597,31 +652,37 @@ var file_dispatch_dispatch_msg_proto_rawDesc = []byte{
0x72, 0x65, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09,
0x66, 0x72, 0x65, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x66,
0x72, 0x65, 0x73, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x2c, 0x0a,
0x12, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65,
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, 0x22, 0x2d, 0x0a, 0x13, 0x44,
0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 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, 0x18, 0x0a, 0x16, 0x44, 0x69,
0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x41, 0x75, 0x74, 0x6f, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76,
0x65, 0x52, 0x65, 0x71, 0x22, 0x31, 0x0a, 0x17, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68,
0x41, 0x75, 0x74, 0x6f, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 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, 0x41, 0x0a, 0x0d, 0x44, 0x69, 0x73, 0x70, 0x61,
0x74, 0x63, 0x68, 0x44, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b,
0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x43, 0x0a,
0x0f, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x54, 0x61, 0x73, 0x6b, 0x52, 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, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x61, 0x77,
0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x78, 0x61, 0x77, 0x61,
0x72, 0x64, 0x22, 0x2c, 0x0a, 0x12, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65,
0x63, 0x65, 0x69, 0x76, 0x65, 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, 0x18, 0x0a, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28,
0x09, 0x52, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x73, 0x22, 0x28, 0x0a, 0x0e, 0x44, 0x69,
0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x44, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06,
0x69, 0x73, 0x53, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73,
0x53, 0x75, 0x63, 0x63, 0x22, 0x29, 0x0a, 0x15, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68,
0x57, 0x65, 0x65, 0x6b, 0x52, 0x65, 0x63, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a,
0x03, 0x69, 0x64, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x69, 0x64, 0x78, 0x22,
0x2a, 0x0a, 0x16, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x57, 0x65, 0x65, 0x6b, 0x52,
0x65, 0x63, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x78,
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x69, 0x64, 0x78, 0x42, 0x06, 0x5a, 0x04, 0x2e,
0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x22, 0x39, 0x0a, 0x13, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x63, 0x65,
0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x22, 0x0a, 0x03, 0x72, 0x73, 0x70, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x54,
0x61, 0x73, 0x6b, 0x52, 0x73, 0x70, 0x52, 0x03, 0x72, 0x73, 0x70, 0x22, 0x18, 0x0a, 0x16, 0x44,
0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x41, 0x75, 0x74, 0x6f, 0x52, 0x65, 0x63, 0x65, 0x69,
0x76, 0x65, 0x52, 0x65, 0x71, 0x22, 0x3f, 0x0a, 0x17, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63,
0x68, 0x41, 0x75, 0x74, 0x6f, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70,
0x12, 0x24, 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10,
0x2e, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x73, 0x70,
0x52, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x22, 0x41, 0x0a, 0x0d, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74,
0x63, 0x68, 0x44, 0x6f, 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,
0x18, 0x0a, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09,
0x52, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x73, 0x22, 0x28, 0x0a, 0x0e, 0x44, 0x69, 0x73,
0x70, 0x61, 0x74, 0x63, 0x68, 0x44, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x69,
0x73, 0x53, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x53,
0x75, 0x63, 0x63, 0x22, 0x29, 0x0a, 0x15, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x57,
0x65, 0x65, 0x6b, 0x52, 0x65, 0x63, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03,
0x69, 0x64, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x69, 0x64, 0x78, 0x22, 0x2a,
0x0a, 0x16, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x57, 0x65, 0x65, 0x6b, 0x52, 0x65,
0x63, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x78, 0x18,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x69, 0x64, 0x78, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b,
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -636,29 +697,32 @@ func file_dispatch_dispatch_msg_proto_rawDescGZIP() []byte {
return file_dispatch_dispatch_msg_proto_rawDescData
}
var file_dispatch_dispatch_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
var file_dispatch_dispatch_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
var file_dispatch_dispatch_msg_proto_goTypes = []interface{}{
(*DispatchNoticeReq)(nil), // 0: DispatchNoticeReq
(*DispatchNoticeResp)(nil), // 1: DispatchNoticeResp
(*DispatchRefreshReq)(nil), // 2: DispatchRefreshReq
(*DispatchRefreshResp)(nil), // 3: DispatchRefreshResp
(*DispatchReceiveReq)(nil), // 4: DispatchReceiveReq
(*DispatchReceiveResp)(nil), // 5: DispatchReceiveResp
(*DispatchAutoReceiveReq)(nil), // 6: DispatchAutoReceiveReq
(*DispatchAutoReceiveResp)(nil), // 7: DispatchAutoReceiveResp
(*DispatchDoReq)(nil), // 8: DispatchDoReq
(*DispatchDoResp)(nil), // 9: DispatchDoResp
(*DispatchWeekReciveReq)(nil), // 10: DispatchWeekReciveReq
(*DispatchWeekReciveResp)(nil), // 11: DispatchWeekReciveResp
(*Noticeboard)(nil), // 12: Noticeboard
(*DispatchTaskRsp)(nil), // 4: DispatchTaskRsp
(*DispatchReceiveReq)(nil), // 5: DispatchReceiveReq
(*DispatchReceiveResp)(nil), // 6: DispatchReceiveResp
(*DispatchAutoReceiveReq)(nil), // 7: DispatchAutoReceiveReq
(*DispatchAutoReceiveResp)(nil), // 8: DispatchAutoReceiveResp
(*DispatchDoReq)(nil), // 9: DispatchDoReq
(*DispatchDoResp)(nil), // 10: DispatchDoResp
(*DispatchWeekReciveReq)(nil), // 11: DispatchWeekReciveReq
(*DispatchWeekReciveResp)(nil), // 12: DispatchWeekReciveResp
(*Noticeboard)(nil), // 13: Noticeboard
}
var file_dispatch_dispatch_msg_proto_depIdxs = []int32{
12, // 0: DispatchNoticeResp.dispatch:type_name -> Noticeboard
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
13, // 0: DispatchNoticeResp.dispatch:type_name -> Noticeboard
4, // 1: DispatchReceiveResp.rsp:type_name -> DispatchTaskRsp
4, // 2: DispatchAutoReceiveResp.task:type_name -> DispatchTaskRsp
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
}
func init() { file_dispatch_dispatch_msg_proto_init() }
@ -717,7 +781,7 @@ func file_dispatch_dispatch_msg_proto_init() {
}
}
file_dispatch_dispatch_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DispatchReceiveReq); i {
switch v := v.(*DispatchTaskRsp); i {
case 0:
return &v.state
case 1:
@ -729,7 +793,7 @@ func file_dispatch_dispatch_msg_proto_init() {
}
}
file_dispatch_dispatch_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DispatchReceiveResp); i {
switch v := v.(*DispatchReceiveReq); i {
case 0:
return &v.state
case 1:
@ -741,7 +805,7 @@ func file_dispatch_dispatch_msg_proto_init() {
}
}
file_dispatch_dispatch_msg_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DispatchAutoReceiveReq); i {
switch v := v.(*DispatchReceiveResp); i {
case 0:
return &v.state
case 1:
@ -753,7 +817,7 @@ func file_dispatch_dispatch_msg_proto_init() {
}
}
file_dispatch_dispatch_msg_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DispatchAutoReceiveResp); i {
switch v := v.(*DispatchAutoReceiveReq); i {
case 0:
return &v.state
case 1:
@ -765,7 +829,7 @@ func file_dispatch_dispatch_msg_proto_init() {
}
}
file_dispatch_dispatch_msg_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DispatchDoReq); i {
switch v := v.(*DispatchAutoReceiveResp); i {
case 0:
return &v.state
case 1:
@ -777,7 +841,7 @@ func file_dispatch_dispatch_msg_proto_init() {
}
}
file_dispatch_dispatch_msg_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DispatchDoResp); i {
switch v := v.(*DispatchDoReq); i {
case 0:
return &v.state
case 1:
@ -789,7 +853,7 @@ func file_dispatch_dispatch_msg_proto_init() {
}
}
file_dispatch_dispatch_msg_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DispatchWeekReciveReq); i {
switch v := v.(*DispatchDoResp); i {
case 0:
return &v.state
case 1:
@ -801,6 +865,18 @@ func file_dispatch_dispatch_msg_proto_init() {
}
}
file_dispatch_dispatch_msg_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DispatchWeekReciveReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_dispatch_dispatch_msg_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DispatchWeekReciveResp); i {
case 0:
return &v.state
@ -819,7 +895,7 @@ func file_dispatch_dispatch_msg_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_dispatch_dispatch_msg_proto_rawDesc,
NumEnums: 0,
NumMessages: 12,
NumMessages: 13,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -25,9 +25,9 @@ type DBWorldtask struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid" bson:"uid"` //玩家ID
LastTaskIds map[int32]*Worldtask `protobuf:"bytes,2,rep,name=lastTaskIds,proto3" json:"lastTaskIds" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3" bson:"lastTaskId"` //上一次完成的任务 key:groupId val:任务ID
TaskList []*Worldtask `protobuf:"bytes,3,rep,name=taskList,proto3" json:"taskList" bson:"taskList"` // 任务列表
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid" bson:"uid"` //玩家ID
LastTaskIds map[int32]*Worldtask `protobuf:"bytes,2,rep,name=lastTaskIds,proto3" json:"lastTaskIds" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3" bson:"lastTaskIds"` //上一次完成的任务 key:groupId val:任务ID
TaskList []*Worldtask `protobuf:"bytes,3,rep,name=taskList,proto3" json:"taskList" bson:"taskList"` // 任务列表
}
func (x *DBWorldtask) Reset() {