MCPcopy Create free account
hub / github.com/Syncplay/syncplay / setWatcherRoom

Method setWatcherRoom

syncplay/server.py:131–145  ·  view source on GitHub ↗
(self, watcher, roomName, asJoin=False)

Source from the content-addressed store, hash-verified

129 self.setWatcherRoom(watcher, roomName, asJoin=True)
130
131 def setWatcherRoom(self, watcher, roomName, asJoin=False):
132 roomName = truncateText(roomName, constants.MAX_ROOM_NAME_LENGTH)
133 self._roomManager.moveWatcher(watcher, roomName)
134 if asJoin:
135 self.sendJoinMessage(watcher)
136 else:
137 self.sendRoomSwitchMessage(watcher)
138
139 room = watcher.getRoom()
140 roomSetByName = room.getSetBy().getName() if room.getSetBy() else None
141 watcher.setPlaylist(roomSetByName, room.getPlaylist())
142 watcher.setPlaylistIndex(roomSetByName, room.getPlaylistIndex())
143 if RoomPasswordProvider.isControlledRoom(roomName):
144 for controller in room.getControllers():
145 watcher.sendControlledRoomAuthStatus(True, controller, roomName)
146
147 def sendRoomSwitchMessage(self, watcher):
148 l = lambda w: w.sendSetting(watcher.getName(), watcher.getRoom(), None, None)

Callers 2

addWatcherMethod · 0.95
handleSetMethod · 0.80

Calls 14

sendJoinMessageMethod · 0.95
sendRoomSwitchMessageMethod · 0.95
truncateTextFunction · 0.90
getSetByMethod · 0.80
getPlaylistMethod · 0.80
getPlaylistIndexMethod · 0.80
isControlledRoomMethod · 0.80
moveWatcherMethod · 0.45
getRoomMethod · 0.45
getNameMethod · 0.45
setPlaylistMethod · 0.45
setPlaylistIndexMethod · 0.45

Tested by

no test coverage detected