32 lines
1.1 KiB
Python
Executable File
32 lines
1.1 KiB
Python
Executable File
#!/usr/bin/env -S uv run --script
|
|
|
|
# Welcome to
|
|
# __________ __ __ .__ __
|
|
# \______ \_____ _/ |__/ |_| | ____ ______ ____ _____ | | __ ____
|
|
# | | _/\__ \\ __\ __\ | _/ __ \ / ___// \\__ \ | |/ // __ \
|
|
# | | \ / __ \| | | | | |_\ ___/ \___ \| | \/ __ \| <\ ___/
|
|
# |________/(______/__| |__| |____/\_____>______>___|__(______/__|__\\_____>
|
|
#
|
|
# This file can be a nice home for your Battlesnake logic and helper functions.
|
|
#
|
|
# To get you started we've included code to prevent your Battlesnake from moving backwards.
|
|
# For more info see docs.battlesnake.com
|
|
|
|
from server.CreateEnvironmentFile import CreateEnvironmentFile
|
|
from server.bootstrap import build_run_config, build_server_from_env
|
|
|
|
import asyncio
|
|
import os
|
|
|
|
# Start server when `python main.py` is run
|
|
if __name__ == "__main__":
|
|
if os.environ.get("CREATE_ENV_FILE", None):
|
|
CreateEnvironmentFile.load_dotenv({
|
|
"STORE_GAME_HISTORY": True,
|
|
"DEBUG": True,
|
|
"SNAKE": "TemplateSnake",
|
|
})
|
|
|
|
server = build_server_from_env(default_snake_type="TemplateSnake")
|
|
asyncio.run(server.run(**build_run_config()))
|