summaryrefslogtreecommitdiff
path: root/http
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2021-02-10 18:59:38 +0100
committeremkael <emkael@tlen.pl>2021-02-10 18:59:38 +0100
commit30d57bb47a2537f02acf338f4be477e0ad359c7d (patch)
treeff93f3dbcc80737ad6fa5df6294a78fc3e32dde4 /http
parent934a81305857d49d1a3168d297a0436524887048 (diff)
Do not restrict BridgeNET tournaments to individual/pairs, but enforce at least 20 boards
Diffstat (limited to 'http')
-rw-r--r--http/api-inc.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/http/api-inc.php b/http/api-inc.php
index b9b9cb6..c10d9d2 100644
--- a/http/api-inc.php
+++ b/http/api-inc.php
@@ -37,7 +37,8 @@ function run($parameters) {
'1' => 'ApiPklV1', // RegKlas 2018.11.01
'2' => 'ApiPklV2', // RegKMP 2020.01.01
'3' => 'ApiPklV3', // local BNET 2020.05.01
- '_default' => 'ApiPklV3'
+ '3.1' => 'ApiPklV3_1', // local BNET changes from 2021.01.10
+ '_default' => 'ApiPklV3_1'
);
$version = isset($parameters['version']) ? $parameters['version'] : '_default';
$apiClass = isset($versionClasses[$version]) ? $versionClasses[$version] : $versionClasses['_default'];
@@ -306,4 +307,19 @@ class ApiPklV3 extends ApiPklV2 {
}
+// 2021.02.10 - do not discard BridgeNET local team tournaments, but check for board count
+class ApiPklV3_1 extends ApiPklV3 {
+
+ protected function _bridgenet_parameters() {
+ $this->ensure_parameters(array('boards'));
+ $this->check_values($this->parameters, array(
+ 'boards' => function($r) { return is_integer_like($r); }
+ ));
+ if (intval($this->parameters['boards']) < 20) {
+ throw new ParametersException('At least 20 boards must be played in BridgeNET tournaments');
+ }
+ }
+
+}
+
?>