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

Method sendHello

syncplay/protocols.py:556–571  ·  view source on GitHub ↗
(self, clientVersion)

Source from the content-addressed store, hash-verified

554 self._watcher = watcher
555
556 def sendHello(self, clientVersion):
557 hello = {}
558 username = self._watcher.getName()
559 hello["username"] = username
560 userIp = self.transport.getPeer().host
561 room = self._watcher.getRoom()
562 if room:
563 hello["room"] = {"name": room.getName()}
564 hello["version"] = clientVersion # Used so 1.2.X client works on newer server
565 hello["realversion"] = syncplay.version
566 hello["features"] = self._factory.getFeatures()
567 hello["motd"] = self._factory.getMotd(userIp, username, room, clientVersion)
568 if self.persistentRoomWarning(clientFeatures=self._features, serverFeatures=hello["features"]):
569 span = "\n\n" if hello["motd"] else ""
570 hello["motd"] = getMessage("persistent-rooms-notice") + span + hello["motd"]
571 self.sendMessage({"Hello": hello})
572
573 @requireLogged
574 def handleSet(self, settings):

Callers 1

handleHelloMethod · 0.95

Calls 7

persistentRoomWarningMethod · 0.95
getMessageFunction · 0.90
getMotdMethod · 0.80
sendMessageMethod · 0.80
getNameMethod · 0.45
getRoomMethod · 0.45
getFeaturesMethod · 0.45

Tested by

no test coverage detected