Fixed room changing

This commit is contained in:
Uriziel 2012-12-26 21:26:46 +01:00
parent eee85223d1
commit ce217a8fb1
1 changed files with 3 additions and 2 deletions

View File

@ -82,7 +82,7 @@ class ConsoleUI(threading.Thread):
return False return False
def _executeCommand(self, data): def _executeCommand(self, data):
command = re.match(r"^(.+)(?:\ (.+))?", data) command = re.match(r"^([^\ ]+)(?:\ (.+))?", data)
if(not command): if(not command):
return return
if(command.group(1) in ["u", "undo", "revert"]): if(command.group(1) in ["u", "undo", "revert"]):
@ -94,12 +94,13 @@ class ConsoleUI(threading.Thread):
elif (command.group(1) in ["p", "play", "pause"]): elif (command.group(1) in ["p", "play", "pause"]):
self._syncplayClient.setPaused(not self._syncplayClient.getPlayerPaused()) self._syncplayClient.setPaused(not self._syncplayClient.getPlayerPaused())
elif (command.group(1) in ["r", "room"]): elif (command.group(1) in ["r", "room"]):
room = command.group(1) room = command.group(2)
if room == None: if room == None:
if self._syncplayClient.userlist.currentUser.file: if self._syncplayClient.userlist.currentUser.file:
room = self._syncplayClient.userlist.currentUser.file["name"] room = self._syncplayClient.userlist.currentUser.file["name"]
else: else:
room = self._syncplayClient.defaultRoom room = self._syncplayClient.defaultRoom
self._syncplayClient.setRoom(room) self._syncplayClient.setRoom(room)
self._syncplayClient.sendRoom() self._syncplayClient.sendRoom()
else: else: