Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 5
0
 def resetState(self):
     if self.isStarted():
         states.create(self)
     else:
         LOG_WARNING('Fort provider is not started')
Exemplo n.º 6
0
 def resetState(self):
     if self.isStarted():
         states.create(self)
     else:
         LOG_WARNING('Fort provider is not started')