From c7c558d09e178c688ac6775a0d124aee3eec5b00 Mon Sep 17 00:00:00 2001 From: Katelyn Gigante Date: Mon, 7 Aug 2023 05:06:05 +1000 Subject: [PATCH] Waiting On API --- gatherling/api_lib.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gatherling/api_lib.php b/gatherling/api_lib.php index 0cfde6558..b8fc1f41c 100644 --- a/gatherling/api_lib.php +++ b/gatherling/api_lib.php @@ -131,6 +131,7 @@ function repr_json_event($event) if ($matches) { $json['matches'] = []; $json['unreported'] = []; + $json['waiting_on'] = []; $addrounds = 0; $roundnum = 0; $timing = 0; @@ -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; @@ -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; + } } } }