Merge back fixes into master
This commit is contained in:
parent
5871e64681
commit
a8603975a1
4 changed files with 14 additions and 5 deletions
|
|
@ -824,7 +824,7 @@ class CmdQuell(COMMAND_DEFAULT_CLASS):
|
||||||
"""Perform the command"""
|
"""Perform the command"""
|
||||||
account = self.account
|
account = self.account
|
||||||
permstr = account.is_superuser and " (superuser)" or "(%s)" % (", ".join(account.permissions.all()))
|
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'):
|
if not account.attributes.get('_quell'):
|
||||||
self.msg("Already using normal Account permissions %s." % permstr)
|
self.msg("Already using normal Account permissions %s." % permstr)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ class CmdLook(COMMAND_DEFAULT_CLASS):
|
||||||
caller.msg("You have no location to look at!")
|
caller.msg("You have no location to look at!")
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
target = caller.search(self.args, use_dbref=caller.check_permstring("Builders"))
|
target = caller.search(self.args)
|
||||||
if not target:
|
if not target:
|
||||||
return
|
return
|
||||||
self.msg(caller.at_look(target))
|
self.msg(caller.at_look(target))
|
||||||
|
|
|
||||||
|
|
@ -292,7 +292,7 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
|
||||||
candidates=None,
|
candidates=None,
|
||||||
nofound_string=None,
|
nofound_string=None,
|
||||||
multimatch_string=None,
|
multimatch_string=None,
|
||||||
use_dbref=True):
|
use_dbref=None):
|
||||||
"""
|
"""
|
||||||
Returns an Object matching a search string/condition
|
Returns an Object matching a search string/condition
|
||||||
|
|
||||||
|
|
@ -343,8 +343,9 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
|
||||||
caller's contents (inventory).
|
caller's contents (inventory).
|
||||||
nofound_string (str): optional custom string for not-found error message.
|
nofound_string (str): optional custom string for not-found error message.
|
||||||
multimatch_string (str): optional custom string for multimatch error header.
|
multimatch_string (str): optional custom string for multimatch error header.
|
||||||
use_dbref (bool, optional): if False, treat a given #dbref strings as a
|
use_dbref (bool or None, optional): if True/False, active/deactivate the use of
|
||||||
normal string rather than database ids.
|
#dbref as valid global search arguments. If None, check against a permission
|
||||||
|
('Builder' by default).
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
match (Object, None or list): will return an Object/None if `quiet=False`,
|
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)
|
is_string = isinstance(searchdata, basestring)
|
||||||
|
|
||||||
|
|
||||||
if is_string:
|
if is_string:
|
||||||
# searchdata is a string; wrap some common self-references
|
# searchdata is a string; wrap some common self-references
|
||||||
if searchdata.lower() in ("here", ):
|
if searchdata.lower() in ("here", ):
|
||||||
|
|
@ -367,6 +369,9 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
|
||||||
if searchdata.lower() in ("me", "self",):
|
if searchdata.lower() in ("me", "self",):
|
||||||
return [self] if quiet else 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:
|
if use_nicks:
|
||||||
# do nick-replacement on search
|
# do nick-replacement on search
|
||||||
searchdata = self.nicks.nickreplace(searchdata, categories=("object", "account"), include_account=True)
|
searchdata = self.nicks.nickreplace(searchdata, categories=("object", "account"), include_account=True)
|
||||||
|
|
|
||||||
|
|
@ -575,6 +575,10 @@ class TypedObject(SharedMemoryModel):
|
||||||
ppos = _PERMISSION_HIERARCHY.index(perm)
|
ppos = _PERMISSION_HIERARCHY.index(perm)
|
||||||
return any(True for hpos, hperm in enumerate(_PERMISSION_HIERARCHY)
|
return any(True for hpos, hperm in enumerate(_PERMISSION_HIERARCHY)
|
||||||
if hperm in perms and hpos > ppos)
|
if hperm in perms and hpos > ppos)
|
||||||
|
# we ignore pluralization (english only)
|
||||||
|
if perm.endswith("s"):
|
||||||
|
return self.check_permstring(perm[:-1])
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue