MCPcopy Index your code
hub / github.com/Syncplay/syncplay / forcePositionUpdate

Method forcePositionUpdate

syncplay/server.py:180–190  ·  view source on GitHub ↗
(self, watcher, doSeek, watcherPauseState)

Source from the content-addressed store, hash-verified

178 self._roomManager.broadcast(watcher, l)
179
180 def forcePositionUpdate(self, watcher, doSeek, watcherPauseState):
181 room = watcher.getRoom()
182 if room.canControl(watcher):
183 paused, position = room.isPaused(), watcher.getPosition()
184 setBy = watcher
185 l = lambda w: w.sendState(position, paused, doSeek, setBy, True)
186 room.setPosition(watcher.getPosition(), setBy)
187 self._roomManager.broadcastRoom(watcher, l)
188 else:
189 watcher.sendState(room.getPosition(), watcherPauseState, False, watcher, True) # Fixes BC break with 1.2.x
190 watcher.sendState(room.getPosition(), room.isPaused(), True, room.getSetBy(), True)
191
192 def getAllWatchersForUser(self, forUser):
193 return self._roomManager.getAllWatchersForUser(forUser)

Callers 1

updateStateMethod · 0.80

Calls 8

broadcastRoomMethod · 0.80
getSetByMethod · 0.80
getRoomMethod · 0.45
canControlMethod · 0.45
isPausedMethod · 0.45
getPositionMethod · 0.45
sendStateMethod · 0.45
setPositionMethod · 0.45

Tested by

no test coverage detected