Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe Final Version #691

Merged
merged 6 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CAPI/python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
grpcio==1.54.2
grpcio-tools==1.62.1
grpcio==1.62.2
grpcio-tools==1.62.2
numpy
14 changes: 7 additions & 7 deletions dependency/shell/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function retry_command {
if [ "$TERMINAL" = "SERVER" ]; then
map_path=$map_dir/$MAP_ID.txt
# allow spectator always.
nice -10 ./Server --port 8888 --studentCount 4 --trickerCount 1 --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 --studentCount 4 --trickerCount 1 --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=$!
echo "server pid: $server_pid"
ls $playback_dir
Expand Down Expand Up @@ -118,13 +118,13 @@ if [ "$TERMINAL" = "SERVER" ]; then
read_array get_current_team_label $TEAM_LABELS
if [[ "${current_team_label}" == "Student" ]]; then
echo "Parse Success: 1st team is Student"
finish_payload='{"result": {"status": "Finished", "scores": ['${score0}', '${score1}']}}'
finish_payload='{"status": "Finished", "scores": ['${score0}', '${score1}']}'
elif [[ "${current_team_label}" == "Tricker" ]]; then
echo "Parse Success: 1st team is Tricker"
finish_payload='{"result": {"status": "Finished", "scores": ['${score1}', '${score0}']}}'
finish_payload='{"status": "Finished", "scores": ['${score1}', '${score0}']}'
else
echo "Parse Failure: 1st team is Unknown"
finish_payload='{"result": {"status": "Crashed", "scores": [0, 0]}}'
finish_payload='{"status": "Crashed", "scores": [0, 0]}'
fi

if [[ -n $finish_payload ]]; then
Expand All @@ -139,11 +139,11 @@ if [ "$TERMINAL" = "SERVER" ]; then
echo "Finish!"
else
echo "Failed to start game."
touch $playback_dir/finish.lock
# touch $playback_dir/finish.lock
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
fi

Expand Down
Loading