上传任务进度推送

This commit is contained in:
liwei 2023-07-11 11:35:52 +08:00
parent 70c2816242
commit 76685f3a37
5 changed files with 14 additions and 13 deletions

View File

@ -58,6 +58,7 @@ func (this *apiComp) Accept(session comm.IUserSession, req *pb.WTaskAcceptReq) (
Title: pb.ErrorCode_ReqParameterError.ToString(), Title: pb.ErrorCode_ReqParameterError.ToString(),
Message: fmt.Sprintf("task:%d no fund in Activations:%v", req.Tid, wtask.Activations), Message: fmt.Sprintf("task:%d no fund in Activations:%v", req.Tid, wtask.Activations),
} }
return
} }
for i, v := range wtask.Activations { for i, v := range wtask.Activations {

View File

@ -42,7 +42,7 @@ func (this *apiComp) BattleFinish(session comm.IUserSession, req *pb.WTaskBattle
return return
} }
if errdata, isWin = this.module.modelBattle.CheckBattleReport(session, req.Report); errdata == nil { if errdata, isWin = this.module.modelBattle.CheckBattleReport(session, req.Report); errdata != nil {
return return
} }

View File

@ -47,7 +47,7 @@ func (this *apiComp) BattleStart(session comm.IUserSession, req *pb.WTaskBattleS
}); err != nil { }); err != nil {
return return
} }
session.SendMsg(string(this.module.GetType()), "battle", &pb.WTaskBattleStartResp{ session.SendMsg(string(this.module.GetType()), "battlestart", &pb.WTaskBattleStartResp{
BattleConfId: req.BattleConfId, BattleConfId: req.BattleConfId,
Info: &pb.BattleInfo{ Info: &pb.BattleInfo{
Id: record.Id, Id: record.Id,

View File

@ -29,7 +29,7 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.WTaskInfoReq) (errd
} }
return return
} }
if progress, errdata = this.module.fishtask(session, wtask, false); errdata != nil { if _, errdata = this.module.fishtask(session, wtask, false); errdata != nil {
return return
} }
if progress, errdata = this.module.pushtaskprogress(session, wtask, false); errdata != nil { if progress, errdata = this.module.pushtaskprogress(session, wtask, false); errdata != nil {

View File

@ -97,7 +97,7 @@ func (this *WTask) BuriedsNotify(uid string, condis []*pb.ConIProgress) {
if temptasks, ok = condlTask[v.Conid]; ok { if temptasks, ok = condlTask[v.Conid]; ok {
for _, task := range temptasks { for _, task := range temptasks {
if _, ok = accepttaskMap[task.Key]; ok { //任务列表进度有变化 if _, ok = accepttaskMap[task.Key]; ok { //任务列表进度有变化
if _, ok = changetasks[task.Key]; ok { if _, ok = changetasks[task.Key]; !ok {
changetasks[task.Key] = task changetasks[task.Key] = task
for _, cid := range task.Completetask { for _, cid := range task.Completetask {
if _, ok = checkcondlsMap[cid]; !ok { if _, ok = checkcondlsMap[cid]; !ok {
@ -448,15 +448,15 @@ func (this *WTask) inquireActivations(session comm.IUserSession, wtask *pb.DBWTa
if v.Des == 5 { //商队任务不主动触发 if v.Des == 5 { //商队任务不主动触发
continue continue
} }
if v.AutoAccept == 0 {
wtask.Activations = append(wtask.Activations, v.Key) wtask.Activations = append(wtask.Activations, v.Key)
changeActiva = true changeActiva = true
// if v.AutoAccept == 0 {
} else if v.AutoAccept == 1 { //自动接取任务 // wtask.Activations = append(wtask.Activations, v.Key)
wtask.Accepts = append(wtask.Accepts, v.Key) // changeActiva = true
changeAccept = true // } else if v.AutoAccept == 1 { //自动接取任务
} // wtask.Accepts = append(wtask.Accepts, v.Key)
// changeAccept = true
// }
if v.Des == 2 { //主线任务 if v.Des == 2 { //主线任务
wtask.Currchapter = v.Group wtask.Currchapter = v.Group
} }