Fix the BC with 1.2.9
This commit is contained in:
parent
feef564d40
commit
ea119fca79
@ -294,15 +294,12 @@ class SyncServerProtocol(JSONCommandProtocol):
|
|||||||
if not username or not roomName or not version:
|
if not username or not roomName or not version:
|
||||||
self.dropWithError(getMessage("hello-server-error"))
|
self.dropWithError(getMessage("hello-server-error"))
|
||||||
return
|
return
|
||||||
elif version.split(".")[0:2] != syncplay.version.split(".")[0:2]:
|
|
||||||
self.dropWithError(getMessage("version-mismatch-server-error").format(version, syncplay.version))
|
|
||||||
return
|
|
||||||
else:
|
else:
|
||||||
if not self._checkPassword(serverPassword):
|
if not self._checkPassword(serverPassword):
|
||||||
return
|
return
|
||||||
self._factory.addWatcher(self, username, roomName)
|
self._factory.addWatcher(self, username, roomName)
|
||||||
self._logged = True
|
self._logged = True
|
||||||
self.sendHello(syncplay.version)
|
self.sendHello(version)
|
||||||
|
|
||||||
def setWatcher(self, watcher):
|
def setWatcher(self, watcher):
|
||||||
self._watcher = watcher
|
self._watcher = watcher
|
||||||
@ -314,7 +311,7 @@ class SyncServerProtocol(JSONCommandProtocol):
|
|||||||
userIp = self.transport.getPeer().host
|
userIp = self.transport.getPeer().host
|
||||||
room = self._watcher.getRoom()
|
room = self._watcher.getRoom()
|
||||||
if room: hello["room"] = {"name": room.getName()}
|
if room: hello["room"] = {"name": room.getName()}
|
||||||
hello["version"] = syncplay.version
|
hello["version"] = clientVersion # syncplay.version - Don't BC with 1.2.x
|
||||||
hello["motd"] = self._factory.getMotd(userIp, username, room, clientVersion)
|
hello["motd"] = self._factory.getMotd(userIp, username, room, clientVersion)
|
||||||
self.sendMessage({"Hello": hello})
|
self.sendMessage({"Hello": hello})
|
||||||
|
|
||||||
|
|||||||
@ -94,7 +94,7 @@ class SyncFactory(Factory):
|
|||||||
l = lambda w: w.sendSetting(watcher.getName(), watcher.getRoom(), watcher.getFile(), None)
|
l = lambda w: w.sendSetting(watcher.getName(), watcher.getRoom(), watcher.getFile(), None)
|
||||||
self._roomManager.broadcast(watcher, l)
|
self._roomManager.broadcast(watcher, l)
|
||||||
|
|
||||||
def forcePositionUpdate(self, watcher, doSeek):
|
def forcePositionUpdate(self, watcher, doSeek, watcherPauseState):
|
||||||
room = watcher.getRoom()
|
room = watcher.getRoom()
|
||||||
if room.canControl(watcher):
|
if room.canControl(watcher):
|
||||||
paused, position = room.isPaused(), watcher.getPosition()
|
paused, position = room.isPaused(), watcher.getPosition()
|
||||||
@ -103,7 +103,8 @@ class SyncFactory(Factory):
|
|||||||
room.setPosition(watcher.getPosition(), setBy)
|
room.setPosition(watcher.getPosition(), setBy)
|
||||||
self._roomManager.broadcastRoom(watcher, l)
|
self._roomManager.broadcastRoom(watcher, l)
|
||||||
else:
|
else:
|
||||||
watcher.sendState(room.getPosition(), room.isPaused(), doSeek, room.getSetBy(), True)
|
watcher.sendState(room.getPosition(), watcherPauseState, False, watcher, True) # Fixes BC break with 1.2.x
|
||||||
|
watcher.sendState(room.getPosition(), room.isPaused(), True, room.getSetBy(), True)
|
||||||
|
|
||||||
def getAllWatchersForUser(self, forUser):
|
def getAllWatchersForUser(self, forUser):
|
||||||
return self._roomManager.getAllWatchersForUser(forUser)
|
return self._roomManager.getAllWatchersForUser(forUser)
|
||||||
@ -398,7 +399,7 @@ class Watcher(object):
|
|||||||
position = self._updatePositionByAge(messageAge, paused, position)
|
position = self._updatePositionByAge(messageAge, paused, position)
|
||||||
self.setPosition(position)
|
self.setPosition(position)
|
||||||
if doSeek or pauseChanged:
|
if doSeek or pauseChanged:
|
||||||
self._server.forcePositionUpdate(self, doSeek)
|
self._server.forcePositionUpdate(self, doSeek, paused)
|
||||||
|
|
||||||
|
|
||||||
class ConfigurationGetter(object):
|
class ConfigurationGetter(object):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user