From 700a5132a12ffa2abd82a1d77ab760268fb05c98 Mon Sep 17 00:00:00 2001 From: Tyler Marques Date: Wed, 4 Jun 2025 14:16:44 -0400 Subject: [PATCH] Fixing some issues with streaming and games not being accessible Signed-off-by: Tyler Marques --- ai_animation/.dockerignore | 3 +++ ai_animation/public/.dockerignore | 1 + ai_animation/reorganize_games.sh | 38 +++++++++++++++++++++++++++++++ ai_animation/vite.config.js | 8 +++---- docker-compose.yaml | 2 ++ 5 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 ai_animation/.dockerignore create mode 100644 ai_animation/public/.dockerignore create mode 100755 ai_animation/reorganize_games.sh diff --git a/ai_animation/.dockerignore b/ai_animation/.dockerignore new file mode 100644 index 0000000..f767f2a --- /dev/null +++ b/ai_animation/.dockerignore @@ -0,0 +1,3 @@ +**/*.zip +./node_modules/ +./public/games/ diff --git a/ai_animation/public/.dockerignore b/ai_animation/public/.dockerignore new file mode 100644 index 0000000..33bb22a --- /dev/null +++ b/ai_animation/public/.dockerignore @@ -0,0 +1 @@ +./games/ diff --git a/ai_animation/reorganize_games.sh b/ai_animation/reorganize_games.sh new file mode 100755 index 0000000..0a3b741 --- /dev/null +++ b/ai_animation/reorganize_games.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# Navigate to the games directory +cd "public/games" || exit 1 + +# Initialize counter +counter=0 + +# Process each directory (excluding files) +for dir in */; do + # Remove trailing slash from directory name + dir_name="${dir%/}" + + # Skip if it's not a directory or if it's a numeric directory (already processed) + if [[ ! -d "$dir_name" ]] || [[ "$dir_name" =~ ^[0-9]+$ ]]; then + continue + fi + + echo "Processing: $dir_name" + + # Create empty file with same name as directory in parent directory + touch "../$dir_name" + + # Check if lmvsgame.json exists and rename it to game.json + if [[ -f "$dir_name/lmvsgame.json" ]]; then + mv "$dir_name/lmvsgame.json" "$dir_name/game.json" + echo " Renamed lmvsgame.json to game.json" + fi + + # Rename directory to integer + mv "$dir_name" "$counter" + echo " Renamed directory to: $counter" + + # Increment counter + ((counter++)) +done + +echo "Reorganization complete. Processed $counter directories." \ No newline at end of file diff --git a/ai_animation/vite.config.js b/ai_animation/vite.config.js index 32355d9..dc2ada2 100644 --- a/ai_animation/vite.config.js +++ b/ai_animation/vite.config.js @@ -4,10 +4,10 @@ import { defineConfig, loadEnv } from 'vite'; export default defineConfig(({ mode }) => { // Load environment variables const env = loadEnv(mode, process.cwd(), ''); - + console.log('Environment mode:', mode); console.log('Environment variables loaded:', Object.keys(env).filter(key => key.startsWith('VITE_'))); - + return { // Define environment variables that should be available in the client define: { @@ -19,10 +19,10 @@ export default defineConfig(({ mode }) => { }, // Server configuration "preview": { - "allowedHosts": ["diplomacy"] + "allowedHosts": ["diplomacy", "archlinux"] }, "dev": { - "allowedHosts": ["diplomacy"] + "allowedHosts": ["diplomacy", "archlinux"] } }; }); diff --git a/docker-compose.yaml b/docker-compose.yaml index 933c8f8..1d0172a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -14,6 +14,8 @@ services: ports: - "4173:4173" - "5173:5173" + volumes: + - ./ai_animation/public/games/:/app/dist/games diplomacy-dev: build: ai_animation ports: