aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_ticktest.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/cmd_ticktest.go')
-rw-r--r--internal/game/cmd_ticktest.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/internal/game/cmd_ticktest.go b/internal/game/cmd_ticktest.go
new file mode 100644
index 0000000..6cadab7
--- /dev/null
+++ b/internal/game/cmd_ticktest.go
@@ -0,0 +1,21 @@
+package game
+
+import (
+ "fmt"
+
+ "thirdcollapse/internal/net"
+)
+
+func (g *Game) doTickTest(sess *net.Session) {
+ count := 0
+ g.Ticks.Subscribe(5, func() bool {
+ count++
+ sess.WriteLine(fmt.Sprintf("[Tick #%d] 600ms heartbeat is working.", count))
+ if count >= 3 {
+ sess.WriteLine("[Tick test complete.]")
+ return false
+ }
+ return true
+ })
+ sess.WriteLine("Tick test started — you'll see 3 messages at 5-tick intervals while commands still work.")
+}