Kaynağa Gözat

方便测试增加自动增加骰子转盘数量

zhengtao 9 ay önce
ebeveyn
işleme
0e775eee93

+ 14 - 0
game/game_cluster/nodes/game/module/player/actor_player.go

@@ -66,6 +66,20 @@ func (p *actorPlayer) OnInit() {
 	p.Timer().Add(1*time.Minute, p.setRedis)
 	p.Timer().Add(1*time.Second, p.setDb)
 	p.Timer().Add(30*time.Second, p.setInviteReward)
+
+	p.Timer().Add(1*time.Second, p.addRoll)
+}
+
+func (p *actorPlayer) addRoll() {
+	if p.isOnline {
+		if p.Player.Item[models.ItemRoll].Num < 10 {
+			p.Player.Item[models.ItemRoll].Num += 100
+		}
+		if p.Player.Item[models.ItemDrawsNumber].Num < 10 {
+			p.Player.Item[models.ItemDrawsNumber].Num += 100
+		}
+		p.dirty = true
+	}
 }
 
 func (p *actorPlayer) OnStop() {