mirror of
https://github.com/evennia/evennia.git
synced 2026-03-26 09:46:32 +01:00
Restructured the way typeclasses are loaded. This makes it possible to run at_init() hooks at initiation also for objects without any custom cases for character/players. at_init() hooks are called only when an object is initiated. This means that a room's at_init() hook is only called when someone looks or enters it or a script operates on it, for example, rest of the time these objects are dormant, most efficiently.
This commit is contained in:
parent
0a1bcd36c2
commit
23cd9e31b1
14 changed files with 142 additions and 109 deletions
|
|
@ -243,14 +243,14 @@ class ScriptDB(TypedObject):
|
|||
#
|
||||
#
|
||||
|
||||
# this is required to properly handle attrubutes and typeclass loading
|
||||
# this is required to properly handle attributes and typeclass loading
|
||||
attribute_model_path = "src.scripts.models"
|
||||
attribute_model_name = "ScriptAttribute"
|
||||
typeclass_paths = settings.SCRIPT_TYPECLASS_PATHS
|
||||
|
||||
# this is used by all typedobjects as a fallback
|
||||
try:
|
||||
default_typeclass_path = settings.DEFAULT_SCRIPT_TYPECLASS
|
||||
default_typeclass_path = settings.BASE_SCRIPT_TYPECLASS
|
||||
except:
|
||||
default_typeclass_path = "src.scripts.scripts.DoNothing"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue