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

Method handleSet

syncplay/protocols.py:184–215  ·  view source on GitHub ↗
(self, settings)

Source from the content-addressed store, hash-verified

182 self._client.userlist.modUser(username, room, file_)
183
184 def handleSet(self, settings):
185 for (command, values) in settings.items():
186 if command == "room":
187 roomName = values["name"] if "name" in values else None
188 self._client.setRoom(roomName)
189 elif command == "user":
190 self._SetUser(values)
191 elif command == "controllerAuth":
192 if values['success']:
193 self._client.controllerIdentificationSuccess(values["user"], values["room"])
194 else:
195 self._client.controllerIdentificationError(values["user"], values["room"])
196 elif command == "newControlledRoom":
197 controlPassword = values['password']
198 roomName = values['roomName']
199 self._client.controlledRoomCreated(roomName, controlPassword)
200 elif command == "ready":
201 user, isReady = values["username"], values["isReady"]
202 manuallyInitiated = values["manuallyInitiated"] if "manuallyInitiated" in values else True
203 setBy = values["setBy"] if "setBy" in values else None
204 self._client.setReady(user, isReady, manuallyInitiated, setBy)
205 elif command == "playlistIndex":
206 user = values['user']
207 resetPosition = True
208 if not self.hadFirstPlaylistIndex:
209 self.hadFirstPlaylistIndex = True
210 resetPosition = False
211 self._client.playlist.changeToPlaylistIndex(values['index'], user, resetPosition=resetPosition)
212 elif command == "playlistChange":
213 self._client.playlist.changePlaylist(values['files'], values['user'])
214 elif command == "features":
215 self._client.setUserFeatures(values["username"], values['features'])
216
217 def sendFeaturesUpdate(self, features):
218 self.sendSet({"features": features})

Callers 1

handleMessagesMethod · 0.45

Calls 9

_SetUserMethod · 0.95
controlledRoomCreatedMethod · 0.80
changePlaylistMethod · 0.80
setUserFeaturesMethod · 0.80
setRoomMethod · 0.45
setReadyMethod · 0.45
changeToPlaylistIndexMethod · 0.45

Tested by

no test coverage detected