Ejemplo n.º 1
0
 def _populate(self):
     super(SwitchPeripheryWindow, self)._populate()
     self._serversDP = ServersDataProvider()
     self._serversDP.setFlashObject(self.as_getServersDPS())
     self.as_setImageS(RES_ICONS.MAPS_ICONS_WINDOWS_SWITCH_PERIPHERY_WINDOW_BG, 0)
     self.as_setWindowTitleS(_ms(DIALOGS.SWITCHPERIPHERYWINDOW_WINDOWTITLE))
     currentServer = self.connectionMgr.serverUserName
     self.as_setTextS(_ms(self.__ctx.getHeader()), _ms(self.__ctx.getDescription(), server=text_styles.error(currentServer)))
     self.addNotificator(SimpleNotifier(self.__ctx.getUpdateTime, self.__onServersUpdate))
     self.startNotification()
     self._updateServersList()
     if not constants.IS_CHINA:
         if GUI_SETTINGS.csisRequestRate == REQUEST_RATE.ALWAYS:
             g_preDefinedHosts.startCSISUpdate()
         g_preDefinedHosts.onCsisQueryStart += self.__onServersUpdate
         g_preDefinedHosts.onCsisQueryComplete += self.__onServersUpdate
         g_preDefinedHosts.onPingPerformed += self.__onServersUpdate
     self.as_setButtonsS([{'label': _ms(DIALOGS.SWITCHPERIPHERYWINDOW_BTNSWITCH),
       'btnLinkage': BUTTON_LINKAGES.BUTTON_NORMAL,
       'action': self._SWITCH_BTN_ACTION,
       'isFocused': True,
       'tooltip': ''}, {'label': _ms(DIALOGS.SWITCHPERIPHERYWINDOW_BTNCANCEL),
       'btnLinkage': BUTTON_LINKAGES.BUTTON_BLACK,
       'action': self._CLOSE_BTN_ACTION,
       'isFocused': False,
       'tooltip': ''}], TEXT_ALIGN.RIGHT, self._BTN_WIDTH)
Ejemplo n.º 2
0
 def startListenCsisUpdate(self, startListenCsis):
     if GUI_SETTINGS.csisRequestRate == REQUEST_RATE.ON_REQUEST:
         if startListenCsis:
             g_preDefinedHosts.startCSISUpdate()
         else:
             g_preDefinedHosts.stopCSISUpdate()
             self._updateServersList()
Ejemplo n.º 3
0
 def startListenCsisUpdate(self, startListenCsis):
     if GUI_SETTINGS.csisRequestRate == REQUEST_RATE.ON_REQUEST:
         if startListenCsis:
             g_preDefinedHosts.startCSISUpdate()
         else:
             g_preDefinedHosts.stopCSISUpdate()
             self._updateServersList()
Ejemplo n.º 4
0
 def startListenCsisQuery(self, startListen):
     if GUI_SETTINGS.csisRequestRate == REQUEST_RATE.ON_REQUEST:
         if startListen:
             g_preDefinedHosts.startCSISUpdate()
         else:
             g_preDefinedHosts.stopCSISUpdate()
     if startListen:
         g_preDefinedHosts.requestPing(True)
Ejemplo n.º 5
0
 def startListenCsisQuery(self, startListen):
     if GUI_SETTINGS.csisRequestRate == REQUEST_RATE.ON_REQUEST:
         if startListen:
             g_preDefinedHosts.startCSISUpdate()
         else:
             g_preDefinedHosts.stopCSISUpdate()
     if startListen:
         g_preDefinedHosts.requestPing(True)
 def onDropDownOpened(self, opened):
     if GUI_SETTINGS.csisRequestRate == REQUEST_RATE.ON_REQUEST:
         if opened:
             g_preDefinedHosts.startCSISUpdate()
         else:
             g_preDefinedHosts.stopCSISUpdate()
             self._updateServersList()
     if opened:
         g_preDefinedHosts.requestPing(True)
Ejemplo n.º 7
0
 def __init__(self, loginPreferences):
     self._loginPreferences = loginPreferences
     g_preDefinedHosts.readScriptConfig(Settings.g_instance.scriptConfig)
     g_preDefinedHosts.onCsisQueryStart += self.__onCsisUpdate
     g_preDefinedHosts.onCsisQueryComplete += self.__onCsisUpdate
     if GUI_SETTINGS.csisRequestRate == REQUEST_RATE.ALWAYS:
         g_preDefinedHosts.startCSISUpdate()
     self._serverList = []
     self._selectedServerIdx = 0
     self.updateServerList()
Ejemplo n.º 8
0
 def _populate(self):
     super(ServerStats, self)._populate()
     if constants.IS_SHOW_SERVER_STATS:
         self._updateCurrentServerInfo()
     self._updateServersList()
     self._updateRoamingCtrl()
     if GUI_SETTINGS.csisRequestRate == REQUEST_RATE.ALWAYS:
         g_preDefinedHosts.startCSISUpdate()
     g_preDefinedHosts.onCsisQueryStart += self.__onCsisUpdate
     g_preDefinedHosts.onCsisQueryComplete += self.__onCsisUpdate
     game_control.g_instance.serverStats.onStatsReceived += self.__onStatsReceived
     self.addListener(events.FightButtonEvent.FIGHT_BUTTON_UPDATE, self._updateRoamingCtrl, scope=EVENT_BUS_SCOPE.LOBBY)
Ejemplo n.º 9
0
 def onDropDownOpened(self, opened):
     r"""
     Invokes by DAAPI when user open\close dropdown menu
     :param opened: true - list has been opened, false - list has been closed
     """
     if GUI_SETTINGS.csisRequestRate == REQUEST_RATE.ON_REQUEST:
         if opened:
             g_preDefinedHosts.startCSISUpdate()
         else:
             g_preDefinedHosts.stopCSISUpdate()
             self._updateServersList()
     if opened:
         g_preDefinedHosts.requestPing(True)
Ejemplo n.º 10
0
 def onDropDownOpened(self, opened):
     r"""
     Invokes by DAAPI when user open\close dropdown menu
     :param opened: true - list has been opened, false - list has been closed
     """
     if GUI_SETTINGS.csisRequestRate == REQUEST_RATE.ON_REQUEST:
         if opened:
             g_preDefinedHosts.startCSISUpdate()
         else:
             g_preDefinedHosts.stopCSISUpdate()
             self._updateServersList()
     if opened:
         g_preDefinedHosts.requestPing(True)
Ejemplo n.º 11
0
 def __init__(self, loginPreferences):
     self._loginPreferences = loginPreferences
     s = Settings.g_instance
     g_preDefinedHosts.readScriptConfig(s.scriptConfig, s.userPrefs)
     g_preDefinedHosts.onCsisQueryStart += self.__onServerUpdate
     g_preDefinedHosts.onPingPerformed += self.__onServerUpdate
     g_preDefinedHosts.onCsisQueryComplete += self.__onServerUpdate
     if GUI_SETTINGS.csisRequestRate == REQUEST_RATE.ALWAYS:
         g_preDefinedHosts.startCSISUpdate()
     g_preDefinedHosts.requestPing()
     self._serverList = []
     self._selectedServerIdx = 0
     self.updateServerList()
Ejemplo n.º 12
0
 def _populate(self):
     super(ServerStats, self)._populate()
     if constants.IS_SHOW_SERVER_STATS:
         self._updateCurrentServerInfo()
     self._updateServersList()
     self._updateRoamingCtrl()
     if GUI_SETTINGS.csisRequestRate == REQUEST_RATE.ALWAYS:
         g_preDefinedHosts.startCSISUpdate()
     g_preDefinedHosts.onCsisQueryStart += self.__onCsisUpdate
     g_preDefinedHosts.onCsisQueryComplete += self.__onCsisUpdate
     game_control.g_instance.serverStats.onStatsReceived += self.__onStatsReceived
     self.addListener(events.FightButtonEvent.FIGHT_BUTTON_UPDATE,
                      self._updateRoamingCtrl,
                      scope=EVENT_BUS_SCOPE.LOBBY)
