From 067f7f2937a11c41cb1715443b92be4ec0748d10 Mon Sep 17 00:00:00 2001 From: eraseyourknees <112027564+eraseyourknees@users.noreply.github.com> Date: Mon, 29 Aug 2022 03:01:11 +0200 Subject: [PATCH] Add some helper functions --- shared/main.php | 2 +- shared/utils.php | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/shared/main.php b/shared/main.php index 242d7fb..ec7931d 100644 --- a/shared/main.php +++ b/shared/main.php @@ -16,7 +16,7 @@ limitations under the License. */ function uupApiVersion() { - return '1.34.0'; + return '1.35.0-dev'; } require_once dirname(__FILE__).'/auths.php'; diff --git a/shared/utils.php b/shared/utils.php index 083b92a..6c8284c 100644 --- a/shared/utils.php +++ b/shared/utils.php @@ -134,3 +134,19 @@ function uupApiCheckUpdateId($updateId) { $updateId ); } + +function uupApiIsServer($skuId) { + $serverSkus = [ + 7, 8, 12, 13, 79, 80, 120, 145, 146, + 147, 148, 159, 160, 406, 407, 408 + ]; + + return in_array($skuId, $serverSkus); +} + +function uupApiBuildMajor($build) { + if(!str_contains($build, '.')) { + return intval($build); + } + return intval(explode('.', $build)[0]); +}