Skip to content

Commit

Permalink
fix: ContestResult in run.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangmy21 authored May 7, 2024
1 parent 1fcce7d commit 24515fb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dependency/shell/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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."
Expand Down

0 comments on commit 24515fb

Please sign in to comment.