mirror of
https://github.com/evennia/evennia.git
synced 2026-03-21 15:26:30 +01:00
Added **kwargs to cmdhandler and execute_cmd() methods, to set arbitrary flags on commands at run-time. Unused by default Evennia but may be useful to codedly change operation parameters on commands at run-time.
This commit is contained in:
parent
19d6d4ff9e
commit
a88afabd60
5 changed files with 33 additions and 8 deletions
|
|
@ -300,7 +300,7 @@ class Object(TypeClass):
|
|||
return self.player
|
||||
return self.dbobj.search_player(searchdata, quiet=quiet)
|
||||
|
||||
def execute_cmd(self, raw_string, sessid=None):
|
||||
def execute_cmd(self, raw_string, sessid=None, **kwargs):
|
||||
"""
|
||||
Do something as this object. This command transparently
|
||||
lets its typeclass execute the command. This method is
|
||||
|
|
@ -311,6 +311,10 @@ class Object(TypeClass):
|
|||
raw_string (string) - raw command input
|
||||
sessid (int) - id of session executing the command. This sets the
|
||||
sessid property on the command.
|
||||
**kwargs - other keyword arguments will be added to the found command
|
||||
object instace as variables before it executes. This is
|
||||
unused by default Evennia but may be used to set flags and
|
||||
change operating paramaters for commands at run-time.
|
||||
|
||||
Returns Deferred - this is an asynchronous Twisted object that will
|
||||
not fire until the command has actually finished executing. To
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue