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

Method handleHello

syncplay/protocols.py:135–151  ·  view source on GitHub ↗
(self, hello)

Source from the content-addressed store, hash-verified

133 return username, roomName, version, motd, features
134
135 def handleHello(self, hello):
136 username, roomName, version, motd, featureList = self._extractHelloArguments(hello)
137 if not username or not roomName or not version:
138 self.dropWithError(getMessage("hello-server-error").format(hello))
139 else:
140 self._client.setUsername(username)
141 self._client.setRoom(roomName)
142 self.logged = True
143 if self.persistentRoomWarning(featureList):
144 span = "\n\n" if motd else ""
145 motd = getMessage("persistent-rooms-notice") + span + motd
146 if motd:
147 self._client.ui.showMessage(motd, noPlayer=True, noTimestamp=True, isMotd=True)
148 self._client.ui.showMessage(getMessage("connected-successful-notification"))
149 self._client.connected()
150 self._client.sendFile()
151 self._client.setServerVersion(version, featureList)
152
153 def persistentRoomWarning(self, serverFeatures):
154 return serverFeatures["persistentRooms"] if "persistentRooms" in serverFeatures else False

Callers 1

handleMessagesMethod · 0.45

Calls 10

dropWithErrorMethod · 0.95
persistentRoomWarningMethod · 0.95
getMessageFunction · 0.90
setUsernameMethod · 0.80
connectedMethod · 0.80
sendFileMethod · 0.80
setServerVersionMethod · 0.80
setRoomMethod · 0.45
showMessageMethod · 0.45

Tested by

no test coverage detected