From b1513c772a934747458645e82c4e68ff57f14dec Mon Sep 17 00:00:00 2001 From: Changli Tang <84725343+TCL606@users.noreply.github.com> Date: Mon, 24 Apr 2023 22:50:01 +0800 Subject: [PATCH] Update run.sh --- dependency/shell/run.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/dependency/shell/run.sh b/dependency/shell/run.sh index 86a88bb..3d63212 100644 --- a/dependency/shell/run.sh +++ b/dependency/shell/run.sh @@ -1,6 +1,8 @@ #!/usr/local -nice -10 ./Server/Server --port 8888 --studentCount 4 --trickerCount 1 --gameTimeInSecond 600 --url $URL --token $TOKEN +python_dir=/usr/local/PlayerCode/CAPI/python/PyAPI + +nice -10 ./Server --port 8888 --studentCount 4 --trickerCount 1 --gameTimeInSecond 600 --url $URL --token $TOKEN sleep 5 for k in {1..2} do @@ -9,8 +11,9 @@ do for i in {1..4} do j=$((i - 1)) - if [ -f "./python/player$i.py" ]; then - nice -0 python3 ./python/player$i.py -I 127.0.0.1 -P 8888 -p $j + if [ -f "./player$i.py" ]; then + cp -f ./player$i.py $python_dir/AI.py + nice -0 python3 $python_dir/AI.py -I 127.0.0.1 -P 8888 -p $j elif [ -f "./capi$i" ]; then nice -0 ./capi$i -I 127.0.0.1 -P 8888 -p $j else @@ -21,8 +24,9 @@ do for i in {5..5} do j=$((i - 1)) - if [ -f "./python/player$i.py" ]; then - nice -0 python3 ./python/player$i.py -I 127.0.0.1 -P 8888 -p $j + if [ -f "./player$i.py" ]; then + cp -f ./player$i.py $python_dir/AI.py + nice -0 python3 $python_dir/AI.py -I 127.0.0.1 -P 8888 -p $j elif [ -f "./capi$i" ]; then nice -0 ./capi$i -I 127.0.0.1 -P 8888 -p $j else