Merge branch 'develop' into feature/admin-bar

This commit is contained in:
slawkens
2021-12-04 20:43:00 +01:00
124 changed files with 202 additions and 1218 deletions

View File

@@ -63,7 +63,7 @@ class DataLoader
self::$startTime = microtime(true);
require LIBS . 'npc.php';
require_once LIBS . 'npc.php';
if(NPCs::loadFromXML()) {
success(self::$locale['step_database_loaded_npcs'] . self::getLoadedTime());
}

View File

@@ -66,7 +66,7 @@ class Plugins {
continue;
}
if(isset($plugin['enabled']) && $plugin['enabled'] === 0) {
if(isset($plugin['enabled']) && !getBoolean($plugin['enabled'])) {
self::$warnings[] = 'Skipping ' . $filename . '... The plugin is disabled.';
continue;
}

View File

@@ -83,10 +83,10 @@ abstract class OTS_Base_DB extends PDO implements IOTS_DB
$startTime = microtime(true);
}
$ret = parent::query(...$args);;
$ret = parent::query(...$args);
if($this->logged) {
$totalTime = microtime(true) - $startTime;
$this->log .= round($totalTime, 4) . ' ms - ' . $query . PHP_EOL;
$this->log .= round($totalTime, 4) . ' ms - ' . $args[0] . PHP_EOL;
}
return $ret;

View File

@@ -223,7 +223,7 @@ class Validator
$npcCheck = config('character_name_npc_check');
if ($npcCheck) {
require LIBS . 'npc.php';
require_once LIBS . 'npc.php';
NPCS::load();
if(NPCS::$npcs && in_array(strtolower($name), NPCS::$npcs)) {
self::$lastError = "Invalid name format. Do not use NPC Names";
@@ -346,7 +346,7 @@ class Validator
$npcCheck = config('character_name_npc_check');
if ($npcCheck) {
require LIBS . 'npc.php';
require_once LIBS . 'npc.php';
NPCS::load();
if(NPCS::$npcs && in_array($name_lower, NPCS::$npcs)) {
self::$lastError = "Invalid name format. Do not use NPC Names";

View File

@@ -41,6 +41,7 @@ $locale['step_requirements_extension'] = '$EXTENSION$ PHP extension';
$locale['step_requirements_warning_images_guilds'] = 'Guild logo upload will not work';
$locale['step_requirements_warning_images_gallery'] = 'Gallery image upload will not work';
$locale['step_requirements_warning_player_signatures'] = 'Player Signatures will not work';
$locale['step_requirements_warning_install_plugins'] = 'It will be not possible to install plugins';
// config
$locale['step_config'] = 'Configuration';

View File

@@ -41,6 +41,7 @@ $locale['step_requirements_extension'] = 'Rozszerzenie PHP - $EXTENSION$';
$locale['step_requirements_warning_images_guilds'] = 'Nie będzie możliwości uploadu obrazków gildii';
$locale['step_requirements_warning_images_gallery'] = 'Nie będzie możliwości uploadu obrazków do galerii';
$locale['step_requirements_warning_player_signatures'] = 'Sygnatury graczy nie będą działać';
$locale['step_requirements_warning_install_plugins'] = 'Nie będzie można instalować rozszerzeń';
// config
$locale['step_config'] = 'Konfiguracja';

View File

@@ -52,6 +52,29 @@ else
$old_name = $player->getName();
$player->setName($name);
$player->save();
if ($db->hasTable('player_deaths') &&
$db->hasColumn('player_deaths', 'mostdamage_is_player') &&
$db->hasColumn('player_deaths', 'killed_by')) {
$namesToChange = $db->query('SELECT `player_id`, `time`, `is_player`, `killed_by`, `mostdamage_is_player`, `mostdamage_by` FROM `player_deaths` WHERE (`is_player` = 1 AND `killed_by` = ' . $db->quote($old_name) . ') OR (`mostdamage_is_player` = 1 AND `mostdamage_by` = ' . $db->quote($old_name) . ');');
if ($namesToChange->rowCount() > 0) {
foreach ($namesToChange->fetchAll(PDO::FETCH_ASSOC) as $row) {
$changeKey = '';
if ($row['is_player'] == '1' && $row['killed_by'] == $old_name) {
$changeKey = 'killed_by';
} else if ($row['mostdamage_is_player'] == '1' && $row['mostdamage_by'] == $old_name) {
$changeKey = 'mostdamage_by';
}
if (!empty($changeKey)) {
$db->update('player_deaths', [$changeKey => $name], ['player_id' => $row['player_id'], 'time' => $row['time']]);
}
}
}
}
$account_logged->setCustomField("premium_points", $points - $config['account_change_character_name_points']);
$account_logged->logAction('Changed name from <b>' . $old_name . '</b> to <b>' . $player->getName() . '</b>.');
$twig->display('success.html.twig', array(
@@ -83,4 +106,4 @@ else
}
}
?>
?>

View File

@@ -10,7 +10,7 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
$character_name = isset($_POST['name']) ? stripslashes(ucwords(strtolower($_POST['name']))) : null;
$character_name = isset($_POST['name']) ? stripslashes($_POST['name']) : null;
$character_sex = isset($_POST['sex']) ? (int)$_POST['sex'] : null;
$character_vocation = isset($_POST['vocation']) ? (int)$_POST['vocation'] : null;
$character_town = isset($_POST['town']) ? (int)$_POST['town'] : null;
@@ -42,4 +42,4 @@ if(!$character_created) {
'save' => $save,
'errors' => $errors
));
}
}

View File

@@ -54,16 +54,14 @@ if (empty($_REQUEST['creature'])) {
$loot = json_decode($creature['loot'], true);
usort($loot, 'sort_by_chance');
$loot_list = [];
foreach ($loot as $item) {
foreach ($loot as &$item) {
$item['name'] = getItemNameById($item['id']);
$item['rarity_chance'] = round($item['chance'] / 1000, 2);
$item['rarity'] = getItemRarity($item['chance']);
$item['tooltip'] = ucfirst($item['name']) . '<br/>Chance: ' . $item['rarity'] . (config('creatures_loot_percentage') ? ' ('. $item['rarity_chance'] .'%)' : '') . '<br/>Max count: ' . $item['count'];
$loot_list[] = $item;
}
$creature['loot'] = isset($loot_list) ? $loot_list : null;
$creature['loot'] = isset($loot) ? $loot : null;
$creature['voices'] = isset($voices) ? $voices : null;
$creature['summons'] = isset($summons) ? $summons : null;
$creature['elements'] = isset($elements) ? $elements : null;

View File

@@ -43,7 +43,15 @@ echo '<br /><br />Page: '.$links_to_pages.'<br />';
$last_threads = $db->query("SELECT `players`.`id` as `player_id`, `players`.`name`, `" . FORUM_TABLE_PREFIX . "forum`.`post_text`, `" . FORUM_TABLE_PREFIX . "forum`.`post_topic`, `" . FORUM_TABLE_PREFIX . "forum`.`id`, `" . FORUM_TABLE_PREFIX . "forum`.`last_post`, `" . FORUM_TABLE_PREFIX . "forum`.`replies`, `" . FORUM_TABLE_PREFIX . "forum`.`views`, `" . FORUM_TABLE_PREFIX . "forum`.`post_date` FROM `players`, `" . FORUM_TABLE_PREFIX . "forum` WHERE `players`.`id` = `" . FORUM_TABLE_PREFIX . "forum`.`author_guid` AND `" . FORUM_TABLE_PREFIX . "forum`.`section` = ".(int) $section_id." AND `" . FORUM_TABLE_PREFIX . "forum`.`first_post` = `" . FORUM_TABLE_PREFIX . "forum`.`id` ORDER BY `" . FORUM_TABLE_PREFIX . "forum`.`last_post` DESC LIMIT ".$config['forum_threads_per_page']." OFFSET ".($_page * $config['forum_threads_per_page']))->fetchAll();
if(isset($last_threads[0]))
{
echo '<table width="100%"><tr bgcolor="'.$config['vdarkborder'].'" align="center"><td><span style="color: white; font-size: 10px"><b>Thread</b></span></td><td><span style="color: white; font-size: 10px"><b>Thread Starter</b></span></td><td><span style="color: white; font-size: 10px"><b>Replies</b></span></td><td><span style="color: white; font-size: 10px"><b>Views</b></span></td><td><span style="color: white; font-size: 10px"><b>Last Post</b></span></td></tr>';
echo '<table width="100%">
<tr bgcolor="'.$config['vdarkborder'].'" align="center">
<td class="white">
<span style="font-size: 10px"><b>Thread</b></span></td>
<td><span style="font-size: 10px"><b>Thread Starter</b></span></td>
<td><span style="font-size: 10px"><b>Replies</b></span></td>
<td><span style="font-size: 10px"><b>Views</b></span></td>
<td><span style="font-size: 10px"><b>Last Post</b></span></td>
</tr>';
$player = new OTS_Player();
foreach($last_threads as $thread)
@@ -83,4 +91,4 @@ if(isset($last_threads[0]))
else
echo '<h3>No threads in this board.</h3>';
?>
?>

View File

@@ -29,11 +29,13 @@ if(isset($_GET['archive']))
// display big news by id
if(isset($_GET['id']))
{
$id = (int)$_GET['id'];
$field_name = 'date';
if($_REQUEST['id'] < 100000)
if($id < 100000)
$field_name = 'id';
$news = $db->query('SELECT * FROM `'.TABLE_PREFIX . 'news` WHERE `hidden` != 1 AND `' . $field_name . '` = ' . (int)$_REQUEST['id'] . '');
$news = $db->query('SELECT * FROM `'.TABLE_PREFIX . 'news` WHERE `hidden` != 1 AND `' . $field_name . '` = ' . $id . '');
if($news->rowCount() == 1)
{
$news = $news->fetch();
@@ -227,4 +229,4 @@ if(!$news_cached)
echo $tmp_content;
}
else
echo $news_cached;
echo $news_cached;

View File

@@ -9,7 +9,7 @@
* @link https://my-aac.org
*/
defined('MYAAC') or die('Direct access not allowed!');
$title = 'Gamemasters List';
$title = 'Support in game';
if($config['account_country'])
require SYSTEM . 'countries.conf.php';

View File

@@ -80,6 +80,7 @@ else {
}
$template_ini = parse_ini_file($file);
unset($file);
if ($cache->enabled()) {
$cache->set('template_ini_' . $template_name, serialize($template_ini));

View File

@@ -1,8 +1,7 @@
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/tinymce/tinymce.min.js"></script>
<script type="text/javascript" src="{{ constant('BASE_URL') }}node_modules/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
tinymce.init({
selector: "textarea",
theme: "modern",
plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount spellchecker imagetools contextmenu colorpicker textpattern help code emoticons',
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
image_advtab: true,

View File

@@ -104,7 +104,7 @@
$('#select-type').change(function () {
var value = $('#select-type').val();
if (value == {{ constant('ARTICLE') }}) {
if (value === {{ constant('ARTICLE') }}) {
$('#article-text').show();
$('#article-image').show();
} else {
@@ -116,20 +116,19 @@
</script>
{% endif %}
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/tinymce/tinymce.min.js"></script>
<script type="text/javascript" src="{{ constant('BASE_URL') }}node_modules/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
var unsaved = false;
var lastContent = '';
let unsaved = false;
let lastContent = '';
tinymce.init({
selector: "#body",
theme: "modern",
plugins: 'preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount spellchecker imagetools contextmenu colorpicker textpattern help code emoticons',
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
image_advtab: true,
setup: function (ed) {
ed.on('NodeChange', function (e) {
if (ed.getContent() != lastContent) {
if (ed.getContent() !== lastContent) {
unsaved = true;
}
});

View File

@@ -64,7 +64,7 @@
</form>
</div>
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/tinymce/tinymce.min.js"></script>
<script type="text/javascript" src="{{ constant('BASE_URL') }}node_modules/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
$(function () {
$('#enable_tinymce').on('change', function (e) {
@@ -86,7 +86,6 @@
function init_tinymce() {
tinymce.init({
selector: "#body",
theme: "modern",
plugins: 'code print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount spellchecker imagetools contextmenu colorpicker textpattern help emoticons',
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
image_advtab: true,

View File

@@ -1,21 +1,21 @@
<b>Boards</b>
<table width="100%">
<tr bgcolor="{{ config.vdarkborder }}">
<tr bgcolor="{{ config.vdarkborder }}" class="white">
<td>
<span style="color: white; font-size: 10px"><b>Board</b></span>
<span style="font-size: 10px"><b>Board</b></span>
</td>
<td>
<span style="color: white; font-size: 10px"><b>Posts</b></span>
<span style="font-size: 10px"><b>Posts</b></span>
</td>
<td>
<span style="color: white; font-size: 10px"><b>Threads</b></span>
<span style="font-size: 10px"><b>Threads</b></span>
</td>
<td align="center">
<span style="color: white; font-size: 10px"><b>Last Post</b></span>
<span style="font-size: 10px"><b>Last Post</b></span>
</td>
{% if canEdit %}
<td>
<span style="color: white; font-size: 10px"><b>Options</b></span>
<span style="font-size: 10px"><b>Options</b></span>
</td>
{% endif %}
</tr>

View File

@@ -12,8 +12,8 @@ Page: {{ links_to_pages|raw }}<br/>
</td>
</tr>
<tr bgcolor="{{ config.vdarkborder }}">
<td width="200">
<span style="color: white; font-size: 10px"><b>Author</b></span>
<td width="200" class="white">
<span style="font-size: 10px"><b>Author</b></span>
</td>
<td>&nbsp;</td>
</tr>

View File

@@ -8,15 +8,11 @@ Here you can change logo of your guild.<br/>Actuall logo: <img src="images/guild
</form>
Only <b>jpg, gif, png, bmp</b> pictures. Max. size: <b>{{ config.guild_image_size_kb }} KB</b><br>
<br/>
{% spaceless %}
<div style="text-align:center">
<form action="?subtopic=guilds&guild={{ guild.getName() }}&action=manager" method="post">
<div class="BigButton" style="background-image:url({{ template_path }}/images/global/buttons/sbutton.gif)">
{{ include('buttons.back.html.twig') }}
</div>
{{ include('buttons.back.html.twig') }}
</form>
</div>
{% endspaceless %}
<script type="text/javascript">
$(function() {
$('#upload_form').submit(function (event) {
@@ -34,4 +30,4 @@ Only <b>jpg, gif, png, bmp</b> pictures. Max. size: <b>{{ config.guild_image_siz
return true;
});
});
</script>
</script>

View File

@@ -5,12 +5,8 @@ Here you can change MOTD (Message of the Day, showed in game!) of your guild.<br
<textarea name="motd" cols="60" rows="3">{{ guild.getCustomField('motd')|raw }}</textarea><br/>
(max. {{ config.guild_motd_chars_limit }} chars) <input type="submit" value="Save MOTD" /></form><br/>
<br/>
{% spaceless %}
<div style="text-align:center">
<form action="?subtopic=guilds&guild={{ guild.getName() }}&action=manager" method="post">
<div class="BigButton" style="background-image:url({{ template_path }}/images/global/buttons/sbutton.gif)">
{{ include('buttons.back.html.twig') }}
</div>
{{ include('buttons.back.html.twig') }}
</form>
</div>
{% endspaceless %}

View File

@@ -3,7 +3,30 @@
<td style="width: 17px"></td>
<td>
<div style="text-align:center"><h2>Ranking for {{ skillName }}{% if vocation is not null %} ({{ vocation }}){% endif %} on {{ config.lua.serverName }}</h2></div><br/>
<table border="0" cellpadding="4" cellspacing="1" width="100%"></table>
<table border="0" cellpadding="4" cellspacing="1" width="100%">
<tr>
<td>Filters</td>
<td>
<label for="vocationFilter">Choose a Skill</label>
<select onchange="location = this.value;" aria-label="skillFilter" id="skillFilter">
{% set i = 0 %}
{% for link, name in types %}
<option value="{{ getLink('highscores') }}/{{ link }}{% if vocation is defined %}/{{ vocation }}{% endif %}" class="size_xs">{{ name }}</option>
{% endfor %}
</select>
</td>
<td>
<label for="vocationFilter">Choose a vocation</label>
<select onchange="location = this.value;" aria-label="vocationFilter" id="vocationFilter">
<option value="{{ getLink('highscores') }}/{{ list }}" class="size_xs">[ALL]</option>
{% set i = 0 %}
{% for i in 1..config.vocations_amount %}
<option value="{{ getLink('highscores') }}/{{ list }}/{{ config.vocations[i]|lower }}" class="size_xs">{{ config.vocations[i]}}</option>
{% endfor %}
</select>
</td>
</tr>
</table>
<table border="0" cellpadding="4" cellspacing="1" width="100%">
<tr bgcolor="{{ config.vdarkborder }}">
{% if config.account_country %}

View File

@@ -28,7 +28,6 @@
cursor: pointer;
font-weight: 600;
background-color: {{ config.vdarkborder }};
color: #fff;
}
</style>
@@ -61,13 +60,13 @@
<div class="ts_Spells">
<input type="radio" name="ts_Spells" id="tab_instant" aria-controls="instant" checked>
<label for="tab_instant">Instant</label>
<label for="tab_instant" class="white">Instant</label>
<input type="radio" name="ts_Spells" id="tab_conjure" aria-controls="conjure">
<label for="tab_conjure">Conjure</label>
<label for="tab_conjure" class="white">Conjure</label>
<input type="radio" name="ts_Spells" id="tab_rune" aria-controls="rune">
<label for="tab_rune">Rune</label>
<label for="tab_rune" class="white">Rune</label>
<div class="tab-panels">
<section id="instant" class="tab-panel">