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

Correct handling of retired and disqualified athletes #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
12 changes: 11 additions & 1 deletion bts/btp_proto.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,23 @@ function update_request(match, key_unicode, password, umpire_btp_id, service_jud
};
});

let scoreStatus = 0; //Won normally
if( (match.presses.length > 0 && match.presses[match.presses.length - 1].type == "retired") ||
(match.presses.length > 1 && match.presses[match.presses.length - 2].type == "retired")) {
scoreStatus = 2; //retired
}
if( (match.presses.length > 0 && match.presses[match.presses.length - 1].type == "disqualified") ||
(match.presses.length > 1 && match.presses[match.presses.length - 2].type == "disqualified")) {
scoreStatus = 3; //disqualified
}

const m = {
ID: btp_m_id.id,
DrawID: btp_m_id.draw,
PlanningID: btp_m_id.planning,
Sets: sets,
Winner: winner,
ScoreStatus: 0, // Won normally (TODO: correctly handle resignations etc.)
ScoreStatus: scoreStatus,
Duration: duration_mins,
Status: 0,
// BTP also sends a boolean ScoreSheetPrinted here
Expand Down