mirror of
https://github.com/evennia/evennia.git
synced 2026-03-25 01:06:32 +01:00
Huge overhaul in the way objects and sessions are used with commands. We now pass all commands through objects (aside from unlogged commands), which means session.msg() is now deprecated for any use other than unlogged out.
As a side-effect of all of this, logging in more than once acts as behaves now. Also, this will allow things/rooms/exits (IE: not players) or un-logged in players to run commands or be forced to run them via @fo. All of this will bring us more in-line with MUX behavior.
This commit is contained in:
parent
50f4d04096
commit
9407eb0ee4
20 changed files with 680 additions and 712 deletions
|
|
@ -9,14 +9,13 @@ import time
|
|||
from src import comsys
|
||||
|
||||
class EvenniaBasicPlayer(object):
|
||||
def at_pre_login(self):
|
||||
def at_pre_login(self, session):
|
||||
"""
|
||||
Everything done here takes place before the player is actually
|
||||
'logged in', in a sense that they're not ready to send logged in
|
||||
commands or receive communication.
|
||||
"""
|
||||
pobject = self.source_obj
|
||||
session = pobject.get_session()
|
||||
|
||||
# Load the player's channels from their JSON __CHANLIST attribute.
|
||||
comsys.load_object_channels(pobject)
|
||||
|
|
@ -24,15 +23,14 @@ class EvenniaBasicPlayer(object):
|
|||
pobject.set_attribute("Lastsite", "%s" % (session.address[0],))
|
||||
pobject.set_flag("CONNECTED", True)
|
||||
|
||||
def at_post_login(self):
|
||||
def at_post_login(self, session):
|
||||
"""
|
||||
The user is now logged in. This is what happens right after the moment
|
||||
they are 'connected'.
|
||||
"""
|
||||
pobject = self.source_obj
|
||||
session = pobject.get_session()
|
||||
|
||||
session.msg("You are now logged in as %s." % (pobject.name,))
|
||||
pobject.emit_to("You are now logged in as %s." % (pobject.name,))
|
||||
pobject.get_location().emit_to_contents("%s has connected." %
|
||||
(pobject.get_name(show_dbref=False),), exclude=pobject)
|
||||
session.execute_cmd("look")
|
||||
pobject.execute_cmd("look")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue