From b6cc0b7cf36820b6b31276468b05f00ca4b4ad4f Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 14 May 2020 00:24:46 +0200 Subject: Boards count instead of over/under parameter --- http/api-inc.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'http/api-inc.php') diff --git a/http/api-inc.php b/http/api-inc.php index c2336af..9cac20e 100644 --- a/http/api-inc.php +++ b/http/api-inc.php @@ -235,6 +235,20 @@ class ApiPklV2 extends ApiPklV1 { } -class ApiPklV3 extends ApiPklV2 {} +class ApiPklV3 extends ApiPklV2 { + + function check_parameters() { + if (!isset($this->parameters['manual']) || !isset($this->parameters['manual']['min_points']) || !isset($this->parameters['manual']['tournament_weight'])) { + if (isset($this->parameters['boards'])) { + $this->check_values($this->parameters, array( + 'boards' => function($r) { return ctype_digit($r); } + )); + $this->parameters['over39_boards'] = strval(intval($this->parameters['boards'] > 39)); + } + } + return parent::check_parameters(); + } + +} ?> -- cgit v1.2.3