def getInfo(self):
     settings = TrainingSettingsCtx()
     if not self.__isCreateRequest:
         settings = settings.fetch(self.prbFunctional.getSettings())
     if g_itemsCache.isSynced():
         accountAttrs = g_itemsCache.items.stats.attributes
     else:
         accountAttrs = 0
     _, maxBound = getTrainingBattleRoundLimits(accountAttrs)
     info = {
         "description": settings.getComment(),
         "timeout": settings.getRoundLen() / 60,
         "arena": settings.getArenaTypeID(),
         "privacy": not settings.isOpened(),
         "create": self.__isCreateRequest,
         "canMakeOpenedClosed": True,
         "canChangeComment": True,
         "canChangeArena": True,
         "maxBattleTime": maxBound / 60,
     }
     if not self.__isCreateRequest:
         permissions = self.prbFunctional.getPermissions()
         info["canMakeOpenedClosed"] = permissions.canMakeOpenedClosed()
         info["canChangeComment"] = permissions.canChangeComment()
         info["canChangeArena"] = permissions.canChangeArena()
     return info
Example #2
0
def onAccountShowGUI(ctx):
    g_lobbyContext.onAccountShowGUI(ctx)
    yield g_itemsCache.update()
    yield g_questsCache.update()
    yield g_settingsCache.update()
    if not g_itemsCache.isSynced():
        return
    g_settingsCore.serverSettings.applySettings()
    game_control.g_instance.onAccountShowGUI(g_lobbyContext.getGuiCtx())
    accDossier = g_itemsCache.items.getAccountDossier()
    g_rareAchievesCache.request(accDossier.getRecord('rareAchievements'))
    MusicController.g_musicController.setAccountAttrs(g_itemsCache.items.stats.attributes)
    MusicController.g_musicController.play(MusicController.MUSIC_EVENT_LOBBY)
    MusicController.g_musicController.play(MusicController.AMBIENT_EVENT_LOBBY)
    premium = isPremiumAccount(g_itemsCache.items.stats.attributes)
    if g_hangarSpace.inited:
        g_hangarSpace.refreshSpace(premium)
    else:
        g_hangarSpace.init(premium)
    g_currentVehicle.init()
    g_windowsManager.onAccountShowGUI(g_lobbyContext.getGuiCtx())
    yield g_windowsManager.window.tooltipManager.request()
    g_prbLoader.onAccountShowGUI(g_lobbyContext.getGuiCtx())
    SoundGroups.g_instance.enableLobbySounds(True)
    onCenterIsLongDisconnected(True)
    Waiting.hide('enter')
 def getInfo(self):
     settings = TrainingSettingsCtx()
     if not self.__isCreateRequest:
         settings = settings.fetch(self.prbFunctional.getSettings())
     if g_itemsCache.isSynced():
         accountAttrs = g_itemsCache.items.stats.attributes
     else:
         accountAttrs = 0
     _, maxBound = getTrainingBattleRoundLimits(accountAttrs)
     info = {
         'description': settings.getComment(),
         'timeout': settings.getRoundLen() / 60,
         'arena': settings.getArenaTypeID(),
         'privacy': not settings.isOpened(),
         'create': self.__isCreateRequest,
         'canMakeOpenedClosed': True,
         'canChangeComment': True,
         'canChangeArena': True,
         'maxBattleTime': maxBound / 60
     }
     if not self.__isCreateRequest:
         permissions = self.prbFunctional.getPermissions()
         info['canMakeOpenedClosed'] = permissions.canMakeOpenedClosed()
         info['canChangeComment'] = permissions.canChangeComment()
         info['canChangeArena'] = permissions.canChangeArena()
     return info
Example #4
0
def onAccountShowGUI(ctx):
    g_lobbyContext.onAccountShowGUI(ctx)
    yield g_itemsCache.update()
    yield g_questsCache.update()
    yield g_settingsCache.update()
    if not g_itemsCache.isSynced():
        return
    g_settingsCore.serverSettings.applySettings()
    game_control.g_instance.onAccountShowGUI(g_lobbyContext.getGuiCtx())
    accDossier = g_itemsCache.items.getAccountDossier()
    g_rareAchievesCache.request(accDossier.getRecord('rareAchievements'))
    MusicController.g_musicController.setAccountAttrs(
        g_itemsCache.items.stats.attributes)
    MusicController.g_musicController.play(MusicController.MUSIC_EVENT_LOBBY)
    MusicController.g_musicController.play(MusicController.AMBIENT_EVENT_LOBBY)
    premium = isPremiumAccount(g_itemsCache.items.stats.attributes)
    if g_hangarSpace.inited:
        g_hangarSpace.refreshSpace(premium)
    else:
        g_hangarSpace.init(premium)
    g_currentVehicle.init()
    g_windowsManager.onAccountShowGUI(g_lobbyContext.getGuiCtx())
    yield g_windowsManager.window.tooltipManager.request()
    g_prbLoader.onAccountShowGUI(g_lobbyContext.getGuiCtx())
    SoundGroups.g_instance.enableLobbySounds(True)
    onCenterIsLongDisconnected(True)
    Waiting.hide('enter')
Example #5
0
def onShopResync():
    yield g_itemsCache.update()
    if not g_itemsCache.isSynced():
        return
    Waiting.hide('sinhronize')
    import time
    now = time.time()
    SystemMessages.g_instance.pushI18nMessage(SYSTEM_MESSAGES.SHOP_RESYNC, date=BigWorld.wg_getLongDateFormat(now), time=BigWorld.wg_getShortTimeFormat(now), type=SystemMessages.SM_TYPE.Information)
Example #6
0
def onShopResync():
    yield g_itemsCache.update(CACHE_SYNC_REASON.SHOP_RESYNC)
    if not g_itemsCache.isSynced():
        Waiting.hide('sinhronize')
        return
    yield g_eventsCache.update()
    Waiting.hide('sinhronize')
    now = time_utils.getCurrentTimestamp()
    SystemMessages.g_instance.pushI18nMessage(SYSTEM_MESSAGES.SHOP_RESYNC, date=BigWorld.wg_getLongDateFormat(now), time=BigWorld.wg_getShortTimeFormat(now), type=SystemMessages.SM_TYPE.Information)
Example #7
0
def onShopResync():
    yield g_itemsCache.update(CACHE_SYNC_REASON.SHOP_RESYNC)
    if not g_itemsCache.isSynced():
        Waiting.hide('sinhronize')
        return
    yield g_eventsCache.update()
    Waiting.hide('sinhronize')
    now = time_utils.getCurrentTimestamp()
    SystemMessages.g_instance.pushI18nMessage(SYSTEM_MESSAGES.SHOP_RESYNC, date=BigWorld.wg_getLongDateFormat(now), time=BigWorld.wg_getShortTimeFormat(now), type=SystemMessages.SM_TYPE.Information)
Example #8
0
def onShopResync():
    yield g_itemsCache.update()
    if not g_itemsCache.isSynced():
        return
    Waiting.hide('sinhronize')
    import time
    now = time.time()
    SystemMessages.g_instance.pushI18nMessage(
        SYSTEM_MESSAGES.SHOP_RESYNC,
        date=BigWorld.wg_getLongDateFormat(now),
        time=BigWorld.wg_getShortTimeFormat(now),
        type=SystemMessages.SM_TYPE.Information)
Example #9
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')
Example #10
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")
Example #11
0
def onAccountShowGUI(ctx):
    global onCenterIsLongDisconnected
    g_lobbyContext.onAccountShowGUI(ctx)
    yield g_itemsCache.update(CACHE_SYNC_REASON.SHOW_GUI)
    g_eventsCache.start()
    yield g_eventsCache.update()
    yield g_settingsCache.update()
    if not g_itemsCache.isSynced():
        return
    eula = EULADispatcher()
    yield eula.processLicense()
    eula.fini()
    g_playerEvents.onGuiCacheSyncCompleted(ctx)
    code = yield AccountValidator().validate()
    if code > 0:
        from gui import DialogsInterface

        DialogsInterface.showDisconnect("#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"))
    MusicController.g_musicController.setAccountAttrs(g_itemsCache.items.stats.attributes)
    MusicController.g_musicController.play(MusicController.MUSIC_EVENT_LOBBY)
    MusicController.g_musicController.play(MusicController.AMBIENT_EVENT_LOBBY)
    premium = isPremiumAccount(g_itemsCache.items.stats.attributes)
    if g_hangarSpace.inited:
        g_hangarSpace.refreshSpace(premium)
    else:
        g_hangarSpace.init(premium)
    g_currentVehicle.init()
    g_appLoader.showLobby()
    g_prbLoader.onAccountShowGUI(g_lobbyContext.getGuiCtx())
    g_clanCache.onAccountShowGUI()
    g_clubsCtrl.start()
    SoundGroups.g_instance.enableLobbySounds(True)
    onCenterIsLongDisconnected(True)
    guiModsSendEvent("onAccountShowGUI", ctx)
    Waiting.hide("enter")
 def getInfo(self):
     settings = TrainingSettingsCtx()
     if not self.__isCreateRequest:
         settings = settings.fetch(self.prbFunctional.getSettings())
     if g_itemsCache.isSynced():
         accountAttrs = g_itemsCache.items.stats.attributes
     else:
         accountAttrs = 0
     _, maxBound = getTrainingBattleRoundLimits(accountAttrs)
     info = {'description': settings.getComment(),
      'timeout': settings.getRoundLen() / 60,
      'arena': settings.getArenaTypeID(),
      'privacy': not settings.isOpened(),
      'create': self.__isCreateRequest,
      'canMakeOpenedClosed': True,
      'canChangeComment': True,
      'canChangeArena': True,
      'maxBattleTime': maxBound / 60}
     if not self.__isCreateRequest:
         permissions = self.prbFunctional.getPermissions()
         info['canMakeOpenedClosed'] = permissions.canMakeOpenedClosed()
         info['canChangeComment'] = permissions.canChangeComment()
         info['canChangeArena'] = permissions.canChangeArena()
     return info