Fix the BC with 1.2.9

This commit is contained in:
Uriziel 2014-10-12 20:26:04 +02:00
parent feef564d40
commit ea119fca79
2 changed files with 6 additions and 8 deletions

View File

@ -294,15 +294,12 @@ class SyncServerProtocol(JSONCommandProtocol):
if not username or not roomName or not version:
self.dropWithError(getMessage("hello-server-error"))
return
elif version.split(".")[0:2] != syncplay.version.split(".")[0:2]:
self.dropWithError(getMessage("version-mismatch-server-error").format(version, syncplay.version))
return
else:
if not self._checkPassword(serverPassword):
return
self._factory.addWatcher(self, username, roomName)
self._logged = True
self.sendHello(syncplay.version)
self.sendHello(version)
def setWatcher(self, watcher):
self._watcher = watcher
@ -314,7 +311,7 @@ class SyncServerProtocol(JSONCommandProtocol):
userIp = self.transport.getPeer().host
room = self._watcher.getRoom()
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)
self.sendMessage({"Hello": hello})

View File

@ -94,7 +94,7 @@ class SyncFactory(Factory):
l = lambda w: w.sendSetting(watcher.getName(), watcher.getRoom(), watcher.getFile(), None)
self._roomManager.broadcast(watcher, l)
def forcePositionUpdate(self, watcher, doSeek):
def forcePositionUpdate(self, watcher, doSeek, watcherPauseState):
room = watcher.getRoom()
if room.canControl(watcher):
paused, position = room.isPaused(), watcher.getPosition()
@ -103,7 +103,8 @@ class SyncFactory(Factory):
room.setPosition(watcher.getPosition(), setBy)
self._roomManager.broadcastRoom(watcher, l)
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):
return self._roomManager.getAllWatchersForUser(forUser)
@ -398,7 +399,7 @@ class Watcher(object):
position = self._updatePositionByAge(messageAge, paused, position)
self.setPosition(position)
if doSeek or pauseChanged:
self._server.forcePositionUpdate(self, doSeek)
self._server.forcePositionUpdate(self, doSeek, paused)
class ConfigurationGetter(object):