mirror of
https://github.com/evennia/evennia.git
synced 2026-03-30 04:27:16 +02:00
OBS: You need to resync your database! Moved cmdsets into the database rather than being dependent on scripts. Moved the creation of the cmdset- and cmdset-handlers into ObjectDB.__init__ rather than bootstrapping it from the typeclass. Added some more script functionality for testing, includong the @script command for assigning a script to an object.
This commit is contained in:
parent
e965830735
commit
126e2ea61f
17 changed files with 370 additions and 216 deletions
|
|
@ -20,14 +20,14 @@ class ScriptManager(TypedObjectManager):
|
|||
return []
|
||||
scripts = self.filter(db_obj=obj)
|
||||
if key:
|
||||
return [script for script in scripts if script.key == key]
|
||||
return scripts.filter(db_key=key)
|
||||
return scripts
|
||||
|
||||
@returns_typeclass_list
|
||||
def get_all_scripts(self, key=None):
|
||||
"""
|
||||
Return all scripts, alternative only
|
||||
scripts with a certain key/dbref.
|
||||
scripts with a certain key/dbref or path.
|
||||
"""
|
||||
if key:
|
||||
dbref = self.dbref(key)
|
||||
|
|
@ -39,7 +39,7 @@ class ScriptManager(TypedObjectManager):
|
|||
# not a dbref. Normal key search
|
||||
scripts = self.filter(db_key=key)
|
||||
else:
|
||||
scripts = self.all()
|
||||
scripts = list(self.all())
|
||||
return scripts
|
||||
|
||||
def delete_script(self, dbref):
|
||||
|
|
@ -120,7 +120,7 @@ class ScriptManager(TypedObjectManager):
|
|||
elif obj:
|
||||
scripts = self.get_all_scripts_on_obj(obj, key=key)
|
||||
else:
|
||||
scripts = self.get_all_scripts(key=key)
|
||||
scripts = self.model.get_all_cached_instances()#get_all_scripts(key=key)
|
||||
if not scripts:
|
||||
VALIDATE_ITERATION -= 1
|
||||
return None, None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue