2022-11-19 12:51:28 +00:00
|
|
|
#
|
|
|
|
# Example module.
|
|
|
|
#
|
|
|
|
|
|
|
|
from .. import hook_system
|
|
|
|
|
|
|
|
hook = hook_system.hook
|
|
|
|
|
|
|
|
|
|
|
|
@hook.add_hook
|
|
|
|
class Login:
|
|
|
|
# Different hook types are executed at different places.
|
|
|
|
# In this case, the hook is executed when a user logs in.
|
2022-11-20 12:21:45 +00:00
|
|
|
#
|
2022-11-19 12:51:28 +00:00
|
|
|
# Check the documentation for more hook types.
|
2022-11-20 12:21:45 +00:00
|
|
|
hook_type = ["player_login"]
|
2022-11-19 12:51:28 +00:00
|
|
|
|
2022-11-20 12:21:45 +00:00
|
|
|
def __call__(self, hook_type, *args, **kwargs):
|
2022-11-19 12:51:28 +00:00
|
|
|
print("LOGIN HOOK:", args, kwargs)
|