File size: 1,290 Bytes
4c75d73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python3
"""Quick test to add world events and verify auto-refresh"""

import requests
import json
import time

def test_world_events_via_api():
    """Test world events via the web interface API"""
    base_url = "http://localhost:7866"
    
    print("🌍 Testing World Events Auto-Refresh")
    print("=" * 50)
    
    try:
        # Try to access the main page first
        response = requests.get(base_url, timeout=5)
        if response.status_code == 200:
            print("✅ Server is accessible")
        else:
            print(f"❌ Server response: {response.status_code}")
            return
            
        print("\n💡 Now go to the browser and:")
        print("1. Join the game with any name")
        print("2. Watch the 'World Events' panel")
        print("3. The auto-refresh should show events every 2 seconds")
        print("4. Try moving around to generate more events")
        print("\n🔄 Auto-refresh timer should now include world_events output!")
        
    except requests.exceptions.RequestException as e:
        print(f"❌ Cannot connect to server: {e}")
        print("Make sure the server is running at http://localhost:7866")

if __name__ == "__main__":
    test_world_events_via_api()