From 96af8a439ccaed97d8c402fa6a9c8668fcd587a4 Mon Sep 17 00:00:00 2001 From: Rod A Santiago Date: Fri, 19 Aug 2016 16:58:03 -0700 Subject: [PATCH] started adding server code for joining experiments --- daemon/core/misc/apibridge.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/daemon/core/misc/apibridge.py b/daemon/core/misc/apibridge.py index 69841c0b..f1bd23a2 100644 --- a/daemon/core/misc/apibridge.py +++ b/daemon/core/misc/apibridge.py @@ -363,19 +363,23 @@ class CoreApiBridge(object): def processApi2SessionMsg(self, message, purpose): - if self.handler.debug: - self.info('Received session request message') if purpose == coreapi2.ADD: + if self.handler.debug: + self.info('Received ADD session request message') + legacymsgs = [] legacymsgs.append(wrapper.RegMsg.instantiate(0, gui='true')) return legacymsgs # The response will be sent to the API2 client when a legacy session message is received from the daemon elif purpose == coreapi2.MODIFY: + if self.handler.debug: + self.info('Received MODIFY session request message') + legacymsgs = [] if message.HasField("experiment"): exp = message.experiment if exp.HasField("experimentId"): - expId = str(experiment.experimentId) + expId = str(exp.experimentId) response = coreapi2.CoreMessage() response.experiment.experimentId = exp.experimentId; response.purpose = purpose @@ -385,6 +389,8 @@ class CoreApiBridge(object): if expId.startswith('_'): try: legacySessNo = int(expId[1:]) + legacymsgs.append(wrapper.ConfMsg.instantiate("all", + coreapi.CONF_TYPE_FLAGS_RESET)) legacymsgs.append(wrapper.RegMsg.instantiate(0, gui='true')) legacymsgs.append(wrapper.SessionMsg.instantiate(0, legacySessNo)) except: