def onAccountShowGUI(ctx):
    global onCenterIsLongDisconnected
    ServicesLocator.statsCollector.noteHangarLoadingState(
        HANGAR_LOADING_STATE.SHOW_GUI)
    ServicesLocator.lobbyContext.onAccountShowGUI(ctx)
    yield ServicesLocator.itemsCache.update(CACHE_SYNC_REASON.SHOW_GUI,
                                            notify=False)
    Waiting.show('enter')
    ServicesLocator.statsCollector.noteHangarLoadingState(
        HANGAR_LOADING_STATE.QUESTS_SYNC)
    ServicesLocator.eventsCache.start()
    yield ServicesLocator.eventsCache.update()
    ServicesLocator.statsCollector.noteHangarLoadingState(
        HANGAR_LOADING_STATE.USER_SERVER_SETTINGS_SYNC)
    yield ServicesLocator.settingsCache.update()
    if not ServicesLocator.itemsCache.isSynced():
        ServicesLocator.gameplay.goToLoginByError('#menu:disconnect/codes/0')
        return
    eula = EULADispatcher()
    yield eula.processLicense()
    eula.fini()
    g_playerEvents.onGuiCacheSyncCompleted(ctx)
    code = AccountValidator().validate()
    if code != ValidationCodes.OK:
        ServicesLocator.gameplay.goToLoginByError(
            '#menu:disconnect/codes/{}'.format(code))
        return
    ServicesLocator.itemsCache.onSyncCompleted(CACHE_SYNC_REASON.SHOW_GUI, {})
    ServicesLocator.settingsCore.serverSettings.applySettings()
    ServicesLocator.gameState.onAccountShowGUI(
        ServicesLocator.lobbyContext.getGuiCtx())
    accDossier = ServicesLocator.itemsCache.items.getAccountDossier()
    ServicesLocator.rareAchievesCache.request(
        accDossier.getBlock('rareAchievements'))
    premium = ServicesLocator.itemsCache.items.stats.isPremium
    if ServicesLocator.hangarSpace.inited:
        ServicesLocator.hangarSpace.refreshSpace(premium)
    else:
        ServicesLocator.hangarSpace.init(premium)
    g_currentVehicle.init()
    g_currentPreviewVehicle.init()
    ServicesLocator.webCtrl.start()
    ServicesLocator.soundCtrl.start()
    ServicesLocator.gameplay.postStateEvent(PlayerEventID.ACCOUNT_SHOW_GUI)
    serverSettings = ServicesLocator.lobbyContext.getServerSettings()
    g_prbLoader.onAccountShowGUI(ServicesLocator.lobbyContext.getGuiCtx())
    g_clanCache.onAccountShowGUI()
    g_blueprintGenerator.init()
    SoundGroups.g_instance.enableLobbySounds(True)
    onCenterIsLongDisconnected(True)
    ServicesLocator.offersProvider.start()
    guiModsSendEvent('onAccountShowGUI', ctx)
    if serverSettings.wgcg.getLoginOnStart():
        yield ServicesLocator.webCtrl.login()
    if serverSettings.isElenEnabled():
        yield ServicesLocator.eventsController.getEvents(
            onlySettings=True, onLogin=True, prefetchKeyArtBig=False)
        yield ServicesLocator.eventsController.getHangarFlag(onLogin=True)
Ejemplo n.º 2
0
 def __init__(self, event):
     super(LoginView, self).__init__()
     self.__onLoadCallback = event.get('callback', None)
     self.__loginDispatcher = LoginDispatcher()
     self.__onLoginQueue = False
     self.__capsLockState = None
     self.__EULADispatcher = EULADispatcher()
     self.__showLoginWallpaperNode = 'showLoginWallpaper'
     return
Ejemplo n.º 3
0
def onAccountShowGUI(ctx):
    global onCenterIsLongDisconnected
    ServicesLocator.statsCollector.noteHangarLoadingState(
        HANGAR_LOADING_STATE.SHOW_GUI)
    ServicesLocator.lobbyContext.onAccountShowGUI(ctx)
    yield ServicesLocator.itemsCache.update(CACHE_SYNC_REASON.SHOW_GUI)
    ServicesLocator.statsCollector.noteHangarLoadingState(
        HANGAR_LOADING_STATE.QUESTS_SYNC)
    ServicesLocator.eventsCache.start()
    yield ServicesLocator.eventsCache.update()
    ServicesLocator.statsCollector.noteHangarLoadingState(
        HANGAR_LOADING_STATE.USER_SERVER_SETTINGS_SYNC)
    yield ServicesLocator.settingsCache.update()
    if not ServicesLocator.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(
        ServicesLocator.lobbyContext.getGuiCtx())
    accDossier = ServicesLocator.itemsCache.items.getAccountDossier()
    g_rareAchievesCache.request(accDossier.getBlock('rareAchievements'))
    premium = isPremiumAccount(
        ServicesLocator.itemsCache.items.stats.attributes)
    if g_hangarSpace.inited:
        g_hangarSpace.refreshSpace(premium)
    else:
        g_hangarSpace.init(premium)
    g_currentVehicle.init()
    g_currentPreviewVehicle.init()
    ServicesLocator.clanCtrl.start()
    ServicesLocator.soundCtrl.start()
    g_appLoader.showLobby()
    g_prbLoader.onAccountShowGUI(ServicesLocator.lobbyContext.getGuiCtx())
    if ServicesLocator.lobbyContext.getServerSettings().isElenEnabled():
        yield ServicesLocator.eventsController.getEvents(onlySettings=True,
                                                         onLogin=True)
        yield ServicesLocator.eventsController.getHangarFlag(onLogin=True)
    g_prbLoader.onAccountShowGUI(ServicesLocator.lobbyContext.getGuiCtx())
    g_clanCache.onAccountShowGUI()
    SoundGroups.g_instance.enableLobbySounds(True)
    onCenterIsLongDisconnected(True)
    guiModsSendEvent('onAccountShowGUI', ctx)
    Waiting.hide('enter')
