Merge back fixes into master

This commit is contained in:
Griatch 2017-10-01 16:51:41 +02:00
parent 5871e64681
commit a8603975a1
4 changed files with 14 additions and 5 deletions

View file

@ -824,7 +824,7 @@ class CmdQuell(COMMAND_DEFAULT_CLASS):
"""Perform the command"""
account = self.account
permstr = account.is_superuser and " (superuser)" or "(%s)" % (", ".join(account.permissions.all()))
if self.cmdstring == '@unquell':
if self.cmdstring in ('unquell', '@unquell'):
if not account.attributes.get('_quell'):
self.msg("Already using normal Account permissions %s." % permstr)
else:

View file

@ -67,7 +67,7 @@ class CmdLook(COMMAND_DEFAULT_CLASS):
caller.msg("You have no location to look at!")
return
else:
target = caller.search(self.args, use_dbref=caller.check_permstring("Builders"))
target = caller.search(self.args)
if not target:
return
self.msg(caller.at_look(target))

View file

@ -292,7 +292,7 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
candidates=None,
nofound_string=None,
multimatch_string=None,
use_dbref=True):
use_dbref=None):
"""
Returns an Object matching a search string/condition
@ -343,8 +343,9 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
caller's contents (inventory).
nofound_string (str): optional custom string for not-found error message.
multimatch_string (str): optional custom string for multimatch error header.
use_dbref (bool, optional): if False, treat a given #dbref strings as a
normal string rather than database ids.
use_dbref (bool or None, optional): if True/False, active/deactivate the use of
#dbref as valid global search arguments. If None, check against a permission
('Builder' by default).
Returns:
match (Object, None or list): will return an Object/None if `quiet=False`,
@ -360,6 +361,7 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
"""
is_string = isinstance(searchdata, basestring)
if is_string:
# searchdata is a string; wrap some common self-references
if searchdata.lower() in ("here", ):
@ -367,6 +369,9 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
if searchdata.lower() in ("me", "self",):
return [self] if quiet else self
if use_dbref is None:
use_dbref = self.locks.check_lockstring(self, "_dummy:perm(Builder)")
if use_nicks:
# do nick-replacement on search
searchdata = self.nicks.nickreplace(searchdata, categories=("object", "account"), include_account=True)

View file

@ -575,6 +575,10 @@ class TypedObject(SharedMemoryModel):
ppos = _PERMISSION_HIERARCHY.index(perm)
return any(True for hpos, hperm in enumerate(_PERMISSION_HIERARCHY)
if hperm in perms and hpos > ppos)
# we ignore pluralization (english only)
if perm.endswith("s"):
return self.check_permstring(perm[:-1])
return False
#