-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·32 lines (24 loc) · 728 Bytes
/
Copy pathrun.sh
File metadata and controls
executable file
·32 lines (24 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
cd "$(dirname "$0")"
if [ -z "$DISPLAY" ]; then
export DISPLAY=:0
fi
export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"
pkill -f "TrackerServer" 2>/dev/null
pkill -f "MazeGUI" 2>/dev/null
sleep 1
java -cp out com.maze.tracker.TrackerServer --width 20 --height 20 > nohup.out 2>&1 &
TRACKER_PID=$!
sleep 2
PLAYER_NAME="${1:-Player1}"
nohup java -cp out com.maze.gui.MazeGUI --name "$PLAYER_NAME" > nohup.out 2>&1 &
if [ -n "$2" ]; then
sleep 1
nohup java -cp out com.maze.gui.MazeGUI --name "$2" > nohup.out 2>&1 &
fi
if [ -n "$3" ]; then
sleep 1
nohup java -cp out com.maze.gui.MazeGUI --name "$3" > nohup.out 2>&1 &
fi
echo "Started Tracker (PID: $TRACKER_PID)"
echo "Game running..."