From fcad52da50c479d524681286f7a35de09a4a3922 Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Tue, 7 May 2019 14:01:37 +0200 Subject: [PATCH] Disable interruptions --- hugvey/story.py | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/hugvey/story.py b/hugvey/story.py index 9b20197..ebf96b9 100644 --- a/hugvey/story.py +++ b/hugvey/story.py @@ -1172,26 +1172,16 @@ class Story(object): # messages that come in, in the case google is faster than our playbackFinish event. # (if this setup doesn't work, try to test on self.lastMsgFinish time anyway) # it keeps tricky with all these run conditions - if len(self.interruptionDiversions) and not self.currentDiversion and not self.allowReplyInterrupt: - self.logger.warn("diverge when speech during playing message") - diversion = random.choice(self.interruptionDiversions) - #: :type diversion: Diversion - r = await diversion.divergeIfNeeded(self, None) - print(r) # is always needed :-) - else: +# if len(self.interruptionDiversions) and not self.currentDiversion and not self.allowReplyInterrupt: +# self.logger.warn("diverge when speech during playing message") +# diversion = random.choice(self.interruptionDiversions) +# #: :type diversion: Diversion +# r = await diversion.divergeIfNeeded(self, None) +# print(r) # is always needed :-) +# else: self.logger.info("ignore speech during playing message") continue -# DEPRECATED WAY OF DOING IT: -# message is still playing: -# if self.currentMessage and not self.lastMsgFinishTime and self.previousReply and self.previousReply.forMessage.interruptCount < 4: -# timeDiff = self.timer.getElapsed() - self.previousReply.forMessage.getFinishedTime() -# if self.previousReply.forMessage.afterrunTime > timeDiff: -# #interrupt only in given interval: -# self.logger.warn("Interrupt message, replay {}".format(self.previousReply.forMessage.id)) -# self.currentReply = self.previousReply -# self.previousReply.forMessage.interruptCount += 1 -# self.currentMessage = await self.setCurrentMessage(self.previousReply.forMessage, self.previousReply) # log if somebody starts speaking if self.currentReply is None: