mirror of
https://github.com/slawkens/myaac.git
synced 2025-12-15 05:19:47 +01:00
Merge branch 'main' into develop
This commit is contained in:
2
.github/workflows/cypress.yml
vendored
2
.github/workflows/cypress.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
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)
|
||||
name: Cypress (PHP ${{ matrix.php-versions }}, ${{ matrix.ots }})
|
||||
steps:
|
||||
|
||||
13
common.php
13
common.php
@@ -148,16 +148,17 @@ if(!IS_CLI) {
|
||||
|
||||
/** @var array $config */
|
||||
ini_set('log_errors', 1);
|
||||
if(@$config['env'] === 'dev' || defined('MYAAC_INSTALL')) {
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
}
|
||||
else {
|
||||
if(isset($config['env']) && $config['env'] !== 'dev' && !defined('MYAAC_INSTALL')) {
|
||||
ini_set('display_errors', 0);
|
||||
ini_set('display_startup_errors', 0);
|
||||
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';
|
||||
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')) {
|
||||
$db->addColumn(TABLE_PREFIX . 'screenshots', 'name', 'VARCHAR(30) NOT NULL');
|
||||
}
|
||||
|
||||
@@ -176,7 +176,9 @@ if (empty($highscores)) {
|
||||
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 {
|
||||
$query
|
||||
->join('player_skills', 'player_skills.player_id', '=', 'players.id')
|
||||
@@ -198,11 +200,11 @@ if (empty($highscores)) {
|
||||
if ($skill == POT::SKILL__MAGLEVEL) {
|
||||
$query
|
||||
->addSelect('players.maglevel as value', 'players.maglevel')
|
||||
->orderBy('manaspent');
|
||||
->orderByDesc('manaspent');
|
||||
} else { // level
|
||||
$query
|
||||
->addSelect('players.level as value', 'players.experience')
|
||||
->orderBy('experience');
|
||||
->orderByDesc('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;
|
||||
}
|
||||
|
||||
|
||||
@@ -108,6 +108,7 @@ define('HOOK_FILTER_ROUTES', ++$i);
|
||||
define('HOOK_FILTER_TWIG_DISPLAY', ++$i);
|
||||
define('HOOK_FILTER_TWIG_RENDER', ++$i);
|
||||
define('HOOK_FILTER_THEME_FOOTER', ++$i);
|
||||
define('HOOK_FILTER_VALIDATE_CHARACTER_NEW_NAME', ++$i);
|
||||
|
||||
const HOOK_FIRST = HOOK_INIT;
|
||||
define('HOOK_LAST', $i);
|
||||
|
||||
Reference in New Issue
Block a user