mirror of
https://github.com/slawkens/myaac.git
synced 2025-05-07 14:49:21 +02:00
New create character checks configurable: block monsters & spells names
This commit is contained in:
parent
ea21e27cdc
commit
da19a34335
@ -296,7 +296,7 @@ class Validator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//check if was namelocked previously
|
// check if was namelocked previously
|
||||||
if($db->hasTable('player_namelocks') && $db->hasColumn('player_namelocks', 'name')) {
|
if($db->hasTable('player_namelocks') && $db->hasColumn('player_namelocks', 'name')) {
|
||||||
$namelock = $db->query('SELECT `player_id` FROM `player_namelocks` WHERE `name` = ' . $db->quote($name));
|
$namelock = $db->query('SELECT `player_id` FROM `player_namelocks` WHERE `name` = ' . $db->quote($name));
|
||||||
if($namelock->rowCount() > 0) {
|
if($namelock->rowCount() > 0) {
|
||||||
@ -305,23 +305,29 @@ class Validator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$monstersCheck = setting('core.create_character_name_monsters_check');
|
||||||
|
if ($monstersCheck) {
|
||||||
$monsters = $db->query('SELECT `name` FROM `' . TABLE_PREFIX . 'monsters` WHERE `name` LIKE ' . $db->quote($name_lower));
|
$monsters = $db->query('SELECT `name` FROM `' . TABLE_PREFIX . 'monsters` WHERE `name` LIKE ' . $db->quote($name_lower));
|
||||||
if($monsters->rowCount() > 0) {
|
if ($monsters->rowCount() > 0) {
|
||||||
self::$lastError = 'Your name cannot contains monster name.';
|
self::$lastError = 'Your name cannot contains monster name.';
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$spellsCheck = setting('core.create_character_name_spells_check');
|
||||||
|
if ($spellsCheck) {
|
||||||
$spells_name = $db->query('SELECT `name` FROM `' . TABLE_PREFIX . 'spells` WHERE `name` LIKE ' . $db->quote($name_lower));
|
$spells_name = $db->query('SELECT `name` FROM `' . TABLE_PREFIX . 'spells` WHERE `name` LIKE ' . $db->quote($name_lower));
|
||||||
if($spells_name->rowCount() > 0) {
|
if ($spells_name->rowCount() > 0) {
|
||||||
self::$lastError = 'Your name cannot contains spell name.';
|
self::$lastError = 'Your name cannot contains spell name.';
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$spells_words = $db->query('SELECT `words` FROM `' . TABLE_PREFIX . 'spells` WHERE `words` = ' . $db->quote($name_lower));
|
$spells_words = $db->query('SELECT `words` FROM `' . TABLE_PREFIX . 'spells` WHERE `words` = ' . $db->quote($name_lower));
|
||||||
if($spells_words->rowCount() > 0) {
|
if ($spells_words->rowCount() > 0) {
|
||||||
self::$lastError = 'Your name cannot contains spell name.';
|
self::$lastError = 'Your name cannot contains spell name.';
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$npcCheck = setting('core.create_character_name_npc_check');
|
$npcCheck = setting('core.create_character_name_npc_check');
|
||||||
if ($npcCheck) {
|
if ($npcCheck) {
|
||||||
|
@ -620,10 +620,22 @@ Sent by MyAAC,<br/>
|
|||||||
'type' => 'section',
|
'type' => 'section',
|
||||||
'title' => 'Create Character',
|
'title' => 'Create Character',
|
||||||
],
|
],
|
||||||
'create_character_name_npc_check' => [
|
'create_character_name_monsters_check' => [
|
||||||
'name' => 'Create Character Name Check NPC Names',
|
'name' => 'Block Monsters Names',
|
||||||
'type' => 'boolean',
|
'type' => 'boolean',
|
||||||
'desc' => 'should country of user be automatically recognized by his IP? This makes an external API call to http://ipinfo.io',
|
'desc' => 'Should monsters names be blocked when creating character?',
|
||||||
|
'default' => true,
|
||||||
|
],
|
||||||
|
'create_character_name_npc_check' => [
|
||||||
|
'name' => 'Block NPC Names',
|
||||||
|
'type' => 'boolean',
|
||||||
|
'desc' => 'Should NPC names be blocked when creating character?',
|
||||||
|
'default' => true,
|
||||||
|
],
|
||||||
|
'create_character_name_spells_check' => [
|
||||||
|
'name' => 'Block Spells Names',
|
||||||
|
'type' => 'boolean',
|
||||||
|
'desc' => 'Should spells names and words be blocked when creating character?',
|
||||||
'default' => true,
|
'default' => true,
|
||||||
],
|
],
|
||||||
'create_character_name_min_length' => [
|
'create_character_name_min_length' => [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user