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

Method authRoomController

syncplay/server.py:198–210  ·  view source on GitHub ↗
(self, watcher, password, roomBaseName=None)

Source from the content-addressed store, hash-verified

196 return self._roomManager.getEmptyPersistentRooms()
197
198 def authRoomController(self, watcher, password, roomBaseName=None):
199 room = watcher.getRoom()
200 roomName = roomBaseName if roomBaseName else room.getName()
201 try:
202 success = RoomPasswordProvider.check(roomName, password, self._salt)
203 if success:
204 watcher.getRoom().addController(watcher)
205 self._roomManager.broadcast(watcher, lambda w: w.sendControlledRoomAuthStatus(success, watcher.getName(), room._name))
206 except NotControlledRoom:
207 newName = RoomPasswordProvider.getControlledRoomName(roomName, password, self._salt)
208 watcher.sendNewControlledRoom(newName, password)
209 except ValueError:
210 self._roomManager.broadcastRoom(watcher, lambda w: w.sendControlledRoomAuthStatus(False, watcher.getName(), room._name))
211
212 def sendChat(self, watcher, message):
213 message = truncateText(message, self.maxChatMessageLength)

Callers 1

handleSetMethod · 0.80

Calls 9

checkMethod · 0.80
addControllerMethod · 0.80
getControlledRoomNameMethod · 0.80
broadcastRoomMethod · 0.80
getRoomMethod · 0.45
getNameMethod · 0.45
broadcastMethod · 0.45
sendNewControlledRoomMethod · 0.45

Tested by

no test coverage detected