mirror of
https://github.com/evennia/evennia.git
synced 2026-03-23 08:16:30 +01:00
Moved all command definitions of Typeclassed entities up one level, to Object, Player and Script respectively. The actual code is still on the models (ObjectDB, PlayerDB and ScriptDB), but one should not be able to use the methods without having to dig into the code as far. Also added extensive, up-to-date headers to the inheriting base objects in game/gamesrc.
This commit is contained in:
parent
8ada50fcb7
commit
7a2cdd3842
8 changed files with 676 additions and 170 deletions
|
|
@ -101,6 +101,8 @@ class ScriptClass(TypeClass):
|
|||
except Exception:
|
||||
logger.log_trace()
|
||||
|
||||
|
||||
# Public methods
|
||||
|
||||
def time_until_next_repeat(self):
|
||||
"""
|
||||
|
|
@ -251,6 +253,32 @@ class Script(ScriptClass):
|
|||
the hooks called by the script machinery.
|
||||
"""
|
||||
|
||||
## available properties
|
||||
|
||||
# key (string) - name of object
|
||||
# name (string)- same as key
|
||||
# aliases (list of strings) - aliases to the object. Will be saved to database as AliasDB entries but returned as strings.
|
||||
# dbref (int, read-only) - unique #id-number. Also "id" can be used.
|
||||
# dbobj (Object, read-only) - link to database model. dbobj.typeclass points back to this class
|
||||
# typeclass (Object, read-only) - this links back to this class as an identified only. Use self.swap_typeclass() to switch.
|
||||
# date_created (string) - time stamp of object creation
|
||||
# permissions (list of strings) - list of permission strings
|
||||
|
||||
# desc (string) - optional description of script, shown in listings
|
||||
# obj (Object) - optional object that this script is connected to and acts on (set automatically by obj.scripts.add())
|
||||
# interval (int) - how often script should run, in seconds. <0 turns off ticker
|
||||
# start_delay (bool) - if the script should start repeating right away or wait self.interval seconds
|
||||
# repeats (int) - how many times the script should repeat before stopping. 0 means infinite repeats
|
||||
# persistent (bool) - if script should survive a server shutdown or not
|
||||
# is_active (bool) - if script is currently running
|
||||
|
||||
## Handlers
|
||||
|
||||
# locks - lock-handler: use locks.add() to add new lock strings
|
||||
# db - attribute-handler: store/retrieve database attributes on this self.db.myattr=val, val=self.db.myattr
|
||||
# ndb - non-persistent attribute handler: same as db but does not create a database entry when storing data
|
||||
|
||||
|
||||
def at_script_creation(self):
|
||||
"""
|
||||
Only called once, by the create function.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue