add .env var to set no save when win and turns are less or the same as the var

This commit is contained in:
2024-04-15 03:29:20 +02:00
parent 7457e66339
commit 38ba576de9
2 changed files with 10 additions and 3 deletions
+2 -1
View File
@@ -19,11 +19,12 @@ import os
# Start server when `python main.py` is run
if __name__ == "__main__":
CreateEnvironmentFile.load_dotenv({"STORE_GAME_HISTORY": True, "DEBUG": True, "SNAKE": "DummSnake"})
CreateEnvironmentFile.load_dotenv({"STORE_GAME_HISTORY": True, "DEBUG": True, "SNAKE": "DummSnake", "STORE_IF_WIN_AND_MOVES_ARE_BIGGER_AS": 10})
server = Server(
data_path=os.path.dirname(__file__),
snake_type=os.environ.get("SNAKE", "DummSnake"),
store_game_when_win_and_moves_are_bigger_as=int(os.environ.get("STORE_IF_WIN_AND_MOVES_ARE_BIGGER_AS", 10))
)
if os.environ.get("STORE_GAME_HISTORY", None):