#!/usr/bin/env python3 """ City Builder Game Launcher """ import sys import subprocess from pathlib import Path def main(): print("=" * 60) print("City Builder - Multiplayer Game") print("=" * 60) print() # Check if virtual environment exists venv_path = Path(".venv") if not venv_path.exists(): print("Virtual environment not found!") print("Creating virtual environment...") subprocess.run([sys.executable, "-m", "venv", ".venv"]) print("Virtual environment created.") print() print("Please run:") print(" - On Linux/Mac: source .venv/bin/activate") print(" - On Windows: .venv\\Scripts\\activate") print("Then run: pip install -r requirements.txt") print("Then run this script again.") return # Start the server print("Starting server on http://127.0.0.1:9901") print("-" * 60) print() print("Press Ctrl+C to stop the server") print() try: subprocess.run([ sys.executable, "-m", "uvicorn", "server.main:app", "--host", "127.0.0.1", "--port", "9901", "--reload" ]) except KeyboardInterrupt: print("\nServer stopped.") if __name__ == "__main__": main()