Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion python/udp_to_websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@
# SimAPI file paths - SayIntentionsAI reads from a specific location
def get_local_appdata_path():
# Get the local appdata directory path where SayIntentionsAI expects SimAPI files
return os.path.join(os.environ.get('LOCALAPPDATA', ''), 'SayIntentionsAI')
# Cross-platform support for Windows and macOS
if os.name == 'nt': # Windows
return os.path.join(os.environ.get('LOCALAPPDATA', ''), 'SayIntentionsAI')
else: # macOS/Linux
# Use ~/Library/Application Support for macOS
home = os.path.expanduser('~')
return os.path.join(home, 'Library', 'Application Support', 'SayIntentionsAI')

def ensure_simapi_dir():
# Ensure the SayIntentionsAI directory exists in local appdata
Expand Down
40 changes: 40 additions & 0 deletions start_aerofly_map.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

echo "Starting Aerofly Moving Map..."
echo

# Start the UDP to WebSocket server in the background
echo "Starting UDP to WebSocket server..."
python3 python/udp_to_websocket.py &
UDP_PID=$!

# Wait a moment for the first server to start
sleep 2

# Start the HTTP server in the background
echo "Starting HTTP server..."
python3 -m http.server 8080 &
HTTP_PID=$!

# Wait a moment for the HTTP server to start
sleep 3

# Open the browser
echo "Opening browser..."
open http://localhost:8080/index.html

echo
echo "Aerofly Moving Map is starting up!"
echo
echo "The following servers should now be running:"
echo "1. UDP to WebSocket Server (receives data from Aerofly FS 4) - PID: $UDP_PID"
echo "2. HTTP Server (serves the web page) - PID: $HTTP_PID"
echo "3. Browser with the moving map"
echo
echo "To stop the servers, press Ctrl+C or run: kill $UDP_PID $HTTP_PID"
echo

# Wait for user input to stop
read -p "Press Enter to stop the servers..."
kill $UDP_PID $HTTP_PID
echo "Servers stopped."