Ejemplo n.º 4
0
    def start(self, lessonNum, isBattleLesson):
        LOG_DEBUG_DEV_BOOTCAMP('Starting bootcamp', lessonNum, isBattleLesson)
        from gui.shared.personality import ServicesLocator
        if BattleReplay.g_replayCtrl.isPlaying:
            self.__replayController = BootcampReplayController()
            self.__replayController.init()
        g_bootcampEvents.onBattleLessonFinished += self.onBattleLessonFinished
        g_bootcampEvents.onGarageLessonFinished += self.onGarageLessonFinished
        g_bootcampEvents.onBattleLoaded += self.onBattleLoaded
        g_bootcampEvents.onResultScreenFinished += self.onResultScreenFinished
        g_bootcampEvents.onRequestBootcampFinish += self.onRequestBootcampFinish
        g_bootcampEvents.onOutroVideoStop += self.onOutroVideoStop
        g_bootcampEvents.onBootcampBecomeNonPlayer += self.onBootcampBecomeNonPlayer
        g_playerEvents.onAvatarBecomeNonPlayer += self.__onAvatarBecomeNonPlayer
        g_playerEvents.onArenaCreated += self.__onArenaCreated
        self.connectionMgr.onDisconnected += self.__cm_onDisconnected
        self.__requestBootcampFinishFromBattle = False
        ctx = self.getContext()
        isRelogin = ctx['relogin']
        LOG_DEBUG_DEV_BOOTCAMP('IsRelogin', isRelogin)
        if not BattleReplay.isPlaying():
            if not isRelogin:
                self.showActionWaitWindow()
                yield self.settingsCore.serverSettings.settingsCache.update()
                self.settingsCore.serverSettings.applySettings()
                if ctx['isNewbie'] and not ctx['completed'] and ctx[
                        'runCount'] == 1:
                    self.__preferences = BootcampPreferences()
                    self.__preferences.setup()
                self.hideActionWaitWindow()
                eula = EULADispatcher()
                yield eula.processLicense()
                eula.fini()
        self.__running = True
        self.__lessonId = lessonNum
        self.__lessonType = BOOTCAMP_LESSON.BATTLE if isBattleLesson else BOOTCAMP_LESSON.GARAGE
        if (lessonNum == 0 or not isBattleLesson) and not isRelogin:
            self.showActionWaitWindow()
            yield ServicesLocator.itemsCache.update(CACHE_SYNC_REASON.SHOW_GUI)
            self.hideActionWaitWindow()
        if self.__currentState is not None:
            self.__currentState.deactivate()
        self.__hangarSpace = ctx['hangarSpace']
        self.__hangarSpacePremium = ctx['hangarSpacePremium']
        self.__bonuses = ctx['bonuses']
        showRewards = ctx['needAwarding']
        previousLesson = self.getContextIntParameter('lastLessonNum') - 1
        if previousLesson >= 0 and previousLesson < len(
                self.__bonuses['battle']):
            self.__bonuses['battle'][previousLesson][
                'showRewards'] = showRewards
        self.__nation = ctx['nation']
        self.__nationsData = ctx['nationsData']
        self.__p['completed'] = ctx['completed']
        self.__p['needAwarding'] = ctx['needAwarding']
        from states.StateBattlePreparing import StateBattlePreparing
        if not BattleReplay.isPlaying():
            if isBattleLesson:
                self.enqueueBattleLesson()
            else:
                self.showActionWaitWindow()
                yield self.nextFrame()
                self.__currentState = StateInGarage(self.__lessonId,
                                                    self.__account,
                                                    self.__checkpoint)
                ReloadLobbyHelper().reload()
                self.hideActionWaitWindow()
                self.__currentState.activate()
        else:
            self.__currentState = StateBattlePreparing(self.__lessonId,
                                                       BigWorld.player())
            self.__currentState.activate()
        BigWorld.overloadBorders(True)
        if self.__chapter is None:
            self.__chapter = Chapter()
        if self.__gui is None:
            self.__gui = BootcampGUI()
        for bankName in self.BOOTCAMP_SOUND_BANKS:
            SoundGroups.g_instance.loadSoundBank(bankName)

        g_bootcampEvents.onBootcampStarted()
        from BootcampGarage import g_bootcampGarage
        g_bootcampGarage.initSubscriptions()
        return
Ejemplo n.º 5
0
def __processEULA(_, callback=None):
    eula = EULADispatcher()
    yield eula.processLicense()
    eula.fini()
    callback(True)
 def start(self, lessonNum, isBattleLesson):
     LOG_DEBUG_DEV_BOOTCAMP('Starting bootcamp', lessonNum, isBattleLesson)
     if BattleReplay.g_replayCtrl.isPlaying:
         self.__replayController = BootcampReplayController()
         self.__replayController.init()
     g_bootcampEvents.onInterludeVideoStarted += self.onInterludeVideoStarted
     g_bootcampEvents.onBattleLessonFinished += self.onBattleLessonFinished
     g_bootcampEvents.onGarageLessonFinished += self.onGarageLessonFinished
     g_bootcampEvents.onBattleLoaded += self.onBattleLoaded
     g_bootcampEvents.onResultScreenPopulated += self.onResultScreenPopulated
     g_bootcampEvents.onResultScreenFinished += self.onResultScreenFinished
     g_bootcampEvents.onRequestBootcampFinish += self.onRequestBootcampFinish
     g_bootcampEvents.onBootcampBecomeNonPlayer += self.onBootcampBecomeNonPlayer
     g_playerEvents.onAvatarBecomeNonPlayer += self.__onAvatarBecomeNonPlayer
     g_playerEvents.onArenaCreated += self.__onArenaCreated
     self.connectionMgr.onDisconnected += self.__cm_onDisconnected
     self.__requestBootcampFinishFromBattle = False
     ctx = self.getContext()
     isRelogin = ctx['relogin']
     LOG_DEBUG_DEV_BOOTCAMP('IsRelogin', isRelogin)
     autoStartBattle = isRelogin or BattleReplay.isPlaying()
     if not autoStartBattle:
         self.showActionWaitWindow()
         yield self.settingsCore.serverSettings.settingsCache.update()
         self.settingsCore.serverSettings.applySettings()
         isNewbie = False
         if ctx['isNewbieSettings'] and not ctx['completed']:
             isNewbie = True
         self.__setupPreferences(isNewbie)
         self.hideActionWaitWindow()
         eula = EULADispatcher()
         yield eula.processLicense()
         eula.fini()
     self.__running = True
     self.__lessonId = lessonNum
     self.__lessonType = BOOTCAMP_LESSON.BATTLE if isBattleLesson else BOOTCAMP_LESSON.GARAGE
     if (lessonNum == 0 or not isBattleLesson) and not autoStartBattle:
         self.showActionWaitWindow()
         yield self.itemsCache.update(CACHE_SYNC_REASON.SHOW_GUI)
         self.__isRecruit = isCurrentUserRecruit()
         self.hideActionWaitWindow()
     if self.__currentState is not None:
         self.__currentState.deactivate()
     self.__hangarSpace = ctx['hangarSpace']
     self.__hangarSpacePremium = ctx['hangarSpacePremium']
     self.__bonuses = ctx['bonuses']
     showRewards = ctx['needAwarding']
     previousLesson = self.getContextIntParameter('lastLessonNum') - 1
     if previousLesson >= 0 and previousLesson < len(
             self.__bonuses['battle']):
         self.__bonuses['battle'][previousLesson][
             'showRewards'] = showRewards
     self.__nation = ctx['nation']
     self.__nationsData = ctx['nationsData']
     self.__p['completed'] = ctx['completed']
     self.__p['needAwarding'] = ctx['needAwarding']
     weave(self.__weaver)
     if AccountSettings.isCleanPC():
         dropNewSettingsCounters()
     g_bootcampEvents.onBootcampStarted()
     if not autoStartBattle:
         if isBattleLesson:
             g_prbLoader.createBattleDispatcher()
             g_prbLoader.setEnabled(True)
             self.enqueueBattleLesson()
         else:
             self.showActionWaitWindow()
             yield self.nextFrame()
             self.__currentState = StateInGarage()
             self.__lobbyReloader.reload()
             self.hideActionWaitWindow()
             self.__currentState.activate()
     else:
         from states.StateBattlePreparing import StateBattlePreparing
         self.__currentState = StateBattlePreparing(self.__lessonId,
                                                    BigWorld.player())
         self.__currentState.activate()
     BigWorld.overloadBorders(True)
     if self.__chapter is None:
         self.__chapter = Chapter()
     if self.__gui is None:
         self.__gui = BootcampGUI()
     WWISE.loadSoundPool(self.BOOTCAMP_SOUND_BANKS, 'Bootcamp')
     self.__combatSoundAssistant = BootcampCombatSoundAssistant()
     self.sessionProvider.getCtx().setPlayerFullNameFormatter(
         _BCNameFormatter())
     return