浏览代码

修改每日定时任务问题

zhengtao 11 月之前
父节点
当前提交
746e498ea8
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      game/game_cluster/nodes/game/module/player/actor_player.go

+ 7 - 1
game/game_cluster/nodes/game/module/player/actor_player.go

@@ -90,12 +90,18 @@ func (p *actorPlayer) OnInit() {
 	p.Timer().Add(1*time.Minute, p.upatePlayerLevelStat)
 	p.Timer().Add(1*time.Minute, p.upatePlayerLevelStat)
 
 
 	//在线用户定时刷新
 	//在线用户定时刷新
-	p.Timer().Add(1*time.Minute, p.Player.InitDaily)
+	p.Timer().Add(1*time.Minute, p.initDaily)
 
 
 	//p.Timer().Add(30*time.Second, p.getAndUpdateAvatar)  //排行榜头像
 	//p.Timer().Add(30*time.Second, p.getAndUpdateAvatar)  //排行榜头像
 
 
 }
 }
 
 
+func (p *actorPlayer) initDaily() {
+	if p.isOnline {
+		p.Player.InitDaily()
+	}
+}
+
 func (p *actorPlayer) addRoll() {
 func (p *actorPlayer) addRoll() {
 	if p.isOnline {
 	if p.isOnline {
 		if p.Player.Item[models.ItemRoll].Num < 10 {
 		if p.Player.Item[models.ItemRoll].Num < 10 {