diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 1ff0f712..57131547 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -1,9 +1,9 @@ name: Cypress on: pull_request: - branches: [develop] + branches: [main] push: - branches: [develop] + branches: [main] jobs: cypress: @@ -35,7 +35,7 @@ jobs: - name: Checkout MyAAC uses: actions/checkout@v4 with: - ref: develop + ref: main - uses: actions/setup-node@v4 with: diff --git a/.github/workflows/phplint.yml b/.github/workflows/phplint.yml index aa95caed..a1b9c4ac 100644 --- a/.github/workflows/phplint.yml +++ b/.github/workflows/phplint.yml @@ -1,9 +1,9 @@ name: PHP Linting on: pull_request: - branches: [develop] + branches: [main] push: - branches: [develop] + branches: [main] jobs: phplint: diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 8c581d8a..2e60e570 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -2,9 +2,9 @@ name: "PHPStan" on: pull_request: - branches: [develop] + branches: [main] push: - branches: [develop] + branches: [main] jobs: tests: diff --git a/.gitignore b/.gitignore index 39712f98..b198856f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ Thumbs.db # /.htaccess +lua # composer composer.phar @@ -75,6 +76,3 @@ landing # system system/functions_custom.php - -# others/rest -system/pages/downloads.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 99fda8da..6b90ab4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,92 @@ # Changelog +## [1.2 - 09.02.2025] + +### Added +* Twig session(key) function + reworked session functions to accept multi-array like in Laravel (https://github.com/slawkens/myaac/commit/b46ddb43d03ef7e5fc34e555e92e856bdc905691) +* add template_name to twig variables (https://github.com/slawkens/myaac/commit/ae1161d77050bda181802b4496c9de920a7bb1bc) +* add HOOK_INIT, executed just after $hooks are loaded (https://github.com/slawkens/myaac/commit/19686725dc810f63a07f049f82c66cf336d90ca6) + +### Changed +* settings: password input hide/show, enable Save button only if changes has been made, save settings in transaction (https://github.com/slawkens/myaac/commit/4fda4f643b60a151179e5dd4f04912fb2618d98f, https://github.com/slawkens/myaac/commit/28fef952f857b79d64bc7495ffa5e1999e68e192, https://github.com/slawkens/myaac/commit/4b6024dc451accadb6c469fa282a9a764c1c0a81) +* rework menus: Different categories can have different colors + Option to reset menus (https://github.com/slawkens/myaac/commit/73de93a561f6b13111e019075724357d8a617249, https://github.com/slawkens/myaac/commit/3da3e62c5b12390d75de9b3320729bcca6e0b458) + +### Fixed +* highscores: Fix online status + vocation for TFS 0.x (https://github.com/slawkens/myaac/commit/ea51ad27c38be88d86514cb979bb394fcfbef1f0) +* clear cache button in admin bar needed to be clicked twice until it worked (https://github.com/slawkens/myaac/commit/ea51ad27c38be88d86514cb979bb394fcfbef1f0) +* HOOK_STARTUP location (https://github.com/slawkens/myaac/commit/a73fb1003ee3f812cf182d1834d65f08e6f60d1f) +* if vocation name has more words (https://github.com/slawkens/myaac/commit/9d7fc98e1e0a96b59ecc1a7c39800a64445db364) + +### Updated +* Bump twig/twig from 3.18.0 to 3.19.0 (#284) + +## [1.1 - 27.01.2025] + +### Changed +* adjust mailer settings descriptions to latest gmail (https://github.com/slawkens/myaac/commit/c5d5bb80671db135e6b503f53684771c7272e05d) +* optimize $player->isOnline() function, thanks @gesior (https://github.com/slawkens/myaac/commit/10dd818b139d5e1bb1ca9ec81edfb083ba9316b4) +* make players.comment and guilds.description VARCHAR (https://github.com/slawkens/myaac/commit/a45ceab83a74bee2b89cdb72baceda75e577e3cf) +* add lua/ folder to .gitignore (https://github.com/slawkens/myaac/commit/07012f786b1114cb6ab2f064f82c645b136a375a) + +### Fixed +* general fixes in the tibiacom template menus, better support for custom menus +* make functions_custom.php optional (https://github.com/slawkens/myaac/commit/dc2b5afd9980984e2b259c9fc99f2ade46f70a5a) +* error in CLI, where BASE_URL is not defined (https://github.com/slawkens/myaac/commit/4d749b881582f64b5a46196dbbb5ee8097127f03) +* hook ACCOUNT_LOGIN_BEFORE_ACCOUNT location (https://github.com/slawkens/myaac/commit/669c447fca8643ce56d9ef8c1374ec647c780998) + +## [1.0.1 - 14.01.2025] + +### Fixed +* tibiacom account & news menu links not auto expanding + +### Updated (Thanks dependabot) +* twig from ^2.0 to ^3.11 +* tinymce from ^6.8.3 to ^7.2.0 +* cypress from ^12.12.0 to ^13.17.0 +* nesbot/carbon from 2.72.5 to 2.72.6 + +## [1.0 - 12.01.2025] + +First stable release in the v1.0 series. + +Minimum PHP 8.1 is required. + +Changes since RC.2: + +### Added +* feature: migrations up/down. Allows to downgrade/upgrade database to specified version (https://github.com/slawkens/myaac/commit/3f6ff3a3326b0475d28d11ffd7fff51f362d799f) +* new hooks for news management (https://github.com/slawkens/myaac/commit/011a85d8ae34283ded6999882833f9d4797028ec, https://github.com/slawkens/myaac/commit/36bd3eb846e829b45313e10f7568dc4e95841143) +* None Vocation to highscores (can be changed to RookStayer in Admin Panel) (https://github.com/slawkens/myaac/commit/a4a248099521bb5b8b2aa5bd592138debd2f19d5) +* support for button_color (green, red, blue) (https://github.com/slawkens/myaac/commit/d8b6b749ee62e88b6af4a05d3d7557f90b94d94e) +* add $whoopsHandler as variable, can be used by plugins (https://github.com/slawkens/myaac/commit/b0c8cf2ecda23045d725aaf43cfb3852ed766a4b) +* PlayerModel->outfit_url attribute (https://github.com/slawkens/myaac/commit/3b5be1a8db5dceecaa388e2925a5536d13b38881) +* support for selecting plugin themes in Admin menus.php (https://github.com/slawkens/myaac/commit/77a2c1cec343ffe4be5c2c2503ee81bc32a14ca1) + +### Changed +* schema: Change character set to utf8mb4 (support for Emojis in Menus/Pages/News/Forum etc.) (https://github.com/slawkens/myaac/commit/27c44f1bdfb6234cf0c9d5b4b491123bb205b08f) +* prefer get_browser_real_ip() over REMOTE_ADDR (https://github.com/slawkens/myaac/commit/941846605c00cee83168d2f916410b8ba8d4b7b9) +* automatically set selected current one on highscores filters (https://github.com/slawkens/myaac/commit/e96227fbe41ae281783b2d49edb169a603601813) +* rewrite towns loading code, removed OTBM loader (was too slow) (https://github.com/slawkens/myaac/commit/c980a0914632e7b27f718464f669a200707d217e) +* allow OTS_Player to be passed as object to getPlayerLink (https://github.com/slawkens/myaac/commit/84d37c5a8f2c4535a41c8aa8264752969d3f3a3d) +* do not clear menus by default on install (https://github.com/slawkens/myaac/commit/12d8faa3eda5e798f97b71e941c035187daad96e) +* display warning in admin panel - plugins - if zip extension is not installed (https://github.com/slawkens/myaac/commit/e3ffe5d9e11d78ab064a370d8541bac351c9bcd9) +* set default_socket_timeout for ipinfo.io checkup to 5 seconds (https://github.com/slawkens/myaac/commit/783d96fc6568a607d3198b832fed3a0dd06c4ebb) +* refactor getTopPlayers function (support for balance) (https://github.com/slawkens/myaac/commit/c769962e39fe8dfb72ecd5be1864e145696be794) + +### Fixed +* XSS in forum (https://github.com/slawkens/myaac/commit/c2b7286d20d4b579171540f7a774e8a0995d5e8f, https://github.com/slawkens/myaac/commit/8fb643596f9586005976e7bdb484a541a9d8715e) +* price deducted when changing sex (https://github.com/slawkens/myaac/commit/16671ea40b72dcf74037c359ad572f9eb825edf9) +* move_thread by unauthorized user (https://github.com/slawkens/myaac/commit/d6c40c836a53cb1710f911f77f45f28b54ea1b54, thanks @anyeor) +* TFS 1.4.2 where conditions is NULL (https://github.com/slawkens/myaac/commit/b8396d4c8482e951da538b13f2296123732c4545) +* do not show forum new thread show button if not logged in (https://github.com/slawkens/myaac/commit/507402171ba3b6e7ee184bd7fa73e0d55e0cad7a, @anyeor) +* login if limiter is disabled (https://github.com/slawkens/myaac/commit/a0f1971583f0f790013e2145fb5ac573c59fbdef) +* fixes to installMenus function (https://github.com/slawkens/myaac/commit/a2fadc5945fe0a5e39f740827f6ffbda1bb501e2) +* many PHP exceptions in different places +* fixes to tibiacom menus ActiveSubmenuItem + +### Removed +* bugtracker SQL table code as the page has been removed/moved to plugins (https://github.com/slawkens/myaac/commit/5782772b901b05fb814bc718d062f6e2cd71df8c) + ## [1.0-RC.2 - 25.10.2024] Still waiting for your reports about bugs found in this release. We are very close to stable release. @@ -87,7 +174,6 @@ Minimum PHP version for this release is 8.1. * support for login and create account only by email (configurable) * with no need for account name * Google ReCAPTCHA v3 support (available as plugin) -* automatically load towns names from .OTBM file * support for Account Number * suggest account number option * many new functions, hooks and configurables @@ -116,4 +202,4 @@ Minimum PHP version for this release is 8.1. * change_password email to be more informal ### Fixed -* hundrets of bug fixes, mostly patched from 0.8, so it makes no sense writing them again here +* hundreds of bug fixes, mostly patched from 0.8, so it makes no sense writing them again here diff --git a/CREDITS b/CREDITS index 878310df..f358158a 100644 --- a/CREDITS +++ b/CREDITS @@ -1,3 +1,3 @@ * Gesior.pl (2007 - 2008) -* Slawkens (2009 - 2023) +* Slawkens (2009 - 2025) * Contributors listed in CONTRIBUTORS.txt diff --git a/README.md b/README.md index dc0bbff6..8fab33a5 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,12 @@ Official website: https://my-aac.org [![OpenTibia Discord](https://img.shields.io/discord/288399552581468162)](https://discord.gg/2J39Wus) [![Closed Issues](https://img.shields.io/github/issues-closed-raw/slawkens/myaac)](https://github.com/slawkens/myaac/issues?q=is%3Aissue+is%3Aclosed) -| Version | Status | Branch | Requirements | -|:--------|:-----------------------|:--------|:---------------| -| **1.x** | **Active development** | develop | **PHP >= 8.1** | -| 0.9.x | Not developed anymore | 0.9 | PHP >= 7.2.5 | -| 0.8.x | Active support | master | PHP >= 7.2.5 | -| 0.7.x | End Of Life | 0.7 | PHP >= 5.3.3 | +| Version | Status | Branch | Requirements | +|:--------|:-----------------------|:-------|:---------------| +| **1.x** | **Active development** | master | **PHP >= 8.1** | +| 0.9.x | Not developed anymore | 0.9 | PHP >= 7.2.5 | +| 0.8.x | Active support | 0.8 | PHP >= 7.2.5 | +| 0.7.x | End Of Life | 0.7 | PHP >= 5.3.3 | ### Requirements diff --git a/admin/pages/accounts.php b/admin/pages/accounts.php index c2154299..67381b5e 100644 --- a/admin/pages/accounts.php +++ b/admin/pages/accounts.php @@ -9,6 +9,7 @@ */ use MyAAC\Models\Account as AccountModel; +use MyAAC\Models\AccountAction; use MyAAC\Models\Player; defined('MYAAC') or die('Direct access not allowed!'); @@ -466,9 +467,8 @@ else if (isset($_REQUEST['search'])) { getId())->orderByDesc('date')->get(); + $accountActions = AccountAction::where('account_id', $account->getId())->orderByDesc('date')->get(); foreach ($accountActions as $i => $log): - $log->ip = ($log->ip != 0 ? long2ip($log->ip) : inet_ntop($log->ipv6)); ?> diff --git a/admin/pages/menus.php b/admin/pages/menus.php index 0e153cd8..e2608b0b 100644 --- a/admin/pages/menus.php +++ b/admin/pages/menus.php @@ -10,6 +10,7 @@ use MyAAC\Cache\Cache; use MyAAC\Models\Menu; +use MyAAC\Plugins; defined('MYAAC') or die('Direct access not allowed!'); $title = 'Menus'; @@ -21,6 +22,8 @@ if (!hasFlag(FLAG_CONTENT_MENUS) && !superAdmin()) { return; } +$pluginThemes = Plugins::getThemes(); + if (isset($_POST['template'])) { $template = $_POST['template']; @@ -56,54 +59,67 @@ if (isset($_POST['template'])) { } } - $cache = Cache::getInstance(); - if ($cache->enabled()) { - $cache->delete('template_menus'); - } - + onTemplateMenusChange(); success('Saved at ' . date('H:i')); } - $file = TEMPLATES . $template . '/config.php'; - if (file_exists($file)) { - require_once $file; + $path = TEMPLATES . $template; + + if (isset($pluginThemes[$template])) { + $path = BASE . $pluginThemes[$template]; + } + + $path .= '/config.php'; + + if (file_exists($path)) { + require_once $path; } else { echo 'Cannot find template config.php file.'; return; } - if (isset($_GET['reset_colors'])) { - if (isset($config['menu_default_color'])) { - Menu::where('template', $template)->update(['color' => str_replace('#', '', $config['menu_default_color'])]); - success('Colors has been reset.'); - } - else { - warning('There is no default color defined, cannot reset colors.'); - } - } - if (!isset($config['menu_categories'])) { echo "No menu categories set in template config.php.
This template doesn't support dynamic menus."; return; } + if (isset($_GET['reset_colors'])) { + foreach ($config['menu_categories'] as $id => $options) { + $color = $options['default_links_color'] ?? ($config['menu_default_links_color'] ?? ($config['menu_default_color'] ?? '#ffffff')); + Menu::where('template', $template)->where('category', $id)->update(['color' => str_replace('#', '', $color)]); + } + + onTemplateMenusChange(); + success('Colors has been reset at ' . date('H:i')); + } + + if (isset($_GET['reset_menus'])) { + $configMenus = config('menus'); + if (isset($configMenus)) { + Plugins::installMenus($template, config('menus'), true); + + onTemplateMenusChange(); + success('Menus has been reset at ' . date('H:i')); + } + else { + error("This template don't support reinstalling menus."); + } + } + $title = 'Menus - ' . $template; + + $canResetColors = isset($config['menu_default_color']) || isset($config['menu_default_links_color']); + foreach ($config['menu_categories'] as $id => $options) { + if (isset($options['default_links_color'])) { + $canResetColors = true; + } + } + + $twig->display('admin.menus.header.html.twig', [ + 'template' => $template, + 'canResetColors' => $canResetColors + ]); ?> -
-

You are editing:

- Hint: You can drag menu items.
- Hint: Add links to external sites using: http:// or https:// prefix.
- Not all templates support blank and colorful links. -

