mirror of
https://github.com/evennia/evennia.git
synced 2026-03-25 17:26:32 +01:00
Added @sessions command for viewing active sessions connected to a given account.
This commit is contained in:
parent
25505d69a6
commit
458e3e7599
4 changed files with 53 additions and 5 deletions
|
|
@ -678,13 +678,18 @@ class ObjectDB(TypedObject):
|
|||
data (object): an optional data object that may or may not
|
||||
be used by the protocol.
|
||||
sessid (int): sessid to relay to, if any.
|
||||
If set to 0 (default), use self.sessid automatically
|
||||
If set to 0 (default), use either from_obj.sessid (if set) or self.sessid automatically
|
||||
If None, echo to all connected sessions
|
||||
"""
|
||||
if _GA(self, 'player'):
|
||||
# note that we must call the player *typeclass'* msg(), otherwise one couldn't overload it.
|
||||
_GA(_GA(self, 'player'), "typeclass").msg(msg, from_obj=from_obj, data=data,
|
||||
sessid=(sessid==0 and _GA(self, "sessid") or sessid or None))
|
||||
if sessid == 0:
|
||||
sessid = None
|
||||
if from_obj and hasattr(from_obj, "sessid"):
|
||||
sessid = from_obj.sessid
|
||||
elif hasattr(self, "sessid"):
|
||||
sessid = self.sessid
|
||||
_GA(_GA(self, 'player'), "typeclass").msg(msg, from_obj=from_obj, data=data, sessid=sessid)
|
||||
|
||||
def emit_to(self, message, from_obj=None, data=None):
|
||||
"Deprecated. Alias for msg"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue