mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Add ServerSession.get_display_name as alias to puppet/account versions. Resolve #2839
This commit is contained in:
parent
c92d2a0c1e
commit
b37ce26005
1 changed files with 14 additions and 5 deletions
|
|
@ -7,14 +7,15 @@ It is stored on the Server side (as opposed to protocol-specific sessions which
|
|||
are stored on the Portal side)
|
||||
"""
|
||||
import time
|
||||
from django.utils import timezone
|
||||
|
||||
from django.conf import settings
|
||||
from evennia.comms.models import ChannelDB
|
||||
from evennia.utils import logger
|
||||
from evennia.utils.utils import make_iter, lazy_property, class_from_module
|
||||
from django.utils import timezone
|
||||
from evennia.commands.cmdsethandler import CmdSetHandler
|
||||
from evennia.comms.models import ChannelDB
|
||||
from evennia.scripts.monitorhandler import MONITOR_HANDLER
|
||||
from evennia.typeclasses.attributes import AttributeHandler, InMemoryAttributeBackend, DbHolder
|
||||
from evennia.typeclasses.attributes import AttributeHandler, DbHolder, InMemoryAttributeBackend
|
||||
from evennia.utils import logger
|
||||
from evennia.utils.utils import class_from_module, lazy_property, make_iter
|
||||
|
||||
_GA = object.__getattribute__
|
||||
_SA = object.__setattr__
|
||||
|
|
@ -435,3 +436,11 @@ class ServerSession(_BASE_SESSION_CLASS):
|
|||
|
||||
"""
|
||||
return True
|
||||
|
||||
def get_display_name(self, *args, **kwargs):
|
||||
if self.puppet:
|
||||
return self.puppet.get_display_name(*args, **kwargs)
|
||||
elif self.account:
|
||||
return self.account.get_display_name(*args, **kwargs)
|
||||
else:
|
||||
return f"{self.protocol_key}({self.address})"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue