Changed the version and version mismatch disconnect behavior

This commit is contained in:
Uriziel 2014-10-11 22:45:52 +02:00
parent 51e2e42293
commit feef564d40
4 changed files with 8 additions and 6 deletions

View File

@ -1,3 +1,3 @@
version = '1.2.9'
milestone = 'Pineapple, Pulverize and Destroy!'
version = '1.3.0'
milestone = 'Akki'
projectURL = 'http://syncplay.pl/'

View File

@ -270,7 +270,7 @@ en = {
"password-required-server-error" : "Password required",
"wrong-password-server-error" : "Wrong password supplied",
"hello-server-error" : "Not enough Hello arguments",
"version-mismatch-server-error" : "Mismatch between versions of client and server"
"version-mismatch-server-error" : "Mismatch between versions of client and server, please update your client or server software. Current client version is {}, while the server version: {}"
}

View File

@ -293,14 +293,16 @@ class SyncServerProtocol(JSONCommandProtocol):
username, serverPassword, roomName, version = self._extractHelloArguments(hello)
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"))
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(version)
self.sendHello(syncplay.version)
def setWatcher(self, watcher):
self._watcher = watcher

View File

@ -78,7 +78,7 @@ class SyncFactory(Factory):
self._roomManager.broadcast(watcher, l)
def removeWatcher(self, watcher):
if watcher.getRoom():
if watcher and watcher.getRoom():
self.sendLeftMessage(watcher)
self._roomManager.removeWatcher(watcher)