|
|
|
"""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:
|
|
|
|
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()
|
|
|