def disconnect(self): if not self.__isConnected: return self.__isConnected = False self.__arenaChat.disconnect() self.__unitChat.disconnect() self.__voipProvider.leave() self.__voipCtrl.stop() self.__provider.setEnable(False) g_messengerEvents.onPluginDisconnected(PROTO_TYPE.BW_CHAT2)
def disconnect(self): if not self.__isConnected: return self.__isConnected = False self.__arenaChat.disconnect() self.__unitChat.disconnect() self.__clubChat.disconnect() self.__voipProvider.leave() self.__provider.setEnable(False) if self.__clubListener: self.__clubListener.stop() self.__clubListener = None g_messengerEvents.onPluginDisconnected(PROTO_TYPE.BW_CHAT2)
def __handleDisconnect(self, reason, description): g_messengerEvents.onPluginDisconnected(PROTO_TYPE.XMPP) client = self.client() if not client: return g_logOutput.debug(CLIENT_LOG_AREA.CONNECTION, 'Client is disconnected') self.__cancelReconnectCallback() self.__cancelReqTokenCallback() if reason == DISCONNECT_REASON.AUTHENTICATION: self.__tokenRequester.clear() if self.isInGameServer() and reason != DISCONNECT_REASON.BY_REQUEST: delay = self.__connectionsInfo.getNextDelay() self.__reconnectCallbackID = BigWorld.callback(delay, self.__doNextConnect) g_logOutput.debug(CLIENT_LOG_AREA.CONNECTION, 'Will try to reconnect after {0} seconds'.format(delay), description) host, port = self.__connectionsInfo.getLastAddress() tries = self.__connectionsInfo.getTries() self.__invokeConnectFailedEvent(tries) sendEventToServer(XMPP_EVENT_LOG.DISCONNECT, host, port, reason, description, tries)
def __handleDisconnect(self, reason, description): g_messengerEvents.onPluginDisconnected(PROTO_TYPE.XMPP) client = self.client() if not client: return g_logOutput.debug(CLIENT_LOG_AREA.CONNECTION, 'Client is disconnected') self.__cancelReconnectCallback() self.__cancelReqTokenCallback() if reason == DISCONNECT_REASON.AUTHENTICATION: self.__tokenRequester.clear() if self.isInGameServer() and reason != DISCONNECT_REASON.BY_REQUEST: delay = self.__connectionsInfo.getNextDelay() self.__reconnectCallbackID = BigWorld.callback(delay, self.__doNextConnect) g_logOutput.debug(CLIENT_LOG_AREA.CONNECTION, 'Will try to reconnect after {0} seconds'.format(delay), description) host, port = self.__connectionsInfo.getLastAddress() tries = self.__connectionsInfo.getTries() g_messengerEvents.onPluginConnectFailed(PROTO_TYPE.XMPP, (host, port), tries) sendEventToServer(XMPP_EVENT_LOG.DISCONNECT, host, port, reason, description, tries)
def __onPluginDisconnected(self, protoType): if protoType == PROTO_TYPE.MIGRATION: return if g_settings.server.useToShowContacts(protoType): g_messengerEvents.onPluginDisconnected(PROTO_TYPE.MIGRATION)
def disconnect(self): self.serviceChannel.clear() if self.__isConnected: self.clear() g_messengerEvents.onPluginDisconnected(PROTO_TYPE.BW)