Beispiel #1
0
 def onExitBattle(self, _):
     arena = getattr(BigWorld.player(), 'arena', None)
     LOG_DEBUG('onExitBattle', arena)
     from helpers.statistics import g_statistics, HANGAR_LOADING_STATE
     g_statistics.noteHangarLoadingState(HANGAR_LOADING_STATE.CONNECTED, True)
     if arena:
         BigWorld.player().leaveArena()
     return
Beispiel #2
0
 def updateVehicle(self, vehicle):
     if self.__inited:
         Waiting.show('loadHangarSpaceVehicle', True)
         g_statistics.noteHangarLoadingState(
             HANGAR_LOADING_STATE.START_LOADING_VEHICLE)
         self.__space.recreateVehicle(vehicle.getCustomizedDescriptor(),
                                      vehicle.modelState, self.__changeDone)
         self.__lastUpdatedVehicle = vehicle
Beispiel #3
0
 def onLogin(self, userName, password, serverName, isSocialToken2Login):
     g_statistics.noteHangarLoadingState(HANGAR_LOADING_STATE.LOGIN, True)
     self._autoSearchVisited = serverName == AUTO_LOGIN_QUERY_URL
     result = self.__validateCredentials(userName.lower().strip(), password.strip(), bool(g_loginManager.getPreference('token2')))
     if result.isValid:
         Waiting.show('login')
         g_loginManager.initiateLogin(userName, password, serverName, isSocialToken2Login, isSocialToken2Login or self._rememberUser)
     else:
         self.as_setErrorMessageS(result.errorMessage, result.invalidFields)
Beispiel #4
0
 def __spaceDone(self):
     self.__spaceInited = True
     if self.__spaceDestroyedDuringLoad:
         self.__spaceDestroyedDuringLoad = False
         self.destroy()
     self.onSpaceCreate()
     Waiting.hide('loadHangarSpace')
     g_statistics.noteHangarLoadingState(HANGAR_LOADING_STATE.FINISH_LOADING_SPACE)
     g_statistics.noteHangarLoadingState(HANGAR_LOADING_STATE.HANGAR_READY, showSummaryNow=True)
Beispiel #5
0
 def __spaceDone(self):
     self.__spaceInited = True
     if self.__spaceDestroyedDuringLoad:
         self.__spaceDestroyedDuringLoad = False
         self.destroy()
     self.onSpaceCreate()
     Waiting.hide('loadHangarSpace')
     g_statistics.noteHangarLoadingState(
         HANGAR_LOADING_STATE.FINISH_LOADING_SPACE)
     g_statistics.noteHangarLoadingState(HANGAR_LOADING_STATE.HANGAR_READY,
                                         showSummaryNow=True)
Beispiel #6
0
 def init(self, isPremium):
     g_statistics.noteHangarLoadingState(HANGAR_LOADING_STATE.START_LOADING_SPACE)
     self.__videoCameraController.init()
     self.__spaceDestroyedDuringLoad = False
     if not self.__spaceInited:
         LOG_DEBUG('_HangarSpace::init')
         Waiting.show('loadHangarSpace')
         self.__inited = True
         self.__isSpacePremium = isPremium
         self.__igrSpaceType = game_control.g_instance.igr.getRoomType()
         self.__space.create(isPremium, self.__spaceDone)
         if self.__lastUpdatedVehicle is not None:
             self.updateVehicle(self.__lastUpdatedVehicle)
         game_control.g_instance.gameSession.onPremiumNotify += self.onPremiumChanged
     return
Beispiel #7
0
 def onLogin(self, userName, password, serverName, isSocialToken2Login):
     g_statistics.noteHangarLoadingState(HANGAR_LOADING_STATE.LOGIN, True)
     self._autoSearchVisited = serverName == AUTO_LOGIN_QUERY_URL
     self.__customLoginStatus = None
     result = self.__validateCredentials(
         userName.lower().strip(), password.strip(),
         bool(g_loginManager.getPreference('token2')))
     if result.isValid:
         Waiting.show('login')
         g_loginManager.initiateLogin(
             userName, password, serverName, isSocialToken2Login,
             isSocialToken2Login or self._rememberUser)
     else:
         self.as_setErrorMessageS(result.errorMessage, result.invalidFields)
     return
Beispiel #8
0
 def init(self, isPremium):
     g_statistics.noteHangarLoadingState(
         HANGAR_LOADING_STATE.START_LOADING_SPACE)
     self.__videoCameraController.init()
     self.__spaceDestroyedDuringLoad = False
     if not self.__spaceInited:
         LOG_DEBUG('_HangarSpace::init')
         Waiting.show('loadHangarSpace')
         self.__inited = True
         self.__isSpacePremium = isPremium
         self.__igrSpaceType = self.igrCtrl.getRoomType()
         self.__space.create(isPremium, self.__spaceDone)
         if self.__lastUpdatedVehicle is not None:
             self.updateVehicle(self.__lastUpdatedVehicle)
         self.gameSession.onPremiumNotify += self.onPremiumChanged
     return
