Skip to content
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