Esempio n. 1
0
 def _dispose(self):
     if Waiting.isOpened('Flash'):
         Waiting.hide('Flash')
     self.stopPrbListening()
     window = self.app.containerManager.getView(ViewTypes.WINDOW, criteria={POP_UP_CRITERIA.VIEW_ALIAS: PREBATTLE_ALIASES.TRAINING_SETTINGS_WINDOW_PY})
     if window is not None:
         window.destroy()
     self.removeListener(events.TrainingSettingsEvent.UPDATE_TRAINING_SETTINGS, self.__createTrainingRoom, scope=EVENT_BUS_SCOPE.LOBBY)
     super(Trainings, self)._dispose()
     return
Esempio n. 2
0
 def doLogin(self, userName, password, serverName, isSocialToken2Login):
     if Waiting.isVisible():
         return False
     result = self.__validateCredentials(userName.lower().strip(),
                                         password.strip(), self.isToken2())
     if result.isValid:
         if not Waiting.isOpened('login'):
             Waiting.show('login')
         self._loginManager.initiateLogin(
             userName, password, serverName, isSocialToken2Login,
             isSocialToken2Login or self._rememberUser)
     else:
         self._view.as_setErrorMessageS(result.errorMessage,
                                        result.invalidFields)
     return True
Esempio n. 3
0
    def onLegacyListReceived(self, prebattles):
        if Waiting.isOpened('Flash'):
            Waiting.hide('Flash')
        listData = []
        playersTotal = 0
        addObservers = self.prbEntity.getEntityType() in OBSERVERS_BONUS_TYPES
        for item in prebattles:
            arena = ArenaType.g_cache[item.arenaTypeID]
            playersTotal += item.playersCount
            maxPlayersInTeam = arena.maxPlayersInTeam
            if addObservers:
                maxPlayersInTeam += PREBATTLE_MAX_OBSERVERS_IN_TEAM
            badge = item.getBadge()
            badgeVO = badge.getBadgeVO(
                ICONS_SIZES.X24, {'isAtlasSource': False}) if badge else {}
            listData.append({
                'id':
                item.prbID,
                'comment':
                item.getCensoredComment(),
                'arena':
                getArenaFullName(item.arenaTypeID),
                'count':
                item.playersCount,
                'total':
                maxPlayersInTeam,
                'owner':
                item.getCreatorFullName(),
                'creatorName':
                item.creator,
                'creatorClan':
                item.clanAbbrev,
                'creatorIgrType':
                item.creatorIgrType,
                'creatorRegion':
                self._lobbyContext.getRegionCode(item.creatorDbId),
                'icon':
                formatters.getMapIconPath(arena, prefix='small/'),
                'disabled':
                not item.isOpened,
                'badgeVisualVO':
                badgeVO
            })

        self.sendData(listData, playersTotal)
Esempio n. 4
0
 def _dispose(self):
     if Waiting.isOpened('Flash'):
         Waiting.hide('Flash')
     self.stopPrbListening()
     window = self.app.containerManager.getView(
         ViewTypes.WINDOW,
         criteria={
             POP_UP_CRITERIA.VIEW_ALIAS:
             PREBATTLE_ALIASES.TRAINING_SETTINGS_WINDOW_PY
         })
     if window is not None:
         window.destroy()
     self.removeListener(
         events.TrainingSettingsEvent.UPDATE_TRAINING_SETTINGS,
         self.__createTrainingRoom,
         scope=EVENT_BUS_SCOPE.LOBBY)
     super(Trainings, self)._dispose()
     return
Esempio n. 5
0
    def onPrbListReceived(self, prebattles):
        if Waiting.isOpened('Flash'):
            Waiting.hide('Flash')
        listData = []
        playersTotal = 0
        for item in prebattles:
            arena = ArenaType.g_cache[item.arenaTypeID]
            playersTotal += item.playersCount
            listData.append({'id': item.prbID,
             'comment': item.getCensoredComment(),
             'arena': getArenaFullName(item.arenaTypeID),
             'count': item.playersCount,
             'total': arena.maxPlayersInTeam,
             'owner': item.getCreatorFullName(),
             'creatorName': item.creator,
             'creatorClan': item.clanAbbrev,
             'creatorIgrType': item.creatorIgrType,
             'creatorRegion': g_lobbyContext.getRegionCode(item.creatorDbId),
             'icon': formatters.getMapIconPath(arena, prefix='small/'),
             'disabled': not item.isOpened})

        self.sendData(listData, playersTotal)
Esempio n. 6
0
    def onPrbListReceived(self, prebattles):
        if Waiting.isOpened('Flash'):
            Waiting.hide('Flash')
        listData = []
        playersTotal = 0
        for item in prebattles:
            arena = ArenaType.g_cache[item.arenaTypeID]
            playersTotal += item.playersCount
            listData.append({
                'id':
                item.prbID,
                'comment':
                item.getCensoredComment(),
                'arena':
                getArenaFullName(item.arenaTypeID),
                'count':
                item.playersCount,
                'total':
                arena.maxPlayersInTeam,
                'owner':
                item.getCreatorFullName(),
                'creatorName':
                item.creator,
                'creatorClan':
                item.clanAbbrev,
                'creatorIgrType':
                item.creatorIgrType,
                'creatorRegion':
                g_lobbyContext.getRegionCode(item.creatorDbId),
                'icon':
                formatters.getMapIconPath(arena, prefix='small/'),
                'disabled':
                not item.isOpened
            })

        self.sendData(listData, playersTotal)
Esempio n. 7
0
 def fini(self):
     if Waiting.isOpened('login'):
         Waiting.hide('login')
     self._action = None
     return
 def fini(self, ctx):
     if Waiting.isOpened('login'):
         Waiting.hide('login')
     ctx.resetDsn()
     self._dsnDesc = None
     return
Esempio n. 9
0
 def _dispose(self):
     if Waiting.isOpened('Flash'):
         Waiting.hide('Flash')
     self.stopPrbListening()
     super(TrainingsListBase, self)._dispose()