Beispiel #9
0
def onDisconnected():
    g_statistics.noteHangarLoadingState(HANGAR_LOADING_STATE.DISCONNECTED)
    guiModsSendEvent('onDisconnected')
    g_prbLoader.onDisconnected()
    g_clanCache.onDisconnected()
    ServicesLocator.soundCtrl.stop(isDisconnected=True)
    ServicesLocator.gameState.onDisconnected()
    ServicesLocator.clubsCtrl.stop(isDisconnected=True)
    ServicesLocator.clanCtrl.stop()
    g_wgncProvider.clear()
    g_itemsCache.clear()
    g_goodiesCache.clear()
    ServicesLocator.clear()
    g_lobbyContext.clear()
    g_vehicleProgressCache.clear()
    UsersInfoHelper.clear()
    Waiting.rollback()
    Waiting.cancelCallback()
    g_appLoader.goToLoginByEvent()
Beispiel #10
0
def onDisconnected():
    g_statistics.noteHangarLoadingState(HANGAR_LOADING_STATE.DISCONNECTED)
    guiModsSendEvent("onDisconnected")
    g_prbLoader.onDisconnected()
    g_clanCache.onDisconnected()
    g_soundsCtrl.stop(isDisconnected=True)
    game_control.g_instance.onDisconnected()
    g_clubsCtrl.stop(isDisconnected=True)
    g_clanCtrl.stop()
    g_wgncProvider.clear()
    g_itemsCache.clear()
    g_goodiesCache.clear()
    g_eventsCache.clear()
    g_lobbyContext.clear()
    g_vehicleProgressCache.clear()
    UsersInfoHelper.clear()
    Waiting.rollback()
    Waiting.cancelCallback()
    g_appLoader.goToLoginByEvent()
Beispiel #11
0
def onDisconnected():
    g_statistics.noteHangarLoadingState(HANGAR_LOADING_STATE.DISCONNECTED)
    g_loginManager.writePeripheryLifetime()
    guiModsSendEvent('onDisconnected')
    g_prbLoader.onDisconnected()
    g_clanCache.onDisconnected()
    g_soundsCtrl.stop(isDisconnected=True)
    game_control.g_instance.onDisconnected()
    g_clubsCtrl.stop(isDisconnected=True)
    g_clanCtrl.stop()
    g_wgncProvider.clear()
    g_itemsCache.clear()
    g_goodiesCache.clear()
    g_eventsCache.clear()
    g_lobbyContext.clear()
    g_vehicleProgressCache.clear()
    UsersInfoHelper.clear()
    Waiting.rollback()
    Waiting.cancelCallback()
    g_appLoader.goToLoginByEvent()
Beispiel #12
0
def onAccountShowGUI(ctx):
    global onCenterIsLongDisconnected
    g_statistics.noteHangarLoadingState(HANGAR_LOADING_STATE.SHOW_GUI)
    g_lobbyContext.onAccountShowGUI(ctx)
    yield g_itemsCache.update(CACHE_SYNC_REASON.SHOW_GUI)
    g_statistics.noteHangarLoadingState(HANGAR_LOADING_STATE.QUESTS_SYNC)
    ServicesLocator.eventsCache.start()
    yield ServicesLocator.eventsCache.update()
    g_statistics.noteHangarLoadingState(
        HANGAR_LOADING_STATE.USER_SERVER_SETTINGS_SYNC)
    yield ServicesLocator.settingsCache.update()
    if not g_itemsCache.isSynced():
        g_appLoader.goToLoginByError('#menu:disconnect/codes/0')
        return
    eula = EULADispatcher()
    yield eula.processLicense()
    eula.fini()
    g_playerEvents.onGuiCacheSyncCompleted(ctx)
    code = yield AccountValidator().validate()
    if code > 0:
        g_appLoader.goToLoginByError('#menu:disconnect/codes/%d' % code)
        return
    ServicesLocator.settingsCore.serverSettings.applySettings()
    ServicesLocator.gameState.onAccountShowGUI(g_lobbyContext.getGuiCtx())
    accDossier = g_itemsCache.items.getAccountDossier()
    g_rareAchievesCache.request(accDossier.getBlock('rareAchievements'))
    premium = isPremiumAccount(g_itemsCache.items.stats.attributes)
    if g_hangarSpace.inited:
        g_hangarSpace.refreshSpace(premium)
    else:
        g_hangarSpace.init(premium)
    g_currentVehicle.init()
    g_currentPreviewVehicle.init()
    g_appLoader.showLobby()
    g_prbLoader.onAccountShowGUI(g_lobbyContext.getGuiCtx())
    g_clanCache.onAccountShowGUI()
    ServicesLocator.clubsCtrl.start()
    ServicesLocator.clanCtrl.start()
    ServicesLocator.soundCtrl.start()
    SoundGroups.g_instance.enableLobbySounds(True)
    onCenterIsLongDisconnected(True)
    guiModsSendEvent('onAccountShowGUI', ctx)
    Waiting.hide('enter')
Beispiel #13
0
def onAccountShowGUI(ctx):
    global onCenterIsLongDisconnected
    g_statistics.noteHangarLoadingState(HANGAR_LOADING_STATE.SHOW_GUI)
    g_lobbyContext.onAccountShowGUI(ctx)
    yield g_itemsCache.update(CACHE_SYNC_REASON.SHOW_GUI)
    g_statistics.noteHangarLoadingState(HANGAR_LOADING_STATE.QUESTS_SYNC)
    g_eventsCache.start()
    yield g_eventsCache.update()
    g_statistics.noteHangarLoadingState(HANGAR_LOADING_STATE.USER_SERVER_SETTINGS_SYNC)
    yield g_settingsCache.update()
    if not g_itemsCache.isSynced():
        g_appLoader.goToLoginByError("#menu:disconnect/codes/0")
        return
    eula = EULADispatcher()
    yield eula.processLicense()
    eula.fini()
    g_playerEvents.onGuiCacheSyncCompleted(ctx)
    code = yield AccountValidator().validate()
    if code > 0:
        g_appLoader.goToLoginByError("#menu:disconnect/codes/%d" % code)
        return
    g_settingsCore.serverSettings.applySettings()
    game_control.g_instance.onAccountShowGUI(g_lobbyContext.getGuiCtx())
    accDossier = g_itemsCache.items.getAccountDossier()
    g_rareAchievesCache.request(accDossier.getBlock("rareAchievements"))
    premium = isPremiumAccount(g_itemsCache.items.stats.attributes)
    if g_hangarSpace.inited:
        g_hangarSpace.refreshSpace(premium)
    else:
        g_hangarSpace.init(premium)
    g_currentVehicle.init()
    g_currentPreviewVehicle.init()
    g_appLoader.showLobby()
    g_prbLoader.onAccountShowGUI(g_lobbyContext.getGuiCtx())
    g_clanCache.onAccountShowGUI()
    g_clubsCtrl.start()
    g_clanCtrl.start()
    g_soundsCtrl.start()
    SoundGroups.g_instance.enableLobbySounds(True)
    onCenterIsLongDisconnected(True)
    guiModsSendEvent("onAccountShowGUI", ctx)
    Waiting.hide("enter")
Beispiel #14
0
 def lock(self):
     from helpers.statistics import g_statistics, HANGAR_LOADING_STATE
     g_statistics.noteHangarLoadingState(
         HANGAR_LOADING_STATE.START_LOADING_TUTORIAL)
     self.showWaiting('update-scene', isSingle=True)
Beispiel #15
0
def onConnected():
    g_statistics.noteHangarLoadingState(HANGAR_LOADING_STATE.CONNECTED)
    guiModsSendEvent('onConnected')
    ServicesLocator.gameState.onConnected()
Beispiel #16
0
 def lock(self):
     from helpers.statistics import g_statistics, HANGAR_LOADING_STATE
     g_statistics.noteHangarLoadingState(HANGAR_LOADING_STATE.START_LOADING_TUTORIAL)
     self.showWaiting('update-scene', isSingle=True)
Beispiel #17
0
 def __changeDone(self):
     Waiting.hide('loadHangarSpaceVehicle')
     g_statistics.noteHangarLoadingState(
         HANGAR_LOADING_STATE.FINISH_LOADING_VEHICLE)
Beispiel #18
0
def onConnected():
    g_statistics.noteHangarLoadingState(HANGAR_LOADING_STATE.CONNECTED)
    guiModsSendEvent('onConnected')
    game_control.g_instance.onConnected()
Beispiel #19
0
 def release(self):
     from helpers.statistics import g_statistics, HANGAR_LOADING_STATE
     g_statistics.noteHangarLoadingState(HANGAR_LOADING_STATE.HANGAR_READY)
     self.hideWaiting('update-scene')
Beispiel #20
0
 def updateVehicle(self, vehicle):
     if self.__inited:
         Waiting.show('loadHangarSpaceVehicle', True)
         g_statistics.noteHangarLoadingState(HANGAR_LOADING_STATE.START_LOADING_VEHICLE)
         self.__space.recreateVehicle(vehicle.getCustomizedDescriptor(), vehicle.modelState, self.__changeDone)
         self.__lastUpdatedVehicle = vehicle
Beispiel #21
0
 def release(self):
     from helpers.statistics import g_statistics, HANGAR_LOADING_STATE
     g_statistics.noteHangarLoadingState(HANGAR_LOADING_STATE.FINISH_LOADING_TUTORIAL, showSummaryNow=True)
     self.hideWaiting('update-scene')
Beispiel #22
0
 def release(self):
     from helpers.statistics import g_statistics, HANGAR_LOADING_STATE
     g_statistics.noteHangarLoadingState(
         HANGAR_LOADING_STATE.FINISH_LOADING_TUTORIAL, showSummaryNow=True)
     self.hideWaiting('update-scene')
Beispiel #23
0
def onConnected():
    g_statistics.noteHangarLoadingState(HANGAR_LOADING_STATE.CONNECTED)
    guiModsSendEvent("onConnected")
    game_control.g_instance.onConnected()
Beispiel #24
0
 def __changeDone(self):
     Waiting.hide('loadHangarSpaceVehicle')
     g_statistics.noteHangarLoadingState(HANGAR_LOADING_STATE.FINISH_LOADING_VEHICLE)