Updated room command

room cmd now defaults to filename
server now allows more characters in room names
This commit is contained in:
Uriziel 2012-09-24 13:39:35 +02:00
parent 82f01447e2
commit 2dbd814fa4
2 changed files with 2 additions and 2 deletions

View File

@ -129,7 +129,7 @@ class SyncServerProtocol(CommandProtocol):
def room(self, args):
watcher = self.factory.watchers.get(self.__protocol)
old_room = watcher.room
watcher.room = str(re.sub('[^\w]','',args[0]))
watcher.room = str(args[0].encode('ascii','replace'))
self.factory.broadcast(watcher, lambda receiver: receiver.watcher_proto.sender.send_room(watcher.name,watcher.room))
if not watcher.room in self.factory.paused:
self.factory.paused[watcher.room] = True

View File

@ -72,7 +72,7 @@ class ConsoleUI(threading.Thread):
elif matched_room:
room = matched_room.group(2)
if room == None:
room = 'default'
room = self._syncplayClient.users.currentUser.filename
self._syncplayClient.users.currentUser.room = room
self._syncplayClient.checkIfFileMatchesOthers()
self._syncplayClient.protocol.sender.send_room(room)