From 6e11d59ddc366d8b058b8c26e3d0f60f24126320 Mon Sep 17 00:00:00 2001 From: Uriziel Date: Tue, 1 Jan 2013 13:04:58 +0100 Subject: [PATCH] State send interval exported to constants --- syncplay/constants.py | 2 +- syncplay/server.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/syncplay/constants.py b/syncplay/constants.py index fd3465a..e388b09 100644 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -15,7 +15,7 @@ SLOWDOWN_RESET_THRESHOLD = 0.1 DIFFFERENT_DURATION_THRESHOLD = 1 PROTOCOL_TIMEOUT = 5 RECONNECT_RETRIES = 10 - +SERVER_STATE_INTERVAL = 1 #Usually there's no need to adjust these COMMANDS_UNDO = ["u", "undo", "revert"] diff --git a/syncplay/server.py b/syncplay/server.py index 9bf5709..522ff7b 100644 --- a/syncplay/server.py +++ b/syncplay/server.py @@ -238,9 +238,9 @@ class Watcher(object): _, position = self.factory.getRoomPausedAndPosition(self.room) return position - def scheduleSendState(self, when=1): + def scheduleSendState(self): self._sendStateTimer = task.LoopingCall(self.sendState) - self._sendStateTimer.start(when, True) + self._sendStateTimer.start(constants.SERVER_STATE_INTERVAL, True) def sendState(self): self.factory.sendState(self.watcherProtocol) @@ -248,7 +248,7 @@ class Watcher(object): def resetStateTimer(self): if(self._sendStateTimer): self._sendStateTimer.stop() - self._sendStateTimer.start(1) + self._sendStateTimer.start(constants.SERVER_STATE_INTERVAL) def deactivate(self): if(self._sendStateTimer):