From 9e3ade03ed5e323a39c95d6cdd78ffd1fbecc917 Mon Sep 17 00:00:00 2001 From: zhaocy Date: Thu, 28 Jul 2022 09:35:47 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E7=BD=AE=E7=8E=A9=E5=AE=B6=E6=B4=BB?= =?UTF-8?q?=E8=B7=83=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/task/module.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/task/module.go b/modules/task/module.go index f0604f81c..328c5971f 100644 --- a/modules/task/module.go +++ b/modules/task/module.go @@ -63,8 +63,22 @@ func (this *ModuleTask) CleanTask(session comm.IUserSession) { this.modelTaskActive.BatchDelLists(session.GetUserId()) } +// 重置玩家活跃度 +func (this *ModuleTask) resetActive(uid string, taskTag comm.TaskTag) { + update := make(map[string]interface{}) + if taskTag == comm.TASK_DAILY { + update["activeday"] = 0 + } else if taskTag == comm.TASK_WEEKLY { + update["activeweek"] = 0 + } + if len(update) > 0 { + this.ModuleUser.ChanageUserExpand(uid, update) + } +} + //重置任务 func (this *ModuleTask) ResetTask(uid string, taskTag comm.TaskTag) { + this.resetActive(uid, taskTag) this.modelTask.clearTask(uid, taskTag) this.modelTaskActive.clearTask(uid, taskTag) this.InitTaskAll(uid)