func (p *BasePlayer) CheckNewDay() { if !util.IsSameDay(time.Now(), p.lastupdate) { p.lastupdate = time.Now() p.Entity.(*entity.Player).SetLastUpdateTime(time.Now().Unix()) App.tasksystem.NewDay(p.Entity.(*entity.Player)) //新一天 } }
func (p *PlayerList) CheckNewDay() { if util.IsSameDay(p.lasttime, time.Now()) { return } newday := &s2c.Respnewday{} for _, pl := range p.players { if !pl.Deleted { server.MailTo(nil, &pl.Mailbox, "SyncTime.RespNewDay", newday) } } p.lasttime = time.Now() }