Пример #1
0
    def onConnect(self, request):
        self.sendMessage("Server socket established")

        # Push an update for the new user.
        # This is inefficient so fix it if it becomes a problem.
        self.factory.pushUpdate()
        WebSocketServerProtocol.onConnect(self, request)
Пример #2
0
 def onConnect(self, request):
     """
     Обработчик соединения по WebSocket-протоколу. Нужен для того, чтобы вытащить печеньку 'authToken'
     :param request: Request
     :type request: autobahn.websocket.protocol.ConnectionRequest
     :return:
     """
     log.msg('Achtung! Connection! %s', request.peer)
     self.process_cookies(request)
     self.token = self.cookies.get(self.cookie_name)
     return WebSocketServerProtocol.onConnect(self, request)
Пример #3
0
 def onConnect(self, request):
     self.sendMessage("Player socket established")
     # Assign a temporary name because I'm kind of worried about race conditions
     self.username = "******"
     WebSocketServerProtocol.onConnect(self, request)
Пример #4
0
 def onConnect(self, request):
     self.sendMessage("Player socket established")
     # Assign a temporary name because I'm kind of worried about race conditions
     self.username = "******"
     WebSocketServerProtocol.onConnect(self, request)
Пример #5
0
 def onConnect(self, request):
     WebSocketServerProtocol.onConnect(self, request)
     self.factory.clients.append(self)