New hook: HOOK_ACCOUNT_CREATE_CHARACTER_AFTER

Possibility to change character after create
This commit is contained in:
slawkens 2023-11-25 13:53:50 +01:00
parent b1224d9d1a
commit 56631bdf27
2 changed files with 15 additions and 0 deletions

View File

@ -58,6 +58,7 @@ define('HOOK_ACCOUNT_LOGIN_AFTER_PASSWORD', ++$i);
define('HOOK_ACCOUNT_LOGIN_AFTER_REMEMBER_ME', ++$i);
define('HOOK_ACCOUNT_LOGIN_AFTER_PAGE', ++$i);
define('HOOK_ACCOUNT_LOGIN_POST', ++$i);
define('HOOK_ACCOUNT_CREATE_CHARACTER_AFTER', ++$i);
define('HOOK_ADMIN_HEAD_END', ++$i);
define('HOOK_ADMIN_HEAD_START', ++$i);
define('HOOK_ADMIN_BODY_START', ++$i);

View File

@ -260,6 +260,20 @@ class CreateCharacter
}
}
global $hooks;
if (!$hooks->trigger(HOOK_ACCOUNT_CREATE_CHARACTER_AFTER,
[
'account' => $account,
'player' => $player,
'name' => $name,
'sex' => $sex,
'vocation' => $vocation,
'town' => $town,
]
)) {
return false;
}
global $twig;
$twig->display('success.html.twig', array(
'title' => 'Character Created',