mirror of
https://github.com/evennia/evennia.git
synced 2026-03-26 09:46:32 +01:00
Changed the way unloggedin commands work. Rather than the cmdhander having a special state for unlogged-in commands, the session itself simply stores the cmdset from settings.CMDSET_UNLOGGEDIN. Clean and efficient and also gives a lot more freedom for creating custom login mechanisms (notably it opens the door to using menu systems).
This commit is contained in:
parent
0ed692c19c
commit
2b2d27ed39
10 changed files with 119 additions and 77 deletions
|
|
@ -624,3 +624,15 @@ def string_from_module(modpath, variable=None):
|
|||
if not mvars:
|
||||
return None
|
||||
return mvars[random.randint(0, len(mvars)-1)]
|
||||
|
||||
def init_new_player(player):
|
||||
"""
|
||||
Helper method to call all hooks, set flags etc on a newly created
|
||||
player (and potentially their character, if it exists already)
|
||||
"""
|
||||
# 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
|
||||
player.db.FIRST_LOGIN = True
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue