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
|
|
@ -77,31 +77,13 @@ def remove_session(session):
|
|||
pass
|
||||
|
||||
|
||||
def session_from_object(targobject):
|
||||
def sessions_from_object(targ_object):
|
||||
"""
|
||||
Return the session object given a object (if there is one open).
|
||||
Returns a list of matching session objects, or None if there are no matches.
|
||||
|
||||
session_list: (list) The server's session_list attribute.
|
||||
targobject: (Object) The object to match.
|
||||
"""
|
||||
results = [prospect for prospect in session_list if prospect.get_pobject() == targobject]
|
||||
if results:
|
||||
return results[0]
|
||||
else:
|
||||
return False
|
||||
|
||||
def session_from_dbref(dbstring):
|
||||
"""
|
||||
Return the session object given a dbref (if there is one open).
|
||||
|
||||
dbstring: (int) The dbref number to match against.
|
||||
"""
|
||||
if is_dbref(dbstring):
|
||||
results = [prospect for prospect in session_list if prospect.get_pobject().dbref_match(dbstring)]
|
||||
if results:
|
||||
return results[0]
|
||||
else:
|
||||
return False
|
||||
return [prospect for prospect in session_list if prospect.get_pobject() == targ_object]
|
||||
|
||||
def announce_all(message, with_ann_prefix=True):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue