mirror of
https://github.com/slawkens/myaac.git
synced 2025-12-15 13:29:47 +01:00
Compare commits
9 Commits
feature/ge
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78a3535b6a | ||
|
|
497959fd30 | ||
|
|
6ba00eea96 | ||
|
|
9ed06782e6 | ||
|
|
18a1178e4b | ||
|
|
c86257e6da | ||
|
|
fd74f01291 | ||
|
|
3011b969a4 | ||
|
|
8e6749c599 |
2
.github/workflows/cypress.yml
vendored
2
.github/workflows/cypress.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
php-versions: [ '8.1', '8.2', '8.3', '8.4' ]
|
php-versions: [ '8.1', '8.2', '8.3', '8.4', '8.5' ]
|
||||||
ots: ['tfs-1.4', 'canary-3.1.2'] # TODO: add 'tfs-master' (actually doesn't work cause AAC doesn't support reading .env configuration)
|
ots: ['tfs-1.4', 'canary-3.1.2'] # TODO: add 'tfs-master' (actually doesn't work cause AAC doesn't support reading .env configuration)
|
||||||
name: Cypress (PHP ${{ matrix.php-versions }}, ${{ matrix.ots }})
|
name: Cypress (PHP ${{ matrix.php-versions }}, ${{ matrix.ots }})
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -1,5 +1,18 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [1.8.6 - 14.12.2025]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
* Added hook for adding custom rules to validate new character name (https://github.com/slawkens/myaac/commit/8e6749c59984631288e8e9803819b2f0ff389761)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
* Highscores: Fix ordering by different skills (Adjust order by desc: skill_tries, manaspent, experience) - More exact results (https://github.com/slawkens/myaac/commit/c86257e6dacbad773aa09c0958eeaa106a967f2d)
|
||||||
|
* Fix exception shown on first install, when there is no vendor - Before it displayed 500 white page, now it display the exception (https://github.com/slawkens/myaac/commit/18a1178e4b93607a350259679e0366cb83fb4126)
|
||||||
|
* Fix typo $up -> $down, in migration nr 7, was failing due that (https://github.com/slawkens/myaac/commit/fd74f01291d0e9cdb92ee1b95021c9d7b591ad7c)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
* Ini set html_errors = 0, to show html code in exceptions (https://github.com/slawkens/myaac/commit/9ed06782e67772826d927ad847a077b99df5060d)
|
||||||
|
|
||||||
## [1.8.5 - 21.11.2025]
|
## [1.8.5 - 21.11.2025]
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
15
common.php
15
common.php
@@ -26,7 +26,7 @@
|
|||||||
if (version_compare(phpversion(), '8.1', '<')) die('PHP version 8.1 or higher is required.');
|
if (version_compare(phpversion(), '8.1', '<')) die('PHP version 8.1 or higher is required.');
|
||||||
|
|
||||||
const MYAAC = true;
|
const MYAAC = true;
|
||||||
const MYAAC_VERSION = '1.8.6-dev';
|
const MYAAC_VERSION = '1.8.7-dev';
|
||||||
const DATABASE_VERSION = 46;
|
const DATABASE_VERSION = 46;
|
||||||
const TABLE_PREFIX = 'myaac_';
|
const TABLE_PREFIX = 'myaac_';
|
||||||
define('START_TIME', microtime(true));
|
define('START_TIME', microtime(true));
|
||||||
@@ -148,16 +148,17 @@ if(!IS_CLI) {
|
|||||||
|
|
||||||
/** @var array $config */
|
/** @var array $config */
|
||||||
ini_set('log_errors', 1);
|
ini_set('log_errors', 1);
|
||||||
if(@$config['env'] === 'dev' || defined('MYAAC_INSTALL')) {
|
if(isset($config['env']) && $config['env'] !== 'dev' && !defined('MYAAC_INSTALL')) {
|
||||||
ini_set('display_errors', 1);
|
|
||||||
ini_set('display_startup_errors', 1);
|
|
||||||
error_reporting(E_ALL);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ini_set('display_errors', 0);
|
ini_set('display_errors', 0);
|
||||||
ini_set('display_startup_errors', 0);
|
ini_set('display_startup_errors', 0);
|
||||||
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
|
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
ini_set('html_errors', 0);
|
||||||
|
ini_set('display_errors', 1);
|
||||||
|
ini_set('display_startup_errors', 1);
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
}
|
||||||
|
|
||||||
$autoloadFile = VENDOR . 'autoload.php';
|
$autoloadFile = VENDOR . 'autoload.php';
|
||||||
if (!is_file($autoloadFile)) {
|
if (!is_file($autoloadFile)) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ $up = function () use ($db) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$up = function () use ($db) {
|
$down = function () use ($db) {
|
||||||
if (!$db->hasColumn(TABLE_PREFIX . 'screenshots', 'name')) {
|
if (!$db->hasColumn(TABLE_PREFIX . 'screenshots', 'name')) {
|
||||||
$db->addColumn(TABLE_PREFIX . 'screenshots', 'name', 'VARCHAR(30) NOT NULL');
|
$db->addColumn(TABLE_PREFIX . 'screenshots', 'name', 'VARCHAR(30) NOT NULL');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -176,7 +176,9 @@ if (empty($highscores)) {
|
|||||||
POT::SKILL_FISH => 'skill_fishing',
|
POT::SKILL_FISH => 'skill_fishing',
|
||||||
);
|
);
|
||||||
|
|
||||||
$query->addSelect($skill_ids[$skill] . ' as value');
|
$query
|
||||||
|
->addSelect($skill_ids[$skill] . ' as value')
|
||||||
|
->orderByDesc($skill_ids[$skill] . '_tries');
|
||||||
} else {
|
} else {
|
||||||
$query
|
$query
|
||||||
->join('player_skills', 'player_skills.player_id', '=', 'players.id')
|
->join('player_skills', 'player_skills.player_id', '=', 'players.id')
|
||||||
@@ -198,11 +200,11 @@ if (empty($highscores)) {
|
|||||||
if ($skill == POT::SKILL__MAGLEVEL) {
|
if ($skill == POT::SKILL__MAGLEVEL) {
|
||||||
$query
|
$query
|
||||||
->addSelect('players.maglevel as value', 'players.maglevel')
|
->addSelect('players.maglevel as value', 'players.maglevel')
|
||||||
->orderBy('manaspent');
|
->orderByDesc('manaspent');
|
||||||
} else { // level
|
} else { // level
|
||||||
$query
|
$query
|
||||||
->addSelect('players.level as value', 'players.experience')
|
->addSelect('players.level as value', 'players.experience')
|
||||||
->orderBy('experience');
|
->orderByDesc('experience');
|
||||||
$list = 'experience';
|
$list = 'experience';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -342,6 +342,16 @@ class Validator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
global $hooks;
|
||||||
|
|
||||||
|
$params = ['name' => $name, 'error' => ''];
|
||||||
|
$hooks->triggerFilter(HOOK_FILTER_VALIDATE_CHARACTER_NEW_NAME, $params);
|
||||||
|
|
||||||
|
if (!empty($params['error'])) {
|
||||||
|
self::$lastError = $params['error'];
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ define('HOOK_FILTER_ROUTES', ++$i);
|
|||||||
define('HOOK_FILTER_TWIG_DISPLAY', ++$i);
|
define('HOOK_FILTER_TWIG_DISPLAY', ++$i);
|
||||||
define('HOOK_FILTER_TWIG_RENDER', ++$i);
|
define('HOOK_FILTER_TWIG_RENDER', ++$i);
|
||||||
define('HOOK_FILTER_THEME_FOOTER', ++$i);
|
define('HOOK_FILTER_THEME_FOOTER', ++$i);
|
||||||
|
define('HOOK_FILTER_VALIDATE_CHARACTER_NEW_NAME', ++$i);
|
||||||
|
|
||||||
const HOOK_FIRST = HOOK_INIT;
|
const HOOK_FIRST = HOOK_INIT;
|
||||||
define('HOOK_LAST', $i);
|
define('HOOK_LAST', $i);
|
||||||
|
|||||||
Reference in New Issue
Block a user