跨周问题

This commit is contained in:
sk 2024-07-01 18:43:00 +08:00
parent b067f07b2c
commit 9a6ced171b
1 changed files with 4 additions and 3 deletions

View File

@ -3,6 +3,7 @@ package main
import ( import (
"time" "time"
"mongo.games.com/game/common"
"mongo.games.com/goserver/core/module" "mongo.games.com/goserver/core/module"
) )
@ -114,9 +115,9 @@ func (this *ClockMgr) Update() {
this.LastDay = day this.LastDay = day
this.fireDayEvent() this.fireDayEvent()
_, week := tNow.ISOWeek() week := common.GetWeekStartTs(tNow.Unix())
if week != this.LastWeek { if week != int64(this.LastWeek) {
this.LastWeek = week this.LastWeek = int(week)
this.fireWeekEvent() this.fireWeekEvent()
} }