Spaces:
Sleeping
Sleeping
debug: Add game loop health check logs
Browse files- Log when game loop starts
- Log every 5 seconds to confirm loop is running
- This will identify if the game loop is the issue
app.py
CHANGED
|
@@ -423,6 +423,7 @@ class ConnectionManager:
|
|
| 423 |
|
| 424 |
async def game_loop(self):
|
| 425 |
"""Main game loop - runs at 20 ticks per second"""
|
|
|
|
| 426 |
while self.active_connections:
|
| 427 |
try:
|
| 428 |
# Update game state
|
|
@@ -487,6 +488,10 @@ class ConnectionManager:
|
|
| 487 |
"""Update game simulation - Red Alert style!"""
|
| 488 |
self.game_state.tick += 1
|
| 489 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 490 |
# Update superweapon charge (30 seconds = 1800 ticks at 60 ticks/sec)
|
| 491 |
for player in self.game_state.players.values():
|
| 492 |
if not player.superweapon_ready and player.superweapon_charge < 1800:
|
|
|
|
| 423 |
|
| 424 |
async def game_loop(self):
|
| 425 |
"""Main game loop - runs at 20 ticks per second"""
|
| 426 |
+
print("🔄 Game loop STARTED")
|
| 427 |
while self.active_connections:
|
| 428 |
try:
|
| 429 |
# Update game state
|
|
|
|
| 488 |
"""Update game simulation - Red Alert style!"""
|
| 489 |
self.game_state.tick += 1
|
| 490 |
|
| 491 |
+
# DEBUG: Log every 5 seconds to confirm game loop is running
|
| 492 |
+
if self.game_state.tick % 100 == 0:
|
| 493 |
+
print(f"⏱️ Game tick: {self.game_state.tick} (loop running)")
|
| 494 |
+
|
| 495 |
# Update superweapon charge (30 seconds = 1800 ticks at 60 ticks/sec)
|
| 496 |
for player in self.game_state.players.values():
|
| 497 |
if not player.superweapon_ready and player.superweapon_charge < 1800:
|