rts-commander / start.py
Luigi's picture
Initial commit: Complete RTS project with MCP evaluation
551ad28
raw
history blame
2.17 kB
#!/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()