diff --git a/evennia/accounts/accounts.py b/evennia/accounts/accounts.py index 9feed46d2e..3a9736d738 100644 --- a/evennia/accounts/accounts.py +++ b/evennia/accounts/accounts.py @@ -457,7 +457,7 @@ class DefaultAccount(with_metaclass(TypeclassBase, AccountDB)): callertype="account", session=session, **kwargs) def search(self, searchdata, return_puppet=False, search_object=False, - typeclass=None, nofound_string=None, multimatch_string=None, **kwargs): + typeclass=None, nofound_string=None, multimatch_string=None, use_nicks=True, **kwargs): """ This is similar to `DefaultObject.search` but defaults to searching for Accounts only. @@ -481,6 +481,7 @@ class DefaultAccount(with_metaclass(TypeclassBase, AccountDB)): multimatch_string (str, optional): A one-time error message to echo if `searchdata` leads to multiple matches. If not given, will fall back to the default handler. + use_nicks (bool, optional): Use account-level nick replacement. Return: match (Account, Object or None): A single Account or Object match. @@ -496,8 +497,10 @@ class DefaultAccount(with_metaclass(TypeclassBase, AccountDB)): if searchdata.lower() in ("me", "*me", "self", "*self",): return self if search_object: - matches = ObjectDB.objects.object_search(searchdata, typeclass=typeclass) + matches = ObjectDB.objects.object_search(searchdata, typeclass=typeclass, use_nicks=use_nicks) else: + searchdata = self.nicks.nickreplace(searchdata, categories=("account", ), include_account=False) + matches = AccountDB.objects.account_search(searchdata, typeclass=typeclass) matches = _AT_SEARCH_RESULT(matches, self, query=searchdata, nofound_string=nofound_string, diff --git a/evennia/commands/default/admin.py b/evennia/commands/default/admin.py index 9da061cc04..8b694ffd8f 100644 --- a/evennia/commands/default/admin.py +++ b/evennia/commands/default/admin.py @@ -544,7 +544,8 @@ class CmdWall(COMMAND_DEFAULT_CLASS): Usage: @wall - Announces a message to all connected accounts. + Announces a message to all connected sessions + including all currently unlogged in. """ key = "@wall" locks = "cmd:perm(wall) or perm(Admin)" @@ -556,5 +557,5 @@ class CmdWall(COMMAND_DEFAULT_CLASS): self.caller.msg("Usage: @wall ") return message = "%s shouts \"%s\"" % (self.caller.name, self.args) - self.msg("Announcing to all connected accounts ...") + self.msg("Announcing to all connected sessions ...") SESSIONS.announce_all(message) diff --git a/evennia/commands/default/general.py b/evennia/commands/default/general.py index 612a798167..81f7f12729 100644 --- a/evennia/commands/default/general.py +++ b/evennia/commands/default/general.py @@ -1,6 +1,7 @@ """ General Character commands usually available to all characters """ +import re from django.conf import settings from evennia.utils import utils, evtable from evennia.typeclasses.attributes import NickTemplateInvalid @@ -75,37 +76,41 @@ class CmdLook(COMMAND_DEFAULT_CLASS): class CmdNick(COMMAND_DEFAULT_CLASS): """ - define a personal alias/nick + define a personal alias/nick by defining a string to + match and replace it with another on the fly Usage: nick[/switches] [= [replacement_string]] nick[/switches]