mirror of
https://github.com/evennia/evennia.git
synced 2026-03-17 05:16:31 +01:00
add in is_connected property to base objects
This commit is contained in:
parent
861c722d30
commit
5817c1b790
1 changed files with 8 additions and 0 deletions
|
|
@ -210,6 +210,14 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
|
|||
def sessions(self):
|
||||
return ObjectSessionHandler(self)
|
||||
|
||||
@property
|
||||
def is_connected(self):
|
||||
# we get an error for objects subscribed to channels without this
|
||||
if self.account: # seems sane to pass on the account
|
||||
return self.account.is_connected
|
||||
else:
|
||||
return False
|
||||
|
||||
@property
|
||||
def has_account(self):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue