Hook for adding custom rules to validate new character name

This commit is contained in:
slawkens
2025-11-24 18:04:09 +01:00
parent ae5df2b704
commit 8e6749c599
2 changed files with 11 additions and 0 deletions

View File

@@ -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;
}