Пример #1
0
 def start(self, clanCache):
     if self.isStarted():
         LOG_WARNING('Fort provider already is ready')
         return
     else:
         self.__initial |= FORT_PROVIDER_INITIAL_FLAGS.STARTED
         self.__clan = weakref.proxy(clanCache)
         self.__listeners = _ClientFortListeners()
         self.__keeper = FortSubscriptionKeeper()
         self.__keeper.onAutoUnsubscribed += self.__onAutoUnsubscribed
         fortMgr = getClientFortMgr()
         if fortMgr:
             fortMgr.onFortResponseReceived += self.__onFortResponseReceived
             fortMgr.onFortUpdateReceived += self.__onFortUpdateReceived
             fortMgr.onFortStateChanged += self.__onFortStateChanged
         else:
             LOG_ERROR('Fort manager is not found')
         g_lobbyContext.getServerSettings().onServerSettingsChange += self.__onServerSettingChanged
         g_playerEvents.onCenterIsLongDisconnected += self.__onCenterIsLongDisconnected
         self.__controller = controls.createInitial()
         self.__controller.init(self.__clan, self.__listeners)
         states.create(self)
         if not g_lobbyContext.getServerSettings().isFortsEnabled() and self.__cachedState is not None:
             if self.__cachedState.getStateID() not in (CLIENT_FORT_STATE.UNSUBSCRIBED, CLIENT_FORT_STATE.DISABLED):
                 SystemMessages.pushI18nMessage(I18N_SM.FORTIFICATION_NOTIFICATION_TURNEDOFF, type=SystemMessages.SM_TYPE.Warning)
                 showFortDisabledDialog()
         return
Пример #2
0
 def start(self, clanCache):
     if self.isStarted():
         LOG_WARNING('Fort provider already is ready')
         return
     else:
         self.__initial |= FORT_PROVIDER_INITIAL_FLAGS.STARTED
         self.__clan = weakref.proxy(clanCache)
         self.__listeners = _ClientFortListeners()
         self.__keeper = FortSubscriptionKeeper()
         self.__keeper.onAutoUnsubscribed += self.__onAutoUnsubscribed
         fortMgr = getClientFortMgr()
         if fortMgr:
             fortMgr.onFortResponseReceived += self.__onFortResponseReceived
             fortMgr.onFortUpdateReceived += self.__onFortUpdateReceived
             fortMgr.onFortStateChanged += self.__onFortStateChanged
         else:
             LOG_ERROR('Fort manager is not found')
         g_lobbyContext.getServerSettings().onServerSettingsChange += self.__onServerSettingChanged
         g_playerEvents.onCenterIsLongDisconnected += self.__onCenterIsLongDisconnected
         self.__controller = controls.createInitial()
         self.__controller.init(self.__clan, self.__listeners)
         states.create(self)
         if not g_lobbyContext.getServerSettings().isFortsEnabled() and self.__cachedState is not None:
             if self.__cachedState.getStateID() not in (CLIENT_FORT_STATE.UNSUBSCRIBED, CLIENT_FORT_STATE.DISABLED):
                 SystemMessages.pushI18nMessage(I18N_SM.FORTIFICATION_NOTIFICATION_TURNEDOFF, type=SystemMessages.SM_TYPE.Warning)
                 showFortDisabledDialog()
         return
Пример #3
0
 def start(self, clanCache):
     if self.isStarted():
         LOG_WARNING('Fort provider already is ready')
         return
     self.__initial |= FORT_PROVIDER_INITIAL_FLAGS.STARTED
     self.__clan = weakref.proxy(clanCache)
     self.__listeners = _ClientFortListeners()
     self.__keeper = FortSubscriptionKeeper()
     self.__keeper.onAutoUnsubscribed += self.__onAutoUnsubscribed
     fortMgr = getClientFortMgr()
     if fortMgr:
         fortMgr.onFortResponseReceived += self.__onFortResponseReceived
         fortMgr.onFortUpdateReceived += self.__onFortUpdateReceived
         fortMgr.onFortStateChanged += self.__onFortStateChanged
     else:
         LOG_ERROR('Fort manager is not found')
     g_playerEvents.onCenterIsLongDisconnected += self.__onCenterIsLongDisconnected
     self.__controller = controls.createInitial()
     self.__controller.init(self.__clan, self.__listeners)
     states.create(self)
Пример #4
0
 def start(self, clanCache):
     if self.isStarted():
         LOG_WARNING('Fort provider already is ready')
         return
     self.__initial |= FORT_PROVIDER_INITIAL_FLAGS.STARTED
     self.__clan = weakref.proxy(clanCache)
     self.__listeners = _ClientFortListeners()
     self.__keeper = FortSubscriptionKeeper()
     self.__keeper.onAutoUnsubscribed += self.__onAutoUnsubscribed
     fortMgr = getClientFortMgr()
     if fortMgr:
         fortMgr.onFortResponseReceived += self.__onFortResponseReceived
         fortMgr.onFortUpdateReceived += self.__onFortUpdateReceived
         fortMgr.onFortStateChanged += self.__onFortStateChanged
     else:
         LOG_ERROR('Fort manager is not found')
     g_playerEvents.onCenterIsLongDisconnected += self.__onCenterIsLongDisconnected
     self.__controller = controls.createInitial()
     self.__controller.init(self.__clan, self.__listeners)
     states.create(self)