Skip to content

Commit

Permalink
Waiting On API
Browse files Browse the repository at this point in the history
  • Loading branch information
silasary committed Aug 6, 2023
1 parent 1d599d0 commit 75400ee
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gatherling/api_lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ function repr_json_event($event)
if ($matches) {
$json['matches'] = [];
$json['unreported'] = [];
$json['waiting_on'] = [];
$addrounds = 0;
$roundnum = 0;
$timing = 0;
Expand All @@ -143,6 +144,7 @@ function repr_json_event($event)
if ($roundnum != $m->round) {
$roundnum = $m->round;
$json['unreported'] = [];
$json['waiting_on'] = [];
}
$data['round'] = $m->round + $addrounds;
$json['matches'][] = $data;
Expand All @@ -153,6 +155,11 @@ function repr_json_event($event)
if (!$m->reportSubmitted($m->playerb)) {
$json['unreported'][] = $m->playerb;
}
if (!$m->reportSubmitted($m->playera) && $m->reportSubmitted($m->playerb)) {
$json['waiting_on'][] = $m->playera;
} elseif ($m->reportSubmitted($m->playera) && !$m->reportSubmitted($m->playerb)) {
$json['waiting_on'][] = $m->playerb;
}
}
}
}
Expand Down

0 comments on commit 75400ee

Please sign in to comment.