Ejemplo n.º 13
0
 def _populate(self):
     super(ServerStats, self)._populate()
     self._serversDP = ServersDataProvider()
     self._serversDP.setFlashObject(self.as_getServersDPS())
     if constants.IS_SHOW_SERVER_STATS:
         self._updateCurrentServerInfo()
     self._updateServersList()
     self._updateRoamingCtrl()
     if not constants.IS_CHINA:
         if GUI_SETTINGS.csisRequestRate == REQUEST_RATE.ALWAYS:
             g_preDefinedHosts.startCSISUpdate()
         g_preDefinedHosts.onCsisQueryStart += self.__onServersUpdate
         g_preDefinedHosts.onCsisQueryComplete += self.__onServersUpdate
         g_preDefinedHosts.onPingPerformed += self.__onServersUpdate
     self.serverStats.onStatsReceived += self.__onStatsReceived
     self.addListener(events.FightButtonEvent.FIGHT_BUTTON_UPDATE, self._updateRoamingCtrl, scope=EVENT_BUS_SCOPE.LOBBY)
Ejemplo n.º 14
0
 def _populate(self):
     super(LoginDispatcher, self)._populate()
     self.__loginDataLoader = LoginDataLoader()
     self.__loginDataLoader.onConfigLoaded += self.onConfigLoaded
     self.__loginDataLoader.loadUserConfig()
     connectionManager.connectionStatusCallbacks += self.__handleConnectionStatus
     connectionManager.searchServersCallbacks += self.__serversFind
     connectionManager.onConnected += self.__onConnected
     connectionManager.startSearchServers()
     g_preDefinedHosts.readScriptConfig(Settings.g_instance.scriptConfig)
     g_playerEvents.onLoginQueueNumberReceived += self.handleQueue
     g_playerEvents.onAccountBecomePlayer += self.__pe_onAccountBecomePlayer
     g_playerEvents.onKickWhileLoginReceived += self.handleKickWhileLogin
     if GUI_SETTINGS.csisRequestRate == REQUEST_RATE.ALWAYS:
         g_preDefinedHosts.startCSISUpdate()
     g_preDefinedHosts.onCsisQueryStart += self.__onCsisUpdate
     g_preDefinedHosts.onCsisQueryComplete += self.__onCsisUpdate
     self.onSetOptions(self.__getFullServersList(), self.__loginDataLoader.host)
 def _populate(self):
     super(PrimeTimeViewBase, self)._populate()
     self.__serversDP = self._getAllServersDP()
     self.__serversDP.setFlashObject(self.as_getServersDPS())
     self.__updateList()
     self.__updateData()
     self._getController().onUpdated += self.__onControllerUpdated
     if not constants.IS_CHINA:
         if GUI_SETTINGS.csisRequestRate == REQUEST_RATE.ALWAYS:
             g_preDefinedHosts.startCSISUpdate()
         g_preDefinedHosts.onCsisQueryStart += self.__onServersUpdate
         g_preDefinedHosts.onCsisQueryComplete += self.__onServersUpdate
         g_preDefinedHosts.onPingPerformed += self.__onServersUpdate
     self.addNotificators(
         PeriodicNotifier(self.__getPeriodUpdateTime,
                          self.__onPeriodUpdate),
         SimpleNotifier(self.__getSimpleUpdateTime, self.__onSimpleUpdate))
     self.startNotification()
Ejemplo n.º 16
0
 def _populate(self):
     super(LoginDispatcher, self)._populate()
     self.__loginDataLoader = LoginDataLoader()
     self.__loginDataLoader.onConfigLoaded += self.onConfigLoaded
     self.__loginDataLoader.loadUserConfig()
     connectionManager.connectionStatusCallbacks += self.__handleConnectionStatus
     connectionManager.searchServersCallbacks += self.__serversFind
     connectionManager.onConnected += self.__onConnected
     connectionManager.startSearchServers()
     g_preDefinedHosts.readScriptConfig(Settings.g_instance.scriptConfig)
     g_playerEvents.onLoginQueueNumberReceived += self.handleQueue
     g_playerEvents.onAccountBecomePlayer += self.__pe_onAccountBecomePlayer
     g_playerEvents.onKickWhileLoginReceived += self.handleKickWhileLogin
     if GUI_SETTINGS.csisRequestRate == REQUEST_RATE.ALWAYS:
         g_preDefinedHosts.startCSISUpdate()
     g_preDefinedHosts.onCsisQueryStart += self.__onCsisUpdate
     g_preDefinedHosts.onCsisQueryComplete += self.__onCsisUpdate
     self.onSetOptions(self.__getFullServersList(),
                       self.__loginDataLoader.host)
