mirror of
https://github.com/evennia/evennia.git
synced 2026-04-02 22:17:17 +02:00
Fixed initial_setup and set up the _playable_characters attribute on all players, for handling multi-accounts. Still some issues with how the character's permissions is accessed.
This commit is contained in:
parent
70b8f074f1
commit
b82a75d816
6 changed files with 40 additions and 57 deletions
|
|
@ -53,7 +53,7 @@ _GA = object.__getattribute__
|
|||
#
|
||||
|
||||
def create_object(typeclass, key=None, location=None,
|
||||
home=None, player=None, permissions=None, locks=None,
|
||||
home=None, permissions=None, locks=None,
|
||||
aliases=None, destination=None, report_to=None):
|
||||
"""
|
||||
Create a new in-game object. Any game object is a combination
|
||||
|
|
@ -116,11 +116,6 @@ def create_object(typeclass, key=None, location=None,
|
|||
# from now on we can use the typeclass object
|
||||
# as if it was the database object.
|
||||
|
||||
if player:
|
||||
# link a player and the object together
|
||||
new_object.player = player
|
||||
player.obj = new_object
|
||||
|
||||
new_object.destination = destination
|
||||
|
||||
# call the hook method. This is where all at_creation
|
||||
|
|
@ -397,11 +392,8 @@ def create_player(name, email, password,
|
|||
typeclass=None,
|
||||
is_superuser=False,
|
||||
locks=None, permissions=None,
|
||||
create_character=True, character_typeclass=None,
|
||||
character_location=None, character_home=None,
|
||||
player_dbobj=None, report_to=None):
|
||||
|
||||
|
||||
"""
|
||||
This creates a new player, handling the creation of the User
|
||||
object and its associated Player object.
|
||||
|
|
@ -510,17 +502,6 @@ def create_player(name, email, password,
|
|||
if locks:
|
||||
new_player.locks.add(locks)
|
||||
|
||||
# create *in-game* 'player' object
|
||||
if create_character:
|
||||
if not character_typeclass:
|
||||
character_typeclass = settings.BASE_CHARACTER_TYPECLASS
|
||||
# creating the object automatically links the player
|
||||
# and object together by player.obj <-> obj.player
|
||||
new_character = create_object(character_typeclass, key=name,
|
||||
location=character_location, home=character_location,
|
||||
permissions=permissions,
|
||||
player=new_player, report_to=report_to)
|
||||
return new_character
|
||||
return new_player
|
||||
except Exception:
|
||||
# a failure in creating the character
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue