Fixed getting "left" message on isolate-rooms

This commit is contained in:
Uriziel 2012-12-14 20:50:34 +01:00
parent 706ca6fea4
commit 4196ba1ec2
1 changed files with 6 additions and 5 deletions

View File

@ -138,15 +138,16 @@ class SyncFactory(Factory):
self.broadcastRoom(watcher.watcherProtocol, l)
def removeWatcher(self, watcherProtocol):
watcher = self._removeWatcherFromTheRoom(watcherProtocol)
watcher = self.getWatcher(watcherProtocol)
if(not watcher):
return
watcher.deactivate()
print "{0} left server".format(watcher.name)
self._deleteRoomIfEmpty(watcher.room)
l = lambda w: w.sendUserSetting(watcher.name, watcher.room, None, {"left": True})
self.broadcast(watcherProtocol, l)
self._removeWatcherFromTheRoom(watcherProtocol)
watcher.deactivate()
self._deleteRoomIfEmpty(watcher.room)
print "{0} left server".format(watcher.name)
def watcherGetUsername(self, watcherProtocol):
return self.getWatcher(watcherProtocol).name