Fixed some bugs with new server code
This commit is contained in:
parent
c1d29e734b
commit
9769570a25
@ -92,6 +92,7 @@ class SyncFactory(Factory):
|
|||||||
room = watcher.getRoom()
|
room = watcher.getRoom()
|
||||||
paused, position = room.isPaused(), watcher.getPosition()
|
paused, position = room.isPaused(), watcher.getPosition()
|
||||||
setBy = watcher
|
setBy = watcher
|
||||||
|
room.setPosition(watcher.getPosition(), setBy)
|
||||||
l = lambda w: w.sendState(position, paused, doSeek, setBy, True)
|
l = lambda w: w.sendState(position, paused, doSeek, setBy, True)
|
||||||
self._roomManager.broadcastRoom(watcher, l)
|
self._roomManager.broadcastRoom(watcher, l)
|
||||||
|
|
||||||
@ -193,6 +194,11 @@ class Room(object):
|
|||||||
self._playState = paused
|
self._playState = paused
|
||||||
self._setBy = setBy
|
self._setBy = setBy
|
||||||
|
|
||||||
|
def setPosition(self, position, setBy=None):
|
||||||
|
for watcher in self._watchers.itervalues():
|
||||||
|
watcher.setPosition(position)
|
||||||
|
self._setBy = setBy
|
||||||
|
|
||||||
def isPlaying(self):
|
def isPlaying(self):
|
||||||
return self._playState == self.STATE_PLAYING
|
return self._playState == self.STATE_PLAYING
|
||||||
|
|
||||||
@ -252,6 +258,10 @@ class Watcher(object):
|
|||||||
def getFile(self):
|
def getFile(self):
|
||||||
return self._file
|
return self._file
|
||||||
|
|
||||||
|
def setPosition(self, position):
|
||||||
|
self._position = position
|
||||||
|
self._lastUpdatedOn = time.time()
|
||||||
|
|
||||||
def getPosition(self):
|
def getPosition(self):
|
||||||
if self._position is None:
|
if self._position is None:
|
||||||
return None
|
return None
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user