MMORPG_AI_NPC_MCP_CLIENT_SERVER / tests /test_auto_refresh.py
Chris4K's picture
Upload 195 files
4c75d73 verified
#!/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()