From 8e16b638af5329c8e6ac4afe0639a0b54ce88993 Mon Sep 17 00:00:00 2001 From: Changli Tang <84725343+TCL606@users.noreply.github.com> Date: Thu, 27 Apr 2023 02:55:14 +0800 Subject: [PATCH] Update run.sh --- dependency/shell/run.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dependency/shell/run.sh b/dependency/shell/run.sh index 7ee81e0..e11e3f8 100644 --- a/dependency/shell/run.sh +++ b/dependency/shell/run.sh @@ -3,8 +3,13 @@ python_dir=/usr/local/PlayerCode/CAPI/python/PyAPI playback_dir=/usr/local/playback -nice -10 ./Server --port 8888 --studentCount 4 --trickerCount 1 --gameTimeInSecond 600 --url $URL --token $TOKEN --fileName $playback_dir/video --startLockFile $playback_dir/start.lock > $playback_dir/server.log & -server_pid=$! +if [ $EXPOSED -eq 1 ]; then + nice -10 ./Server --port 8888 --studentCount 4 --trickerCount 1 --gameTimeInSecond 600 --url $URL --token $TOKEN --fileName $playback_dir/video --startLockFile $playback_dir/start.lock > $playback_dir/server.log & + server_pid=$! +else + nice -10 ./Server --port 8888 --studentCount 4 --trickerCount 1 --gameTimeInSecond 600 --notAllowSpectator --url $URL --token $TOKEN --fileName $playback_dir/video --startLockFile $playback_dir/start.lock > $playback_dir/server.log & + server_pid=$! +fi sleep 5 for k in {1..2} do @@ -60,4 +65,4 @@ fi result=$(cat /usr/local/playback/result.json) score0=$(parse_json $result "Student") score1=$(parse_json $result "Tricker") -curl $URL -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" -d '{"result":[{"team_id":0, "score":'${score0}'}, {"team_id":1, "score":'${score1}'}], "mode":'${MODE}'}' \ No newline at end of file +curl $URL -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" -d '{"result":[{"team_id":0, "score":'${score0}'}, {"team_id":1, "score":'${score1}'}], "mode":'${MODE}'}'