From 48f145031bb3583e88304136741661b8fb44657a Mon Sep 17 00:00:00 2001 From: Duarte Cordeiro Date: Thu, 25 Sep 2014 11:22:06 +0100 Subject: [PATCH] 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. --- src/commands/command.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/commands/command.py b/src/commands/command.py index 43cf87a4a..9ab18aa24 100644 --- a/src/commands/command.py +++ b/src/commands/command.py @@ -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