From 9a1bccf14cecf2313fc98592d6026d93055ad6e9 Mon Sep 17 00:00:00 2001 From: by <123456@qq.com> Date: Sun, 12 Jan 2025 00:01:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=B4=E5=85=BD=E6=8E=92=E8=A1=8C=E6=A6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/rankmatch.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/worldsrv/rankmatch.go b/worldsrv/rankmatch.go index fdcf4c0..45f0c57 100644 --- a/worldsrv/rankmatch.go +++ b/worldsrv/rankmatch.go @@ -956,9 +956,9 @@ func (r *RankMatchMgr) NianRankAward() { // 转换为时间戳(以秒为单位) timestamp := t.Unix() end, _ := time.Parse(time.DateTime, endTime) - //endTimestamp := end.Unix() + endTimestamp := end.Unix() nowTime := time.Now().Unix() - if nowTime < timestamp || time.Now().Day()-1 > end.Day() { + if nowTime < timestamp || nowTime-86400 > endTimestamp { return } log := &model.NianPlayerRankLog{} @@ -1053,7 +1053,8 @@ func (r *RankMatchMgr) NianRankAward() { })).StartByExecutor("NianLuck_Award") } else if info.TypeId == 2 { - if time.Now().Day()-1 != end.Day() { + yesterday := time.Unix(time.Now().Unix()-86400, 0) + if yesterday.Day() != end.Day() { return } rankAward := info.RankInfo