mirror of
https://github.com/slawkens/myaac.git
synced 2026-04-26 12:23:32 +02:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81b8bd8a2c | ||
|
|
def432d4b7 | ||
|
|
b0edbb79d9 | ||
|
|
ba1ee4bdb7 | ||
|
|
54bdea85a3 | ||
|
|
ac9a328206 | ||
|
|
609cf152af | ||
|
|
ec7079dd57 | ||
|
|
fa93187f80 | ||
|
|
7bc8a66cc1 | ||
|
|
4145d9eb3c | ||
|
|
a27b8a4fa5 | ||
|
|
4570ba3801 | ||
|
|
578c0548ee | ||
|
|
aa63e1c986 |
@@ -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.
|
||||
|
||||
[](https://www.jetbrains.com/?from=https://github.com/slawkens)
|
||||
|
||||
### License
|
||||
|
||||
This program and all associated files are released under the GNU Public License.
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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
6
package-lock.json
generated
@@ -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"
|
||||
},
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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="" />';
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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'];
|
||||
|
||||
}
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
use MyAAC\Models\Gallery;
|
||||
|
||||
if(PAGE !== 'news') {
|
||||
if(PAGE !== 'news' || !$db->hasTable(TABLE_PREFIX . 'gallery')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user