#!/usr/bin/env python3 """ Quick start script for RTS Game """ import subprocess import sys import os def main(): print("šŸŽ® RTS Commander - Quick Start") print("=" * 50) print() # Check if we're in the correct directory if not os.path.exists('app.py'): print("āŒ Error: app.py not found!") print("Please run this script from the web/ directory") sys.exit(1) # Check if static files exist required_files = ['static/index.html', 'static/styles.css', 'static/game.js'] for file in required_files: if not os.path.exists(file): print(f"āŒ Error: {file} not found!") sys.exit(1) print("āœ… All required files found") print() # Install dependencies print("šŸ“¦ Installing dependencies...") try: subprocess.run([sys.executable, "-m", "pip", "install", "-q", "-r", "requirements.txt"], check=True) print("āœ… Dependencies installed") except subprocess.CalledProcessError: print("āŒ Failed to install dependencies") sys.exit(1) print() print("šŸš€ Starting RTS Game Server...") print() print("šŸ“ Server will be available at:") print(" http://localhost:7860") print() print("šŸ“” MCP server available at:") print(" http://localhost:8001") print(" (For AI integration via Model Context Protocol)") print() print("šŸ’” To start only the MCP server (for testing):") print(" python start_mcp_only.py") print() print("Press Ctrl+C to stop the server") print() # Start uvicorn server try: subprocess.run([ sys.executable, "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--reload" ]) except KeyboardInterrupt: print("\n\nšŸ‘‹ Server stopped. Thanks for playing!") except FileNotFoundError: print("āŒ uvicorn not found. Installing...") subprocess.run([sys.executable, "-m", "pip", "install", "uvicorn[standard]"]) print("Please run this script again.") if __name__ == "__main__": main()