Corrected command.msg function to work with the changes introducted with MULTISESSION_MODE=3, e.g. the replacement of session id (int) for a session handler object.

This commit is contained in:
Duarte Cordeiro 2014-09-25 11:22:06 +01:00 committed by Griatch
parent 50b072170f
commit 48f145031b

View file

@ -241,7 +241,16 @@ class Command(object):
if not sessid:
if hasattr(to_obj, "sessid"):
# this is the case when to_obj is e.g. a Character
sessid = all_sessions and None or to_obj.sessid
toobj_sessions = to_obj.sessid.get()
# If to_obj has more than one session MULTISESSION_MODE=3
# we need to send to every session.
#(setting it to None, does it)
if len(toobj_sessions)>1:
session_tosend=None
else:
session_tosend=toobj_sessions[0]
sessid = all_sessions and None or session_tosend
elif to_obj == self.caller:
# this is the case if to_obj is the calling Player
sessid = all_sessions and None or self.sessid