MMORPG_AI_NPC_MCP_CLIENT_SERVER / tests /test_autodiscovery.py
Chris4K's picture
Upload 195 files
4c75d73 verified
#!/usr/bin/env python3
"""
Test script for the auto-discovery system
"""
from src.core.game_engine import GameEngine
from src.interfaces.npc_addon import get_registered_addons
def test_autodiscovery():
print("Testing auto-discovery system...")
# Create game engine to trigger addon discovery
engine = GameEngine()
engine.start()
# Check what addons were discovered
addons = get_registered_addons()
print(f"\nDiscovered addons: {len(addons)}")
for addon_id, addon in addons.items():
print(f" - {addon_id}: {addon.addon_name}")
if hasattr(addon, 'npc_config') and addon.npc_config:
config = addon.npc_config
print(f" NPC: {config['id']} at position ({config['x']}, {config['y']})")
if hasattr(addon, 'ui_tab_name') and addon.ui_tab_name:
print(f" UI Tab: {addon.ui_tab_name}")
# Check if weather oracle was discovered
if 'weather_oracle' in addons:
print("\n✅ Weather Oracle addon successfully auto-discovered!")
else:
print("\n❌ Weather Oracle addon NOT discovered")
# Check if fortune teller was discovered
if 'fortune_teller' in addons:
print("✅ Fortune Teller addon successfully auto-discovered!")
else:
print("❌ Fortune Teller addon NOT discovered")
print(f"\nTotal addons discovered: {len(addons)}")
engine.stop()
if __name__ == "__main__":
test_autodiscovery()