From 24515fb927a0f5d7d2946435db0d4c81cc0fe045 Mon Sep 17 00:00:00 2001 From: xiangmy21 <90919434+xiangmy21@users.noreply.github.com> Date: Wed, 8 May 2024 03:59:02 +0800 Subject: [PATCH] fix: ContestResult in run.sh --- dependency/shell/run.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dependency/shell/run.sh b/dependency/shell/run.sh index bb10d6d1..4ac6370c 100644 --- a/dependency/shell/run.sh +++ b/dependency/shell/run.sh @@ -81,10 +81,10 @@ function retry_command { if [ "$TERMINAL" = "SERVER" ]; then map_path=$map_dir/$MAP_ID.txt if [ $EXPOSED -eq 1 ]; then - nice -10 ./Server --port 8888 --teamCount 2 --shipNum 4 --resultFileName $playback_dir/result --gameTimeInSecond $GAME_TIME --mode $MODE_NUM --mapResource $map_path --url $SCORE_URL --token $TOKEN --fileName $playback_dir/video --startLockFile $playback_dir/start.lock > $playback_dir/server.log 2>&1 & + nice -10 ./Server --port 8888 --teamCount 2 --shipNum 4 --resultFileName $playback_dir/result --gameTimeInSecond $GAME_TIME --mode $MODE_NUM --mapResource $map_path --url $SCORE_URL --token $TOKEN --fileName $playback_dir/playback --startLockFile $playback_dir/start.lock > $playback_dir/server.log 2>&1 & server_pid=$! else - nice -10 ./Server --port 8888 --teamCount 2 --shipNum 4 --resultFileName $playback_dir/result --gameTimeInSecond $GAME_TIME --mode $MODE_NUM --mapResource $map_path --notAllowSpectator --url $SCORE_URL --token $TOKEN --fileName $playback_dir/video --startLockFile $playback_dir/start.lock > $playback_dir/server.log 2>&1 & + nice -10 ./Server --port 8888 --teamCount 2 --shipNum 4 --resultFileName $playback_dir/result --gameTimeInSecond $GAME_TIME --mode $MODE_NUM --mapResource $map_path --notAllowSpectator --url $SCORE_URL --token $TOKEN --fileName $playback_dir/playback --startLockFile $playback_dir/start.lock > $playback_dir/server.log 2>&1 & server_pid=$! fi @@ -101,9 +101,9 @@ if [ "$TERMINAL" = "SERVER" ]; then if [ ! -f $playback_dir/start.lock ]; then echo "Failed to start game." touch temp.lock - mv -f temp.lock $playback_dir/video.thuaipb + mv -f temp.lock $playback_dir/playback.thuaipb kill -9 $server_pid - finish_payload='{"result": {"status": "Crashed", "scores": [0, 0]}}' + finish_payload='{"status": "Crashed", "scores": [0, 0]}' curl $FINISH_URL -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" -d "${finish_payload}" > $playback_dir/send.log 2>&1 else echo "Game is started."