mirror of
https://github.com/Syncplay/syncplay
synced 2025-02-21 13:36:48 +00:00
Changed the version and version mismatch disconnect behavior
This commit is contained in:
parent
51e2e42293
commit
feef564d40
@ -1,3 +1,3 @@
|
||||
version = '1.2.9'
|
||||
milestone = 'Pineapple, Pulverize and Destroy!'
|
||||
version = '1.3.0'
|
||||
milestone = 'Akki'
|
||||
projectURL = 'http://syncplay.pl/'
|
||||
|
@ -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: {}"
|
||||
|
||||
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user