def onHandleQueue(self, serverName, queueNumber): showAutoSearchBtn = AUTO_LOGIN_QUERY_ENABLED and not self.__autoSearchVisited cancelBtnLbl = WAITING.BUTTONS_CANCEL if showAutoSearchBtn else WAITING.BUTTONS_EXITQUEUE message = i18n.makeString(WAITING.MESSAGE_QUEUE, serverName, queueNumber) if showAutoSearchBtn: message = i18n.makeString(WAITING.MESSAGE_USEAUTOSEARCH, serverName, queueNumber, serverName) if not self.__onLoginQueue: Waiting.close() self.__setLoginQueue(True) self.fireEvent( LoginEventEx(LoginEventEx.SET_LOGIN_QUEUE, View.alias, WAITING.TITLES_QUEUE, message, cancelBtnLbl, showAutoSearchBtn), EVENT_BUS_SCOPE.LOBBY) self.addListener(LoginEventEx.ON_LOGIN_QUEUE_CLOSED, self.__onLoginQueueClosed, EVENT_BUS_SCOPE.LOBBY) self.addListener(LoginEventEx.SWITCH_LOGIN_QUEUE_TO_AUTO, self.__onLoginQueueSwitched, EVENT_BUS_SCOPE.LOBBY) else: ctx = { 'title': WAITING.TITLES_QUEUE, 'message': message, 'cancelLabel': cancelBtnLbl, 'showAutoLoginBtn': showAutoSearchBtn } self.fireEvent( ArgsEvent(ArgsEvent.UPDATE_ARGS, VIEW_ALIAS.LOGIN_QUEUE, ctx), EVENT_BUS_SCOPE.LOBBY)
def _onHandleQueue(self, queueNumber): serverName = connectionManager.serverUserName showAutoSearchBtn = AUTO_LOGIN_QUERY_ENABLED and not self._autoSearchVisited cancelBtnLbl = WAITING.BUTTONS_CANCEL if showAutoSearchBtn else WAITING.BUTTONS_EXITQUEUE message = _ms(WAITING.MESSAGE_QUEUE, serverName, queueNumber) if showAutoSearchBtn: message = _ms(WAITING.MESSAGE_USEAUTOSEARCH, serverName, queueNumber, serverName) if not self.__loginQueueDialogShown: self._clearLoginView() self.__loginQueueDialogShown = True self.fireEvent( LoginEventEx(LoginEventEx.SET_LOGIN_QUEUE, View.alias, WAITING.TITLES_QUEUE, message, cancelBtnLbl, showAutoSearchBtn), EVENT_BUS_SCOPE.LOBBY) self.addListener(LoginEventEx.ON_LOGIN_QUEUE_CLOSED, self._onLoginQueueClosed, EVENT_BUS_SCOPE.LOBBY) self.addListener(LoginEventEx.SWITCH_LOGIN_QUEUE_TO_AUTO, self._onLoginQueueSwitched, EVENT_BUS_SCOPE.LOBBY) else: ctx = { 'title': WAITING.TITLES_QUEUE, 'message': message, 'cancelLabel': cancelBtnLbl, 'showAutoLoginBtn': showAutoSearchBtn } self.fireEvent( ArgsEvent(ArgsEvent.UPDATE_ARGS, VIEW_ALIAS.LOGIN_QUEUE, ctx), EVENT_BUS_SCOPE.LOBBY)
def __showLoginRetryDialog(self, data): self._clearLoginView() self.fireEvent( LoginEventEx(LoginEventEx.SET_AUTO_LOGIN, View.alias, data['waitingOpen'], data['message'], data['waitingClose'], False), EVENT_BUS_SCOPE.LOBBY) self.addListener(LoginEventEx.ON_LOGIN_QUEUE_CLOSED, self.__closeLoginRetryDialog, EVENT_BUS_SCOPE.LOBBY) self.__loginRetryDialogShown = True
def __setAutoLogin(self, waitingOpen, message, waitingClose): Waiting.hide('login') if not self.__onLoginQueue: self.__setLoginQueue(True) self.fireEvent( LoginEventEx(LoginEventEx.SET_AUTO_LOGIN, View.alias, waitingOpen, message, waitingClose), EVENT_BUS_SCOPE.LOBBY) self.addListener(LoginEventEx.ON_LOGIN_QUEUE_CLOSED, self.__onLoginQueueClosed, EVENT_BUS_SCOPE.LOBBY)
def onHandleQueue(self, message): if not self.__onLoginQueue: Waiting.close() self.__setLoginQueue(True) self.fireEvent( LoginEventEx(LoginEventEx.SET_LOGIN_QUEUE, View.alias, WAITING.TITLES_QUEUE, message, WAITING.BUTTONS_EXITQUEUE), EVENT_BUS_SCOPE.LOBBY) self.addListener(LoginEventEx.ON_LOGIN_QUEUE_CLOSED, self.__onLoginQueueClosed, EVENT_BUS_SCOPE.LOBBY) else: ctx = { 'title': WAITING.TITLES_QUEUE, 'message': message, 'cancelLabel': WAITING.BUTTONS_EXITQUEUE } self.fireEvent( ArgsEvent(ArgsEvent.UPDATE_ARGS, VIEW_ALIAS.LOGIN_QUEUE, ctx), EVENT_BUS_SCOPE.LOBBY)
def __windowClosing(self): self.fireEvent( LoginEventEx(LoginEventEx.ON_LOGIN_QUEUE_CLOSED, '', '', '', '', False), EVENT_BUS_SCOPE.LOBBY) connectionManager.disconnect() self.destroy()
def onAutoLoginClick(self): self.fireEvent( LoginEventEx(LoginEventEx.SWITCH_LOGIN_QUEUE_TO_AUTO, '', '', '', '', False), EVENT_BUS_SCOPE.LOBBY) connectionManager.disconnect() self.destroy()
def __windowClosing(self): self.fireEvent(LoginEventEx(LoginEventEx.ON_LOGIN_QUEUE_CLOSED, '', '', '', ''), EVENT_BUS_SCOPE.LOBBY) self.app.disconnect(True) self.destroy()