mirror of
https://github.com/evennia/evennia.git
synced 2026-04-02 22:17:17 +02:00
Fixed player creation, removing FIRST_LOGIN flag on character (keeping it on player)
This commit is contained in:
parent
71346dcc67
commit
db8af97ab2
3 changed files with 13 additions and 7 deletions
|
|
@ -165,14 +165,14 @@ class CmdUnconnectedCreate(MuxCommand):
|
|||
permissions=permissions)
|
||||
|
||||
# create character to go with player
|
||||
new_character = create_object(character_typeclass, key=name,
|
||||
new_character = create.create_object(typeclass, key=playername,
|
||||
location=default_home, home=default_home,
|
||||
permissions=permissions)
|
||||
# set list
|
||||
new_player.db._playable_characters.append(new_character)
|
||||
|
||||
except Exception:
|
||||
session.msg("There was an error creating the default Player/Character:\n%s\n If this problem persists, contact an admin.")
|
||||
except Exception, e:
|
||||
session.msg("There was an error creating the default Player/Character:\n%s\n If this problem persists, contact an admin." % e)
|
||||
return
|
||||
|
||||
# This needs to be called so the engine knows this player is logging in for the first time.
|
||||
|
|
|
|||
|
|
@ -483,11 +483,17 @@ class PlayerDB(TypedObject):
|
|||
"""
|
||||
Return session with given sessid connected to this player.
|
||||
"""
|
||||
return SESSIONS.sessions_from_player(self, sessid=sessid)
|
||||
global _SESSIONS
|
||||
if not _SESSIONS:
|
||||
from src.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
return _SESSIONS.sessions_from_player(self, sessid=sessid)
|
||||
|
||||
def get_all_sessions(self):
|
||||
"Return all sessions connected to this player"
|
||||
return SESSIONS.sessions_from_player(self)
|
||||
global _SESSIONS
|
||||
if not _SESSIONS:
|
||||
from src.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
return _SESSIONS.sessions_from_player(self)
|
||||
|
||||
def get_character(self, sessid=None, character=None, return_dbobj=False):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -908,8 +908,8 @@ def init_new_player(player):
|
|||
"""
|
||||
# the FIRST_LOGIN flags are necessary for the system to call
|
||||
# the relevant first-login hooks.
|
||||
if player.character:
|
||||
player.character.db.FIRST_LOGIN = True
|
||||
#if player.character:
|
||||
# player.character.db.FIRST_LOGIN = True
|
||||
player.db.FIRST_LOGIN = True
|
||||
|
||||
def string_similarity(string1, string2):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue