Compare commits

..

15 Commits
v1.8.9 ... main

Author SHA1 Message Date
slawkens
81b8bd8a2c News: Do not cache if logged as admin, so it shows the admin buttons 2026-04-24 22:12:53 +02:00
slawkens
def432d4b7 tibiacom theme: Fix if gallery table not exist (develop branch) 2026-04-24 22:09:14 +02:00
slawkens
b0edbb79d9 Update characters.php 2026-04-24 21:58:42 +02:00
slawkens
ba1ee4bdb7 Nothing important [skip ci] 2026-04-24 21:22:27 +02:00
slawkens
54bdea85a3 Fix phpstan 2026-04-24 20:36:56 +02:00
slawkens
ac9a328206 Highscores: Prevent mass queries amount caused by getPlayerLink 2026-04-24 16:39:55 +02:00
slawkens
609cf152af Plugins: Fix uninstall when hook is without HOOK_ prefix 2026-04-24 16:24:06 +02:00
slawkens
ec7079dd57 Bye JetBrains, it was not my decision :( 2026-04-14 19:58:12 +02:00
slawkens
fa93187f80 Add $fillable to Account model 2026-04-12 09:56:01 +02:00
slawkens
7bc8a66cc1 BugTracker has been moved to plugins, remove the model 2026-04-11 18:13:25 +02:00
slawkens
4145d9eb3c Fix: Clear hooks on plugin uninstall
Fixes error with gesior-shop-system clear-cache.php being called, despite it's removed
2026-04-11 17:49:22 +02:00
slawkens
a27b8a4fa5 Merge branch 'main' of https://github.com/slawkens/myaac 2026-04-11 17:42:45 +02:00
dependabot[bot]
4570ba3801 Bump lodash from 4.17.23 to 4.18.1 (#358)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.23 to 4.18.1.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.23...4.18.1)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.18.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-11 17:23:17 +02:00
slawkens
578c0548ee Start v1.8.10-dev 2026-04-11 15:23:46 +02:00
slawkens
aa63e1c986 Fix client boosted + online count (?) 2026-04-10 23:08:33 +02:00
14 changed files with 56 additions and 35 deletions

View File

@@ -86,12 +86,6 @@ Look: [Contributing](https://docs.my-aac.org/misc/contributing) in our wiki.
If you have a great idea or want to contribute to the project - visit our website at https://www.my-aac.org
## Project supported by JetBrains
Many thanks to Jetbrains for kindly providing a license for me to work on this and other open-source projects.
[![JetBrains](https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg)](https://www.jetbrains.com/?from=https://github.com/slawkens)
### License
This program and all associated files are released under the GNU Public License.

View File

@@ -26,7 +26,7 @@
if (version_compare(phpversion(), '8.1', '<')) die('PHP version 8.1 or higher is required.');
const MYAAC = true;
const MYAAC_VERSION = '1.8.9';
const MYAAC_VERSION = '1.8.10-dev';
const DATABASE_VERSION = 46;
const TABLE_PREFIX = 'myaac_';
define('START_TIME', microtime(true));

View File

@@ -93,9 +93,9 @@ switch ($action) {
$creatureBoost = $db->query("SELECT * FROM " . $db->tableName('boosted_creature'))->fetchAll();
$bossBoost = $db->query("SELECT * FROM " . $db->tableName('boosted_boss'))->fetchAll();
die(json_encode([
'boostedcreature' => true,
//'boostedcreature' => true,
'bossraceid' => intval($bossBoost[0]['raceid']),
'creatureraceid' => intval($creatureBoost[0]['raceid']),
'bossraceid' => intval($bossBoost[0]['raceid'])
]));
}

6
package-lock.json generated
View File

@@ -1431,9 +1431,9 @@
}
},
"node_modules/lodash": {
"version": "4.17.23",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
"integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==",
"version": "4.18.1",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz",
"integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==",
"dev": true,
"license": "MIT"
},

View File

@@ -30,9 +30,6 @@ parameters:
# Eloquent models
- '#Call to an undefined method [a-zA-Z0-9\\_]+::[a-zA-Z0-9\\_]+\(\)#'
- '#Call to an undefined static method [a-zA-Z0-9\\_]+::[a-zA-Z0-9\\_]+\(\)#'
# system/pages/highscores.php
- '#Access to an undefined property Illuminate\\Database\\Eloquent\\Model::\$online_status#'
- '#Access to an undefined property Illuminate\\Database\\Eloquent\\Model::\$vocation_name#'
-
message: '#Variable \$tmp in empty\(\) always exists and is always falsy#'
path: templates\kathrine\javascript.php

View File

@@ -47,7 +47,6 @@ if(isset($_REQUEST['name']))
if(empty($name))
{
$tmp_link = getPlayerLink($name);
echo 'Here you can get detailed information about a certain player on ' . $config['lua']['serverName'] . '.<br/>';
echo generate_search_form(true);
return;

View File

@@ -210,10 +210,14 @@ if (empty($highscores)) {
}
$highscores = $query->get()->map(function($row) {
/**
* @var Player $row
*/
$tmp = $row->toArray();
$tmp['online'] = $row->online_status;
$tmp['vocation'] = $row->vocation_name;
$tmp['outfit_url'] = $row->outfit_url; // @phpstan-ignore-line
$tmp['outfit_url'] = $row->outfit_url;
$tmp['link'] = getPlayerLink($row->name, false);
unset($tmp['online_table']);
return $tmp;
@@ -247,7 +251,6 @@ foreach($highscores as $id => &$player)
$player['experience'] = number_format($player['experience']);
}
$player['link'] = getPlayerLink($player['name'], false);
$player['flag'] = getFlagImage($player['country']);
$player['outfit'] = '<img style="position:absolute;margin-top:-50px;margin-left:-30px" src="' . $player['outfit_url'] . '" alt="" />';

View File

@@ -108,8 +108,9 @@ $title = 'Latest News';
$cache = Cache::getInstance();
$news_cached = false;
if($cache->enabled())
if($cache->enabled() && !admin()) {
$news_cached = News::getCached(NEWS);
}
if(!$news_cached)
{

View File

@@ -14,6 +14,26 @@ class Hooks
self::$_hooks[$hook->type()][] = $hook;
}
public function unregister($name, $type, $file): void
{
if (is_string($type)) {
$type = constant($type);
}
if(!isset(self::$_hooks[$type])) {
return;
}
foreach(self::$_hooks[$type] as $id => $hook) {
if($name == $hook->name()
&& $type == $hook->type()
&& $file == $hook->file()
) {
unset(self::$_hooks[$type][$id]);
}
}
}
public function trigger($type, $params = []): bool
{
$ret = true;

View File

@@ -18,6 +18,15 @@ class Account extends Model {
public $timestamps = false;
protected $fillable = [
'name', 'number', 'email', 'password',
'key', 'created', 'rlname', 'location', 'country',
'web_lastlogin', 'web_flags',
'email_new', 'email_new_time', 'email_code',
'premium_points', 'coins', 'coins_transferable',
'premium_ends_at', 'premend', 'lastday', 'premdays',
];
protected $casts = [
'lastday' => 'integer',
'premdays' => 'integer',

View File

@@ -1,15 +0,0 @@
<?php
namespace MyAAC\Models;
use Illuminate\Database\Eloquent\Model;
class BugTracker extends Model {
protected $table = TABLE_PREFIX . 'bugtracker';
public $timestamps = false;
protected $fillable = ['account', 'type', 'status', 'text', 'id', 'subject', 'reply', 'who', 'uid', 'tag'];
}

View File

@@ -5,8 +5,10 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasOne;
/**
* @property string $name
* @property int $level
* @property int $vocation
* @property int $promotion
* @property int $online
* @property int $looktype
* @property int $lookhead
@@ -14,6 +16,8 @@ use Illuminate\Database\Eloquent\Relations\HasOne;
* @property int $looklegs
* @property int $lookfeet
* @property int $lookaddons
* @property bool $online_status
* @property string $vocation_name
* @property string $outfit_url
* @property hasOne $onlineTable
*/

View File

@@ -868,6 +868,15 @@ class Plugins {
}
}
global $hooks;
foreach($plugin_info['hooks'] ?? [] as $name => $info) {
if (str_contains($info['type'], 'HOOK_')) {
$info['type'] = str_replace('HOOK_', '', $info['type']);
}
$hooks->unregister($name, 'HOOK_' . $info['type'], $info['file']);
}
clearCache();
return true;
}

View File

@@ -2,7 +2,7 @@
use MyAAC\Models\Gallery;
if(PAGE !== 'news') {
if(PAGE !== 'news' || !$db->hasTable(TABLE_PREFIX . 'gallery')) {
return;
}