- -
- - - -
-
- -
select('name', 'link', 'blank', 'color', 'category', 'ordering') @@ -133,12 +149,13 @@ if (isset($_POST['template'])) { if (isset($menus[$id])) { $i = 0; foreach ($menus[$id] as $menu): + $color = (empty($menu['color']) ? ($cat['default_links_color'] ?? ($config['menu_default_links_color'] ?? ($config['menu_default_color'] ?? '#ffffff'))) : '#' . $menu['color']); ?>
  • - +
  • display('admin.menus.js.html.twig', array( 'menus' => $menus, 'last_id' => $last_id, - 'menu_default_color' => $config['menu_default_color'] ?? '#ffffff' )); ?> distinct()->get()->toArray(); foreach ($templates as $key => $value) { - $file = TEMPLATES . $value['template'] . '/config.php'; - if (!file_exists($file)) { + $path = TEMPLATES . $value['template']; + + if (isset($pluginThemes[$value['template']])) { + $path = BASE . $pluginThemes[$value['template']]; + } + + if (!file_exists($path . '/config.php')) { unset($templates[$key]); } } @@ -179,3 +200,11 @@ if (isset($_POST['template'])) { 'templates' => $templates )); } + +function onTemplateMenusChange(): void +{ + $cache = Cache::getInstance(); + if ($cache->enabled()) { + $cache->delete('template_menus'); + } +} diff --git a/common.php b/common.php index 0969ac06..99593401 100644 --- a/common.php +++ b/common.php @@ -26,8 +26,8 @@ if (version_compare(phpversion(), '8.1', '<')) die('PHP version 8.1 or higher is required.'); const MYAAC = true; -const MYAAC_VERSION = '1.0-RC.2'; -const DATABASE_VERSION = 42; +const MYAAC_VERSION = '1.2'; +const DATABASE_VERSION = 44; const TABLE_PREFIX = 'myaac_'; define('START_TIME', microtime(true)); define('MYAAC_OS', stripos(PHP_OS, 'WIN') === 0 ? 'WINDOWS' : (strtoupper(PHP_OS) === 'DARWIN' ? 'MAC' : 'LINUX')); diff --git a/composer.json b/composer.json index f36588c7..a150c7a3 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "ext-dom": "*", "phpmailer/phpmailer": "^6.1", "composer/semver": "^3.2", - "twig/twig": "^2.0", + "twig/twig": "^3.11", "erusev/parsedown": "^1.7", "nikic/fast-route": "^1.3", "matomo/device-detector": "^6.0", diff --git a/composer.lock b/composer.lock index f9296128..3a484492 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "27c63d07ab6337cd8bb5b59f2b2e08d8", + "content-hash": "be4d1489a53a9cd8eec6bcaa7a096f30", "packages": [ { "name": "brick/math", @@ -885,16 +885,16 @@ }, { "name": "matomo/device-detector", - "version": "6.4.1", + "version": "6.4.2", "source": { "type": "git", "url": "https://github.com/matomo-org/device-detector.git", - "reference": "0d364e0dd6c177da3c24cd4049178026324fd7ac" + "reference": "806e52d214b05ddead1a1d4304c7592f61f95976" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/matomo-org/device-detector/zipball/0d364e0dd6c177da3c24cd4049178026324fd7ac", - "reference": "0d364e0dd6c177da3c24cd4049178026324fd7ac", + "url": "https://api.github.com/repos/matomo-org/device-detector/zipball/806e52d214b05ddead1a1d4304c7592f61f95976", + "reference": "806e52d214b05ddead1a1d4304c7592f61f95976", "shasum": "" }, "require": { @@ -950,20 +950,20 @@ "source": "https://github.com/matomo-org/matomo", "wiki": "https://dev.matomo.org/" }, - "time": "2024-09-24T13:50:04+00:00" + "time": "2024-12-16T16:38:01+00:00" }, { "name": "maximebf/debugbar", - "version": "v1.23.3", + "version": "v1.23.5", "source": { "type": "git", - "url": "https://github.com/maximebf/php-debugbar.git", - "reference": "687400043d77943ef95e8417cb44e1673ee57844" + "url": "https://github.com/php-debugbar/php-debugbar.git", + "reference": "eeabd61a1f19ba5dcd5ac4585a477130ee03ce25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/687400043d77943ef95e8417cb44e1673ee57844", - "reference": "687400043d77943ef95e8417cb44e1673ee57844", + "url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/eeabd61a1f19ba5dcd5ac4585a477130ee03ce25", + "reference": "eeabd61a1f19ba5dcd5ac4585a477130ee03ce25", "shasum": "" }, "require": { @@ -1015,10 +1015,10 @@ "debugbar" ], "support": { - "issues": "https://github.com/maximebf/php-debugbar/issues", - "source": "https://github.com/maximebf/php-debugbar/tree/v1.23.3" + "issues": "https://github.com/php-debugbar/php-debugbar/issues", + "source": "https://github.com/php-debugbar/php-debugbar/tree/v1.23.5" }, - "time": "2024-10-29T12:24:25+00:00" + "time": "2024-12-15T19:20:42+00:00" }, { "name": "mustangostang/spyc", @@ -1076,16 +1076,16 @@ }, { "name": "nesbot/carbon", - "version": "2.72.5", + "version": "2.72.6", "source": { "type": "git", - "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "afd46589c216118ecd48ff2b95d77596af1e57ed" + "url": "https://github.com/CarbonPHP/carbon.git", + "reference": "1e9d50601e7035a4c61441a208cb5bed73e108c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/afd46589c216118ecd48ff2b95d77596af1e57ed", - "reference": "afd46589c216118ecd48ff2b95d77596af1e57ed", + "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/1e9d50601e7035a4c61441a208cb5bed73e108c5", + "reference": "1e9d50601e7035a4c61441a208cb5bed73e108c5", "shasum": "" }, "require": { @@ -1105,7 +1105,7 @@ "doctrine/orm": "^2.7 || ^3.0", "friendsofphp/php-cs-fixer": "^3.0", "kylekatarnls/multi-tester": "^2.0", - "ondrejmirtes/better-reflection": "*", + "ondrejmirtes/better-reflection": "<6", "phpmd/phpmd": "^2.9", "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "^0.12.99 || ^1.7.14", @@ -1118,10 +1118,6 @@ ], "type": "library", "extra": { - "branch-alias": { - "dev-master": "3.x-dev", - "dev-2.x": "2.x-dev" - }, "laravel": { "providers": [ "Carbon\\Laravel\\ServiceProvider" @@ -1131,6 +1127,10 @@ "includes": [ "extension.neon" ] + }, + "branch-alias": { + "dev-2.x": "2.x-dev", + "dev-master": "3.x-dev" } }, "autoload": { @@ -1179,7 +1179,7 @@ "type": "tidelift" } ], - "time": "2024-06-03T19:18:41+00:00" + "time": "2024-12-27T09:28:11+00:00" }, { "name": "nikic/fast-route", @@ -1575,16 +1575,16 @@ }, { "name": "symfony/console", - "version": "v6.4.15", + "version": "v6.4.17", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "f1fc6f47283e27336e7cebb9e8946c8de7bff9bd" + "reference": "799445db3f15768ecc382ac5699e6da0520a0a04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/f1fc6f47283e27336e7cebb9e8946c8de7bff9bd", - "reference": "f1fc6f47283e27336e7cebb9e8946c8de7bff9bd", + "url": "https://api.github.com/repos/symfony/console/zipball/799445db3f15768ecc382ac5699e6da0520a0a04", + "reference": "799445db3f15768ecc382ac5699e6da0520a0a04", "shasum": "" }, "require": { @@ -1649,7 +1649,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.15" + "source": "https://github.com/symfony/console/tree/v6.4.17" }, "funding": [ { @@ -1665,7 +1665,7 @@ "type": "tidelift" } ], - "time": "2024-11-06T14:19:14+00:00" + "time": "2024-12-07T12:07:30+00:00" }, { "name": "symfony/deprecation-contracts", @@ -1686,12 +1686,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -1760,8 +1760,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -1836,8 +1836,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -1914,8 +1914,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -1998,8 +1998,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -2052,71 +2052,6 @@ ], "time": "2024-09-09T11:45:10+00:00" }, - { - "name": "symfony/polyfill-php72", - "version": "v1.31.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "fa2ae56c44f03bed91a39bfc9822e31e7c5c38ce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/fa2ae56c44f03bed91a39bfc9822e31e7c5c38ce", - "reference": "fa2ae56c44f03bed91a39bfc9822e31e7c5c38ce", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "type": "metapackage", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.31.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-09T11:45:10+00:00" - }, { "name": "symfony/polyfill-php80", "version": "v1.31.0", @@ -2137,8 +2072,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -2197,6 +2132,82 @@ ], "time": "2024-09-09T11:45:10+00:00" }, + { + "name": "symfony/polyfill-php81", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, { "name": "symfony/service-contracts", "version": "v3.5.1", @@ -2221,12 +2232,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -2480,12 +2491,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -2626,38 +2637,38 @@ }, { "name": "twig/twig", - "version": "v2.16.1", + "version": "v3.19.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "19185947ec75d433a3ac650af32fc05649b95ee1" + "reference": "d4f8c2b86374f08efc859323dbcd95c590f7124e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/19185947ec75d433a3ac650af32fc05649b95ee1", - "reference": "19185947ec75d433a3ac650af32fc05649b95ee1", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/d4f8c2b86374f08efc859323dbcd95c590f7124e", + "reference": "d4f8c2b86374f08efc859323dbcd95c590f7124e", "shasum": "" }, "require": { - "php": ">=7.1.3", + "php": ">=8.0.2", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "^1.8", "symfony/polyfill-mbstring": "^1.3", - "symfony/polyfill-php72": "^1.8" + "symfony/polyfill-php81": "^1.29" }, "require-dev": { - "psr/container": "^1.0", - "symfony/phpunit-bridge": "^5.4.9|^6.3" + "phpstan/phpstan": "^2.0", + "psr/container": "^1.0|^2.0", + "symfony/phpunit-bridge": "^5.4.9|^6.4|^7.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.16-dev" - } - }, "autoload": { - "psr-0": { - "Twig_": "lib/" - }, + "files": [ + "src/Resources/core.php", + "src/Resources/debug.php", + "src/Resources/escaper.php", + "src/Resources/string_loader.php" + ], "psr-4": { "Twig\\": "src/" } @@ -2690,7 +2701,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v2.16.1" + "source": "https://github.com/twigphp/Twig/tree/v3.19.0" }, "funding": [ { @@ -2702,7 +2713,7 @@ "type": "tidelift" } ], - "time": "2024-09-09T17:53:56+00:00" + "time": "2025-01-29T07:06:14+00:00" }, { "name": "voku/portable-ascii", @@ -2840,16 +2851,16 @@ "packages-dev": [ { "name": "phpstan/phpstan", - "version": "1.12.12", + "version": "1.12.15", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "b5ae1b88f471d3fd4ba1aa0046234b5ca3776dd0" + "reference": "c91d4e8bc056f46cf653656e6f71004b254574d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/b5ae1b88f471d3fd4ba1aa0046234b5ca3776dd0", - "reference": "b5ae1b88f471d3fd4ba1aa0046234b5ca3776dd0", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c91d4e8bc056f46cf653656e6f71004b254574d1", + "reference": "c91d4e8bc056f46cf653656e6f71004b254574d1", "shasum": "" }, "require": { @@ -2894,7 +2905,7 @@ "type": "github" } ], - "time": "2024-11-28T22:13:23+00:00" + "time": "2025-01-05T16:40:22+00:00" } ], "aliases": [], @@ -2911,5 +2922,5 @@ "ext-dom": "*" }, "platform-dev": [], - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.3.0" } diff --git a/cypress/e2e/3-check-public-pages.cy.js b/cypress/e2e/3-check-public-pages.cy.js index 2ea5697b..9460739b 100644 --- a/cypress/e2e/3-check-public-pages.cy.js +++ b/cypress/e2e/3-check-public-pages.cy.js @@ -116,9 +116,9 @@ describe('Check Public Pages', () => { }) // library - it('Go to creatures page', () => { + it('Go to monsters page', () => { cy.visit({ - url: Cypress.env('URL') + '/creatures', + url: Cypress.env('URL') + '/monsters', method: 'GET', }) }) diff --git a/cypress/e2e/4-check-protected-pages.cy.js b/cypress/e2e/4-check-protected-pages.cy.js index c3c4b4c6..fca74232 100644 --- a/cypress/e2e/4-check-protected-pages.cy.js +++ b/cypress/e2e/4-check-protected-pages.cy.js @@ -4,7 +4,7 @@ const YOU_ARE_NOT_LOGGEDIN = 'You are not logged in.'; describe('Check Protected Pages', () => { // character actions - it('Go to accouht character creation page', () => { + it('Go to account character creation page', () => { cy.visit({ url: Cypress.env('URL') + '/account/character/create', method: 'GET', @@ -12,7 +12,7 @@ describe('Check Protected Pages', () => { cy.contains(REQUIRED_LOGIN_MESSAGE) }) - it('Go to accouht character deletion page', () => { + it('Go to account character deletion page', () => { cy.visit({ url: Cypress.env('URL') + '/account/character/delete', method: 'GET', @@ -21,7 +21,7 @@ describe('Check Protected Pages', () => { }) // account actions - it('Go to accouht email change page', () => { + it('Go to account email change page', () => { cy.visit({ url: Cypress.env('URL') + '/account/email', method: 'GET', @@ -29,7 +29,7 @@ describe('Check Protected Pages', () => { cy.contains(REQUIRED_LOGIN_MESSAGE) }) - it('Go to accouht password change page', () => { + it('Go to account password change page', () => { cy.visit({ url: Cypress.env('URL') + '/account/password', method: 'GET', @@ -37,7 +37,7 @@ describe('Check Protected Pages', () => { cy.contains(REQUIRED_LOGIN_MESSAGE) }) - it('Go to accouht info change page', () => { + it('Go to account info change page', () => { cy.visit({ url: Cypress.env('URL') + '/account/info', method: 'GET', @@ -45,7 +45,7 @@ describe('Check Protected Pages', () => { cy.contains(REQUIRED_LOGIN_MESSAGE) }) - it('Go to accouht logout change page', () => { + it('Go to account logout change page', () => { cy.visit({ url: Cypress.env('URL') + '/account/logout', method: 'GET', diff --git a/index.php b/index.php index c8c65419..0a42deed 100644 --- a/index.php +++ b/index.php @@ -76,6 +76,8 @@ require_once SYSTEM . 'status.php'; $twig->addGlobal('config', $config); $twig->addGlobal('status', $status); +$hooks->trigger(HOOK_STARTUP); + // backward support for gesior if(setting('core.backward_support')) { define('INITIALIZED', true); @@ -117,8 +119,6 @@ if(setting('core.backward_support')) { require_once SYSTEM . 'router.php'; -$hooks->trigger(HOOK_STARTUP); - // anonymous usage statistics // sent only when user agrees if(setting('core.anonymous_usage_statistics')) { @@ -134,7 +134,7 @@ if(setting('core.anonymous_usage_statistics')) { if(fetchDatabaseConfig('last_usage_report', $value)) { $should_report = time() > (int)$value + $report_time; if($cache->enabled()) { - $cache->set('last_usage_report', $value); + $cache->set('last_usage_report', $value, 60 * 60); } } else { @@ -148,7 +148,7 @@ if(setting('core.anonymous_usage_statistics')) { updateDatabaseConfig('last_usage_report', time()); if($cache->enabled()) { - $cache->set('last_usage_report', time()); + $cache->set('last_usage_report', time(), 60 * 60); } } } diff --git a/install/includes/schema.sql b/install/includes/schema.sql index 91853e07..8b557324 100644 --- a/install/includes/schema.sql +++ b/install/includes/schema.sql @@ -1,13 +1,13 @@ -SET @myaac_database_version = 42; +SET @myaac_database_version = 43; CREATE TABLE `myaac_account_actions` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, `account_id` INT(11) NOT NULL, - `ip` INT(10) UNSIGNED NOT NULL DEFAULT 0, - `ipv6` BINARY(16) NOT NULL DEFAULT 0, + `ip` VARCHAR(45) NOT NULL DEFAULT '', `date` INT(11) NOT NULL DEFAULT 0, `action` VARCHAR(255) NOT NULL DEFAULT '', - KEY (`account_id`) + PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8mb4; CREATE TABLE `myaac_admin_menu` diff --git a/install/template/template.php b/install/template/template.php index 1e1829a6..aadaae23 100644 --- a/install/template/template.php +++ b/install/template/template.php @@ -1,3 +1,4 @@ + diff --git a/install/tools/5-database.php b/install/tools/5-database.php index ff0bcbbb..395492ee 100644 --- a/install/tools/5-database.php +++ b/install/tools/5-database.php @@ -156,9 +156,14 @@ if ($db->hasTable('guilds')) { } if (!$db->hasColumn('guilds', 'description')) { - if (query("ALTER TABLE `guilds` ADD `description` TEXT NOT NULL;")) + if (query("ALTER TABLE `guilds` ADD `description` VARCHAR(5000) NOT NULL DEFAULT '';")) success($locale['step_database_adding_field'] . ' guilds.description...'); } + else { + if (query("ALTER TABLE `guilds` MODIFY `description` VARCHAR(5000) NOT NULL DEFAULT '';")) { + success($locale['step_database_modifying_field'] . ' guilds.description...'); + } + } if ($db->hasColumn('guilds', 'logo_gfx_name')) { if (query("ALTER TABLE `guilds` CHANGE `logo_gfx_name` `logo_name` VARCHAR( 255 ) NOT NULL DEFAULT 'default.gif';")) { @@ -197,9 +202,14 @@ if ($db->hasTable('players')) { } if (!$db->hasColumn('players', 'comment')) { - if (query("ALTER TABLE `players` ADD `comment` TEXT NOT NULL;")) + if (query("ALTER TABLE `players` ADD `comment` VARCHAR(5000) NOT NULL DEFAULT '';")) success($locale['step_database_adding_field'] . ' players.comment...'); } + else { + if (query("ALTER TABLE `players` MODIFY `comment` VARCHAR(5000) NOT NULL DEFAULT '';")) { + success($locale['step_database_modifying_field'] . ' players.comment...'); + } + } if ($db->hasColumn('players', 'rank_id')) { if (query("ALTER TABLE players MODIFY `rank_id` INT(11) NOT NULL DEFAULT 0;")) diff --git a/nginx-sample.conf b/nginx-sample.conf index a3d8d865..d3cf8b6c 100644 --- a/nginx-sample.conf +++ b/nginx-sample.conf @@ -24,7 +24,7 @@ server { } location / { - try_files $uri $uri/ /index.php?$query_string;; + try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { diff --git a/package-lock.json b/package-lock.json index a9754f0b..a8c17859 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,10 +11,10 @@ "fs-extra": "^11.2.0", "jquery": "^3.7.1", "jquery-ui": "^1.13.2", - "tinymce": "^6.8.3" + "tinymce": "^7.2.0" }, "devDependencies": { - "cypress": "^12.12.0" + "cypress": "^13.17.0" } }, "node_modules/@colors/colors": { @@ -22,16 +22,18 @@ "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", "dev": true, + "license": "MIT", "optional": true, "engines": { "node": ">=0.1.90" } }, "node_modules/@cypress/request": { - "version": "2.88.12", - "resolved": "https://registry.npmjs.org/@cypress/request/-/request-2.88.12.tgz", - "integrity": "sha512-tOn+0mDZxASFM+cuAP9szGUGPI1HwWVSvdzm7V4cCsPdFTx6qMj29CwaQmRAMIEhORIUBFBsYROYJcveK4uOjA==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.7.tgz", + "integrity": "sha512-LzxlLEMbBOPYB85uXrDqvD4MgcenjRBLIns3zyhx7vTPj/0u2eQhzXvPiGcaJrV38Q9dbkExWp6cOHPJ+EtFYg==", "dev": true, + "license": "Apache-2.0", "dependencies": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -39,16 +41,16 @@ "combined-stream": "~1.0.6", "extend": "~3.0.2", "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "http-signature": "~1.3.6", + "form-data": "~4.0.0", + "http-signature": "~1.4.0", "is-typedarray": "~1.0.0", "isstream": "~0.1.2", "json-stringify-safe": "~5.0.1", "mime-types": "~2.1.19", "performance-now": "^2.1.0", - "qs": "~6.10.3", + "qs": "6.13.1", "safe-buffer": "^5.1.2", - "tough-cookie": "^4.1.3", + "tough-cookie": "^5.0.0", "tunnel-agent": "^0.6.0", "uuid": "^8.3.2" }, @@ -61,6 +63,7 @@ "resolved": "https://registry.npmjs.org/@cypress/xvfb/-/xvfb-1.2.4.tgz", "integrity": "sha512-skbBzPggOVYCbnGgV+0dmBdW/s77ZkAOXIC1knS8NagwDjBrNC1LuXtQJeiN6l+m7lzmHtaoUw/ctJKdqkG57Q==", "dev": true, + "license": "MIT", "dependencies": { "debug": "^3.1.0", "lodash.once": "^4.1.1" @@ -71,6 +74,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "license": "MIT", "dependencies": { "ms": "^2.1.1" } @@ -78,31 +82,37 @@ "node_modules/@tinymce/tinymce-jquery": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/@tinymce/tinymce-jquery/-/tinymce-jquery-2.1.0.tgz", - "integrity": "sha512-ynfgfL/n5/Us7h3AnJL3mAwsShuE/USvAJFOdilJDkZuVCypWSwVVo3E3wIqSzDGvqyU+293ok1+sD+jxraT8w==" + "integrity": "sha512-ynfgfL/n5/Us7h3AnJL3mAwsShuE/USvAJFOdilJDkZuVCypWSwVVo3E3wIqSzDGvqyU+293ok1+sD+jxraT8w==", + "license": "MIT" }, "node_modules/@types/node": { - "version": "16.18.82", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.82.tgz", - "integrity": "sha512-pcDZtkx9z8XYV+ius2P3Ot2VVrcYOfXffBQUBuiszrlUzKSmoDYqo+mV+IoL8iIiIjjtOMvNSmH1hwJ+Q+f96Q==", - "dev": true + "version": "16.18.123", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.123.tgz", + "integrity": "sha512-/n7I6V/4agSpJtFDKKFEa763Hc1z3hmvchobHS1TisCOTKD5nxq8NJ2iK7SRIMYL276Q9mgWOx2AWp5n2XI6eA==", + "dev": true, + "license": "MIT", + "optional": true }, "node_modules/@types/sinonjs__fake-timers": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.1.tgz", "integrity": "sha512-0kSuKjAS0TrGLJ0M/+8MaFkGsQhZpB6pxOmvS3K8FYI72K//YmdfoW9X2qPsAKh1mkwxGD5zib9s1FIFed6E8g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/sizzle": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.8.tgz", - "integrity": "sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==", - "dev": true + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.9.tgz", + "integrity": "sha512-xzLEyKB50yqCUPUJkIsrVvoWNfFUbIZI+RspLWt8u+tIW/BetMBZtgV2LY/2o+tYH8dRvQ+eoPf3NdhQCcLE2w==", + "dev": true, + "license": "MIT" }, "node_modules/@types/yauzl": { "version": "2.10.3", "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "@types/node": "*" @@ -113,6 +123,7 @@ "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "dev": true, + "license": "MIT", "dependencies": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" @@ -126,6 +137,7 @@ "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -135,6 +147,7 @@ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, + "license": "MIT", "dependencies": { "type-fest": "^0.21.3" }, @@ -150,6 +163,7 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -159,6 +173,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -187,13 +202,15 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/asn1": { "version": "0.2.6", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", "dev": true, + "license": "MIT", "dependencies": { "safer-buffer": "~2.1.0" } @@ -203,6 +220,7 @@ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8" } @@ -212,27 +230,31 @@ "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/async": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", - "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==", - "dev": true + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "dev": true, + "license": "MIT" }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/at-least-node": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", "dev": true, + "license": "ISC", "engines": { "node": ">= 4.0.0" } @@ -242,21 +264,17 @@ "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", "dev": true, + "license": "Apache-2.0", "engines": { "node": "*" } }, "node_modules/aws4": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", - "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==", - "dev": true - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.2.tgz", + "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==", + "dev": true, + "license": "MIT" }, "node_modules/base64-js": { "version": "1.5.1", @@ -276,13 +294,15 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "tweetnacl": "^0.14.3" } @@ -291,13 +311,15 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/blob-util/-/blob-util-2.0.2.tgz", "integrity": "sha512-T7JQa+zsXXEa6/8ZhHcQEW1UFfVM49Ts65uBkFL6fz2QmrElqmbajIDJvuA0tEhRe5eIjpV9ZF+0RfZR9voJFQ==", - "dev": true + "dev": true, + "license": "Apache-2.0" }, "node_modules/bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/bootstrap": { "version": "4.6.2", @@ -313,21 +335,12 @@ "url": "https://opencollective.com/bootstrap" } ], + "license": "MIT", "peerDependencies": { "jquery": "1.9.1 - 3", "popper.js": "^1.16.1" } }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/buffer": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", @@ -347,6 +360,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -357,6 +371,7 @@ "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", "dev": true, + "license": "MIT", "engines": { "node": "*" } @@ -366,21 +381,34 @@ "resolved": "https://registry.npmjs.org/cachedir/-/cachedir-2.4.0.tgz", "integrity": "sha512-9EtFOZR8g22CL7BWjJ9BUx1+A/djkofnyW3aOXZORNW2kxoUpx2h+uN2cOqwPmFhnpVmxg+KW2OjOSgChTEvsQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, - "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "node_modules/call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", "dev": true, + "license": "MIT", "dependencies": { - "es-define-property": "^1.0.0", "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", + "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "get-intrinsic": "^1.2.6" }, "engines": { "node": ">= 0.4" @@ -393,13 +421,15 @@ "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", - "dev": true + "dev": true, + "license": "Apache-2.0" }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -416,6 +446,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -428,14 +459,15 @@ "resolved": "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz", "integrity": "sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8.0" } }, "node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.1.0.tgz", + "integrity": "sha512-HutrvTNsF48wnxkzERIXOe5/mlcfFcbfCmwcg6CJnizbSue78AbDt+1cgl26zwn61WFxhcPykPfZrbqjGmBb4A==", "dev": true, "funding": [ { @@ -443,6 +475,7 @@ "url": "https://github.com/sponsors/sibiraj-s" } ], + "license": "MIT", "engines": { "node": ">=8" } @@ -452,6 +485,7 @@ "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -461,6 +495,7 @@ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, + "license": "MIT", "dependencies": { "restore-cursor": "^3.1.0" }, @@ -469,10 +504,11 @@ } }, "node_modules/cli-table3": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz", - "integrity": "sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==", + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz", + "integrity": "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==", "dev": true, + "license": "MIT", "dependencies": { "string-width": "^4.2.0" }, @@ -488,6 +524,7 @@ "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", "dev": true, + "license": "MIT", "dependencies": { "slice-ansi": "^3.0.0", "string-width": "^4.2.0" @@ -504,6 +541,7 @@ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -515,19 +553,22 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/colorette": { "version": "2.0.20", "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, + "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" }, @@ -540,6 +581,7 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 6" } @@ -549,27 +591,24 @@ "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz", "integrity": "sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==", "dev": true, + "license": "MIT", "engines": { "node": ">=4.0.0" } }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, "node_modules/core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -580,24 +619,25 @@ } }, "node_modules/cypress": { - "version": "12.17.4", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.17.4.tgz", - "integrity": "sha512-gAN8Pmns9MA5eCDFSDJXWKUpaL3IDd89N9TtIupjYnzLSmlpVr+ZR+vb4U/qaMp+lB6tBvAmt7504c3Z4RU5KQ==", + "version": "13.17.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.17.0.tgz", + "integrity": "sha512-5xWkaPurwkIljojFidhw8lFScyxhtiFHl/i/3zov+1Z5CmY4t9tjIdvSXfu82Y3w7wt0uR9KkucbhkVvJZLQSA==", "dev": true, "hasInstallScript": true, + "license": "MIT", "dependencies": { - "@cypress/request": "2.88.12", + "@cypress/request": "^3.0.6", "@cypress/xvfb": "^1.2.4", - "@types/node": "^16.18.39", "@types/sinonjs__fake-timers": "8.1.1", "@types/sizzle": "^2.3.2", "arch": "^2.2.0", "blob-util": "^2.0.2", "bluebird": "^3.7.2", - "buffer": "^5.6.0", + "buffer": "^5.7.1", "cachedir": "^2.3.0", "chalk": "^4.1.0", "check-more-types": "^2.24.0", + "ci-info": "^4.0.0", "cli-cursor": "^3.1.0", "cli-table3": "~0.6.1", "commander": "^6.2.1", @@ -612,7 +652,6 @@ "figures": "^3.2.0", "fs-extra": "^9.1.0", "getos": "^3.2.1", - "is-ci": "^3.0.0", "is-installed-globally": "~0.4.0", "lazy-ass": "^1.6.0", "listr2": "^3.8.3", @@ -626,7 +665,8 @@ "request-progress": "^3.0.0", "semver": "^7.5.3", "supports-color": "^8.1.1", - "tmp": "~0.2.1", + "tmp": "~0.2.3", + "tree-kill": "1.2.2", "untildify": "^4.0.0", "yauzl": "^2.10.0" }, @@ -634,7 +674,7 @@ "cypress": "bin/cypress" }, "engines": { - "node": "^14.0.0 || ^16.0.0 || >=18.0.0" + "node": "^16.0.0 || ^18.0.0 || >=20.0.0" } }, "node_modules/cypress/node_modules/fs-extra": { @@ -642,6 +682,7 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", "dev": true, + "license": "MIT", "dependencies": { "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", @@ -657,6 +698,7 @@ "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", "dev": true, + "license": "MIT", "dependencies": { "assert-plus": "^1.0.0" }, @@ -665,18 +707,20 @@ } }, "node_modules/dayjs": { - "version": "1.11.10", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.10.tgz", - "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==", - "dev": true + "version": "1.11.13", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.13.tgz", + "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==", + "dev": true, + "license": "MIT" }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, + "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -687,37 +731,37 @@ } } }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.4.0" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", "dev": true, + "license": "MIT", "dependencies": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -727,13 +771,15 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "dev": true, + "license": "MIT", "dependencies": { "once": "^1.4.0" } @@ -743,6 +789,7 @@ "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-colors": "^4.1.1", "strip-ansi": "^6.0.1" @@ -752,13 +799,11 @@ } }, "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", "dev": true, - "dependencies": { - "get-intrinsic": "^1.2.4" - }, + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -768,6 +813,20 @@ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, "engines": { "node": ">= 0.4" } @@ -777,6 +836,7 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.0" } @@ -785,13 +845,15 @@ "version": "6.4.7", "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.7.tgz", "integrity": "sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/execa": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", "dev": true, + "license": "MIT", "dependencies": { "cross-spawn": "^7.0.0", "get-stream": "^5.0.0", @@ -815,6 +877,7 @@ "resolved": "https://registry.npmjs.org/executable/-/executable-4.1.1.tgz", "integrity": "sha512-8iA79xD3uAch729dUG8xaaBBFGaEa0wdD2VkYLFHwlqosEj/jT66AzcreRDSgV7ehnNLBW2WR5jIXwGKjVdTLg==", "dev": true, + "license": "MIT", "dependencies": { "pify": "^2.2.0" }, @@ -826,13 +889,15 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/extract-zip": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "debug": "^4.1.1", "get-stream": "^5.1.0", @@ -855,13 +920,15 @@ "dev": true, "engines": [ "node >=0.6.0" - ] + ], + "license": "MIT" }, "node_modules/fd-slicer": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", "dev": true, + "license": "MIT", "dependencies": { "pend": "~1.2.0" } @@ -871,6 +938,7 @@ "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, + "license": "MIT", "dependencies": { "escape-string-regexp": "^1.0.5" }, @@ -886,28 +954,31 @@ "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", "dev": true, + "license": "Apache-2.0", "engines": { "node": "*" } }, "node_modules/form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", "dev": true, + "license": "MIT", "dependencies": { "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", + "combined-stream": "^1.0.8", "mime-types": "^2.1.12" }, "engines": { - "node": ">= 0.12" + "node": ">= 6" } }, "node_modules/fs-extra": { "version": "11.2.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -917,32 +988,33 @@ "node": ">=14.14" } }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", + "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", "dev": true, + "license": "MIT", "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "get-proto": "^1.0.0", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -951,11 +1023,26 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/get-stream": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", "dev": true, + "license": "MIT", "dependencies": { "pump": "^3.0.0" }, @@ -971,6 +1058,7 @@ "resolved": "https://registry.npmjs.org/getos/-/getos-3.2.1.tgz", "integrity": "sha512-U56CfOK17OKgTVqozZjUKNdkfEv6jk5WISBJ8SHoagjE6L69zOwl3Z+O8myjY9MEW3i2HPWQBt/LTbCgcC973Q==", "dev": true, + "license": "MIT", "dependencies": { "async": "^3.2.0" } @@ -980,35 +1068,17 @@ "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", "dev": true, + "license": "MIT", "dependencies": { "assert-plus": "^1.0.0" } }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/global-dirs": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", "dev": true, + "license": "MIT", "dependencies": { "ini": "2.0.0" }, @@ -1020,12 +1090,13 @@ } }, "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", "dev": true, - "dependencies": { - "get-intrinsic": "^1.1.3" + "license": "MIT", + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1034,46 +1105,25 @@ "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -1082,10 +1132,11 @@ } }, "node_modules/hasown": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", - "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dev": true, + "license": "MIT", "dependencies": { "function-bind": "^1.1.2" }, @@ -1094,14 +1145,15 @@ } }, "node_modules/http-signature": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.3.6.tgz", - "integrity": "sha512-3adrsD6zqo4GsTqtO7FyrejHNv+NgiIfAfv68+jVlFmSr9OGy7zrxONceFRLKvnnZA5jbxQBX1u9PpB6Wi32Gw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.4.0.tgz", + "integrity": "sha512-G5akfn7eKbpDN+8nPS/cb57YeA1jLTVxjpCj7tmm3QKPdyDy7T+qSC40e9ptydSWvkwjSXw1VbkpyEm39ukeAg==", "dev": true, + "license": "MIT", "dependencies": { "assert-plus": "^1.0.0", "jsprim": "^2.0.2", - "sshpk": "^1.14.1" + "sshpk": "^1.18.0" }, "engines": { "node": ">=0.10" @@ -1112,6 +1164,7 @@ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=8.12.0" } @@ -1134,59 +1187,35 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "BSD-3-Clause" }, "node_modules/indent-string": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, "node_modules/ini": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", "dev": true, + "license": "ISC", "engines": { "node": ">=10" } }, - "node_modules/is-ci": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", - "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", - "dev": true, - "dependencies": { - "ci-info": "^3.2.0" - }, - "bin": { - "is-ci": "bin.js" - } - }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -1196,6 +1225,7 @@ "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", "dev": true, + "license": "MIT", "dependencies": { "global-dirs": "^3.0.0", "is-path-inside": "^3.0.2" @@ -1212,6 +1242,7 @@ "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -1221,6 +1252,7 @@ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" }, @@ -1232,13 +1264,15 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -1250,49 +1284,57 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/jquery": { "version": "3.7.1", "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", - "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==" + "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==", + "license": "MIT" }, "node_modules/jquery-ui": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/jquery-ui/-/jquery-ui-1.13.2.tgz", - "integrity": "sha512-wBZPnqWs5GaYJmo1Jj0k/mrSkzdQzKDwhXNtHKcBdAcKVxMM3KNYFq+iJ2i1rwiG53Z8M4mTn3Qxrm17uH1D4Q==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/jquery-ui/-/jquery-ui-1.14.1.tgz", + "integrity": "sha512-DhzsYH8VeIvOaxwi+B/2BCsFFT5EGjShdzOcm5DssWjtcpGWIMsn66rJciDA6jBruzNiLf1q0KvwMoX1uGNvnQ==", + "license": "MIT", "dependencies": { - "jquery": ">=1.8.0 <4.0.0" + "jquery": ">=1.12.0 <5.0.0" } }, "node_modules/jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json-schema": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "dev": true + "dev": true, + "license": "(AFL-2.1 OR BSD-3-Clause)" }, "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/jsonfile": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "license": "MIT", "dependencies": { "universalify": "^2.0.0" }, @@ -1308,6 +1350,7 @@ "engines": [ "node >=0.6.0" ], + "license": "MIT", "dependencies": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -1320,6 +1363,7 @@ "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz", "integrity": "sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw==", "dev": true, + "license": "MIT", "engines": { "node": "> 0.8" } @@ -1329,6 +1373,7 @@ "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.14.0.tgz", "integrity": "sha512-TyWI8G99GX9GjE54cJ+RrNMcIFBfwMPxc3XTFiAYGN4s10hWROGtOg7+O6u6LE3mNkyld7RSLE6nrKBvTfcs3g==", "dev": true, + "license": "MIT", "dependencies": { "cli-truncate": "^2.1.0", "colorette": "^2.0.16", @@ -1355,19 +1400,22 @@ "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.once": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, + "license": "MIT", "dependencies": { "chalk": "^4.1.0", "is-unicode-supported": "^0.1.0" @@ -1384,6 +1432,7 @@ "resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz", "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", "dev": true, + "license": "MIT", "dependencies": { "ansi-escapes": "^4.3.0", "cli-cursor": "^3.1.0", @@ -1402,6 +1451,7 @@ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", @@ -1419,6 +1469,7 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -1428,29 +1479,29 @@ "node": ">=8" } }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, + "license": "MIT", "engines": { - "node": ">=10" + "node": ">= 0.4" } }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -1460,6 +1511,7 @@ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, + "license": "MIT", "dependencies": { "mime-db": "1.52.0" }, @@ -1472,42 +1524,34 @@ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/minimist": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" }, "node_modules/npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, + "license": "MIT", "dependencies": { "path-key": "^3.0.0" }, @@ -1516,10 +1560,14 @@ } }, "node_modules/object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -1529,6 +1577,7 @@ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, + "license": "ISC", "dependencies": { "wrappy": "1" } @@ -1538,6 +1587,7 @@ "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, + "license": "MIT", "dependencies": { "mimic-fn": "^2.1.0" }, @@ -1552,13 +1602,15 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/ospath/-/ospath-1.2.2.tgz", "integrity": "sha512-o6E5qJV5zkAbIDNhGSIlyOhScKXgQrSRMilfph0clDfM0nEnBOlKlH4sWDmG95BW/CvwNz0vmm7dJVtU2KlMiA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/p-map": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", "dev": true, + "license": "MIT", "dependencies": { "aggregate-error": "^3.0.0" }, @@ -1569,20 +1621,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -1591,19 +1635,22 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -1613,6 +1660,7 @@ "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1.tgz", "integrity": "sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ==", "deprecated": "You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1", + "license": "MIT", "peer": true, "funding": { "type": "opencollective", @@ -1624,6 +1672,7 @@ "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", "integrity": "sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" }, @@ -1636,6 +1685,7 @@ "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6.0" } @@ -1644,40 +1694,28 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz", "integrity": "sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A==", - "dev": true - }, - "node_modules/psl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", + "integrity": "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==", "dev": true, + "license": "MIT", "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" } }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/qs": { - "version": "6.10.4", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.4.tgz", - "integrity": "sha512-OQiU+C+Ds5qiH91qh/mg0w+8nwQuLjM4F4M/PbmhDOoYehPh+Fb0bDjtR1sOvy7YKxvj28Y/M0PhP5uVX0kB+g==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.1.tgz", + "integrity": "sha512-EJPeIn0CYrGu+hli1xilKAPXODtJ12T0sP63Ijx2/khC2JtuaN3JyNIpvmnkmaEtha9ocbG4A4cMcr+TvqvwQg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" }, "engines": { "node": ">=0.6" @@ -1686,32 +1724,22 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/querystringify": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", - "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", - "dev": true - }, "node_modules/request-progress": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-3.0.0.tgz", "integrity": "sha512-MnWzEHHaxHO2iWiQuHrUPBi/1WeBf5PkxQqNyNvLl9VAYSdXkP8tQ3pBSeCPD+yw0v0Aq1zosWLz0BdeXpWwZg==", "dev": true, + "license": "MIT", "dependencies": { "throttleit": "^1.0.0" } }, - "node_modules/requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "dev": true - }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, + "license": "MIT", "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" @@ -1721,31 +1749,18 @@ } }, "node_modules/rfdc": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.1.tgz", - "integrity": "sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==", - "dev": true - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } + "license": "MIT" }, "node_modules/rxjs": { "version": "7.8.1", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", "dev": true, + "license": "Apache-2.0", "dependencies": { "tslib": "^2.1.0" } @@ -1768,22 +1783,22 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/semver": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", - "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -1791,28 +1806,12 @@ "node": ">=10" } }, - "node_modules/set-function-length": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.1.tgz", - "integrity": "sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==", - "dev": true, - "dependencies": { - "define-data-property": "^1.1.2", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.3", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, + "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" }, @@ -1825,20 +1824,79 @@ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/side-channel": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.5.tgz", - "integrity": "sha512-QcgiIWV4WV7qWExbN5llt6frQB/lBven9pqliLXfGPB+K9ZYXxDozp0wLkHS24kWCm+6YXH/f0HhnObZnZOBnQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.6", "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -1851,13 +1909,15 @@ "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/slice-ansi": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", @@ -1872,6 +1932,7 @@ "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", "dev": true, + "license": "MIT", "dependencies": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -1897,6 +1958,7 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -1911,6 +1973,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -1923,6 +1986,7 @@ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -1932,6 +1996,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -1947,6 +2012,7 @@ "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.1.tgz", "integrity": "sha512-vDZpf9Chs9mAdfY046mcPt8fg5QSZr37hEH4TXYBnDF+izxgrbRGUAAaBvIk/fJm9aOFCGFd1EsNg5AZCbnQCQ==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/sindresorhus" } @@ -1955,60 +2021,81 @@ "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/tinymce": { - "version": "6.8.3", - "resolved": "https://registry.npmjs.org/tinymce/-/tinymce-6.8.3.tgz", - "integrity": "sha512-3fCHKAeqT+xNwBVESf6iDbDV0VNwZNmfrkx9c/6Gz5iB8piMfaO6s7FvoiTrj1hf1gVbfyLTnz1DooI6DhgINQ==" + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/tinymce/-/tinymce-7.6.0.tgz", + "integrity": "sha512-kUrklnD7H8JbpSDEGRh51GKK6Mrf+pR9neSDzUHvXKV+2oRtMB7sqfAtEOnM0/WKdstwaX0qoNCZNo2H1Y0EFA==", + "license": "GPL-2.0-or-later" + }, + "node_modules/tldts": { + "version": "6.1.71", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.71.tgz", + "integrity": "sha512-LQIHmHnuzfZgZWAf2HzL83TIIrD8NhhI0DVxqo9/FdOd4ilec+NTNZOlDZf7EwrTNoutccbsHjvWHYXLAtvxjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tldts-core": "^6.1.71" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "6.1.71", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.71.tgz", + "integrity": "sha512-LRbChn2YRpic1KxY+ldL1pGXN/oVvKfCVufwfVzEQdFYNo39uF7AJa/WXdo+gYO7PTvdfkCPCed6Hkvz/kR7jg==", + "dev": true, + "license": "MIT" }, "node_modules/tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", + "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", "dev": true, - "dependencies": { - "rimraf": "^3.0.0" - }, + "license": "MIT", "engines": { - "node": ">=8.17.0" + "node": ">=14.14" } }, "node_modules/tough-cookie": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", - "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.0.tgz", + "integrity": "sha512-rvZUv+7MoBYTiDmFPBrhL7Ujx9Sk+q9wwm22x8c8T5IJaR+Wsyc7TNxbVxo84kZoRJZZMazowFLqpankBEQrGg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.2.0", - "url-parse": "^1.5.3" + "tldts": "^6.1.32" }, "engines": { - "node": ">=6" + "node": ">=16" } }, - "node_modules/tough-cookie/node_modules/universalify": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", - "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", "dev": true, - "engines": { - "node": ">= 4.0.0" + "license": "MIT", + "bin": { + "tree-kill": "cli.js" } }, "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "dev": true + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD" }, "node_modules/tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", "dev": true, + "license": "Apache-2.0", "dependencies": { "safe-buffer": "^5.0.1" }, @@ -2020,13 +2107,15 @@ "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "dev": true + "dev": true, + "license": "Unlicense" }, "node_modules/type-fest": { "version": "0.21.3", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, + "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -2038,6 +2127,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "license": "MIT", "engines": { "node": ">= 10.0.0" } @@ -2047,25 +2137,17 @@ "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/url-parse": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", - "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", - "dev": true, - "dependencies": { - "querystringify": "^2.1.1", - "requires-port": "^1.0.0" - } - }, "node_modules/uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "dev": true, + "license": "MIT", "bin": { "uuid": "dist/bin/uuid" } @@ -2078,6 +2160,7 @@ "engines": [ "node >=0.6.0" ], + "license": "MIT", "dependencies": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", @@ -2089,6 +2172,7 @@ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -2104,6 +2188,7 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -2120,19 +2205,15 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", "dev": true, + "license": "MIT", "dependencies": { "buffer-crc32": "~0.2.3", "fd-slicer": "~1.1.0" diff --git a/package.json b/package.json index 57456549..7bf43b48 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "postinstall": "node ./npm-post-install.js" }, "devDependencies": { - "cypress": "^12.12.0" + "cypress": "^13.17.0" }, "dependencies": { "@tinymce/tinymce-jquery": "^2.1.0", @@ -12,6 +12,6 @@ "fs-extra": "^11.2.0", "jquery": "^3.7.1", "jquery-ui": "^1.13.2", - "tinymce": "^6.8.3" + "tinymce": "^7.2.0" } } diff --git a/plugins/account-create-hint.json b/plugins/account-create-hint.json index 87734108..3bf20037 100644 --- a/plugins/account-create-hint.json +++ b/plugins/account-create-hint.json @@ -1,6 +1,6 @@ { "name": "create-account-hint", - "description": "This plugin display text 'To play on Forgotten you need an account. All you have to do to create your new account is to enter an account name, password, country and your email address. Also you have to agree to the terms presented below. If you have done so, your account name will be shown on the following page and your account password will be sent to your email address along with further instructions. If you do not receive the email with your password, please check your spam filter.' on the create account page. Be careful when uninstalling this!", + "description": "This plugin display text 'To play on Forgotten you need an account. All you have to do to create your new account is to enter an account name, password, country and your email address. Also you have to agree to the terms presented below. If you have done so, your account name will be shown on the following page and your account password will be sent to your email address along with further instructions. If you do not receive the email with your password, please check your spam filter.' on the create account page.", "version": "1.0", "author": "slawkens", "contact": "slawkens@gmail.com", diff --git a/plugins/account-create-hint/hint.php b/plugins/account-create-hint/hint.php index b7ff8a7a..d1eab9ad 100644 --- a/plugins/account-create-hint/hint.php +++ b/plugins/account-create-hint/hint.php @@ -9,7 +9,4 @@ */ defined('MYAAC') or die('Direct access not allowed!'); -global $twig_loader; -$twig_loader->prependPath(BASE . 'plugins/account-create-hint'); - -$twig->display('hint.html.twig'); +$twig->display('account-create-hint/hint.html.twig'); diff --git a/release.sh b/release.sh index 855db72f..b42b56bb 100644 --- a/release.sh +++ b/release.sh @@ -22,7 +22,7 @@ if [ $1 = "prepare" ]; then mkdir -p tmp # get myaac from git archive - git archive --format zip --output tmp/myaac.zip develop + git archive --format zip --output tmp/myaac.zip main cd tmp/ || exit diff --git a/system/functions.php b/system/functions.php index 560030f6..5076b054 100644 --- a/system/functions.php +++ b/system/functions.php @@ -49,7 +49,7 @@ function warning($message, $return = false) { return message($message, 'warning', $return); } function note($message, $return = false) { - return info($message, $return); + return message($message, 'note', $return); } function info($message, $return = false) { return message($message, 'info', $return); @@ -121,7 +121,7 @@ function getPlayerLink($name, $generate = true, bool $colored = false): string function getMonsterLink($name, $generate = true): string { - $url = BASE_URL . (setting('core.friendly_urls') ? '' : 'index.php/') . 'monsters/' . urlencode($name); + $url = BASE_URL . (setting('core.friendly_urls') ? '' : 'index.php/') . 'monsters?name=' . urlencode($name); if(!$generate) return $url; return generateLink($url, $name); @@ -129,16 +129,14 @@ function getMonsterLink($name, $generate = true): string function getHouseLink($name, $generate = true): string { - if(is_numeric($name)) - { + if(is_numeric($name)) { $house = House::find(intval($name), ['name']); if ($house) { $name = $house->name; } } - - $url = BASE_URL . (setting('core.friendly_urls') ? '' : 'index.php/') . 'houses/' . urlencode($name); + $url = BASE_URL . (setting('core.friendly_urls') ? '' : 'index.php/') . 'houses?name=' . urlencode($name); if(!$generate) return $url; return generateLink($url, $name); @@ -990,31 +988,29 @@ function load_config_lua($filename) continue; } $tmp_exp = explode('=', $line, 2); - if(strpos($line, 'dofile') !== false) - { + if(str_contains($line, 'dofile')) { $delimiter = '"'; - if(strpos($line, $delimiter) === false) + if(!str_contains($line, $delimiter)) { $delimiter = "'"; + } $tmp = explode($delimiter, $line); $result = array_merge($result, load_config_lua($config['server_path'] . $tmp[1])); } - else if(count($tmp_exp) >= 2) - { + else if(count($tmp_exp) >= 2) { $key = trim($tmp_exp[0]); - if(0 !== strpos($key, '--')) - { + if(!str_starts_with($key, '--')) { $value = trim($tmp_exp[1]); - if(strpos($value, '--') !== false) {// found some deep comment + if(str_contains($value, '--')) {// found some deep comment $value = preg_replace('/--.*$/i', '', $value); } if(is_numeric($value)) $result[$key] = (float) $value; elseif(in_array(@$value[0], array("'", '"')) && in_array(@$value[strlen($value) - 1], array("'", '"'))) - $result[$key] = (string) substr(substr($value, 1), 0, -1); + $result[$key] = substr(substr($value, 1), 0, -1); elseif(in_array($value, array('true', 'false'))) - $result[$key] = ($value === 'true') ? true : false; + $result[$key] = $value === 'true'; elseif(@$value[0] === '{') { // arrays are not supported yet // just ignore the error @@ -1022,7 +1018,7 @@ function load_config_lua($filename) } else { - foreach($result as $tmp_key => $tmp_value) // load values definied by other keys, like: dailyFragsToBlackSkull = dailyFragsToRedSkull + foreach($result as $tmp_key => $tmp_value) // load values defined by other keys, like: dailyFragsToBlackSkull = dailyFragsToRedSkull $value = str_replace($tmp_key, $tmp_value, $value); $ret = @eval("return $value;"); if((string) $ret == '' && trim($value) !== '""') // = parser error @@ -1036,8 +1032,7 @@ function load_config_lua($filename) } } - $result = array_merge($result, isset($config['lua']) ? $config['lua'] : array()); - return $result; + return array_merge($result, $config['lua'] ?? []); } function str_replace_first($search,$replace, $subject) { @@ -1063,17 +1058,36 @@ function get_browser_real_ip() { return '0'; } -function setSession($key, $data) { - $_SESSION[setting('core.session_prefix') . $key] = $data; +function setSession($key, $value = null): void { + if (!is_array($key)) { + $key = [$key => $value]; + } + + foreach ($key as $arrayKey => $arrayValue) { + if (is_null($arrayValue)) { + unsetSession($arrayKey); + } + else { + $_SESSION[setting('core.session_prefix') . $arrayKey] = $arrayValue; + } + } } function getSession($key) { - $key = setting('core.session_prefix') . $key; - return isset($_SESSION[$key]) ? $_SESSION[$key] : false; + return $_SESSION[setting('core.session_prefix') . $key] ?? null; } -function unsetSession($key) { +function unsetSession($key): void { unset($_SESSION[setting('core.session_prefix') . $key]); } +function session($key): mixed { + if (is_array($key)) { + setSession($key); + return null; + } + + return getSession($key); +} + function csrf(bool $return = false): string { return CsrfToken::create($return); } @@ -1096,20 +1110,16 @@ function csrfProtect(): void } } -function getTopPlayers($limit = 5) { +function getTopPlayers($limit = 5, $skill = 'level') { global $db; - $cache = Cache::getInstance(); - if($cache->enabled()) { - $tmp = ''; - if($cache->fetch('top_' . $limit . '_level', $tmp)) { - $players = unserialize($tmp); - } + if ($skill === 'level') { + $skill = 'experience'; } - if (!isset($players)) { + return Cache::remember("top_{$limit}_{$skill}", 2 * 60, function () use ($db, $limit, $skill) { $columns = [ - 'id', 'name', 'level', 'vocation', 'experience', + 'id', 'name', 'level', 'vocation', 'experience', 'balance', 'looktype', 'lookhead', 'lookbody', 'looklegs', 'lookfeet' ]; @@ -1117,36 +1127,27 @@ function getTopPlayers($limit = 5) { $columns[] = 'lookaddons'; } - if ($db->hasColumn('players', 'online')) { - $columns[] = 'online'; - } - - $players = Player::query() + return Player::query() ->select($columns) ->withOnlineStatus() ->notDeleted() ->where('group_id', '<', setting('core.highscores_groups_hidden')) ->whereNotIn('id', setting('core.highscores_ids_hidden')) ->where('account_id', '!=', 1) - ->orderByDesc('experience') + ->orderByDesc($skill) ->limit($limit) ->get() ->map(function ($e, $i) { $row = $e->toArray(); $row['online'] = $e->online_status; $row['rank'] = $i + 1; + $row['outfit_url'] = $e->outfit_url; unset($row['online_table']); return $row; })->toArray(); - - if($cache->enabled()) { - $cache->set('top_' . $limit . '_level', serialize($players), 120); - } - } - - return $players; + }); } function deleteDirectory($dir, $ignore = array(), $contentOnly = false) { @@ -1694,4 +1695,7 @@ function getAccountIdentityColumn(): string require_once SYSTEM . 'compat/base.php'; // custom functions -require SYSTEM . 'functions_custom.php'; +$customFunctions = SYSTEM . 'functions_custom.php'; +if (is_file($customFunctions)) { + require $customFunctions; +} diff --git a/system/init.php b/system/init.php index 9217e8f0..ba2990db 100644 --- a/system/init.php +++ b/system/init.php @@ -50,6 +50,7 @@ $cache = Cache::getInstance(); global $hooks; $hooks = new Hooks(); $hooks->load(); +$hooks->trigger(HOOK_INIT); // twig require_once SYSTEM . 'twig.php'; @@ -96,8 +97,8 @@ if($config_lua_reload) { // cache config if($cache->enabled()) { - $cache->set('config_lua', serialize($config['lua']), 120); - $cache->set('server_path', $config['server_path']); + $cache->set('config_lua', serialize($config['lua']), 2 * 60); + $cache->set('server_path', $config['server_path'], 10 * 60); } } unset($tmp); @@ -139,7 +140,7 @@ require_once SYSTEM . 'database.php'; // verify myaac tables exists in database if(!defined('MYAAC_INSTALL') && !$db->hasTable('myaac_account_actions')) { - throw new RuntimeException('Seems that the table myaac_account_actions of MyAAC doesn\'t exist in the database. This is a fatal error. You can try to reinstall MyAAC by visiting ' . BASE_URL . 'install'); + throw new RuntimeException('Seems that the table myaac_account_actions of MyAAC doesn\'t exist in the database. This is a fatal error. You can try to reinstall MyAAC by visiting ' . (IS_CLI ? 'http://your-ip.com/' : BASE_URL) . 'install'); } // execute migrations diff --git a/system/libs/pot/OTS_Account.php b/system/libs/pot/OTS_Account.php index 067c418d..0de49ccc 100644 --- a/system/libs/pot/OTS_Account.php +++ b/system/libs/pot/OTS_Account.php @@ -12,6 +12,8 @@ * @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU Lesser General Public License, Version 3 */ +use MyAAC\Models\AccountAction; + /** * OTServ account abstraction. * @@ -1010,26 +1012,16 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable public function logAction($action) { - $ip = get_browser_real_ip(); - if(strpos($ip, ":") === false) { - $ipv6 = '0'; - } - else { - $ipv6 = $ip; - $ip = ''; - } - - return $this->db->exec('INSERT INTO `' . TABLE_PREFIX . 'account_actions` (`account_id`, `ip`, `ipv6`, `date`, `action`) VALUES (' . $this->db->quote($this->getId()).', ' . ($ip == '' ? '0' : $this->db->quote(ip2long($ip))) . ', (' . ($ipv6 == '0' ? $this->db->quote('') : $this->db->quote(inet_pton($ipv6))) . '), UNIX_TIMESTAMP(NOW()), ' . $this->db->quote($action).')'); + AccountAction::create([ + 'account_id' => $this->getId(), + 'ip' => get_browser_real_ip(), + 'date' => time(), + 'action' => $action, + ]); } - public function getActionsLog($limit1, $limit2) - { - $actions = array(); - - foreach($this->db->query('SELECT `ip`, `ipv6`, `date`, `action` FROM `' . TABLE_PREFIX . 'account_actions` WHERE `account_id` = ' . $this->data['id'] . ' ORDER by `date` DESC LIMIT ' . $limit1 . ', ' . $limit2 . '')->fetchAll() as $a) - $actions[] = array('ip' => $a['ip'], 'ipv6' => $a['ipv6'], 'date' => $a['date'], 'action' => $a['action']); - - return $actions; + public function getActionsLog($limit) { + return AccountAction::where('account_id', $this->data['id'])->orderByDesc('date')->limit($limit)->get()->toArray(); } /** * Returns players iterator. diff --git a/system/libs/pot/OTS_Player.php b/system/libs/pot/OTS_Player.php index 478450b5..5c1cbf87 100644 --- a/system/libs/pot/OTS_Player.php +++ b/system/libs/pot/OTS_Player.php @@ -90,7 +90,7 @@ class OTS_Player extends OTS_Row_DAO * @version 0.1.2 * @var array */ - private $data = array('group_id' => 1, 'sex' => 0, 'vocation' => 0, 'experience' => 0, 'level' => 1, 'maglevel' => 0, 'health' => 100, 'healthmax' => 100, 'mana' => 100, 'manamax' => 100, 'manaspent' => 0, 'soul' => 0, 'lookbody' => 10, 'lookfeet' => 10, 'lookhead' => 10, 'looklegs' => 10, 'looktype' => 136, 'lookaddons' => 0, 'posx' => 0, 'posy' => 0, 'posz' => 0, 'cap' => 0, 'lastlogin' => 0, 'lastip' => 0, 'save' => true, 'skulltime' => 0, 'skull' => 0, 'balance' => 0, 'lastlogout' => 0, 'blessings' => 0, 'stamina' => 0, 'online' => 0, 'comment' => '', 'created' => 0, 'hide' => 0); + private $data = array('group_id' => 1, 'sex' => 0, 'vocation' => 0, 'experience' => 0, 'level' => 1, 'maglevel' => 0, 'health' => 100, 'healthmax' => 100, 'mana' => 100, 'manamax' => 100, 'manaspent' => 0, 'soul' => 0, 'lookbody' => 10, 'lookfeet' => 10, 'lookhead' => 10, 'looklegs' => 10, 'looktype' => 136, 'lookaddons' => 0, 'posx' => 0, 'posy' => 0, 'posz' => 0, 'cap' => 0, 'lastlogin' => 0, 'lastip' => 0, 'save' => true, 'skulltime' => 0, 'skull' => 0, 'balance' => 0, 'lastlogout' => 0, 'blessings' => 0, 'stamina' => 0, 'online' => 0, 'comment' => '', 'created' => 0, 'hide' => 0); /** * Player skills. @@ -99,7 +99,7 @@ class OTS_Player extends OTS_Row_DAO * @since 0.0.2 * @var array */ - private $skills = array( + private $skills = array( POT::SKILL_FIST => array('value' => 0, 'tries' => 0), POT::SKILL_CLUB => array('value' => 0, 'tries' => 0), POT::SKILL_SWORD => array('value' => 0, 'tries' => 0), @@ -108,6 +108,8 @@ class OTS_Player extends OTS_Row_DAO POT::SKILL_SHIELD => array('value' => 0, 'tries' => 0), POT::SKILL_FISH => array('value' => 0, 'tries' => 0) ); + + private static array $playersOnline; /** * Magic PHP5 method. * @@ -117,10 +119,10 @@ class OTS_Player extends OTS_Row_DAO * @version 0.0.4 * @since 0.0.4 */ - public function __sleep() - { - return array('data', 'skills'); - } + public function __sleep() + { + return array('data', 'skills'); + } /** * Loads player with given id. @@ -129,8 +131,8 @@ class OTS_Player extends OTS_Row_DAO * @param int $id Player's ID. * @throws PDOException On PDO operation error. */ - public function load($id, $fields = null, $load_skills = true) - { + public function load($id, $fields = null, $load_skills = true) + { global $__load; if(!isset($__load['loss_experience'])) @@ -234,9 +236,9 @@ class OTS_Player extends OTS_Row_DAO $this->data = $this->db->query('SELECT `id`, `name`, `account_id`, `group_id`, `sex`, `vocation`, `experience`, `level`, `maglevel`, `health`, `healthmax`, `mana`, `manamax`, `manaspent`, `soul`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`' . ($this->db->hasColumn('players', 'lookaddons') ? ', `lookaddons`' : '') . ', `posx`, `posy`, `posz`, `cap`, `lastlogin`, `lastlogout`, `lastip`, `save`, `conditions`, `' . $__load['skull_time'] . '` as `skulltime`, `' . $__load['skull_type'] . '` as `skull`' . $__load['guild_info'] . ', `town_id`' . $__load['loss_experience'] . $__load['loss_items'] . ', `balance`' . ($__load['blessings'] ? ', `blessings`' : '') . ($__load['direction'] ? ', `direction`' : '') . ($__load['stamina'] ? ', `stamina`' : '') . ($__load['world_id'] ? ', `world_id`' : '') . ($__load['online'] ? ', `online`' : '') . ', `' . ($__load['deletion'] ? 'deletion' : 'deleted') . '`' . ($__load['promotion'] ? ', `promotion`' : '') . ($__load['marriage'] ? ', `marriage`' : '') . ', `comment`, `created`, `hide` FROM `players` WHERE `id` = ' . (int)$id)->fetch(); } - // loads skills - if( $this->isLoaded() && $load_skills) - { + // loads skills + if( $this->isLoaded() && $load_skills) + { if($this->db->hasColumn('players', 'skill_fist')) { $skill_ids = array( @@ -271,8 +273,8 @@ class OTS_Player extends OTS_Row_DAO $this->skills[ $skill['skillid'] ] = array('value' => $skill['value'], 'tries' => $skill['count']); } } - } - } + } + } /** * Loads player by it's name. @@ -282,27 +284,27 @@ class OTS_Player extends OTS_Row_DAO * @param string $name Player's name. * @throws PDOException On PDO operation error. */ - public function find($name) - { - // finds player's ID - $id = $this->db->query('SELECT `id` FROM `players` WHERE `name` = ' . $this->db->quote($name) )->fetch(); + public function find($name) + { + // finds player's ID + $id = $this->db->query('SELECT `id` FROM `players` WHERE `name` = ' . $this->db->quote($name) )->fetch(); - // if anything was found - if( isset($id['id']) ) - { - $this->load($id['id']); - } - } + // if anything was found + if( isset($id['id']) ) + { + $this->load($id['id']); + } + } /** * Checks if object is loaded. * * @return bool Load state. */ - public function isLoaded() - { - return isset($this->data['id']); - } + public function isLoaded() + { + return isset($this->data['id']); + } /** * Saves player in database. @@ -314,8 +316,8 @@ class OTS_Player extends OTS_Row_DAO * @version 0.1.2 * @throws PDOException On PDO operation error. */ - public function save() - { + public function save() + { $skull_type = 'skull'; if($this->db->hasColumn('players', 'skull_type')) { $skull_type = 'skull_type'; @@ -359,9 +361,9 @@ class OTS_Player extends OTS_Row_DAO if(!isset($this->data['town_id'])) $this->data['town_id'] = 1; - // updates existing player - if( isset($this->data['id']) ) - { + // updates existing player + if( isset($this->data['id']) ) + { $loss = ''; if($this->db->hasColumn('players', 'loss_experience')) { $loss = ', `loss_experience` = ' . $this->data['loss_experience'] . ', `loss_mana` = ' . $this->data['loss_mana'] . ', `loss_skills` = ' . $this->data['loss_skills']; @@ -397,12 +399,12 @@ class OTS_Player extends OTS_Row_DAO $lookaddons = ', `lookaddons` = ' . $this->db->quote($this->data['lookaddons']); } - // UPDATE query on database - $this->db->query('UPDATE ' . $this->db->tableName('players') . ' SET ' . $this->db->fieldName('name') . ' = ' . $this->db->quote($this->data['name']) . ', ' . $this->db->fieldName('account_id') . ' = ' . $this->data['account_id'] . ', ' . $this->db->fieldName('group_id') . ' = ' . $this->data['group_id'] . ', ' . $this->db->fieldName('sex') . ' = ' . $this->data['sex'] . ', ' . $this->db->fieldName('vocation') . ' = ' . $this->data['vocation'] . ', ' . $this->db->fieldName('experience') . ' = ' . $this->data['experience'] . ', ' . $this->db->fieldName('level') . ' = ' . $this->data['level'] . ', ' . $this->db->fieldName('maglevel') . ' = ' . $this->data['maglevel'] . ', ' . $this->db->fieldName('health') . ' = ' . $this->data['health'] . ', ' . $this->db->fieldName('healthmax') . ' = ' . $this->data['healthmax'] . ', ' . $this->db->fieldName('mana') . ' = ' . $this->data['mana'] . ', ' . $this->db->fieldName('manamax') . ' = ' . $this->data['manamax'] . ', ' . $this->db->fieldName('manaspent') . ' = ' . $this->data['manaspent'] . ', ' . $this->db->fieldName('soul') . ' = ' . $this->data['soul'] . ', ' . $this->db->fieldName('lookbody') . ' = ' . $this->data['lookbody'] . ', ' . $this->db->fieldName('lookfeet') . ' = ' . $this->data['lookfeet'] . ', ' . $this->db->fieldName('lookhead') . ' = ' . $this->data['lookhead'] . ', ' . $this->db->fieldName('looklegs') . ' = ' . $this->data['looklegs'] . ', ' . $this->db->fieldName('looktype') . ' = ' . $this->data['looktype'] . $lookaddons . ', ' . $this->db->fieldName('posx') . ' = ' . $this->data['posx'] . ', ' . $this->db->fieldName('posy') . ' = ' . $this->data['posy'] . ', ' . $this->db->fieldName('posz') . ' = ' . $this->data['posz'] . ', ' . $this->db->fieldName('cap') . ' = ' . $this->data['cap'] . ', ' . $this->db->fieldName('lastlogin') . ' = ' . $this->data['lastlogin'] . ', ' . $this->db->fieldName('lastlogout') . ' = ' . $this->data['lastlogout'] . ', ' . $this->db->fieldName('lastip') . ' = ' . $this->db->quote($this->data['lastip']) . ', ' . $this->db->fieldName('save') . ' = ' . (int) $this->data['save'] . ', ' . $this->db->fieldName('conditions') . ' = ' . $this->db->quote($this->data['conditions']) . ', `' . $skull_time . '` = ' . $this->data['skulltime'] . ', `' . $skull_type . '` = ' . (int) $this->data['skull'] . $guild_info . ', ' . $this->db->fieldName('town_id') . ' = ' . $this->data['town_id'] . $loss . $loss_items . ', ' . $this->db->fieldName('balance') . ' = ' . $this->data['balance'] . $blessings . $stamina . $direction . ' WHERE ' . $this->db->fieldName('id') . ' = ' . $this->data['id']); - } - // creates new player - else - { + // UPDATE query on database + $this->db->query('UPDATE ' . $this->db->tableName('players') . ' SET ' . $this->db->fieldName('name') . ' = ' . $this->db->quote($this->data['name']) . ', ' . $this->db->fieldName('account_id') . ' = ' . $this->data['account_id'] . ', ' . $this->db->fieldName('group_id') . ' = ' . $this->data['group_id'] . ', ' . $this->db->fieldName('sex') . ' = ' . $this->data['sex'] . ', ' . $this->db->fieldName('vocation') . ' = ' . $this->data['vocation'] . ', ' . $this->db->fieldName('experience') . ' = ' . $this->data['experience'] . ', ' . $this->db->fieldName('level') . ' = ' . $this->data['level'] . ', ' . $this->db->fieldName('maglevel') . ' = ' . $this->data['maglevel'] . ', ' . $this->db->fieldName('health') . ' = ' . $this->data['health'] . ', ' . $this->db->fieldName('healthmax') . ' = ' . $this->data['healthmax'] . ', ' . $this->db->fieldName('mana') . ' = ' . $this->data['mana'] . ', ' . $this->db->fieldName('manamax') . ' = ' . $this->data['manamax'] . ', ' . $this->db->fieldName('manaspent') . ' = ' . $this->data['manaspent'] . ', ' . $this->db->fieldName('soul') . ' = ' . $this->data['soul'] . ', ' . $this->db->fieldName('lookbody') . ' = ' . $this->data['lookbody'] . ', ' . $this->db->fieldName('lookfeet') . ' = ' . $this->data['lookfeet'] . ', ' . $this->db->fieldName('lookhead') . ' = ' . $this->data['lookhead'] . ', ' . $this->db->fieldName('looklegs') . ' = ' . $this->data['looklegs'] . ', ' . $this->db->fieldName('looktype') . ' = ' . $this->data['looktype'] . $lookaddons . ', ' . $this->db->fieldName('posx') . ' = ' . $this->data['posx'] . ', ' . $this->db->fieldName('posy') . ' = ' . $this->data['posy'] . ', ' . $this->db->fieldName('posz') . ' = ' . $this->data['posz'] . ', ' . $this->db->fieldName('cap') . ' = ' . $this->data['cap'] . ', ' . $this->db->fieldName('lastlogin') . ' = ' . $this->data['lastlogin'] . ', ' . $this->db->fieldName('lastlogout') . ' = ' . $this->data['lastlogout'] . ', ' . $this->db->fieldName('lastip') . ' = ' . $this->db->quote($this->data['lastip']) . ', ' . $this->db->fieldName('save') . ' = ' . (int) $this->data['save'] . ', ' . $this->db->fieldName('conditions') . ' = ' . $this->db->quote($this->data['conditions']) . ', `' . $skull_time . '` = ' . $this->data['skulltime'] . ', `' . $skull_type . '` = ' . (int) $this->data['skull'] . $guild_info . ', ' . $this->db->fieldName('town_id') . ' = ' . $this->data['town_id'] . $loss . $loss_items . ', ' . $this->db->fieldName('balance') . ' = ' . $this->data['balance'] . $blessings . $stamina . $direction . ' WHERE ' . $this->db->fieldName('id') . ' = ' . $this->data['id']); + } + // creates new player + else + { $loss = ''; $loss_data = ''; if($this->db->hasColumn('players', 'loss_experience')) { @@ -459,13 +461,13 @@ class OTS_Player extends OTS_Row_DAO $lookaddons_data = ', ' . $this->data['lookaddons']; } - // INSERT query on database - $this->db->query('INSERT INTO `players` (`name`, `account_id`, `group_id`, `sex`, `vocation`, `experience`, `level`, `maglevel`, `health`, `healthmax`, `mana`, `manamax`, `manaspent`, `soul`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`' . $lookaddons . ', `posx`, `posy`, `posz`, `cap`, `lastlogin`, `lastlogout`, `lastip`, `save`, `conditions`, `' . $skull_time . '`, `' . $skull_type . '`' . $guild_info . ', `town_id`' . $loss . $loss_items . ', `balance`' . $blessings . $stamina . $direction . ', `created`' . $promotion . ', `comment`) VALUES (' . $this->db->quote($this->data['name']) . ', ' . $this->data['account_id'] . ', ' . $this->data['group_id'] . ', ' . $this->data['sex'] . ', ' . $this->data['vocation'] . ', ' . $this->data['experience'] . ', ' . $this->data['level'] . ', ' . $this->data['maglevel'] . ', ' . $this->data['health'] . ', ' . $this->data['healthmax'] . ', ' . $this->data['mana'] . ', ' . $this->data['manamax'] . ', ' . $this->data['manaspent'] . ', ' . $this->data['soul'] . ', ' . $this->data['lookbody'] . ', ' . $this->data['lookfeet'] . ', ' . $this->data['lookhead'] . ', ' . $this->data['looklegs'] . ', ' . $this->data['looktype'] . $lookaddons_data . ', ' . $this->data['posx'] . ', ' . $this->data['posy'] . ', ' . $this->data['posz'] . ', ' . $this->data['cap'] . ', ' . $this->data['lastlogin'] . ', ' . $this->data['lastlogout'] . ', ' . $this->data['lastip'] . ', ' . (int) $this->data['save'] . ', ' . $this->db->quote($this->data['conditions']) . ', ' . $this->data['skulltime'] . ', ' . (int) $this->data['skull'] . $guild_info_data . ', ' . $this->data['town_id'] . $loss_data . $loss_items_data . ', ' . $this->data['balance'] . $blessings_data . $stamina_data . $direction_data . ', ' . time() . $promotion_data . ', "")'); - // ID of new group - $this->data['id'] = $this->db->lastInsertId(); - } + // INSERT query on database + $this->db->query('INSERT INTO `players` (`name`, `account_id`, `group_id`, `sex`, `vocation`, `experience`, `level`, `maglevel`, `health`, `healthmax`, `mana`, `manamax`, `manaspent`, `soul`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`' . $lookaddons . ', `posx`, `posy`, `posz`, `cap`, `lastlogin`, `lastlogout`, `lastip`, `save`, `conditions`, `' . $skull_time . '`, `' . $skull_type . '`' . $guild_info . ', `town_id`' . $loss . $loss_items . ', `balance`' . $blessings . $stamina . $direction . ', `created`' . $promotion . ', `comment`) VALUES (' . $this->db->quote($this->data['name']) . ', ' . $this->data['account_id'] . ', ' . $this->data['group_id'] . ', ' . $this->data['sex'] . ', ' . $this->data['vocation'] . ', ' . $this->data['experience'] . ', ' . $this->data['level'] . ', ' . $this->data['maglevel'] . ', ' . $this->data['health'] . ', ' . $this->data['healthmax'] . ', ' . $this->data['mana'] . ', ' . $this->data['manamax'] . ', ' . $this->data['manaspent'] . ', ' . $this->data['soul'] . ', ' . $this->data['lookbody'] . ', ' . $this->data['lookfeet'] . ', ' . $this->data['lookhead'] . ', ' . $this->data['looklegs'] . ', ' . $this->data['looktype'] . $lookaddons_data . ', ' . $this->data['posx'] . ', ' . $this->data['posy'] . ', ' . $this->data['posz'] . ', ' . $this->data['cap'] . ', ' . $this->data['lastlogin'] . ', ' . $this->data['lastlogout'] . ', ' . $this->data['lastip'] . ', ' . (int) $this->data['save'] . ', ' . $this->db->quote($this->data['conditions']) . ', ' . $this->data['skulltime'] . ', ' . (int) $this->data['skull'] . $guild_info_data . ', ' . $this->data['town_id'] . $loss_data . $loss_items_data . ', ' . $this->data['balance'] . $blessings_data . $stamina_data . $direction_data . ', ' . time() . $promotion_data . ', "")'); + // ID of new group + $this->data['id'] = $this->db->lastInsertId(); + } - // updates skills - doesn't matter if we have just created character - trigger inserts new skills + // updates skills - doesn't matter if we have just created character - trigger inserts new skills if($this->db->hasColumn('players', 'skill_fist')) { // tfs 1.0 $set = ''; @@ -496,7 +498,7 @@ class OTS_Player extends OTS_Row_DAO $this->db->query('UPDATE ' . $this->db->tableName('player_skills') . ' SET ' . $this->db->fieldName('value') . ' = ' . $skill['value'] . ', ' . $this->db->fieldName('count') . ' = ' . $skill['tries'] . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('skillid') . ' = ' . $id); } } - } + } /** * Player ID. @@ -509,43 +511,43 @@ class OTS_Player extends OTS_Row_DAO * @return int Player ID. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getId() - { - if( !isset($this->data['id']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getId() + { + if( !isset($this->data['id']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['id']; - } + return $this->data['id']; + } - public function isHidden() - { - if( !isset($this->data['hide']) ) - { - throw new E_OTS_NotLoaded(); - } + public function isHidden() + { + if( !isset($this->data['hide']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['hide'] == 1; - } + return $this->data['hide'] == 1; + } - public function setHidden($hidden) - { - $this->data['hide'] = (int) $hidden; - } + public function setHidden($hidden) + { + $this->data['hide'] = (int) $hidden; + } - public function getMarriage() - { + public function getMarriage() + { if(!$this->db->hasColumn('players', 'marriage')) return ''; - if( !isset($this->data['marriage']) ) - { - throw new E_OTS_NotLoaded(); - } + if( !isset($this->data['marriage']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['marriage']; - } + return $this->data['marriage']; + } /** * Player name. @@ -558,15 +560,15 @@ class OTS_Player extends OTS_Row_DAO * @return string Player's name. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getName() - { - if( !isset($this->data['name']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getName() + { + if( !isset($this->data['name']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['name']; - } + return $this->data['name']; + } /** * Sets players's name. @@ -577,10 +579,10 @@ class OTS_Player extends OTS_Row_DAO * * @param string $name Name. */ - public function setName($name) - { - $this->data['name'] = (string) $name; - } + public function setName($name) + { + $this->data['name'] = (string) $name; + } /** * Returns account of this player. @@ -594,27 +596,27 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotLoaded If player is not loaded. * @throws PDOException On PDO operation error. */ - public function getAccount() - { - if( !isset($this->data['account_id']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getAccount() + { + if( !isset($this->data['account_id']) ) + { + throw new E_OTS_NotLoaded(); + } - $account = new OTS_Account(); - $account->load($this->data['account_id']); - return $account; - } + $account = new OTS_Account(); + $account->load($this->data['account_id']); + return $account; + } - public function getAccountId() - { - if( !isset($this->data['account_id']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getAccountId() + { + if( !isset($this->data['account_id']) ) + { + throw new E_OTS_NotLoaded(); + } return $this->data['account_id']; - } + } /** * Assigns character to account. * @@ -625,15 +627,15 @@ class OTS_Player extends OTS_Row_DAO * @param OTS_Account $account Owning account. * @throws E_OTS_NotLoaded If passed $account parameter is not loaded. */ - public function setAccount(OTS_Account $account) - { - $this->data['account_id'] = $account->getId(); - } + public function setAccount(OTS_Account $account) + { + $this->data['account_id'] = $account->getId(); + } public function setAccountId($account_id) - { - $this->data['account_id'] = (int)$account_id; - } + { + $this->data['account_id'] = (int)$account_id; + } /** * Returns group of this player. @@ -647,19 +649,19 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotLoaded If player is not loaded. * @throws PDOException On PDO operation error. */ - public function getGroup() - { + public function getGroup() + { //global $config; //if($path == '') // $path = $config['data_path'].'XML/groups.xml'; - if( !isset($this->data['group_id']) ) - { - throw new E_OTS_NotLoaded(); - } + if( !isset($this->data['group_id']) ) + { + throw new E_OTS_NotLoaded(); + } - //$groups = new DOMDocument(); - //$groups->load($path); + //$groups = new DOMDocument(); + //$groups->load($path); global $groups; $tmp = $groups->getGroup($this->data['group_id']); @@ -671,18 +673,18 @@ class OTS_Player extends OTS_Row_DAO /* $_id = $this->data['group_id']; $tmpGroup = new OTS_Group; - foreach($groups->getElementsByTagName('group') as $group) - { + foreach($groups->getElementsByTagName('group') as $group) + { if($group->getAttribute('id') == $_id) { $tmpGroup->load($group); return $tmpGroup; } - }*/ + }*/ // $group = new OTS_Group(); // $group->load($this->data['group_id']); // return $group; - } + } /** * Assigns character to group. @@ -694,15 +696,15 @@ class OTS_Player extends OTS_Row_DAO * @param OTS_Group $group Group to be a member. * @throws E_OTS_NotLoaded If passed $group parameter is not loaded. */ - public function setGroup(OTS_Group $group) - { - $this->data['group_id'] = $group->getId(); - } + public function setGroup(OTS_Group $group) + { + $this->data['group_id'] = $group->getId(); + } - public function setGroupId($group_id) - { - $this->data['group_id'] = $group_id; - } + public function setGroupId($group_id) + { + $this->data['group_id'] = $group_id; + } /** * Player's Premium Account expiration timestamp. @@ -713,15 +715,15 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotLoaded If player is not loaded. * @deprecated 0.1.5 Use OTS_Account->getPremiumEnd(). */ - public function getPremiumEnd() - { - if( !isset($this->data['id']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getPremiumEnd() + { + if( !isset($this->data['id']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->getAccount()->getPremiumEnd(); - } + return $this->getAccount()->getPremiumEnd(); + } /** * Player gender. @@ -734,80 +736,88 @@ class OTS_Player extends OTS_Row_DAO * @return int Player gender. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getSex() - { - if( !isset($this->data['sex']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getSex() + { + if( !isset($this->data['sex']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['sex']; - } + return $this->data['sex']; + } public function isDeleted() - { + { $field = 'deleted'; if($this->db->hasColumn('players', 'deletion')) $field = 'deletion'; - if( !isset($this->data[$field]) ) - { - throw new E_OTS_NotLoaded(); - } - - return $this->data[$field] > 0; - } - - public function setDeleted($deleted) - { - $this->data['deleted'] = (int) $deleted; - } - - public function isOnline() - { - if($this->db->hasTable('players_online')) // tfs 1.0 + if( !isset($this->data[$field]) ) { - $query = $this->db->query('SELECT `player_id` FROM `players_online` WHERE `player_id` = ' . $this->data['id']); - return $query->rowCount() > 0; + throw new E_OTS_NotLoaded(); } - if( !isset($this->data['online']) ) - { - throw new E_OTS_NotLoaded(); - } + return $this->data[$field] > 0; + } - return $this->data['online'] == 1; - } + public function setDeleted($deleted) + { + $this->data['deleted'] = (int) $deleted; + } - public function getCreated() - { - if( !isset($this->data['created']) ) - { - throw new E_OTS_NotLoaded(); - } + public function isOnline() + { + if($this->db->hasTable('players_online')) {// tfs 1.0 + if (!isset(self::$playersOnline)) { + self::$playersOnline = []; - return $this->data['created']; - } + $query = $this->db->query('SELECT `player_id` FROM `players_online`'); - public function setCreated($created) - { - $this->data['created'] = (bool) $created; - } + foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $item) { + self::$playersOnline[$item['player_id']] = true; + } + } - public function getComment() - { - if( !isset($this->data['comment']) ) - { - throw new E_OTS_NotLoaded(); - } + return isset(self::$playersOnline[$this->data['id']]); + } - return $this->data['comment']; - } + if( !isset($this->data['online']) ) + { + throw new E_OTS_NotLoaded(); + } - public function setComment($comment) - { - $this->data['comment'] = (string) $comment; - } + return $this->data['online'] == 1; + } + + public function getCreated() + { + if( !isset($this->data['created']) ) + { + throw new E_OTS_NotLoaded(); + } + + return $this->data['created']; + } + + public function setCreated($created) + { + $this->data['created'] = (bool) $created; + } + + public function getComment() + { + if( !isset($this->data['comment']) ) + { + throw new E_OTS_NotLoaded(); + } + + return $this->data['comment']; + } + + public function setComment($comment) + { + $this->data['comment'] = (string) $comment; + } /** @@ -819,10 +829,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $sex Player gender. */ - public function setSex($sex) - { - $this->data['sex'] = (int) $sex; - } + public function setSex($sex) + { + $this->data['sex'] = (int) $sex; + } /** * Player proffesion. @@ -835,12 +845,12 @@ class OTS_Player extends OTS_Row_DAO * @return int Player proffesion. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getVocation() - { - if( !isset($this->data['vocation']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getVocation() + { + if( !isset($this->data['vocation']) ) + { + throw new E_OTS_NotLoaded(); + } if(isset($this->data['promotion'])) { global $config; @@ -848,19 +858,19 @@ class OTS_Player extends OTS_Row_DAO return ($this->data['vocation'] + ($this->data['promotion'] * $config['vocations_amount'])); } - return $this->data['vocation']; - } + return $this->data['vocation']; + } - public function getPromotion() - { - if( !isset($this->data['promotion']) ) - { - return false; - } + public function getPromotion() + { + if( !isset($this->data['promotion']) ) + { + return false; + } - return $this->data['promotion']; - } + return $this->data['promotion']; + } /** * Sets player proffesion. * @@ -870,15 +880,15 @@ class OTS_Player extends OTS_Row_DAO * * @param int $vocation Player proffesion. */ - public function setVocation($vocation) - { - $this->data['vocation'] = (int) $vocation; - } + public function setVocation($vocation) + { + $this->data['vocation'] = (int) $vocation; + } - public function setPromotion($promotion) - { - $this->data['promotion'] = (int) $promotion; - } + public function setPromotion($promotion) + { + $this->data['promotion'] = (int) $promotion; + } /** * Experience points. * @@ -890,15 +900,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Experience points. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getExperience() - { - if( !isset($this->data['experience']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getExperience() + { + if( !isset($this->data['experience']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['experience']; - } + return $this->data['experience']; + } /** * Sets experience points. @@ -909,10 +919,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $experience Experience points. */ - public function setExperience($experience) - { - $this->data['experience'] = (int) $experience; - } + public function setExperience($experience) + { + $this->data['experience'] = (int) $experience; + } /** * Experience level. @@ -925,15 +935,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Experience level. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getLevel() - { - if( !isset($this->data['level']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getLevel() + { + if( !isset($this->data['level']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['level']; - } + return $this->data['level']; + } /** * Sets experience level. @@ -944,10 +954,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $level Experience level. */ - public function setLevel($level) - { - $this->data['level'] = (int) $level; - } + public function setLevel($level) + { + $this->data['level'] = (int) $level; + } /** * Magic level. @@ -960,15 +970,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Magic level. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getMagLevel() - { - if( !isset($this->data['maglevel']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getMagLevel() + { + if( !isset($this->data['maglevel']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['maglevel']; - } + return $this->data['maglevel']; + } /** * Sets magic level. @@ -979,10 +989,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $maglevel Magic level. */ - public function setMagLevel($maglevel) - { - $this->data['maglevel'] = (int) $maglevel; - } + public function setMagLevel($maglevel) + { + $this->data['maglevel'] = (int) $maglevel; + } /** * Current HP. @@ -995,15 +1005,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Current HP. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getHealth() - { - if( !isset($this->data['health']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getHealth() + { + if( !isset($this->data['health']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['health']; - } + return $this->data['health']; + } /** * Sets current HP. @@ -1014,10 +1024,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $health Current HP. */ - public function setHealth($health) - { - $this->data['health'] = (int) $health; - } + public function setHealth($health) + { + $this->data['health'] = (int) $health; + } /** * Maximum HP. @@ -1030,15 +1040,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Maximum HP. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getHealthMax() - { - if( !isset($this->data['healthmax']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getHealthMax() + { + if( !isset($this->data['healthmax']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['healthmax']; - } + return $this->data['healthmax']; + } /** * Sets maximum HP. @@ -1049,10 +1059,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $healthmax Maximum HP. */ - public function setHealthMax($healthmax) - { - $this->data['healthmax'] = (int) $healthmax; - } + public function setHealthMax($healthmax) + { + $this->data['healthmax'] = (int) $healthmax; + } /** * Current mana. @@ -1065,15 +1075,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Current mana. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getMana() - { - if( !isset($this->data['mana']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getMana() + { + if( !isset($this->data['mana']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['mana']; - } + return $this->data['mana']; + } /** * Sets current mana. @@ -1084,10 +1094,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $mana Current mana. */ - public function setMana($mana) - { - $this->data['mana'] = (int) $mana; - } + public function setMana($mana) + { + $this->data['mana'] = (int) $mana; + } /** * Maximum mana. @@ -1100,15 +1110,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Maximum mana. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getManaMax() - { - if( !isset($this->data['manamax']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getManaMax() + { + if( !isset($this->data['manamax']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['manamax']; - } + return $this->data['manamax']; + } /** * Sets maximum mana. @@ -1119,10 +1129,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $manamax Maximum mana. */ - public function setManaMax($manamax) - { - $this->data['manamax'] = (int) $manamax; - } + public function setManaMax($manamax) + { + $this->data['manamax'] = (int) $manamax; + } /** * Mana spent. @@ -1135,15 +1145,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Mana spent. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getManaSpent() - { - if( !isset($this->data['manaspent']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getManaSpent() + { + if( !isset($this->data['manaspent']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['manaspent']; - } + return $this->data['manaspent']; + } /** * Sets mana spent. @@ -1154,10 +1164,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $manaspent Mana spent. */ - public function setManaSpent($manaspent) - { - $this->data['manaspent'] = (int) $manaspent; - } + public function setManaSpent($manaspent) + { + $this->data['manaspent'] = (int) $manaspent; + } /** * Soul points. @@ -1170,15 +1180,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Soul points. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getSoul() - { - if( !isset($this->data['soul']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getSoul() + { + if( !isset($this->data['soul']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['soul']; - } + return $this->data['soul']; + } /** * Sets soul points. @@ -1189,10 +1199,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $soul Soul points. */ - public function setSoul($soul) - { - $this->data['soul'] = (int) $soul; - } + public function setSoul($soul) + { + $this->data['soul'] = (int) $soul; + } /** * Looking direction. @@ -1205,15 +1215,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Looking direction. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getDirection() - { - if( !isset($this->data['direction']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getDirection() + { + if( !isset($this->data['direction']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['direction']; - } + return $this->data['direction']; + } /** * Sets looking direction. @@ -1224,10 +1234,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $direction Looking direction. */ - public function setDirection($direction) - { - $this->data['direction'] = (int) $direction; - } + public function setDirection($direction) + { + $this->data['direction'] = (int) $direction; + } public function getOutfit(): string { @@ -1247,15 +1257,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Body color. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getLookBody() - { - if( !isset($this->data['lookbody']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getLookBody() + { + if( !isset($this->data['lookbody']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['lookbody']; - } + return $this->data['lookbody']; + } /** * Sets body color. @@ -1266,10 +1276,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $lookbody Body color. */ - public function setLookBody($lookbody) - { - $this->data['lookbody'] = (int) $lookbody; - } + public function setLookBody($lookbody) + { + $this->data['lookbody'] = (int) $lookbody; + } /** * Boots color. @@ -1282,15 +1292,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Boots color. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getLookFeet() - { - if( !isset($this->data['lookfeet']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getLookFeet() + { + if( !isset($this->data['lookfeet']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['lookfeet']; - } + return $this->data['lookfeet']; + } /** * Sets boots color. @@ -1301,10 +1311,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $lookfeet Boots color. */ - public function setLookFeet($lookfeet) - { - $this->data['lookfeet'] = (int) $lookfeet; - } + public function setLookFeet($lookfeet) + { + $this->data['lookfeet'] = (int) $lookfeet; + } /** * Hair color. @@ -1317,15 +1327,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Hair color. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getLookHead() - { - if( !isset($this->data['lookhead']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getLookHead() + { + if( !isset($this->data['lookhead']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['lookhead']; - } + return $this->data['lookhead']; + } /** * Sets hair color. @@ -1336,10 +1346,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $lookhead Hair color. */ - public function setLookHead($lookhead) - { - $this->data['lookhead'] = (int) $lookhead; - } + public function setLookHead($lookhead) + { + $this->data['lookhead'] = (int) $lookhead; + } /** * Legs color. @@ -1352,15 +1362,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Legs color. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getLookLegs() - { - if( !isset($this->data['looklegs']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getLookLegs() + { + if( !isset($this->data['looklegs']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['looklegs']; - } + return $this->data['looklegs']; + } /** * Sets legs color. @@ -1371,10 +1381,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $looklegs Legs color. */ - public function setLookLegs($looklegs) - { - $this->data['looklegs'] = (int) $looklegs; - } + public function setLookLegs($looklegs) + { + $this->data['looklegs'] = (int) $looklegs; + } /** * Outfit. @@ -1387,15 +1397,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Outfit. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getLookType() - { - if( !isset($this->data['looktype']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getLookType() + { + if( !isset($this->data['looktype']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['looktype']; - } + return $this->data['looktype']; + } /** * Sets outfit. @@ -1406,10 +1416,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $looktype Outfit. */ - public function setLookType($looktype) - { - $this->data['looktype'] = (int) $looktype; - } + public function setLookType($looktype) + { + $this->data['looktype'] = (int) $looktype; + } /** * Addons. @@ -1422,15 +1432,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Addons. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getLookAddons() - { - if( !isset($this->data['lookaddons']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getLookAddons() + { + if( !isset($this->data['lookaddons']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['lookaddons']; - } + return $this->data['lookaddons']; + } /** * Sets addons. @@ -1441,10 +1451,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $lookaddons Addons. */ - public function setLookAddons($lookaddons) - { - $this->data['lookaddons'] = (int) $lookaddons; - } + public function setLookAddons($lookaddons) + { + $this->data['lookaddons'] = (int) $lookaddons; + } /** * X map coordinate. @@ -1457,15 +1467,15 @@ class OTS_Player extends OTS_Row_DAO * @return int X map coordinate. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getPosX() - { - if( !isset($this->data['posx']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getPosX() + { + if( !isset($this->data['posx']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['posx']; - } + return $this->data['posx']; + } /** * Sets X map coordinate. @@ -1476,10 +1486,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $posx X map coordinate. */ - public function setPosX($posx) - { - $this->data['posx'] = (int) $posx; - } + public function setPosX($posx) + { + $this->data['posx'] = (int) $posx; + } /** * Y map coordinate. @@ -1492,15 +1502,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Y map coordinate. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getPosY() - { - if( !isset($this->data['posy']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getPosY() + { + if( !isset($this->data['posy']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['posy']; - } + return $this->data['posy']; + } /** * Sets Y map coordinate. @@ -1511,10 +1521,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $posy Y map coordinate. */ - public function setPosY($posy) - { - $this->data['posy'] = (int) $posy; - } + public function setPosY($posy) + { + $this->data['posy'] = (int) $posy; + } /** * Z map coordinate. @@ -1527,15 +1537,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Z map coordinate. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getPosZ() - { - if( !isset($this->data['posz']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getPosZ() + { + if( !isset($this->data['posz']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['posz']; - } + return $this->data['posz']; + } /** * Sets Z map coordinate. @@ -1546,10 +1556,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $posz Z map coordinate. */ - public function setPosZ($posz) - { - $this->data['posz'] = (int) $posz; - } + public function setPosZ($posz) + { + $this->data['posz'] = (int) $posz; + } /** * Capacity. @@ -1562,15 +1572,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Capacity. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getCap() - { - if( !isset($this->data['cap']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getCap() + { + if( !isset($this->data['cap']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['cap']; - } + return $this->data['cap']; + } /** * Sets capacity. @@ -1581,10 +1591,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $cap Capacity. */ - public function setCap($cap) - { - $this->data['cap'] = (int) $cap; - } + public function setCap($cap) + { + $this->data['cap'] = (int) $cap; + } /** * Last login timestamp. @@ -1597,25 +1607,25 @@ class OTS_Player extends OTS_Row_DAO * @return int Last login timestamp. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getLastLogin() - { - if( !isset($this->data['lastlogin']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getLastLogin() + { + if( !isset($this->data['lastlogin']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['lastlogin']; - } + return $this->data['lastlogin']; + } - public function getLastLogout() - { - if( !isset($this->data['lastlogout']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getLastLogout() + { + if( !isset($this->data['lastlogout']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['lastlogout']; - } + return $this->data['lastlogout']; + } /** @@ -1627,15 +1637,15 @@ class OTS_Player extends OTS_Row_DAO * * @param int $lastlogin Last login timestamp. */ - public function setLastLogin($lastlogin) - { - $this->data['lastlogin'] = (int) $lastlogin; - } + public function setLastLogin($lastlogin) + { + $this->data['lastlogin'] = (int) $lastlogin; + } - public function setLastLogout($lastlogout) - { - $this->data['lastlogout'] = (int) $lastlogout; - } + public function setLastLogout($lastlogout) + { + $this->data['lastlogout'] = (int) $lastlogout; + } /** * Last login IP. @@ -1648,15 +1658,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Last login IP. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getLastIP() - { - if( !isset($this->data['lastip']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getLastIP() + { + if( !isset($this->data['lastip']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['lastip']; - } + return $this->data['lastip']; + } /** * Sets last login IP. @@ -1667,10 +1677,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $lastip Last login IP. */ - public function setLastIP($lastip) - { - $this->data['lastip'] = (int) $lastip; - } + public function setLastIP($lastip) + { + $this->data['lastip'] = (int) $lastip; + } /** * Checks if save flag is set. @@ -1683,15 +1693,15 @@ class OTS_Player extends OTS_Row_DAO * @return bool PACC days. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function isSaveSet() - { - if( !isset($this->data['save']) ) - { - throw new E_OTS_NotLoaded(); - } + public function isSaveSet() + { + if( !isset($this->data['save']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['save']; - } + return $this->data['save']; + } /** * Unsets save flag. @@ -1702,10 +1712,10 @@ class OTS_Player extends OTS_Row_DAO * * @version 0.0.7 */ - public function unsetSave() - { - $this->data['save'] = false; - } + public function unsetSave() + { + $this->data['save'] = false; + } /** * @version 0.0.7 @@ -1714,15 +1724,15 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotLoaded If player is not loaded. * @deprecated 0.0.7 Save field is back as flag not a counter. */ - public function getSave() - { - if( !isset($this->data['save']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getSave() + { + if( !isset($this->data['save']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['save']; - } + return $this->data['save']; + } /** * Sets save flag. @@ -1734,10 +1744,10 @@ class OTS_Player extends OTS_Row_DAO * @version 0.0.7 * @param int $save Deprecated, unused, optional. */ - public function setSave($save = 1) - { - $this->data['save'] = true; - } + public function setSave($save = 1) + { + $this->data['save'] = true; + } /** * Conditions. @@ -1750,10 +1760,10 @@ class OTS_Player extends OTS_Row_DAO * @return string Conditions binary string. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getConditions() - { - return $this->data['conditions']; - } + public function getConditions() + { + return $this->data['conditions']; + } /** * Sets conditions. @@ -1764,10 +1774,10 @@ class OTS_Player extends OTS_Row_DAO * * @param string $conditions Condition binary string. */ - public function setConditions($conditions) - { - $this->data['conditions'] = $conditions; - } + public function setConditions($conditions) + { + $this->data['conditions'] = $conditions; + } /** * Red skulled time remained. @@ -1780,15 +1790,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Red skulled time remained. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getSkullTime() - { - if( !isset($this->data['skulltime']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getSkullTime() + { + if( !isset($this->data['skulltime']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['skulltime']; - } + return $this->data['skulltime']; + } /** * Sets red skulled time remained. @@ -1799,10 +1809,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $redskulltime Red skulled time remained. */ - public function setSkullTime($skulltime) - { - $this->data['skulltime'] = (int) $skulltime; - } + public function setSkullTime($skulltime) + { + $this->data['skulltime'] = (int) $skulltime; + } /** * Checks if player has red skull. @@ -1815,15 +1825,15 @@ class OTS_Player extends OTS_Row_DAO * @return bool Red skull state. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getSkull() - { - if( !isset($this->data['skull']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getSkull() + { + if( !isset($this->data['skull']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['skull']; - } + return $this->data['skull']; + } /** * Unsets red skull flag. @@ -1832,10 +1842,10 @@ class OTS_Player extends OTS_Row_DAO * This method only updates object state. To save changes in database you need to use {@link OTS_Player::save() save() method} to flush changed to database. *

    */ - public function unsetRedSkull() - { - $this->data['skull'] = false; - } + public function unsetRedSkull() + { + $this->data['skull'] = false; + } /** * Sets red skull flag. @@ -1844,10 +1854,10 @@ class OTS_Player extends OTS_Row_DAO * This method only updates object state. To save changes in database you need to use {@link OTS_Player::save() save() method} to flush changed to database. *

    */ - public function setSkull($value) - { - $this->data['skull'] = $value; - } + public function setSkull($value) + { + $this->data['skull'] = $value; + } /** * Guild nick. @@ -1860,7 +1870,7 @@ class OTS_Player extends OTS_Row_DAO * @return string Guild title. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function loadRank() + public function loadRank() { $table = 'guild_membership'; if($this->db->hasTable('guild_members')) @@ -1879,13 +1889,13 @@ class OTS_Player extends OTS_Row_DAO } } - public function getGuildNick() - { + public function getGuildNick() + { if(!isset($this->data['guildnick']) || !isset($this->data['rank_id'])) $this->loadRank(); return $this->data['guildnick']; - } + } /** * Sets guild nick. @@ -1896,9 +1906,9 @@ class OTS_Player extends OTS_Row_DAO * * @param string $guildnick Name. */ - public function setGuildNick($guildnick) - { - $this->data['guildnick'] = (string) $guildnick; + public function setGuildNick($guildnick) + { + $this->data['guildnick'] = (string) $guildnick; if($this->db->hasTable('guild_members')) $this->db->query('UPDATE `guild_members` SET `nick` = ' . $this->db->quote($this->data['guildnick']) . ' WHERE `player_id` = ' . $this->getId()); else if($this->db->hasTable('guild_membership')) @@ -1932,8 +1942,8 @@ class OTS_Player extends OTS_Row_DAO * @return OTS_GuildRank|null Guild rank (null if not member of any). * @throws PDOException On PDO operation error. */ - public function getRank() - { + public function getRank() + { $rank_id = 0; if($this->db->hasTable('guild_members')) { $query = $this->db->query('SELECT `rank_id` FROM `guild_members` WHERE `player_id`= ' . $this->data['id'] . ' LIMIT 1;'); @@ -1954,20 +1964,20 @@ class OTS_Player extends OTS_Row_DAO $rank_id = (int)$query['rank_id']; } - $guildRank = new OTS_GuildRank(); + $guildRank = new OTS_GuildRank(); if($rank_id !== 0) { $guildRank->load($rank_id); } - return $guildRank; - } + return $guildRank; + } /** * @param int $rank_id Guild rank ID. * @deprecated 0.0.4 Use setRank(). */ - public function setRankId($rank_id, $guild) - { + public function setRankId($rank_id, $guild) + { if( isset($rank_id) && isset($guild)) { if($rank_id == 0) { if($this->db->hasTable('guild_membership')) { @@ -2004,7 +2014,7 @@ class OTS_Player extends OTS_Row_DAO } } } - } + } /** * Assigns guild rank. @@ -2016,13 +2026,13 @@ class OTS_Player extends OTS_Row_DAO * @param OTS_GuildRank|null Guild rank (null to clear assign). * @throws E_OTS_NotLoaded If passed $guildRank parameter is not loaded. */ - public function setRank(OTS_GuildRank $guildRank = null) - { + public function setRank(OTS_GuildRank $guildRank = null) + { if(isset($guildRank)) $this->setRankId($guildRank->getId(), $guildRank->getGuild()->getId()); else $this->setRankId(0, 0); - } + } /** * Residence town's ID. @@ -2035,15 +2045,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Residence town's ID. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getTownId() - { - if( !isset($this->data['town_id']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getTownId() + { + if( !isset($this->data['town_id']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['town_id']; - } + return $this->data['town_id']; + } /** * Sets residence town's ID. @@ -2054,10 +2064,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $town_id Residence town's ID. */ - public function setTownId($town_id) - { - $this->data['town_id'] = (int) $town_id; - } + public function setTownId($town_id) + { + $this->data['town_id'] = (int) $town_id; + } /** * Percentage of experience lost after dead. @@ -2070,15 +2080,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Percentage of experience lost after dead. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getLossExperience() - { - if( !isset($this->data['loss_experience']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getLossExperience() + { + if( !isset($this->data['loss_experience']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['loss_experience']; - } + return $this->data['loss_experience']; + } /** * Sets percentage of experience lost after dead. @@ -2089,10 +2099,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $loss_experience Percentage of experience lost after dead. */ - public function setLossExperience($loss_experience) - { - $this->data['loss_experience'] = (int) $loss_experience; - } + public function setLossExperience($loss_experience) + { + $this->data['loss_experience'] = (int) $loss_experience; + } /** * Percentage of used mana lost after dead. @@ -2105,15 +2115,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Percentage of used mana lost after dead. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getLossMana() - { - if( !isset($this->data['loss_mana']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getLossMana() + { + if( !isset($this->data['loss_mana']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['loss_mana']; - } + return $this->data['loss_mana']; + } /** * Sets percentage of used mana lost after dead. @@ -2124,10 +2134,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $loss_mana Percentage of used mana lost after dead. */ - public function setLossMana($loss_mana) - { - $this->data['loss_mana'] = (int) $loss_mana; - } + public function setLossMana($loss_mana) + { + $this->data['loss_mana'] = (int) $loss_mana; + } /** * Percentage of skills lost after dead. @@ -2140,15 +2150,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Percentage of skills lost after dead. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getLossSkills() - { - if( !isset($this->data['loss_skills']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getLossSkills() + { + if( !isset($this->data['loss_skills']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['loss_skills']; - } + return $this->data['loss_skills']; + } /** * Sets percentage of skills lost after dead. @@ -2159,10 +2169,10 @@ class OTS_Player extends OTS_Row_DAO * * @param int $loss_skills Percentage of skills lost after dead. */ - public function setLossSkills($loss_skills) - { - $this->data['loss_skills'] = (int) $loss_skills; - } + public function setLossSkills($loss_skills) + { + $this->data['loss_skills'] = (int) $loss_skills; + } /** * Percentage of items lost after dead. @@ -2172,15 +2182,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Percentage of items lost after dead. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getLossItems() - { - if( !isset($this->data['loss_items']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getLossItems() + { + if( !isset($this->data['loss_items']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['loss_items']; - } + return $this->data['loss_items']; + } /** * Sets percentage of items lost after dead. @@ -2189,39 +2199,39 @@ class OTS_Player extends OTS_Row_DAO * @since 0.1.4 * @param int $loss_items Percentage of items lost after dead. */ - public function setLossItems($loss_items) - { - $this->data['loss_items'] = (int) $loss_items; - } + public function setLossItems($loss_items) + { + $this->data['loss_items'] = (int) $loss_items; + } - public function getLossContainers() - { - if( !isset($this->data['loss_containers']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getLossContainers() + { + if( !isset($this->data['loss_containers']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['loss_containers']; - } - public function setLossContainers($loss_containers) - { - $this->data['loss_containers'] = (int) $loss_containers; - } + return $this->data['loss_containers']; + } + public function setLossContainers($loss_containers) + { + $this->data['loss_containers'] = (int) $loss_containers; + } - public function getBlessings() - { - if( !isset($this->data['blessings']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getBlessings() + { + if( !isset($this->data['blessings']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['blessings']; - } + return $this->data['blessings']; + } - public function setBlessings($blessings) - { - $this->data['blessings'] = (int) $blessings; - } + public function setBlessings($blessings) + { + $this->data['blessings'] = (int) $blessings; + } public function countBlessings() { @@ -2253,20 +2263,20 @@ class OTS_Player extends OTS_Row_DAO return $value; } - public function getStamina() - { - if( !isset($this->data['stamina']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getStamina() + { + if( !isset($this->data['stamina']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['stamina']; - } + return $this->data['stamina']; + } - public function setStamina($stamina) - { - $this->data['stamina'] = (int) $stamina; - } + public function setStamina($stamina) + { + $this->data['stamina'] = (int) $stamina; + } /** * Bank balance. * @@ -2275,15 +2285,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Amount of money stored in bank. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getBalance() - { - if( !isset($this->data['balance']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getBalance() + { + if( !isset($this->data['balance']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['balance']; - } + return $this->data['balance']; + } /** * Sets bank balance value. @@ -2296,24 +2306,24 @@ class OTS_Player extends OTS_Row_DAO * @since 0.1.2 * @param int $balance Amount of money to be set in bank. */ - public function setBalance($balance) - { - $this->data['balance'] = (int) $balance; - } + public function setBalance($balance) + { + $this->data['balance'] = (int) $balance; + } - public function getWorldId() - { - if( !isset($this->data['world_id']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getWorldId() + { + if( !isset($this->data['world_id']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->data['world_id']; - } - public function setWorldId($worldId) - { - $this->data['world_id'] = (int) $worldId; - } + return $this->data['world_id']; + } + public function setWorldId($worldId) + { + $this->data['world_id'] = (int) $worldId; + } /** * Reads custom field. * @@ -2332,16 +2342,16 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotLoaded If player is not loaded. * @throws PDOException On PDO operation error. */ - public function getCustomField($field) - { - if( !isset($this->data['id']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getCustomField($field) + { + if( !isset($this->data['id']) ) + { + throw new E_OTS_NotLoaded(); + } - $value = $this->db->query('SELECT ' . $this->db->fieldName($field) . ' FROM ' . $this->db->tableName('players') . ' WHERE ' . $this->db->fieldName('id') . ' = ' . $this->data['id'])->fetch(); - return $value[$field]; - } + $value = $this->db->query('SELECT ' . $this->db->fieldName($field) . ' FROM ' . $this->db->tableName('players') . ' WHERE ' . $this->db->fieldName('id') . ' = ' . $this->data['id'])->fetch(); + return $value[$field]; + } /** * Writes custom field. @@ -2365,21 +2375,21 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotLoaded If player is not loaded. * @throws PDOException On PDO operation error. */ - public function setCustomField($field, $value) - { - if( !isset($this->data['id']) ) - { - throw new E_OTS_NotLoaded(); - } + public function setCustomField($field, $value) + { + if( !isset($this->data['id']) ) + { + throw new E_OTS_NotLoaded(); + } - // quotes value for SQL query - if(!( is_int($value) || is_float($value) )) - { - $value = $this->db->quote($value); - } + // quotes value for SQL query + if(!( is_int($value) || is_float($value) )) + { + $value = $this->db->quote($value); + } - $this->db->query('UPDATE `players` SET `' . $field . '` = ' . $value . ' WHERE `id` = ' . $this->data['id']); - } + $this->db->query('UPDATE `players` SET `' . $field . '` = ' . $value . ' WHERE `id` = ' . $this->data['id']); + } /** * Returns player's skill. @@ -2390,15 +2400,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Skill value. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getSkill($skill) - { - if( !isset($this->skills[$skill]) ) - { - throw new E_OTS_NotLoaded(); - } + public function getSkill($skill) + { + if( !isset($this->skills[$skill]) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->skills[$skill]['value']; - } + return $this->skills[$skill]['value']; + } /** * Sets skill value. @@ -2408,8 +2418,8 @@ class OTS_Player extends OTS_Row_DAO * @param int $skill Skill ID. * @param int $value Skill value. */ - public function setSkill($skill, $value) - { + public function setSkill($skill, $value) + { $skill_ids = array( 'skill_fist' => POT::SKILL_FIST, 'skill_club' => POT::SKILL_CLUB, @@ -2424,7 +2434,7 @@ class OTS_Player extends OTS_Row_DAO else { $this->skills[ (int) $skill_ids[$skill]]['value'] = (int) $value; } - } + } /** * Returns player's skill's tries for next level. @@ -2435,15 +2445,15 @@ class OTS_Player extends OTS_Row_DAO * @return int Skill tries. * @throws E_OTS_NotLoaded If player is not loaded. */ - public function getSkillTries($skill) - { - if( !isset($this->skills[$skill]) ) - { - throw new E_OTS_NotLoaded(); - } + public function getSkillTries($skill) + { + if( !isset($this->skills[$skill]) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->skills[$skill]['tries']; - } + return $this->skills[$skill]['tries']; + } /** * Sets skill's tries for next level. @@ -2453,8 +2463,8 @@ class OTS_Player extends OTS_Row_DAO * @param int $skill Skill ID. * @param int $tries Skill tries. */ - public function setSkillTries($skill, $tries) - { + public function setSkillTries($skill, $tries) + { $skill_ids = array( 'skill_fist' => POT::SKILL_FIST, 'skill_club' => POT::SKILL_CLUB, @@ -2470,7 +2480,7 @@ class OTS_Player extends OTS_Row_DAO else { $this->skills[ (int) $skill_ids[$skill]]['tries'] = (int) $tries; } - } + } /** * Returns value of storage record. @@ -2482,22 +2492,22 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotLoaded If player is not loaded. * @throws PDOException On PDO operation error. */ - public function getStorage($key) - { - if( !isset($this->data['id']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getStorage($key) + { + if( !isset($this->data['id']) ) + { + throw new E_OTS_NotLoaded(); + } - $value = $this->db->query('SELECT ' . $this->db->fieldName('value') . ' FROM ' . $this->db->tableName('player_storage') . ' WHERE ' . $this->db->fieldName('key') . ' = ' . (int) $key . ' AND ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'])->fetch(); + $value = $this->db->query('SELECT ' . $this->db->fieldName('value') . ' FROM ' . $this->db->tableName('player_storage') . ' WHERE ' . $this->db->fieldName('key') . ' = ' . (int) $key . ' AND ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'])->fetch(); - if($value === false) - { - return null; - } + if($value === false) + { + return null; + } - return $value['value']; - } + return $value['value']; + } /** * Sets value of storage record. @@ -2509,26 +2519,26 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotLoaded If player is not loaded. * @throws PDOException On PDO operation error. */ - public function setStorage($key, $value) - { - if( !isset($this->data['id']) ) - { - throw new E_OTS_NotLoaded(); - } + public function setStorage($key, $value) + { + if( !isset($this->data['id']) ) + { + throw new E_OTS_NotLoaded(); + } - $current = $this->getStorage($key); + $current = $this->getStorage($key); - // checks if there is any row to be updates - if( isset($current) ) - { - $this->db->query('UPDATE ' . $this->db->tableName('player_storage') . ' SET ' . $this->db->fieldName('value') . ' = ' . (int) $value . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('key') . ' = ' . (int) $key); - } - // inserts new storage record - else - { - $this->db->query('INSERT INTO ' . $this->db->tableName('player_storage') . ' (' . $this->db->fieldName('player_id') . ', ' . $this->db->fieldName('key') . ', ' . $this->db->fieldName('value') . ') VALUES (' . $this->data['id'] . ', ' . (int) $key . ', ' . (int) $value . ')'); - } - } + // checks if there is any row to be updates + if( isset($current) ) + { + $this->db->query('UPDATE ' . $this->db->tableName('player_storage') . ' SET ' . $this->db->fieldName('value') . ' = ' . (int) $value . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('key') . ' = ' . (int) $key); + } + // inserts new storage record + else + { + $this->db->query('INSERT INTO ' . $this->db->tableName('player_storage') . ' (' . $this->db->fieldName('player_id') . ', ' . $this->db->fieldName('key') . ', ' . $this->db->fieldName('value') . ') VALUES (' . $this->data['id'] . ', ' . (int) $key . ', ' . (int) $value . ')'); + } + } /** * Deletes item with contained items. @@ -2538,17 +2548,17 @@ class OTS_Player extends OTS_Row_DAO * @param int $sid Item unique player's ID. * @throws PDOException On PDO operation error. */ - private function deleteItem($sid) - { - // deletes all sub-items - foreach( $this->db->query('SELECT ' . $this->db->fieldName('sid') . ' FROM ' . $this->db->tableName('player_items') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('pid') . ' = ' . $sid)->fetchAll() as $item) - { - $this->deleteItem($item['sid']); - } + private function deleteItem($sid) + { + // deletes all sub-items + foreach( $this->db->query('SELECT ' . $this->db->fieldName('sid') . ' FROM ' . $this->db->tableName('player_items') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('pid') . ' = ' . $sid)->fetchAll() as $item) + { + $this->deleteItem($item['sid']); + } - // deletes item - $this->db->query('DELETE FROM ' . $this->db->tableName('player_items') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('sid') . ' = ' . $sid); - } + // deletes item + $this->db->query('DELETE FROM ' . $this->db->tableName('player_items') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('sid') . ' = ' . $sid); + } /** * Returns items tree from given slot. @@ -2565,51 +2575,51 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotAContainer If item which is not of type container contains sub items. * @throws PDOException On PDO operation error. */ - public function getSlot($slot) - { - if( !isset($this->data['id']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getSlot($slot) + { + if( !isset($this->data['id']) ) + { + throw new E_OTS_NotLoaded(); + } - // loads current item - $item = $this->db->query('SELECT ' . $this->db->fieldName('itemtype') . ', ' . $this->db->fieldName('sid') . ', ' . $this->db->fieldName('count') . ', ' . $this->db->fieldName('attributes') . ' FROM ' . $this->db->tableName('player_items') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName($slot > POT::SLOT_AMMO ? 'sid' : 'pid') . ' = ' . (int) $slot)->fetch(); + // loads current item + $item = $this->db->query('SELECT ' . $this->db->fieldName('itemtype') . ', ' . $this->db->fieldName('sid') . ', ' . $this->db->fieldName('count') . ', ' . $this->db->fieldName('attributes') . ' FROM ' . $this->db->tableName('player_items') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName($slot > POT::SLOT_AMMO ? 'sid' : 'pid') . ' = ' . (int) $slot)->fetch(); - if( empty($item) ) - { - return null; - } + if( empty($item) ) + { + return null; + } - // checks if there are any items under current one - $items = array(); - foreach( $this->db->query('SELECT ' . $this->db->fieldName('sid') . ' FROM ' . $this->db->tableName('player_items') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('pid') . ' = ' . $item['sid'])->fetchAll() as $sub) - { - $items[] = $this->getSlot($sub['sid']); - } + // checks if there are any items under current one + $items = array(); + foreach( $this->db->query('SELECT ' . $this->db->fieldName('sid') . ' FROM ' . $this->db->tableName('player_items') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('pid') . ' = ' . $item['sid'])->fetchAll() as $sub) + { + $items[] = $this->getSlot($sub['sid']); + } - // item type - $slot = POT::getInstance()->getItemsList()->getItemType($item['itemtype'])->createItem(); - $slot->setCount($item['count']); - $slot->setAttributes($item['attributes']); + // item type + $slot = POT::getInstance()->getItemsList()->getItemType($item['itemtype'])->createItem(); + $slot->setCount($item['count']); + $slot->setAttributes($item['attributes']); - // checks if current item has any contained items - if( !empty($items) ) - { - // checks if item is realy a container - if(!$slot instanceof OTS_Container) - { - throw new E_OTS_NotAContainer(); - } + // checks if current item has any contained items + if( !empty($items) ) + { + // checks if item is realy a container + if(!$slot instanceof OTS_Container) + { + throw new E_OTS_NotAContainer(); + } - // puts items into container - foreach($items as $sub) - { - $slot->addItem($sub); - } - } + // puts items into container + foreach($items as $sub) + { + $slot->addItem($sub); + } + } - return $slot; - } + return $slot; + } /** * Sets slot content. @@ -2622,56 +2632,56 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotLoaded If player is not loaded. * @throws PDOException On PDO operation error. */ - public function setSlot($slot, OTS_Item $item = null, $pid = 0) - { - static $sid; + public function setSlot($slot, OTS_Item $item = null, $pid = 0) + { + static $sid; - if( !isset($this->data['id']) ) - { - throw new E_OTS_NotLoaded(); - } + if( !isset($this->data['id']) ) + { + throw new E_OTS_NotLoaded(); + } - // clears current slot - if($slot <= POT::SLOT_AMMO) - { - $id = $this->db->query('SELECT ' . $this->db->fieldName('sid') . ' FROM ' . $this->db->tableName('player_items') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('pid') . ' = ' . (int) $slot)->fetch(); - $this->deleteItem( (int) $id['sid']); - } + // clears current slot + if($slot <= POT::SLOT_AMMO) + { + $id = $this->db->query('SELECT ' . $this->db->fieldName('sid') . ' FROM ' . $this->db->tableName('player_items') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('pid') . ' = ' . (int) $slot)->fetch(); + $this->deleteItem( (int) $id['sid']); + } - // checks if there is any item to insert - if( isset($item) ) - { - // current maximum sid (over slot sids) - if( !isset($sid) ) - { - $sid = $this->db->query('SELECT MAX(' . $this->db->fieldName('sid') . ') AS `sid` FROM ' . $this->db->tableName('player_items') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'])->fetch(); - $sid = $sid['sid'] > POT::SLOT_AMMO ? $sid['sid'] : POT::SLOT_AMMO; - } + // checks if there is any item to insert + if( isset($item) ) + { + // current maximum sid (over slot sids) + if( !isset($sid) ) + { + $sid = $this->db->query('SELECT MAX(' . $this->db->fieldName('sid') . ') AS `sid` FROM ' . $this->db->tableName('player_items') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'])->fetch(); + $sid = $sid['sid'] > POT::SLOT_AMMO ? $sid['sid'] : POT::SLOT_AMMO; + } - $sid++; + $sid++; - // inserts given item - $this->db->query('INSERT INTO ' . $this->db->tableName('player_items') . ' (' . $this->db->fieldName('player_id') . ', ' . $this->db->fieldName('sid') . ', ' . $this->db->fieldName('pid') . ', ' . $this->db->fieldName('itemtype') . ', ' . $this->db->fieldName('count') . ', ' . $this->db->fieldName('attributes') . ') VALUES (' . $this->data['id'] . ', ' . $sid . ', ' . (int) $slot . ', ' . $item->getId() . ', ' . $item->getCount() . ', ' . $this->db->quote( $item->getAttributes() ) . ')'); + // inserts given item + $this->db->query('INSERT INTO ' . $this->db->tableName('player_items') . ' (' . $this->db->fieldName('player_id') . ', ' . $this->db->fieldName('sid') . ', ' . $this->db->fieldName('pid') . ', ' . $this->db->fieldName('itemtype') . ', ' . $this->db->fieldName('count') . ', ' . $this->db->fieldName('attributes') . ') VALUES (' . $this->data['id'] . ', ' . $sid . ', ' . (int) $slot . ', ' . $item->getId() . ', ' . $item->getCount() . ', ' . $this->db->quote( $item->getAttributes() ) . ')'); - // checks if this is container - if($item instanceof OTS_Container) - { - $pid = $sid; + // checks if this is container + if($item instanceof OTS_Container) + { + $pid = $sid; - // inserts all contained items - foreach($item as $sub) - { - $this->setSlot($pid, $sub); - } - } - } + // inserts all contained items + foreach($item as $sub) + { + $this->setSlot($pid, $sub); + } + } + } - // clears $sid for next public call - if($slot <= POT::SLOT_AMMO) - { - $sid = null; - } - } + // clears $sid for next public call + if($slot <= POT::SLOT_AMMO) + { + $sid = null; + } + } /** * Deletes depot item with contained items. @@ -2681,17 +2691,17 @@ class OTS_Player extends OTS_Row_DAO * @param int $sid Depot item unique player's ID. * @throws PDOException On PDO operation error. */ - private function deleteDepot($sid) - { - // deletes all sub-items - foreach( $this->db->query('SELECT ' . $this->db->fieldName('sid') . ' FROM ' . $this->db->tableName('player_depotitems') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('pid') . ' = ' . $sid)->fetchAll() as $item) - { - $this->deleteDepot($item['sid']); - } + private function deleteDepot($sid) + { + // deletes all sub-items + foreach( $this->db->query('SELECT ' . $this->db->fieldName('sid') . ' FROM ' . $this->db->tableName('player_depotitems') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('pid') . ' = ' . $sid)->fetchAll() as $item) + { + $this->deleteDepot($item['sid']); + } - // deletes item - $this->db->query('DELETE FROM ' . $this->db->tableName('player_depotitems') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('sid') . ' = ' . $sid); - } + // deletes item + $this->db->query('DELETE FROM ' . $this->db->tableName('player_depotitems') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('sid') . ' = ' . $sid); + } /** * Returns items tree from given depot. @@ -2708,51 +2718,51 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotAContainer If item which is not of type container contains sub items. * @throws PDOException On PDO operation error. */ - public function getDepot($depot) - { - if( !isset($this->data['id']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getDepot($depot) + { + if( !isset($this->data['id']) ) + { + throw new E_OTS_NotLoaded(); + } - // loads current item - $item = $this->db->query('SELECT ' . $this->db->fieldName('itemtype') . ', ' . $this->db->fieldName('sid') . ', ' . $this->db->fieldName('count') . ', ' . $this->db->fieldName('attributes') . ' FROM ' . $this->db->tableName('player_depotitems') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName($depot > POT::DEPOT_SID_FIRST ? 'sid' : 'pid') . ' = ' . (int) $depot)->fetch(); + // loads current item + $item = $this->db->query('SELECT ' . $this->db->fieldName('itemtype') . ', ' . $this->db->fieldName('sid') . ', ' . $this->db->fieldName('count') . ', ' . $this->db->fieldName('attributes') . ' FROM ' . $this->db->tableName('player_depotitems') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName($depot > POT::DEPOT_SID_FIRST ? 'sid' : 'pid') . ' = ' . (int) $depot)->fetch(); - if( empty($item) ) - { - return null; - } + if( empty($item) ) + { + return null; + } - // checks if there are any items under current one - $items = array(); - foreach( $this->db->query('SELECT ' . $this->db->fieldName('sid') . ' FROM ' . $this->db->tableName('player_depotitems') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('pid') . ' = ' . $item['sid'])->fetchAll() as $sub) - { - $items[] = $this->getDepot($sub['sid']); - } + // checks if there are any items under current one + $items = array(); + foreach( $this->db->query('SELECT ' . $this->db->fieldName('sid') . ' FROM ' . $this->db->tableName('player_depotitems') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('pid') . ' = ' . $item['sid'])->fetchAll() as $sub) + { + $items[] = $this->getDepot($sub['sid']); + } - // item type - $depot = POT::getInstance()->getItemsList()->getItemType($item['itemtype'])->createItem(); - $depot->setCount($item['count']); - $depot->setAttributes($item['attributes']); + // item type + $depot = POT::getInstance()->getItemsList()->getItemType($item['itemtype'])->createItem(); + $depot->setCount($item['count']); + $depot->setAttributes($item['attributes']); - // checks if current item has any contained items - if( !empty($items) ) - { - // checks if item is realy a container - if(!$depot instanceof OTS_Container) - { - throw new E_OTS_NotAContainer(); - } + // checks if current item has any contained items + if( !empty($items) ) + { + // checks if item is realy a container + if(!$depot instanceof OTS_Container) + { + throw new E_OTS_NotAContainer(); + } - // puts items into container - foreach($items as $sub) - { - $depot->addItem($sub); - } - } + // puts items into container + foreach($items as $sub) + { + $depot->addItem($sub); + } + } - return $depot; - } + return $depot; + } /** * Sets depot content. @@ -2766,62 +2776,62 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotLoaded If player is not loaded. * @throws PDOException On PDO operation error. */ - public function setDepot($depot, OTS_Item $item = null, $pid = 0, $depot_id = 0) - { - static $sid; + public function setDepot($depot, OTS_Item $item = null, $pid = 0, $depot_id = 0) + { + static $sid; - // if no depot_id is specified then it is same as depot slot - if($depot_id == 0) - { - $depot_id = $depot; - } + // if no depot_id is specified then it is same as depot slot + if($depot_id == 0) + { + $depot_id = $depot; + } - if( !isset($this->data['id']) ) - { - throw new E_OTS_NotLoaded(); - } + if( !isset($this->data['id']) ) + { + throw new E_OTS_NotLoaded(); + } - // clears current depot - if($depot <= POT::DEPOT_SID_FIRST) - { - $id = $this->db->query('SELECT ' . $this->db->fieldName('sid') . ' FROM ' . $this->db->tableName('player_depotitems') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('pid') . ' = ' . (int) $depot)->fetch(); - $this->deleteDepot( (int) $id['sid']); - } + // clears current depot + if($depot <= POT::DEPOT_SID_FIRST) + { + $id = $this->db->query('SELECT ' . $this->db->fieldName('sid') . ' FROM ' . $this->db->tableName('player_depotitems') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('pid') . ' = ' . (int) $depot)->fetch(); + $this->deleteDepot( (int) $id['sid']); + } - // checks if there is any item to insert - if( isset($item) ) - { - // current maximum sid (over depot sids) - if( !isset($sid) ) - { - $sid = $this->db->query('SELECT MAX(' . $this->db->fieldName('sid') . ') AS `sid` FROM ' . $this->db->tableName('player_depotitems') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'])->fetch(); - $sid = $sid['sid'] > POT::DEPOT_SID_FIRST ? $sid['sid'] : POT::DEPOT_SID_FIRST; - } + // checks if there is any item to insert + if( isset($item) ) + { + // current maximum sid (over depot sids) + if( !isset($sid) ) + { + $sid = $this->db->query('SELECT MAX(' . $this->db->fieldName('sid') . ') AS `sid` FROM ' . $this->db->tableName('player_depotitems') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'])->fetch(); + $sid = $sid['sid'] > POT::DEPOT_SID_FIRST ? $sid['sid'] : POT::DEPOT_SID_FIRST; + } - $sid++; + $sid++; - // inserts given item - $this->db->query('INSERT INTO ' . $this->db->tableName('player_depotitems') . ' (' . $this->db->fieldName('player_id') . ', ' . $this->db->fieldName('depot_id') . ', ' . $this->db->fieldName('sid') . ', ' . $this->db->fieldName('pid') . ', ' . $this->db->fieldName('itemtype') . ', ' . $this->db->fieldName('count') . ', ' . $this->db->fieldName('attributes') . ') VALUES (' . $this->data['id'] . ', ' . $depot_id . ', ' . $sid . ', ' . (int) $depot . ', ' . $item->getId() . ', ' . $item->getCount() . ', ' . $this->db->quote( $item->getAttributes() ) . ')'); + // inserts given item + $this->db->query('INSERT INTO ' . $this->db->tableName('player_depotitems') . ' (' . $this->db->fieldName('player_id') . ', ' . $this->db->fieldName('depot_id') . ', ' . $this->db->fieldName('sid') . ', ' . $this->db->fieldName('pid') . ', ' . $this->db->fieldName('itemtype') . ', ' . $this->db->fieldName('count') . ', ' . $this->db->fieldName('attributes') . ') VALUES (' . $this->data['id'] . ', ' . $depot_id . ', ' . $sid . ', ' . (int) $depot . ', ' . $item->getId() . ', ' . $item->getCount() . ', ' . $this->db->quote( $item->getAttributes() ) . ')'); - // checks if this is container - if($item instanceof OTS_Container) - { - $pid = $sid; + // checks if this is container + if($item instanceof OTS_Container) + { + $pid = $sid; - // inserts all contained items - foreach($item as $sub) - { - $this->setDepot($pid, $sub, 0, $depot_id); - } - } - } + // inserts all contained items + foreach($item as $sub) + { + $this->setDepot($pid, $sub, 0, $depot_id); + } + } + } - // clears $sid for next public call - if($depot <= POT::DEPOT_SID_FIRST) - { - $sid = null; - } - } + // clears $sid for next public call + if($depot <= POT::DEPOT_SID_FIRST) + { + $sid = null; + } + } /** * @version 0.1.5 @@ -2830,22 +2840,22 @@ class OTS_Player extends OTS_Row_DAO * @throws PDOException On PDO operation error. * @deprecated 0.1.5 Use OTS_PlayerBan class. */ - public function ban($time = 0) - { - // can't ban nothing - if( !$this->isLoaded() ) - { - throw new E_OTS_NotLoaded(); - } + public function ban($time = 0) + { + // can't ban nothing + if( !$this->isLoaded() ) + { + throw new E_OTS_NotLoaded(); + } - // creates ban entry - $ban = new OTS_PlayerBan(); - $ban->setValue($this->data['id']); - $ban->setExpires($time); - $ban->setAdded( time() ); - $ban->activate(); - $ban->save(); - } + // creates ban entry + $ban = new OTS_PlayerBan(); + $ban->setValue($this->data['id']); + $ban->setExpires($time); + $ban->setAdded( time() ); + $ban->activate(); + $ban->save(); + } /** * @version 0.1.5 @@ -2853,19 +2863,19 @@ class OTS_Player extends OTS_Row_DAO * @throws PDOException On PDO operation error. * @deprecated 0.1.5 Use OTS_PlayerBan class. */ - public function unban() - { - // can't unban nothing - if( !$this->isLoaded() ) - { - throw new E_OTS_NotLoaded(); - } + public function unban() + { + // can't unban nothing + if( !$this->isLoaded() ) + { + throw new E_OTS_NotLoaded(); + } - // deletes ban entry - $ban = new OTS_PlayerBan(); - $ban->find($this->data['id']); - $ban->delete(); - } + // deletes ban entry + $ban = new OTS_PlayerBan(); + $ban->find($this->data['id']); + $ban->delete(); + } /** * @version 0.1.5 @@ -2874,41 +2884,41 @@ class OTS_Player extends OTS_Row_DAO * @throws PDOException On PDO operation error. * @deprecated 0.1.5 Use OTS_PlayerBan class. */ - public function isBanned() - { - // nothing can't be banned - if( !$this->isLoaded() ) - { - throw new E_OTS_NotLoaded(); - } + public function isBanned() + { + // nothing can't be banned + if( !$this->isLoaded() ) + { + throw new E_OTS_NotLoaded(); + } if( !isset($this->data['banned']) ) $this->loadBan(); - return ($this->data['banned'] == 1); - } + return ($this->data['banned'] == 1); + } - public function getBanTime() - { - // nothing can't be banned - if( !$this->isLoaded() ) - { - throw new E_OTS_NotLoaded(); - } + public function getBanTime() + { + // nothing can't be banned + if( !$this->isLoaded() ) + { + throw new E_OTS_NotLoaded(); + } if( !isset($this->data['banned_time']) ) $this->loadBan(); - return $this->data['banned_time']; - } + return $this->data['banned_time']; + } - public function loadBan() - { - // nothing can't be banned - if( !$this->isLoaded() ) - { - throw new E_OTS_NotLoaded(); - } + public function loadBan() + { + // nothing can't be banned + if( !$this->isLoaded() ) + { + throw new E_OTS_NotLoaded(); + } $ban = $this->db->query('SELECT ' . $this->db->fieldName('active') . ', ' . $this->db->fieldName('expires') . ' FROM ' . $this->db->tableName('bans') . ' WHERE (' . $this->db->fieldName('type') . ' = 3 OR ' . $this->db->fieldName('type') . ' = 5) AND ' . $this->db->fieldName('active') . ' = 1 AND ' . $this->db->fieldName('value') . ' = ' . $this->data['account_id'] . ' AND (' . $this->db->fieldName('expires') . ' > ' . time() .' OR ' . $this->db->fieldName('expires') . ' = -1)')->fetch(); $this->data['banned'] = $ban['active']; $this->data['banned_time'] = $ban['expires']; - } + } /** * Deletes player. * @@ -2917,19 +2927,19 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotLoaded If player is not loaded. * @throws PDOException On PDO operation error. */ - public function delete() - { - if( !isset($this->data['id']) ) - { - throw new E_OTS_NotLoaded(); - } + public function delete() + { + if( !isset($this->data['id']) ) + { + throw new E_OTS_NotLoaded(); + } - // deletes row from database - $this->db->query('UPDATE ' . $this->db->tableName('players') . ' SET ' . $this->db->fieldName('deleted') . ' = 1 WHERE ' . $this->db->fieldName('id') . ' = ' . $this->data['id']); + // deletes row from database + $this->db->query('UPDATE ' . $this->db->tableName('players') . ' SET ' . $this->db->fieldName('deleted') . ' = 1 WHERE ' . $this->db->fieldName('id') . ' = ' . $this->data['id']); - // resets object handle - unset($this->data['id']); - } + // resets object handle + unset($this->data['id']); + } /** * Player proffesion name. @@ -2943,12 +2953,12 @@ class OTS_Player extends OTS_Row_DAO * @return string Player proffesion name. * @throws E_OTS_NotLoaded If player is not loaded or global vocations list is not loaded. */ - public function getVocationName() - { - if( !isset($this->data['vocation']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getVocationName() + { + if( !isset($this->data['vocation']) ) + { + throw new E_OTS_NotLoaded(); + } global $config; $voc = $this->getVocation(); @@ -2957,8 +2967,8 @@ class OTS_Player extends OTS_Row_DAO } return $config['vocations'][$voc]; - //return POT::getInstance()->getVocationsList()->getVocationName($this->data['vocation']); - } + //return POT::getInstance()->getVocationsList()->getVocationName($this->data['vocation']); + } /** * Player residence town name. @@ -2972,15 +2982,15 @@ class OTS_Player extends OTS_Row_DAO * @return string Player town name. * @throws E_OTS_NotLoaded If player is not loaded or global map is not loaded. */ - public function getTownName() - { - if( !isset($this->data['town_id']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getTownName() + { + if( !isset($this->data['town_id']) ) + { + throw new E_OTS_NotLoaded(); + } - return POT::getInstance()->getMap()->getTownName($this->data['town_id']); - } + return POT::getInstance()->getMap()->getTownName($this->data['town_id']); + } /** * Returns house rented by this player. @@ -2995,23 +3005,23 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotLoaded If player is not loaded or global houses list is not loaded. * @throws PDOException On PDO operation error. */ - public function getHouse() - { - if( !isset($this->data['id']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getHouse() + { + if( !isset($this->data['id']) ) + { + throw new E_OTS_NotLoaded(); + } - // SELECT query on database - $house = $this->db->query('SELECT ' . $this->db->fieldName('id') . ' FROM ' . $this->db->tableName('houses') . ' WHERE ' . $this->db->fieldName('owner') . ' = ' . $this->data['id'])->fetch(); + // SELECT query on database + $house = $this->db->query('SELECT ' . $this->db->fieldName('id') . ' FROM ' . $this->db->tableName('houses') . ' WHERE ' . $this->db->fieldName('owner') . ' = ' . $this->data['id'])->fetch(); - if( !empty($house) ) - { - return POT::getInstance()->getHousesList()->getHouse($house['id']); - } + if( !empty($house) ) + { + return POT::getInstance()->getHousesList()->getHouse($house['id']); + } - return null; - } + return null; + } /** * Returns list of VIPs. @@ -3026,29 +3036,29 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotLoaded If player is not loaded. * @throws PDOException On PDO operation error. */ - public function getVIPsList() - { - if( !isset($this->data['id']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getVIPsList() + { + if( !isset($this->data['id']) ) + { + throw new E_OTS_NotLoaded(); + } - $list = new OTS_Players_List(); + $list = new OTS_Players_List(); - // foreign table fields identifiers - $field1 = new OTS_SQLField('player_id', 'player_viplist'); - $field2 = new OTS_SQLField('vip_id', 'player_viplist'); + // foreign table fields identifiers + $field1 = new OTS_SQLField('player_id', 'player_viplist'); + $field2 = new OTS_SQLField('vip_id', 'player_viplist'); - // creates filter - $filter = new OTS_SQLFilter(); - $filter->addFilter($field1, $this->data['id']); - $filter->compareField('id', $field2); + // creates filter + $filter = new OTS_SQLFilter(); + $filter->addFilter($field1, $this->data['id']); + $filter->compareField('id', $field2); - // puts filter onto list - $list->setFilter($filter); + // puts filter onto list + $list->setFilter($filter); - return $list; - } + return $list; + } /** * Adds player to VIP list. @@ -3059,15 +3069,15 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotLoaded If player is not loaded. * @throws PDOException On PDO operation error. */ - public function addVIP(OTS_Player $player) - { - if( !isset($this->data['id']) ) - { - throw new E_OTS_NotLoaded(); - } + public function addVIP(OTS_Player $player) + { + if( !isset($this->data['id']) ) + { + throw new E_OTS_NotLoaded(); + } - $this->db->query('INSERT INTO ' . $this->db->tableName('player_viplist') . ' (' . $this->db->fieldName('player_id') . ', ' . $this->db->fieldName('vip_id') . ') VALUES (' . $this->data['id'] . ', ' . $player->getId() . ')'); - } + $this->db->query('INSERT INTO ' . $this->db->tableName('player_viplist') . ' (' . $this->db->fieldName('player_id') . ', ' . $this->db->fieldName('vip_id') . ') VALUES (' . $this->data['id'] . ', ' . $player->getId() . ')'); + } /** * Checks if given player is a VIP for current one. @@ -3079,15 +3089,15 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotLoaded If player is not loaded. * @throws PDOException On PDO operation error. */ - public function isVIP(OTS_Player $player) - { - if( !isset($this->data['id']) ) - { - throw new E_OTS_NotLoaded(); - } + public function isVIP(OTS_Player $player) + { + if( !isset($this->data['id']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->db->query('SELECT COUNT(' . $this->db->fieldName('vip_id') . ') FROM ' . $this->db->tableName('player_viplist') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('vip_id') . ' = ' . $player->getId() )->fetchColumn() > 0; - } + return $this->db->query('SELECT COUNT(' . $this->db->fieldName('vip_id') . ') FROM ' . $this->db->tableName('player_viplist') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('vip_id') . ' = ' . $player->getId() )->fetchColumn() > 0; + } /** * Deletes player from VIP list. @@ -3098,15 +3108,15 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotLoaded If player is not loaded. * @throws PDOException On PDO operation error. */ - public function deleteVIP(OTS_Player $player) - { - if( !isset($this->data['id']) ) - { - throw new E_OTS_NotLoaded(); - } + public function deleteVIP(OTS_Player $player) + { + if( !isset($this->data['id']) ) + { + throw new E_OTS_NotLoaded(); + } - $this->db->query('DELETE FROM ' . $this->db->tableName('player_viplist') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('vip_id') . ' = ' . $player->getId() ); - } + $this->db->query('DELETE FROM ' . $this->db->tableName('player_viplist') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('vip_id') . ' = ' . $player->getId() ); + } /** * Returns list of known spells. @@ -3121,39 +3131,39 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotLoaded If player is not loaded. * @throws PDOException On PDO operation error. */ - public function getSpellsList() - { - if( !isset($this->data['id']) ) - { - throw new E_OTS_NotLoaded(); - } + public function getSpellsList() + { + if( !isset($this->data['id']) ) + { + throw new E_OTS_NotLoaded(); + } - $spells = array(); - $list = POT::getInstance()->getSpellsList(); + $spells = array(); + $list = POT::getInstance()->getSpellsList(); - // reads all known spells - foreach( $this->db->query('SELECT ' . $this->db->fieldName('name') . ' FROM ' . $this->db->tableName('player_spells') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id']) as $spell) - { - // checks if there is rune, instant or conjure spell with given name + // reads all known spells + foreach( $this->db->query('SELECT ' . $this->db->fieldName('name') . ' FROM ' . $this->db->tableName('player_spells') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id']) as $spell) + { + // checks if there is rune, instant or conjure spell with given name - if( $list->hasRune($spell['name']) ) - { - $spells[] = $list->getRune($spell['name']); - } + if( $list->hasRune($spell['name']) ) + { + $spells[] = $list->getRune($spell['name']); + } - if( $list->hasInstance($spell['name']) ) - { - $spells[] = $list->getInstance($spell['name']); - } + if( $list->hasInstance($spell['name']) ) + { + $spells[] = $list->getInstance($spell['name']); + } - if( $list->hasConjure($spell['name']) ) - { - $spells[] = $list->getConjure($spell['name']); - } - } + if( $list->hasConjure($spell['name']) ) + { + $spells[] = $list->getConjure($spell['name']); + } + } - return $spells; - } + return $spells; + } /** * Checks if player knows given spell. @@ -3165,15 +3175,15 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotLoaded If player is not loaded. * @throws PDOException On PDO operation error. */ - public function hasSpell(OTS_Spell $spell) - { - if( !isset($this->data['id']) ) - { - throw new E_OTS_NotLoaded(); - } + public function hasSpell(OTS_Spell $spell) + { + if( !isset($this->data['id']) ) + { + throw new E_OTS_NotLoaded(); + } - return $this->db->query('SELECT COUNT(' . $this->db->fieldName('name') . ') FROM ' . $this->db->tableName('player_spells') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('name') . ' = ' . $this->db->quote( $spell->getName() ) )->fetchColumn() > 0; - } + return $this->db->query('SELECT COUNT(' . $this->db->fieldName('name') . ') FROM ' . $this->db->tableName('player_spells') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('name') . ' = ' . $this->db->quote( $spell->getName() ) )->fetchColumn() > 0; + } /** * Adds given spell to player's spell book (makes him knowing it). @@ -3184,15 +3194,15 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotLoaded If player is not loaded. * @throws PDOException On PDO operation error. */ - public function addSpell(OTS_Spell $spell) - { - if( !isset($this->data['id']) ) - { - throw new E_OTS_NotLoaded(); - } + public function addSpell(OTS_Spell $spell) + { + if( !isset($this->data['id']) ) + { + throw new E_OTS_NotLoaded(); + } - $this->db->query('INSERT INTO ' . $this->db->tableName('player_spells') . ' (' . $this->db->fieldName('player_id') . ', ' . $this->db->fieldName('name') . ') VALUES (' . $this->data['id'] . ', ' . $this->db->quote( $spell->getName() ) . ')'); - } + $this->db->query('INSERT INTO ' . $this->db->tableName('player_spells') . ' (' . $this->db->fieldName('player_id') . ', ' . $this->db->fieldName('name') . ') VALUES (' . $this->data['id'] . ', ' . $this->db->quote( $spell->getName() ) . ')'); + } /** * Removes given spell from player's spell book. @@ -3203,15 +3213,15 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotLoaded If player is not loaded. * @throws PDOException On PDO operation error. */ - public function deleteSpell(OTS_Spell $spell) - { - if( !isset($this->data['id']) ) - { - throw new E_OTS_NotLoaded(); - } + public function deleteSpell(OTS_Spell $spell) + { + if( !isset($this->data['id']) ) + { + throw new E_OTS_NotLoaded(); + } - $this->db->query('DELETE FROM ' . $this->db->tableName('player_spells') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('name') . ' = ' . $this->db->quote( $spell->getName() ) ); - } + $this->db->query('DELETE FROM ' . $this->db->tableName('player_spells') . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('name') . ' = ' . $this->db->quote( $spell->getName() ) ); + } public static function getPercentLevel($count, $nextLevelCount) { @@ -3232,168 +3242,168 @@ class OTS_Player extends OTS_Row_DAO * @throws OutOfBoundsException For non-supported properties. * @throws PDOException On PDO operation error. */ - public function __get($name) - { - switch($name) - { - case 'id': - return $this->getId(); + public function __get($name) + { + switch($name) + { + case 'id': + return $this->getId(); - case 'name': - return $this->getName(); + case 'name': + return $this->getName(); - case 'account': - return $this->getAccount(); + case 'account': + return $this->getAccount(); - case 'group': - return $this->getGroup(); + case 'group': + return $this->getGroup(); - case 'sex': - return $this->getSex(); + case 'sex': + return $this->getSex(); - case 'vocation': - return $this->getVocation(); + case 'vocation': + return $this->getVocation(); - case 'experience': - return $this->getExperience(); + case 'experience': + return $this->getExperience(); - case 'level': - return $this->getLevel(); + case 'level': + return $this->getLevel(); - case 'magLevel': - return $this->getMagLevel(); + case 'magLevel': + return $this->getMagLevel(); - case 'health': - return $this->getHealth(); + case 'health': + return $this->getHealth(); - case 'healthMax': - return $this->getHealthMax(); + case 'healthMax': + return $this->getHealthMax(); - case 'mana': - return $this->getMana(); + case 'mana': + return $this->getMana(); - case 'manaMax': - return $this->getManaMax(); + case 'manaMax': + return $this->getManaMax(); - case 'manaSpent': - return $this->getManaSpent(); + case 'manaSpent': + return $this->getManaSpent(); - case 'soul': - return $this->getSoul(); + case 'soul': + return $this->getSoul(); - case 'direction': - return $this->getDirection(); + case 'direction': + return $this->getDirection(); - case 'lookBody': - return $this->getLookBody(); + case 'lookBody': + return $this->getLookBody(); - case 'lookFeet': - return $this->getLookFeet(); + case 'lookFeet': + return $this->getLookFeet(); - case 'lookHead': - return $this->getLookHead(); + case 'lookHead': + return $this->getLookHead(); - case 'lookLegs': - return $this->getLookLegs(); + case 'lookLegs': + return $this->getLookLegs(); - case 'lookType': - return $this->getLookType(); + case 'lookType': + return $this->getLookType(); - case 'lookAddons': - return $this->getLookAddons(); + case 'lookAddons': + return $this->getLookAddons(); - case 'posX': - return $this->getPosX(); + case 'posX': + return $this->getPosX(); - case 'posY': - return $this->getPosY(); + case 'posY': + return $this->getPosY(); - case 'posZ': - return $this->getPosZ(); + case 'posZ': + return $this->getPosZ(); - case 'cap': - return $this->getCap(); + case 'cap': + return $this->getCap(); - case 'lastLogin': - return $this->getLastLogin(); + case 'lastLogin': + return $this->getLastLogin(); - case 'lastLogout': - return $this->getLastLogout(); + case 'lastLogout': + return $this->getLastLogout(); - case 'lastIP': - return $this->getLastIP(); + case 'lastIP': + return $this->getLastIP(); - case 'save': - return $this->isSaveSet(); + case 'save': + return $this->isSaveSet(); - case 'conditions': - return $this->getConditions(); + case 'conditions': + return $this->getConditions(); - case 'skullTime': - return $this->getRedSkullTime(); + case 'skullTime': + return $this->getRedSkullTime(); - case 'skull': - return $this->getSkull(); + case 'skull': + return $this->getSkull(); - case 'guildNick': - return $this->getGuildNick(); + case 'guildNick': + return $this->getGuildNick(); - case 'rank': - return $this->getRank(); + case 'rank': + return $this->getRank(); - case 'townId': - return $this->getTownId(); + case 'townId': + return $this->getTownId(); - case 'townName': - return $this->getTownName(); + case 'townName': + return $this->getTownName(); - case 'house': - return $this->getHouse(); + case 'house': + return $this->getHouse(); - case 'lossExperience': - return $this->getLossExperience(); + case 'lossExperience': + return $this->getLossExperience(); - case 'lossMana': - return $this->getLossMana(); + case 'lossMana': + return $this->getLossMana(); - case 'lossSkills': - return $this->getLossSkills(); + case 'lossSkills': + return $this->getLossSkills(); - case 'lossItems': - return $this->getLossItems(); + case 'lossItems': + return $this->getLossItems(); - case 'lossContainers': - return $this->getLossContainers(); + case 'lossContainers': + return $this->getLossContainers(); - case 'balance': - return $this->getBalance(); + case 'balance': + return $this->getBalance(); - case 'loaded': - return $this->isLoaded(); + case 'loaded': + return $this->isLoaded(); - case 'banned': - return $this->isBanned(); + case 'banned': + return $this->isBanned(); - case 'online': - return $this->isOnline(); + case 'online': + return $this->isOnline(); - case 'worldId': - return $this->getWorldId(); + case 'worldId': + return $this->getWorldId(); - case 'vipsList': - return $this->getVIPsList(); + case 'vipsList': + return $this->getVIPsList(); - case 'vocationName': - return $this->getVocationName(); + case 'vocationName': + return $this->getVocationName(); - case 'spellsList': - return $this->getSpellsList(); + case 'spellsList': + return $this->getSpellsList(); - default: - throw new OutOfBoundsException(); - } - } + default: + throw new OutOfBoundsException(); + } + } /** * Magic PHP5 method. @@ -3405,203 +3415,203 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotLoaded When passing object value which represents not-initialised instance. * @throws OutOfBoundsException For non-supported properties. */ - public function __set($name, $value) - { - switch($name) - { - case 'name': - $this->setName($value); - break; + public function __set($name, $value) + { + switch($name) + { + case 'name': + $this->setName($value); + break; - case 'account': - $this->setAccount($value); - break; + case 'account': + $this->setAccount($value); + break; - case 'group': - $this->setGroup($value); - break; + case 'group': + $this->setGroup($value); + break; - case 'sex': - $this->setSex($value); - break; + case 'sex': + $this->setSex($value); + break; - case 'vocation': - $this->setVocation($value); - break; + case 'vocation': + $this->setVocation($value); + break; - case 'experience': - $this->setExperience($value); - break; + case 'experience': + $this->setExperience($value); + break; - case 'level': - $this->setLevel($value); - break; + case 'level': + $this->setLevel($value); + break; - case 'magLevel': - $this->setMagLevel($value); - break; + case 'magLevel': + $this->setMagLevel($value); + break; - case 'health': - $this->setHealth($value); - break; + case 'health': + $this->setHealth($value); + break; - case 'healthMax': - $this->setHealthMax($value); - break; + case 'healthMax': + $this->setHealthMax($value); + break; - case 'mana': - $this->setMana($value); - break; + case 'mana': + $this->setMana($value); + break; - case 'manaMax': - $this->setManaMax($value); - break; + case 'manaMax': + $this->setManaMax($value); + break; - case 'manaSpent': - $this->setManaSpent($value); - break; + case 'manaSpent': + $this->setManaSpent($value); + break; - case 'soul': - $this->setSoul($value); - break; + case 'soul': + $this->setSoul($value); + break; - case 'direction': - $this->setDirection($value); - break; + case 'direction': + $this->setDirection($value); + break; - case 'lookBody': - $this->setLookBody($value); - break; + case 'lookBody': + $this->setLookBody($value); + break; - case 'lookFeet': - $this->setLookFeet($value); - break; + case 'lookFeet': + $this->setLookFeet($value); + break; - case 'lookHead': - $this->setLookHead($value); - break; + case 'lookHead': + $this->setLookHead($value); + break; - case 'lookLegs': - $this->setLookLegs($value); - break; + case 'lookLegs': + $this->setLookLegs($value); + break; - case 'lookType': - $this->setLookType($value); - break; + case 'lookType': + $this->setLookType($value); + break; - case 'lookAddons': - $this->setLookAddons($value); - break; + case 'lookAddons': + $this->setLookAddons($value); + break; - case 'posX': - $this->setPosX($value); - break; + case 'posX': + $this->setPosX($value); + break; - case 'posY': - $this->setPosY($value); - break; + case 'posY': + $this->setPosY($value); + break; - case 'posZ': - $this->setPosZ($value); - break; + case 'posZ': + $this->setPosZ($value); + break; - case 'cap': - $this->setCap($value); - break; + case 'cap': + $this->setCap($value); + break; - case 'lastLogin': - $this->setLastLogin($value); - break; + case 'lastLogin': + $this->setLastLogin($value); + break; - case 'lastLogout': - $this->setLastLogout($value); - break; + case 'lastLogout': + $this->setLastLogout($value); + break; - case 'lastIP': - $this->setLastIP($value); - break; + case 'lastIP': + $this->setLastIP($value); + break; - case 'conditions': - $this->setConditions($value); - break; + case 'conditions': + $this->setConditions($value); + break; - case 'skull': - $this->setSkull($value); - break; + case 'skull': + $this->setSkull($value); + break; - case 'skullTime': - $this->setSkullTime($value); - break; + case 'skullTime': + $this->setSkullTime($value); + break; - case 'guildNick': - $this->setGuildNick($value); - break; + case 'guildNick': + $this->setGuildNick($value); + break; - case 'rank': - $this->setRank($value); - break; + case 'rank': + $this->setRank($value); + break; - case 'townId': - $this->setTownId($value); - break; + case 'townId': + $this->setTownId($value); + break; - case 'lossExperience': - $this->setLossExperience($value); - break; + case 'lossExperience': + $this->setLossExperience($value); + break; - case 'lossMana': - $this->setLossMana($value); - break; + case 'lossMana': + $this->setLossMana($value); + break; - case 'lossSkills': - $this->setLossSkills($value); - break; + case 'lossSkills': + $this->setLossSkills($value); + break; - case 'lossItems': - $this->setLossItems($value); - break; + case 'lossItems': + $this->setLossItems($value); + break; - case 'balance': - $this->setBalance($value); - break; + case 'balance': + $this->setBalance($value); + break; - case 'skull': - if($value) - { - $this->setRedSkull(); - } - else - { - $this->unsetRedSkull(); - } - break; + case 'skull': + if($value) + { + $this->setRedSkull(); + } + else + { + $this->unsetRedSkull(); + } + break; - case 'save': - if($value) - { - $this->setSave(); - } - else - { - $this->unsetSave(); - } - break; + case 'save': + if($value) + { + $this->setSave(); + } + else + { + $this->unsetSave(); + } + break; - case 'banned': - if($value) - { - $this->ban(); - } - else - { - $this->unban(); - } - break; + case 'banned': + if($value) + { + $this->ban(); + } + else + { + $this->unban(); + } + break; - default: - throw new OutOfBoundsException(); - } - } + default: + throw new OutOfBoundsException(); + } + } /** * Returns string representation of object. @@ -3614,18 +3624,18 @@ class OTS_Player extends OTS_Row_DAO * @since 0.1.0 * @return string String representation of object. */ - public function __toString() - { - $ots = POT::getInstance(); + public function __toString() + { + $ots = POT::getInstance(); - // checks if display driver is loaded - if( $ots->isDisplayDriverLoaded() ) - { - return $ots->getDisplayDriver()->displayPlayer($this); - } + // checks if display driver is loaded + if( $ots->isDisplayDriverLoaded() ) + { + return $ots->getDisplayDriver()->displayPlayer($this); + } - return $this->getName(); - } + return $this->getName(); + } } /**#@-*/ diff --git a/system/login.php b/system/login.php index e018c043..42a96111 100644 --- a/system/login.php +++ b/system/login.php @@ -14,12 +14,12 @@ $account_logged = new OTS_Account(); // stay-logged with sessions $current_session = getSession('account'); -if($current_session !== false) +if($current_session) { $account_logged->load($current_session); if($account_logged->isLoaded() && $account_logged->getPassword() == getSession('password') //&& (!isset($_SESSION['admin']) || admin()) - && (getSession('remember_me') !== false || getSession('last_visit') > time() - 15 * 60)) { // login for 15 minutes if "remember me" is not used + && (getSession('remember_me') || getSession('last_visit') > time() - 15 * 60)) { // login for 15 minutes if "remember me" is not used $logged = true; } else { diff --git a/system/migrations/43.php b/system/migrations/43.php new file mode 100644 index 00000000..2601f265 --- /dev/null +++ b/system/migrations/43.php @@ -0,0 +1,20 @@ +query("UPDATE guilds set description = '' WHERE description is NULL;"); // prevent truncate error when column is NULL + $db->modifyColumn('guilds', 'description', "VARCHAR(5000) NOT NULL DEFAULT ''"); + + $db->query("UPDATE players set comment = '' WHERE comment is NULL;"); + $db->modifyColumn('players', 'comment', "VARCHAR(5000) NOT NULL DEFAULT ''"); +}; + +$down = function () use ($db) { + $db->modifyColumn('guilds', 'description', "TEXT NOT NULL"); + $db->modifyColumn('players', 'comment', "TEXT NOT NULL"); +}; + diff --git a/system/migrations/44.php b/system/migrations/44.php new file mode 100644 index 00000000..ea98d6f2 --- /dev/null +++ b/system/migrations/44.php @@ -0,0 +1,27 @@ +query("ALTER TABLE `myaac_account_actions` DROP KEY `account_id`;"); + $db->query("ALTER TABLE `myaac_account_actions` ADD COLUMN `id` INT(11) NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (`id`);"); + + $db->modifyColumn(TABLE_PREFIX . 'account_actions', 'ip', "VARCHAR(45) NOT NULL DEFAULT ''"); + $db->query("UPDATE `" . TABLE_PREFIX . "account_actions` SET `ip` = INET_NTOA(`ip`) WHERE `ip` != '0';"); + $db->query("UPDATE `" . TABLE_PREFIX . "account_actions` SET `ip` = INET6_NTOA(`ipv6`) WHERE `ip` = '0';"); + $db->dropColumn(TABLE_PREFIX . 'account_actions', 'ipv6'); +}; + +$down = function () use ($db) { + $db->query("ALTER TABLE `" . TABLE_PREFIX . "account_actions` DROP `id`;"); + $db->query("ALTER TABLE `" . TABLE_PREFIX . "account_actions` ADD KEY (`account_id`);"); + + $db->addColumn(TABLE_PREFIX . 'account_actions', 'ipv6', "BINARY(16) NOT NULL DEFAULT 0x00000000000000000000000000000000 AFTER ip"); + $db->query("UPDATE `" . TABLE_PREFIX . "account_actions` SET `ipv6` = INET6_ATON(ip) WHERE NOT IS_IPV4(`ip`);"); + $db->query("UPDATE `" . TABLE_PREFIX . "account_actions` SET `ip` = INET_ATON(`ip`) WHERE IS_IPV4(`ip`);"); + $db->query("UPDATE `" . TABLE_PREFIX . "account_actions` SET `ip` = 0 WHERE `ipv6` != 0x00000000000000000000000000000000;"); + $db->modifyColumn(TABLE_PREFIX . 'account_actions', 'ip', "INT(11) UNSIGNED NOT NULL DEFAULT 0;"); +}; diff --git a/system/pages/account/manage.php b/system/pages/account/manage.php index eff71c78..3b3dc288 100644 --- a/system/pages/account/manage.php +++ b/system/pages/account/manage.php @@ -85,12 +85,8 @@ if($email_new_time > 1) } } -$actions = array(); -foreach($account_logged->getActionsLog(0, 1000) as $action) { - $actions[] = array('action' => $action['action'], 'date' => $action['date'], 'ip' => $action['ip'] != 0 ? long2ip($action['ip']) : inet_ntop($action['ipv6'])); -} +$actions = $account_logged->getActionsLog(1000); -$players = array(); /** @var OTS_Players_List $account_players */ $account_players = $account_logged->getPlayersList(); $account_players->orderBy('id'); diff --git a/system/pages/highscores.php b/system/pages/highscores.php index d7eb7384..91ba2e2b 100644 --- a/system/pages/highscores.php +++ b/system/pages/highscores.php @@ -21,9 +21,9 @@ $settingHighscoresCountryBox = setting('core.highscores_country_box'); if(config('account_country') && $settingHighscoresCountryBox) require SYSTEM . 'countries.conf.php'; -$list = $_GET['list'] ?? 'experience'; +$list = urldecode($_GET['list'] ?? 'experience'); $page = $_GET['page'] ?? 1; -$vocation = $_GET['vocation'] ?? 'all'; +$vocation = urldecode($_GET['vocation'] ?? 'all'); if(!is_numeric($page) || $page < 1 || $page > PHP_INT_MAX) { $page = 1; @@ -207,6 +207,7 @@ if (empty($highscores)) { $tmp = $row->toArray(); $tmp['online'] = $row->online_status; $tmp['vocation'] = $row->vocation_name; + $tmp['outfit_url'] = $row->outfit_url; // @phpstan-ignore-line unset($tmp['online_table']); return $tmp; @@ -233,14 +234,10 @@ foreach($highscores as $id => &$player) $player['experience'] = number_format($player['experience']); } - if(!$settingHighscoresVocation) { - unset($player['vocation']); - } - $player['link'] = getPlayerLink($player['name'], false); $player['flag'] = getFlagImage($player['country']); if($settingHighscoresOutfit) { - $player['outfit'] = ''; + $player['outfit'] = ''; } $player['rank'] = $offset + $i; } diff --git a/system/pages/houses.php b/system/pages/houses.php index 6e948d51..9d5bbe3b 100644 --- a/system/pages/houses.php +++ b/system/pages/houses.php @@ -30,11 +30,11 @@ $state = ''; $order = ''; $type = ''; -if(isset($_GET['page']) && $_GET['page'] == 'view' && isset($_REQUEST['house'])) +if(isset($_REQUEST['name'])) { $beds = array("", "one", "two", "three", "fourth", "fifth"); - $houseName = $_REQUEST['house']; - $houseId = (Validator::number($_REQUEST['house']) ? $_REQUEST['house'] : -1); + $houseName = urldecode($_REQUEST['name']); + $houseId = (Validator::number($_REQUEST['name']) ? $_REQUEST['name'] : -1); $selectHouse = $db->query('SELECT * FROM ' . $db->tableName('houses') . ' WHERE ' . $db->fieldName('name') . ' LIKE ' . $db->quote($houseName) . ' OR `id` = ' . $db->quote($houseId)); $house = array(); @@ -187,7 +187,7 @@ if(isset($_POST['town']) && isset($_POST['state']) && isset($_POST['order']) && $houseRent = 'Free'; } - $houses[] = array('owner' => $owner, 'name' => $house['name'], 'size' => ($hasTilesColumn ? $house['tiles'] : $house['size']), 'rent' => $house['rent'], 'rentedBy' => $houseRent); + $houses[] = array('owner' => $owner, 'name' => $house['name'], 'size' => ($hasTilesColumn ? $house['tiles'] : $house['size']), 'rent' => $house['rent'], 'rentedBy' => $houseRent, 'link' => getHouseLink($house['name'], false)); } $housesSearch = true; diff --git a/system/pages/news.php b/system/pages/news.php index 0262163e..dc8c700e 100644 --- a/system/pages/news.php +++ b/system/pages/news.php @@ -88,7 +88,7 @@ if(isset($_GET['archive'])) foreach($news_DB as $news) { $newses[] = array( - 'link' => getLink('news') . '/' . $news['id'], + 'link' => getLink('news/archive') . '/' . $news['id'], 'icon_id' => $categories[$news['category']]['icon_id'], 'title' => stripslashes($news['title']), 'date' => $news['date'] diff --git a/system/routes.php b/system/routes.php index c49b16b1..13cee37f 100644 --- a/system/routes.php +++ b/system/routes.php @@ -39,10 +39,10 @@ return [ [['GET', 'POST'], 'guilds/{guild:string}', 'guilds/show.php'], - ['GET', 'highscores/{list:alphanum}/{vocation:alphanum}/{page:int}', 'highscores.php'], - ['GET', 'highscores/{list:alphanum}/{page:int}', 'highscores.php'], - ['GET', 'highscores/{list:alphanum}/{vocation:alphanum}', 'highscores.php'], - ['GET', 'highscores/{list:alphanum}', 'highscores.php'], + ['GET', 'highscores/{list:string}/{vocation:string}/{page:int}', 'highscores.php'], + ['GET', 'highscores/{list:string}/{page:int}', 'highscores.php'], + ['GET', 'highscores/{list:string}/{vocation:string}', 'highscores.php'], + ['GET', 'highscores/{list:string}', 'highscores.php'], /* '/^polls\/[0-9]+\/?$/' => array('subtopic' => 'polls', 'id' => '$1'), '/^spells\/[A-Za-z0-9-_%]+\/[A-Za-z0-9-_]+\/?$/' => array('subtopic' => 'spells', 'vocation' => '$1', 'order' => '$2'), diff --git a/system/settings.php b/system/settings.php index 0d447c0f..dcd32ebc 100644 --- a/system/settings.php +++ b/system/settings.php @@ -348,7 +348,7 @@ return [ ], 'database_password' => [ 'name' => 'Database Password', - 'type' => 'text', + 'type' => 'password', 'default' => '', 'show_if' => [ 'database_overwrite', '=', 'true' @@ -509,7 +509,7 @@ Sent by MyAAC,
    'smtp_port' => [ 'name' => 'SMTP Host', 'type' => 'number', - 'desc' => '25 (default) / 465 (ssl, GMail) / 587 (tls, Microsoft Outlook)', + 'desc' => '25 (default) / 587 (tls - GMail, Microsoft Outlook)', 'default' => 25, 'show_if' => [ 'mail_enabled', '=', 'true' @@ -536,7 +536,8 @@ Sent by MyAAC,
    'smtp_pass' => [ 'name' => 'SMTP Password', 'type' => 'password', - 'desc' => 'Here your email password to authenticate with SMTP', + 'desc' => 'Here your email password to authenticate with SMTP.' . PHP_EOL + . 'For GMail use generated App password - https://myaccount.google.com/apppasswords.', 'default' => '', 'show_if' => [ 'mail_enabled', '=', 'true' @@ -546,7 +547,8 @@ Sent by MyAAC,
    'name' => 'SMTP Security', 'type' => 'options', 'options' => ['None', 'SSL', 'TLS'], - 'desc' => 'What kind of encryption to use on the SMTP connection', + 'desc' => 'What kind of encryption to use on the SMTP connection.' . PHP_EOL + . '(Gmail, Outlook - tls).', 'default' => 0, 'show_if' => [ 'mail_enabled', '=', 'true' @@ -1401,7 +1403,7 @@ Sent by MyAAC,
    'name' => 'Outfit Images URL', 'type' => 'text', 'desc' => 'Set to animoutfit.php for animated outfit', - 'default' => 'https://outfit-images.ots.me/outfit.php', + 'default' => 'https://outfit-images.ots.me/latest/outfit.php', ], 'outfit_images_wrong_looktypes' => [ 'name' => 'Outfit Images Wrong Looktypes', diff --git a/system/src/CreateCharacter.php b/system/src/CreateCharacter.php index 3d3ae8ff..594eda9d 100644 --- a/system/src/CreateCharacter.php +++ b/system/src/CreateCharacter.php @@ -105,9 +105,6 @@ class CreateCharacter * @param array $errors * @return bool * @throws \E_OTS_NotLoaded - * @throws \Twig_Error_Loader - * @throws \Twig_Error_Runtime - * @throws \Twig_Error_Syntax */ public function doCreate($name, $sex, $vocation, $town, $account, &$errors) { diff --git a/system/src/Models/AccountAction.php b/system/src/Models/AccountAction.php index d5cd531b..3ccdab84 100644 --- a/system/src/Models/AccountAction.php +++ b/system/src/Models/AccountAction.php @@ -9,6 +9,6 @@ class AccountAction extends Model { public $timestamps = false; - protected $fillable = ['account_id', 'ip', 'ipv6', 'date', 'action']; + protected $fillable = ['account_id', 'ip', 'date', 'action']; } diff --git a/system/src/Models/Player.php b/system/src/Models/Player.php index 0f8811d1..77fe4504 100644 --- a/system/src/Models/Player.php +++ b/system/src/Models/Player.php @@ -8,6 +8,13 @@ use Illuminate\Database\Eloquent\Relations\HasOne; * @property int $level * @property int $vocation * @property int $online + * @property int $looktype + * @property int $lookhead + * @property int $lookbody + * @property int $looklegs + * @property int $lookfeet + * @property int $lookaddons + * @property string $outfit_url * @property hasOne $onlineTable */ class Player extends Model { @@ -42,8 +49,8 @@ class Player extends Model { public function getVocationNameAttribute() { $vocation = $this->vocation; - if (isset($this->promotion)) { - $vocation *= $this->promotion; + if (isset($this->promotion) && $this->promotion > 0) { + $vocation += ($this->promotion * setting('core.vocations_amount')); } return config('vocations')[$vocation] ?? 'Unknown'; @@ -73,11 +80,21 @@ class Player extends Model { $query->where($column, 0); } - public function scopeWithOnlineStatus($query) { + public function scopeWithOnlineStatus($query) + { global $db; - $query->when($db->hasTable('players_online'), function ($query) { - $query->with('onlineTable'); - }); + if ($db->hasColumn('players', 'online')) { + $query->addSelect('online'); + } + else { + $query->when($db->hasTable('players_online'), function ($query) { + $query->with('onlineTable'); + }); + } + } + + public function getOutfitUrlAttribute() { + return setting('core.outfit_images_url') . '?id=' . $this->looktype . (!empty($this->lookaddons) ? '&addons=' . $this->lookaddons : '') . '&head=' . $this->lookhead . '&body=' . $this->lookbody . '&legs=' . $this->looklegs . '&feet=' . $this->lookfeet; } public function getOnlineStatusAttribute() diff --git a/system/src/Settings.php b/system/src/Settings.php index 0749396a..e243687e 100644 --- a/system/src/Settings.php +++ b/system/src/Settings.php @@ -72,24 +72,32 @@ class Settings implements \ArrayAccess } } - $this->errors = []; - ModelsSettings::where('name', $pluginName)->delete(); - foreach ($values as $key => $value) { - $errorMessage = ''; - if (isset($settings['settings'][$key]['callbacks']['beforeSave']) && !$settings['settings'][$key]['callbacks']['beforeSave']($key, $value, $errorMessage)) { - $this->errors[] = $errorMessage; - continue; - } + global $db; + + try { + $db->beginTransaction(); + + $this->errors = []; + ModelsSettings::where('name', $pluginName)->delete(); + foreach ($values as $key => $value) { + $errorMessage = ''; + if (isset($settings['settings'][$key]['callbacks']['beforeSave']) && !$settings['settings'][$key]['callbacks']['beforeSave']($key, $value, $errorMessage)) { + $this->errors[] = $errorMessage; + continue; + } - try { ModelsSettings::create([ 'name' => $pluginName, 'key' => $key, 'value' => $value ]); - } catch (\PDOException $error) { - $this->errors[] = 'Error while saving setting (' . $pluginName . ' - ' . $key . '): ' . $error->getMessage(); } + + $db->commit(); + } catch (\Exception $error) { + $db->rollBack(); + $this->errors[] = 'Error while saving settings (' . $pluginName . ')
    ' . $error->getMessage(); + return false; } $this->clearCache(); @@ -247,7 +255,15 @@ class Settings implements \ArrayAccess $min = $max = $step = ''; } + if ($setting['type'] === 'password') { + echo '
    '; + } + echo ''; + + if ($setting['type'] === 'password') { + echo '
    '; + } } else if($setting['type'] === 'textarea') { diff --git a/system/src/global.php b/system/src/global.php index f2609f2b..ed9df203 100644 --- a/system/src/global.php +++ b/system/src/global.php @@ -5,6 +5,7 @@ const SKILL_BALANCE = -2; $i = 0; +define('HOOK_INIT', ++$i); define('HOOK_STARTUP', ++$i); define('HOOK_BEFORE_PAGE', ++$i); define('HOOK_AFTER_PAGE', ++$i); @@ -101,7 +102,7 @@ define('HOOK_FILTER_TWIG_DISPLAY', ++$i); define('HOOK_FILTER_TWIG_RENDER', ++$i); define('HOOK_FILTER_THEME_FOOTER', ++$i); -const HOOK_FIRST = HOOK_STARTUP; +const HOOK_FIRST = HOOK_INIT; define('HOOK_LAST', $i); function is_sub_dir($path = NULL, $parent_folder = BASE): bool|string diff --git a/system/template.php b/system/template.php index 8a2258ff..08ff2e7d 100644 --- a/system/template.php +++ b/system/template.php @@ -41,7 +41,7 @@ if(setting('core.template_allow_change')) } else { $template_session = getSession('template'); - if ($template_session !== false) { + if ($template_session) { if (!preg_match("/[^A-z0-9_\-]/", $template_session)) { $template_name = $template_session; } @@ -95,7 +95,7 @@ else { unset($file); if ($cache->enabled()) { - $cache->set('template_ini_' . $template_name, serialize($template_ini)); + $cache->set('template_ini_' . $template_name, serialize($template_ini), 10 * 60); } } } @@ -133,6 +133,7 @@ if($forumSetting != '') $template['link_forum'] = ""; } +$twig->addGlobal('template_name', $template_name); $twig->addGlobal('template_path', $template_path); if($twig_loader) { $twig_loader->prependPath(BASE . $template_path); @@ -152,17 +153,40 @@ function get_template_menus(): array return $result->toArray(); }); - $menus = array(); + $configMenuCategories = config('menu_categories'); + $configMenuDefaultColor = config('menu_default_links_color') ?? config('menu_default_color'); + + $menus = []; foreach($result as $menu) { - $link_full = strpos(trim($menu['link']), 'http') === 0 ? $menu['link'] : getLink($menu['link']); - $menus[$menu['category']][] = array('name' => $menu['name'], 'link' => $menu['link'], 'link_full' => $link_full, 'blank' => $menu['blank'] == 1, 'target_blank' => ($menu['blank'] == 1 ? ' target="blank"' : ''), 'color' => $menu['color']); + if (empty($menu['link'])) { + $menu['link'] = 'news'; + } + + $link_full = (str_starts_with(trim($menu['link']), 'http') ? $menu['link'] : getLink($menu['link'])); + $target_blank = ($menu['blank'] == 1 ? ' target="blank"' : ''); + + $color = (empty($menu['color']) ? ($configMenuCategories[$menu['category']]['default_links_color'] ?? ($configMenuDefaultColor ?? '')) : $menu['color']); + + $color = str_replace('#', '', $color); + + if (in_array('#' . $color, [$configMenuCategories[$menu['category']]['default_links_color'] ?? '', $configMenuDefaultColor])) { + $color = ''; + } + + $style_color = (empty($color) ? '' : 'style="color: #' . $color . ' !important"'); + + $menus[$menu['category']][] = [ + 'name' => $menu['name'], + 'link' => $menu['link'], 'link_full' => $link_full, + 'blank' => $menu['blank'] == 1, 'target_blank' => $target_blank, + 'color' => $color, 'style_color' => $style_color, + ]; } - $new_menus = array(); + $new_menus = []; /** * @var array $configMenuCategories */ - $configMenuCategories = config('menu_categories'); if($configMenuCategories === null) { return []; } diff --git a/system/templates/account.login.html.twig b/system/templates/account.login.html.twig index c1b4afcc..fe52d7f9 100644 --- a/system/templates/account.login.html.twig +++ b/system/templates/account.login.html.twig @@ -24,21 +24,28 @@ Please enter your account {{ account|lower }} and your password.
    - {{ hook('HOOK_ACCOUNT_LOGIN_BEFORE_PASSWORD') }} + + {{ hook('HOOK_ACCOUNT_LOGIN_BEFORE_ACCOUNT') }} + + {{ hook('HOOK_ACCOUNT_LOGIN_AFTER_ACCOUNT') }} + {{ hook('HOOK_ACCOUNT_LOGIN_BEFORE_PASSWORD') }} + + {{ hook('HOOK_ACCOUNT_LOGIN_AFTER_PASSWORD') }} + {% set showedRank, i = false, 0 %} - {% for rank in guild_members if rank.members|length > 0 %} - {% set rankStyle, i = getStyle(i), i + 1 %} + {% for rank in guild_members %} + {% if rank.members|length > 0 %} + {% set rankStyle, i = getStyle(i), i + 1 %} - {% for player in rank.members %} - - + {% for player in rank.members %} + + - - {% if level_in_guild > rank.rank_level or isLeader %} - {% if guildOwnerName != playerName %} - - {KICK} - - {% endif %} - {% endif %} - {% else %} - {% if showGuildNick %} ({{ guildNickRaw }}){% endif %} - {% endif %} - - + + + + + {% endfor %} - - - - - {% endfor %} - - {% set showedRank = false %} + {% set showedRank = false %} + {% endif %} {% else %} @@ -162,7 +164,7 @@ {% set i = 0 %} - {% for invited_player in invited_list if invited_list|length > 0 %} + {% for invited_player in invited_list %} {% if invited_player.isLoaded() %} {% set i = i + 1 %} diff --git a/system/templates/highscores.html.twig b/system/templates/highscores.html.twig index 938220e5..86599b90 100644 --- a/system/templates/highscores.html.twig +++ b/system/templates/highscores.html.twig @@ -9,19 +9,17 @@ @@ -105,7 +103,7 @@ @@ -118,9 +116,9 @@ diff --git a/system/templates/houses.html.twig b/system/templates/houses.html.twig index 7575a4d3..173a2253 100644 --- a/system/templates/houses.html.twig +++ b/system/templates/houses.html.twig @@ -56,10 +56,9 @@ the search criteria and start a new search. {% endfor %} @@ -85,17 +84,19 @@ the search criteria and start a new search. diff --git a/system/twig.php b/system/twig.php index 08d1c846..f59230e3 100644 --- a/system/twig.php +++ b/system/twig.php @@ -139,6 +139,11 @@ $function = new TwigFunction('csrfToken', function () { }); $twig->addFunction($function); +$function = new TwigFunction('session', function ($key) { + return session($key); +}); +$twig->addFunction($function); + $filter = new TwigFilter('urlencode', function ($s) { return urlencode($s); }); diff --git a/templates/kathrine/config.php b/templates/kathrine/config.php index 2de3804e..63847317 100644 --- a/templates/kathrine/config.php +++ b/templates/kathrine/config.php @@ -1,5 +1,5 @@ array('id' => 'news', 'name' => 'Latest News'), @@ -8,3 +8,5 @@ $config['menu_categories'] = array( MENU_CATEGORY_LIBRARY => array('id' => 'library', 'name' => 'Library'), MENU_CATEGORY_SHOP => array('id' => 'shops', 'name' => 'Shop') ); + +$config['menus'] = require __DIR__ . '/menus.php'; diff --git a/templates/kathrine/menus.php b/templates/kathrine/menus.php index e6b2bfbf..f2ef20ed 100644 --- a/templates/kathrine/menus.php +++ b/templates/kathrine/menus.php @@ -26,7 +26,7 @@ return [ 'Team' => 'team', ], MENU_CATEGORY_LIBRARY => [ - 'Monsters' => 'creatures', + 'Monsters' => 'monsters', 'Spells' => 'spells', 'Server Info' => 'server-info', 'Commands' => 'commands', diff --git a/templates/kathrine/template.php b/templates/kathrine/template.php index 8cbc945f..af03b3c9 100644 --- a/templates/kathrine/template.php +++ b/templates/kathrine/template.php @@ -42,8 +42,6 @@ defined('MYAAC') or die('Direct access not allowed!');
    $menu) { if(!isset($menus[$category])) { continue; @@ -54,8 +52,8 @@ defined('MYAAC') or die('Direct access not allowed!'); $size = count($menus[$category]); $i = 0; - foreach($menus[$category] as $menu) { - echo '' . $menu['name'] . ''; + foreach($menus[$category] as $link) { + echo '' . $link['name'] . ''; if(++$i != $size) { echo ''; diff --git a/templates/tibiacom/config.php b/templates/tibiacom/config.php index 3f3f49d5..7ed168d9 100644 --- a/templates/tibiacom/config.php +++ b/templates/tibiacom/config.php @@ -1,5 +1,5 @@ array('id' => 'news', 'name' => 'Latest News'), @@ -9,3 +9,5 @@ $config['menu_categories'] = array( MENU_CATEGORY_LIBRARY => array('id' => 'library', 'name' => 'Library'), MENU_CATEGORY_SHOP => array('id' => 'shops', 'name' => 'Shop') ); + +$config['menus'] = require __DIR__ . '/menus.php'; diff --git a/templates/tibiacom/headline.php b/templates/tibiacom/headline.php index 85dae0f2..4bf3f273 100644 --- a/templates/tibiacom/headline.php +++ b/templates/tibiacom/headline.php @@ -7,7 +7,7 @@ if(strlen($text) > 100) // max limit putenv('GDFONTPATH=' . __DIR__); // create image -$image = imagecreatetruecolor(250, 28); +$image = imagecreatetruecolor(600, 28); // make the background transparent imagecolortransparent($image, imagecolorallocate($image, 0, 0, 0)); diff --git a/templates/tibiacom/index.php b/templates/tibiacom/index.php index 2152b043..6d0d1e63 100644 --- a/templates/tibiacom/index.php +++ b/templates/tibiacom/index.php @@ -35,6 +35,17 @@ if(isset($config['boxes'])) } else { $tmp = str_replace('/', '_', PAGE); + $exp = explode('/', PAGE); + if(PAGE !== 'account/create' && PAGE !== 'account/lost' && isset($exp[1])) { + if ($exp[0] === 'account') { + $tmp = 'account_manage'; + } else if ($exp[0] === 'news' && $exp[1] === 'archive') { + $tmp = 'news_archive'; + } + else if (in_array($exp[0], ['characters', 'highscores', 'guilds', 'forum'])) { + $tmp = $exp[0]; + } + } } } else { @@ -107,6 +118,15 @@ if(isset($config['boxes'])) menu[0] = {}; var unloadhelper = false; + + // load the menu and set the active submenu item by using the variable 'activeSubmenuItem' function LoadMenu() { @@ -114,7 +134,7 @@ if(isset($config['boxes'])) document.getElementById("ActiveSubmenuItemIcon_"+activeSubmenuItem).style.visibility = "visible"; menus = localStorage.getItem('menus'); if(menus == null || menus.lastIndexOf("&") === -1) { - menus = "news=1&account=0&community=0&library=0&forum=0&"; + menus = ""; } FillMenuArray(); InitializeMenu(); @@ -318,10 +338,22 @@ if(isset($config['boxes'])) $cat) { + if (!isset($menus[$id]) || ($id == MENU_CATEGORY_SHOP && !setting('core.gifts_system'))) { + continue; + } + + $countElements++; +} + +$i = 0; foreach($config['menu_categories'] as $id => $cat) { if(!isset($menus[$id]) || ($id == MENU_CATEGORY_SHOP && !setting('core.gifts_system'))) { continue; } + + $i++; ?>
    ' class='menuitem'> @@ -340,19 +372,13 @@ foreach($config['menu_categories'] as $id => $cat) {
    _Submenu' class='Submenu'> $menu) { - if (empty($menu['link'])) { - $menu['link'] = 'news'; - } - $link_color = '#' . (strlen($menu['color']) == 0 ? $default_menu_color : $menu['color']); ?> - '> - 'forum', ], MENU_CATEGORY_LIBRARY => [ - 'Monsters' => 'creatures', + 'Monsters' => 'monsters', 'Spells' => 'spells', 'Commands' => 'commands', 'Exp Stages' => 'exp-stages',
    {{ account_login_by }}:
    Password:
    diff --git a/system/templates/admin-bar.html.twig b/system/templates/admin-bar.html.twig index b14eb84e..5d215610 100644 --- a/system/templates/admin-bar.html.twig +++ b/system/templates/admin-bar.html.twig @@ -110,7 +110,7 @@ html { margin-top: 32px !important; }
    {{ csrf() }} - Clear Cache + Clear Cache
    diff --git a/system/templates/admin.menus.header.html.twig b/system/templates/admin.menus.header.html.twig new file mode 100644 index 00000000..97038840 --- /dev/null +++ b/system/templates/admin.menus.header.html.twig @@ -0,0 +1,31 @@ +
    +

    You are editing: {{ template }}

    + Hint: You can drag menu items.
    + Hint: Add links to external sites using: http:// or https:// prefix.
    + Not all templates support blank and colorful links. +

    +
    +
    +
    +
    + {% if config('menus') is not null %} +
    + {{ csrf() }} + + +
    +
    + {% endif %} + {% if canResetColors %} +
    + {{ csrf() }} + + +
    +
    + {% endif %} +
    +
    +
    +
    +
    diff --git a/system/templates/admin.menus.js.html.twig b/system/templates/admin.menus.js.html.twig index e511c6de..dcb4fd33 100644 --- a/system/templates/admin.menus.js.html.twig +++ b/system/templates/admin.menus.js.html.twig @@ -1,31 +1,41 @@ + + diff --git a/system/templates/guilds.view.html.twig b/system/templates/guilds.view.html.twig index 5ff6f82a..695d7464 100644 --- a/system/templates/guilds.view.html.twig +++ b/system/templates/guilds.view.html.twig @@ -79,57 +79,59 @@
    - {% if not showedRank %}{{ rank.rank_name }}{% endif %} - {% set showedRank = true %} -
    + {% if not showedRank %}{{ rank.rank_name }}{% endif %} + {% set showedRank = true %} + - {% set playerName = player.getName() %} -
    - {{ csrf() }} - {{ getPlayerLink(playerName, true)|raw }} +
    + {% set playerName = player.getName() %} + + {{ csrf() }} + {{ getPlayerLink(playerName, true)|raw }} - {% set showGuildNick = false %} - {% if player.getGuildNick() is not empty %} - {% set showGuildNick = true %} - {% set guildNickRaw = player.getGuildNick()|raw %} - {% endif %} + {% set showGuildNick = false %} + {% if player.getGuildNick() is not empty %} + {% set showGuildNick = true %} + {% set guildNickRaw = player.getGuildNick()|raw %} + {% endif %} - {% if logged %} - {% if player.getId() in players_from_account_ids %} - () + {% if logged %} + {% if player.getId() in players_from_account_ids %} + () + {% else %} + {% if showGuildNick %} ({{ guildNickRaw }}){% endif %} + {% endif %} + + {% if level_in_guild > rank.rank_level or isLeader %} + {% if guildOwnerName != playerName %} + + {KICK} + + {% endif %} + {% endif %} {% else %} {% if showGuildNick %} ({{ guildNickRaw }}){% endif %} {% endif %} + + {{ player.getVocationName() }}{{ player.getLevel() }} + Online{% else %} red;">Offline{% endif %} +
    {{ player.getVocationName() }}{{ player.getLevel() }} - Online{% else %} red;">Offline{% endif %} -
    No guild members found.
    {% for link, name in types %} - {{ name }}
    + {{ name }}
    {% endfor %}
    - [ALL]
    + [ALL]
    {% for i in 0..config.vocations_amount %} - {{ config.vocations[i]}}
    + {{ config.vocations[i]}}
    {% endfor %}
    -
    - + {{ include('buttons.view.html.twig') }} - +
    {% set checked = false %} - {% for id, name in config.towns if id > 0 %} - {% if ((townId is empty and name is not empty) or id == townId) and not checked %} - {% set variable = "checked" %} - {% set checked = true %} - {% else %} - {% set variable = "" %} - {% endif %} + {% for id, name in config.towns %} + {% if id > 0 %} + {% if ((townId is empty and name is not empty) or id == townId) and not checked %} + {% set variable = "checked" %} + {% set checked = true %} + {% else %} + {% set variable = "" %} + {% endif %} - - -
    + + +
    + {% endif %} {% endfor %}