update
This commit is contained in:
parent
bf56296aa6
commit
c4f0e8fc26
@ -154,6 +154,8 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe
|
|||||||
}
|
}
|
||||||
|
|
||||||
finishRsp := func() {
|
finishRsp := func() {
|
||||||
|
this.module.modelWorldtask.updateRandomTask(session.GetUserId(), userTask)
|
||||||
|
|
||||||
nextTaskIds := this.module.modelWorldtask.findNextTasks(curTaskConf.Key)
|
nextTaskIds := this.module.modelWorldtask.findNextTasks(curTaskConf.Key)
|
||||||
this.module.Debug("nextTaskIds", log.Field{Key: "nextTaskIds", Value: nextTaskIds})
|
this.module.Debug("nextTaskIds", log.Field{Key: "nextTaskIds", Value: nextTaskIds})
|
||||||
|
|
||||||
|
@ -231,6 +231,8 @@ func (this *ModelWorldtask) updateCheckCond(uid string, userTask *pb.DBWorldtask
|
|||||||
|
|
||||||
// 任务完成推送
|
// 任务完成推送
|
||||||
func (this *ModelWorldtask) taskFinishPush(session comm.IUserSession, groupId int32, userTask *pb.DBWorldtask, curTaskConf *cfg.GameWorldTaskData) {
|
func (this *ModelWorldtask) taskFinishPush(session comm.IUserSession, groupId int32, userTask *pb.DBWorldtask, curTaskConf *cfg.GameWorldTaskData) {
|
||||||
|
this.updateRandomTask(session.GetUserId(), userTask)
|
||||||
|
|
||||||
nextTaskIds := this.findNextTasks(curTaskConf.Key)
|
nextTaskIds := this.findNextTasks(curTaskConf.Key)
|
||||||
this.moduleWorldtask.Debug("nextTaskIds", log.Field{Key: "nextTaskIds", Value: nextTaskIds})
|
this.moduleWorldtask.Debug("nextTaskIds", log.Field{Key: "nextTaskIds", Value: nextTaskIds})
|
||||||
|
|
||||||
@ -353,6 +355,23 @@ func (this *ModelWorldtask) updateRandomTask(uid string, myWorldtask *pb.DBWorld
|
|||||||
|
|
||||||
now := configure.Now().Unix()
|
now := configure.Now().Unix()
|
||||||
update := make(map[string]interface{})
|
update := make(map[string]interface{})
|
||||||
|
// 日常
|
||||||
|
if now-myWorldtask.DaliyRefreshTime >= 3600*24 {
|
||||||
|
dailyIds := this.randomTask(user.Lv, dailyDes, myWorldtask)
|
||||||
|
if len(dailyIds) > 0 {
|
||||||
|
for _, v := range dailyIds {
|
||||||
|
gwtd, err := this.moduleWorldtask.configure.getWorldtaskById(v)
|
||||||
|
if err != nil || gwtd == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
myWorldtask.CurrentTask[gwtd.Group] = &pb.Worldtask{
|
||||||
|
TaskId: v,
|
||||||
|
TaskType: gwtd.Des,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
update["daliyRefreshTime"] = configure.Now().Unix()
|
||||||
|
}
|
||||||
|
}
|
||||||
//周常
|
//周常
|
||||||
if now-myWorldtask.WeekRefreshTime >= 3600*24*7 {
|
if now-myWorldtask.WeekRefreshTime >= 3600*24*7 {
|
||||||
weekIds := this.randomTask(user.Lv, weekDes, myWorldtask)
|
weekIds := this.randomTask(user.Lv, weekDes, myWorldtask)
|
||||||
|
Loading…
Reference in New Issue
Block a user