Ejemplo n.º 17
0
 def _populate(self):
     super(PrimeTimeViewBase, self)._populate()
     self.__serversDP = self.__buildDataProvider()
     self.__serversDP.setFlashObject(self.as_getServersDPS())
     self.__updateServersList()
     self.__updateSelectedServer()
     self.__updateSelectedServerData()
     self._getController().onUpdated += self.__onControllerUpdated
     if not constants.IS_CHINA:
         if GUI_SETTINGS.csisRequestRate == REQUEST_RATE.ALWAYS:
             g_preDefinedHosts.startCSISUpdate()
         g_preDefinedHosts.onCsisQueryStart += self.__onServersUpdate
         g_preDefinedHosts.onCsisQueryComplete += self.__onServersUpdate
         g_preDefinedHosts.onPingPerformed += self.__onServersUpdate
     self.addNotificators(
         PeriodicNotifier(self.__getInfoUpdatePeriod,
                          self.__onNotifierTriggered,
                          periods=(time_utils.ONE_MINUTE, )))
     self.startNotification()
Ejemplo n.º 18
0
 def _populate(self):
     super(SwitchPeripheryWindow, self)._populate()
     self._serversDP = ServersDataProvider()
     self._serversDP.setFlashObject(self.as_getServersDPS())
     self.as_setImageS(RES_ICONS.MAPS_ICONS_WINDOWS_SWITCH_PERIPHERY_WINDOW_BG, 0)
     self.as_setWindowTitleS(_ms(DIALOGS.SWITCHPERIPHERYWINDOW_WINDOWTITLE))
     currentServer = connectionManager.serverUserName
     self.as_setTextS(_ms(self.__ctx.getHeader()), _ms(self.__ctx.getDescription(), server=text_styles.error(currentServer)))
     self._updateServersList()
     if not constants.IS_CHINA:
         if GUI_SETTINGS.csisRequestRate == REQUEST_RATE.ALWAYS:
             g_preDefinedHosts.startCSISUpdate()
         g_preDefinedHosts.onCsisQueryStart += self.__onServersUpdate
         g_preDefinedHosts.onCsisQueryComplete += self.__onServersUpdate
         g_preDefinedHosts.onPingPerformed += self.__onServersUpdate
     self.as_setButtonsS([{'label': _ms(DIALOGS.SWITCHPERIPHERYWINDOW_BTNSWITCH),
       'btnLinkage': BUTTON_LINKAGES.BUTTON_NORMAL,
       'action': self._SWITCH_BTN_ACTION,
       'isFocused': True,
       'tooltip': ''}, {'label': _ms(DIALOGS.SWITCHPERIPHERYWINDOW_BTNCANCEL),
       'btnLinkage': BUTTON_LINKAGES.BUTTON_BLACK,
       'action': self._CLOSE_BTN_ACTION,
       'isFocused': False,
       'tooltip': ''}], TEXT_ALIGN.RIGHT, self._BTN_WIDTH)
Ejemplo n.º 19
0
 def startListenCsisQuery(self, value):
     if GUI_SETTINGS.csisRequestRate == REQUEST_RATE.ON_REQUEST:
         if value:
             g_preDefinedHosts.startCSISUpdate()
         else:
             g_preDefinedHosts.stopCSISUpdate()
Ejemplo n.º 20
0
 def startListenCsisQuery(self, value):
     if GUI_SETTINGS.csisRequestRate == REQUEST_RATE.ON_REQUEST:
         if value:
             g_preDefinedHosts.startCSISUpdate()
         else:
             g_preDefinedHosts.stopCSISUpdate()