Minor fixes to handle addition of created chars to account playable characters list, and check for multisession mode compliance.
This commit is contained in:
parent
2d27a54da9
commit
882e6130e4
2 changed files with 12 additions and 3 deletions
|
|
@ -733,7 +733,8 @@ class DefaultAccount(with_metaclass(TypeclassBase, AccountDB)):
|
||||||
|
|
||||||
if character:
|
if character:
|
||||||
# Update playable character list
|
# Update playable character list
|
||||||
account.db._playable_characters.append(character)
|
if character not in account.characters:
|
||||||
|
account.db._playable_characters.append(character)
|
||||||
|
|
||||||
# We need to set this to have @ic auto-connect to this character
|
# We need to set this to have @ic auto-connect to this character
|
||||||
account.db._last_puppet = character
|
account.db._last_puppet = character
|
||||||
|
|
|
||||||
|
|
@ -1944,12 +1944,20 @@ class DefaultCharacter(DefaultObject):
|
||||||
locks = kwargs.pop('locks', '')
|
locks = kwargs.pop('locks', '')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
# Check to make sure account does not have too many chars
|
||||||
|
if len(account.characters) >= settings.MAX_NR_CHARACTERS:
|
||||||
|
errors.append("There are too many characters associated with this account.")
|
||||||
|
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: obj.db.creator_id = account.id
|
if account:
|
||||||
|
obj.db.creator_id = account.id
|
||||||
|
if obj not in account.characters:
|
||||||
|
account.db._playable_characters.append(obj)
|
||||||
|
|
||||||
# Add locks
|
# Add locks
|
||||||
if not locks and account:
|
if not locks and account:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue