mirror of
https://github.com/evennia/evennia.git
synced 2026-04-18 14:19:05 +02:00
Merge branch 'develop' into develop-py3
This commit is contained in:
commit
d6f41d7148
2 changed files with 13 additions and 9 deletions
|
|
@ -211,7 +211,9 @@ class CmdNick(COMMAND_DEFAULT_CLASS):
|
||||||
if not specified_nicktype:
|
if not specified_nicktype:
|
||||||
nicktypes = ("object", "account", "inputline")
|
nicktypes = ("object", "account", "inputline")
|
||||||
for nicktype in nicktypes:
|
for nicktype in nicktypes:
|
||||||
nicks = utils.make_iter(caller.nicks.get(category=nicktype, return_obj=True))
|
nicks = [nick for nick in
|
||||||
|
utils.make_iter(caller.nicks.get(category=nicktype, return_obj=True))
|
||||||
|
if nick]
|
||||||
for nick in nicks:
|
for nick in nicks:
|
||||||
_, _, nick, repl = nick.value
|
_, _, nick, repl = nick.value
|
||||||
if nick.startswith(self.lhs):
|
if nick.startswith(self.lhs):
|
||||||
|
|
|
||||||
|
|
@ -392,9 +392,11 @@ 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 or None, optional): if True/False, active/deactivate the use of
|
use_dbref (bool or None, optional): If `True`, allow to enter e.g. a query "#123"
|
||||||
#dbref as valid global search arguments. If None, check against a permission
|
to find an object (globally) by its database-id 123. If `False`, the string "#123"
|
||||||
('Builder' by default).
|
will be treated like a normal string. If `None` (default), the ability to query by
|
||||||
|
#dbref is turned on if `self` has the permission 'Builder' and is turned off
|
||||||
|
otherwise.
|
||||||
|
|
||||||
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`,
|
||||||
|
|
@ -430,8 +432,8 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
|
||||||
# only allow exact matching if searching the entire database
|
# only allow exact matching if searching the entire database
|
||||||
# or unique #dbrefs
|
# or unique #dbrefs
|
||||||
exact = True
|
exact = True
|
||||||
else:
|
|
||||||
# TODO: write code...if candidates is None:
|
elif candidates is None:
|
||||||
# no custom candidates given - get them automatically
|
# no custom candidates given - get them automatically
|
||||||
if location:
|
if location:
|
||||||
# location(s) were given
|
# location(s) were given
|
||||||
|
|
@ -1947,13 +1949,13 @@ class DefaultCharacter(DefaultObject):
|
||||||
if len(account.characters) >= settings.MAX_NR_CHARACTERS:
|
if len(account.characters) >= settings.MAX_NR_CHARACTERS:
|
||||||
errors.append("There are too many characters associated with this account.")
|
errors.append("There are too many characters associated with this account.")
|
||||||
return obj, errors
|
return obj, errors
|
||||||
|
|
||||||
# Create the Character
|
# Create the Character
|
||||||
obj = create.create_object(**kwargs)
|
obj = create.create_object(**kwargs)
|
||||||
|
|
||||||
# Record creator id and creation IP
|
# Record creator id and creation IP
|
||||||
if ip: obj.db.creator_ip = ip
|
if ip: obj.db.creator_ip = ip
|
||||||
if account:
|
if account:
|
||||||
obj.db.creator_id = account.id
|
obj.db.creator_id = account.id
|
||||||
if obj not in account.characters:
|
if obj not in account.characters:
|
||||||
account.db._playable_characters.append(obj)
|
account.db._playable_characters.append(obj)
|
||||||
|
|
@ -1970,7 +1972,7 @@ class DefaultCharacter(DefaultObject):
|
||||||
# If no description is set, set a default description
|
# If no description is set, set a default description
|
||||||
if description or not obj.db.desc:
|
if description or not obj.db.desc:
|
||||||
obj.db.desc = description if description else "This is a character."
|
obj.db.desc = description if description else "This is a character."
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
errors.append("An error occurred while creating this '%s' object." % key)
|
errors.append("An error occurred while creating this '%s' object." % key)
|
||||||
logger.log_err(e)
|
logger.log_err(e)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue