Пример #1
0
 def _getDetailedData(self, data):
     stats = data['stats']
     ratings = data['ratings']
     favouriteAttrs = data['favouriteAttrs']
     ratingsOutDated = ratings.isGlobalMapOutdated()
     columns = [[PUtils.getLabelDataObject(CL.GLOBALMAPVIEW_LEVEL10, _getLevelParams(CL.globalmapview_statistics10, stats.getBattles10LevelCount, stats.getWins10LevelEfficiency, ratings.getGlobalMapEloRating10, ratings.getGlobalMapEloRatingRank10, favouriteAttrs.getFavouriteArena10, ratingsOutDated))], [PUtils.getLabelDataObject(CL.GLOBALMAPVIEW_LEVEL8, _getLevelParams(CL.globalmapview_statistics8, stats.getBattles8LevelCount, stats.getWins8LevelEfficiency, ratings.getGlobalMapEloRating8, ratings.getGlobalMapEloRatingRank8, favouriteAttrs.getFavouriteArena8, ratingsOutDated))], [PUtils.getLabelDataObject(CL.GLOBALMAPVIEW_LEVEL6, _getLevelParams(CL.globalmapview_statistics6, stats.getBattles6LevelCount, stats.getWins6LevelEfficiency, ratings.getGlobalMapEloRating6, ratings.getGlobalMapEloRatingRank6, favouriteAttrs.getFavouriteArena6, ratingsOutDated))]]
     return (PUtils.getLabelViewTypeDataObject(CLANS.GLOBALMAPVIEW_TABS_STATS, columns, PUtils.VIEW_TYPE_TABLES), PUtils.getLabelViewTypeDataObject(CLANS.GLOBALMAPVIEW_TABS_PROVINCES, None, PUtils.VIEW_TYPE_TABLE))
Пример #2
0
    def _sendVehicleData(self, targetData, vehDossier):
        outcome = ProfileUtils.packProfileCommonInfo(targetData)
        outcome['lossesEfficiency'] = targetData.getLossesEfficiency()
        outcome['survivalEfficiency'] = targetData.getSurvivalEfficiency()
        outcome['maxVehicleFrags'] = targetData.getMaxFrags()
        outcome['fragsCount'] = targetData.getFragsCount()
        outcome['deathsCount'] = targetData.getDeathsCount()
        outcome['fragsEfficiency'] = targetData.getFragsEfficiency()
        outcome['damageDealt'] = targetData.getDamageDealt()
        outcome['damageReceived'] = targetData.getDamageReceived()
        outcome['damageEfficiency'] = targetData.getDamageEfficiency()
        outcome['avgFrags'] = targetData.getAvgFrags()
        outcome['avgEnemiesSpotted'] = targetData.getAvgEnemiesSpotted()
        outcome['avgDamageDealt'] = targetData.getAvgDamageDealt()
        outcome['avgDamageReceived'] = targetData.getAvgDamageReceived()
        packedList = None
        if self._isTotalStatisticsTempSolution:
            packedList = []
            achievements = vehDossier.getAchievements(True)
            for achievementBlockList in achievements:
                packedList.append(ProfileUtils.packAchievementList(achievementBlockList, vehDossier, self._userID is None))

        outcome['achievements'] = packedList
        self.as_responseVehicleDossierS(outcome)
        return
Пример #3
0
 def _getDetailedData(self, data):
     targetData = data[0]
     dataList = []
     if isFortificationBattlesEnabled():
         dataList.append(_getDetailedStatisticsData(PROFILE.SECTION_STATISTICS_BODYBAR_LABEL_FORTBATTLES, self.__fortBattlesTargetData, isCurrentUser=self._isCurrentUser, layout=FORT_STATISTICS_LAYOUT))
     dataList.append(_getDetailedStatisticsData(PROFILE.SECTION_STATISTICS_BODYBAR_LABEL_FORTSORTIE, targetData, isCurrentUser=self._isCurrentUser))
     specificData = []
     battlesCount = self.__fortBattlesTargetData.getBattlesCount()
     lossesCount = self.__fortBattlesTargetData.getLossesCount()
     winsCount = self.__fortBattlesTargetData.getWinsCount()
     formattedBattlesCount = BigWorld.wg_getIntegralFormat(battlesCount)
     specificDataColumn1 = []
     if isFortificationBattlesEnabled():
         specificDataColumn1.append(PUtils.getLabelDataObject(PROFILE.SECTION_STATISTICS_BODYPARAMS_LABEL_FORTBATTLES, (DSUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTTOTALBATTLES, formattedBattlesCount, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_BATTLES, PUtils.createToolTipData((BigWorld.wg_getIntegralFormat(winsCount), BigWorld.wg_getIntegralFormat(lossesCount)))),
          DSUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTBATTLESTOTALWINS, PUtils.getFormattedWinsEfficiency(self.__fortBattlesTargetData), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLESWINS),
          DSUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_LOOTING, self.__fortMiscTargetData.getEnemyBasePlunderNumber(), PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_LOOTING),
          DSUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTBATTLES_ATTACKS, self.__fortMiscTargetData.getAttackNumber(), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLES_ATTACKS),
          DSUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTBATTLES_DEFENCES, self.__fortMiscTargetData.getDefenceHours(), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLES_DEFENCES))))
     battlesCount = targetData.getBattlesCount()
     lossesCount = targetData.getLossesCount()
     winsCount = targetData.getWinsCount()
     drawsCount = targetData.getDrawsCount()
     formattedBattlesCount = BigWorld.wg_getIntegralFormat(battlesCount)
     specificDataColumn1.append(PUtils.getLabelDataObject(PROFILE.SECTION_STATISTICS_BODYPARAMS_LABEL_FORTSORTIE, (DSUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORT_SORTIE, formattedBattlesCount, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_SORTIE, PUtils.createToolTipData((BigWorld.wg_getIntegralFormat(winsCount), BigWorld.wg_getIntegralFormat(lossesCount), BigWorld.wg_getIntegralFormat(drawsCount)))), DSUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTSORTIETOTALWINS, self._formattedWinsEfficiency, PROFILE.PROFILE_PARAMS_TOOLTIP_FORTSORTIEWINS))))
     specificData.append(specificDataColumn1)
     resourcesDataList = [DSUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTSORTIES_AVGRESOURCES, self.__avgFortSortiesLoot, PROFILE.PROFILE_PARAMS_TOOLTIP_FORTSORTIES_AVGRESOURCES), DSUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTSORTIES_TOTALRESOURCES, BigWorld.wg_getIntegralFormat(self.__totalSortiesLoot), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTSORTIES_TOTALRESOURCES)]
     specificDataColumn2 = []
     if isFortificationBattlesEnabled():
         resourcesDataList.append(DSUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTBATTLES_TOTALRESOURCES, BigWorld.wg_getIntegralFormat(self.__fortMiscTargetData.getLootInBattles()), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLES_TOTALRESOURCES))
         resourcesDataList.append(DSUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTBATTLES_MAXRESOURCES, BigWorld.wg_getIntegralFormat(self.__fortMiscTargetData.getMaxLootInBattles()), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLES_MAXRESOURCES))
     specificDataColumn2.append(PUtils.getLabelDataObject(PROFILE.SECTION_STATISTICS_BODYPARAMS_LABEL_RESOURCE, resourcesDataList))
     specificData.append(specificDataColumn2)
     dataList.append(PUtils.getLabelViewTypeDataObject(PROFILE.SECTION_STATISTICS_BODYBAR_LABEL_SPECIFIC, specificData, PUtils.VIEW_TYPE_TABLES))
     return dataList
Пример #4
0
 def _getHeaderData(self, data):
     return (PUtils.getTotalBattlesHeaderParam(data[0], PROFILE.SECTION_STATISTICS_SCORES_TOTALBATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_BATTLESCOUNT),
      PUtils.packLditItemData(self._damageEfficiency, PROFILE.SECTION_STATISTICS_DETAILED_DAMAGECOEFFICIENT, PROFILE.PROFILE_PARAMS_TOOLTIP_DAMAGECOEFF, 'dmgRatio40x32.png', PUtils.createToolTipData((BigWorld.wg_getIntegralFormat(self._dmgDealt), BigWorld.wg_getIntegralFormat(self._dmgReceived)))),
      _packAvgDmgLditItemData(self._avgDmg),
      _packAvgXPLditItemData(self._avgXP),
      PUtils.packLditItemData(self._avgAssistDmg, PROFILE.SECTION_STATISTICS_SCORES_AVGASSISTEDDAMAGE, PROFILE.PROFILE_PARAMS_TOOLTIP_AVGASSISTEDDAMAGE, 'assist40x32.png'),
      PUtils.packLditItemData(BigWorld.wg_getNiceNumberFormat(self._armorUsingEfficiency), PROFILE.SECTION_STATISTICS_SCORES_ARMORUSING, PROFILE.PROFILE_PARAMS_TOOLTIP_ARMORUSING, 'armorUsing40x32.png', self._armorUsingToolTipData))
Пример #5
0
 def _getDetailedData(self, data):
     stats = data['stats']
     ratings = data['ratings']
     favouriteAttrs = data['favouriteAttrs']
     ratingsOutDated = ratings.isGlobalMapOutdated()
     columns = [[PUtils.getLabelDataObject(CL.GLOBALMAPVIEW_LEVEL10, _getLevelParams(CL.globalmapview_statistics10, stats.getBattles10LevelCount, stats.getWins10LevelEfficiency, ratings.getGlobalMapEloRating10, ratings.getGlobalMapEloRatingRank10, favouriteAttrs.getFavouriteArena10, ratingsOutDated))], [PUtils.getLabelDataObject(CL.GLOBALMAPVIEW_LEVEL8, _getLevelParams(CL.globalmapview_statistics8, stats.getBattles8LevelCount, stats.getWins8LevelEfficiency, ratings.getGlobalMapEloRating8, ratings.getGlobalMapEloRatingRank8, favouriteAttrs.getFavouriteArena8, ratingsOutDated))], [PUtils.getLabelDataObject(CL.GLOBALMAPVIEW_LEVEL6, _getLevelParams(CL.globalmapview_statistics6, stats.getBattles6LevelCount, stats.getWins6LevelEfficiency, ratings.getGlobalMapEloRating6, ratings.getGlobalMapEloRatingRank6, favouriteAttrs.getFavouriteArena6, ratingsOutDated))]]
     return (PUtils.getLabelViewTypeDataObject(CL.GLOBALMAPVIEW_TABS_STATS, columns, PUtils.VIEW_TYPE_TABLES), PUtils.getLabelViewTypeDataObject(CL.GLOBALMAPVIEW_TABS_PROVINCES, None, PUtils.VIEW_TYPE_TABLE))
Пример #6
0
    def _sendVehicleData(self, targetData, vehDossier):
        outcome = ProfileUtils.packProfileCommonInfo(targetData)
        outcome['lossesEfficiency'] = targetData.getLossesEfficiency()
        outcome['survivalEfficiency'] = targetData.getSurvivalEfficiency()
        outcome['maxVehicleFrags'] = targetData.getMaxFrags()
        outcome['fragsCount'] = targetData.getFragsCount()
        outcome['deathsCount'] = targetData.getDeathsCount()
        outcome['fragsEfficiency'] = targetData.getFragsEfficiency()
        outcome['damageDealt'] = targetData.getDamageDealt()
        outcome['damageReceived'] = targetData.getDamageReceived()
        outcome['damageEfficiency'] = targetData.getDamageEfficiency()
        outcome['avgFrags'] = targetData.getAvgFrags()
        outcome['avgEnemiesSpotted'] = targetData.getAvgEnemiesSpotted()
        outcome['avgDamageDealt'] = targetData.getAvgDamageDealt()
        outcome['avgDamageReceived'] = targetData.getAvgDamageReceived()
        packedList = None
        if self._isTotalStatisticsTempSolution:
            packedList = []
            achievements = vehDossier.getAchievements(True)
            for achievementBlockList in achievements:
                packedList.append(
                    ProfileUtils.packAchievementList(achievementBlockList,
                                                     vehDossier,
                                                     self._userID is None))

        outcome['achievements'] = packedList
        self.as_responseVehicleDossierS(outcome)
        return
Пример #7
0
 def __packAvgPosition(self):
     res = PUtils.getValueOrUnavailable(
         self.__targetData.getAveragePosition())
     return PUtils.packLditItemData(
         backport.getNiceNumberFormat(res),
         PROFILE.SECTION_SUMMARY_SCORES_AVERAGERANK,
         PROFILE.PROFILE_PARAMS_TOOLTIP_BRAVERAGERANK,
         'avgPosition40x32.png')
Пример #8
0
 def _getHeaderData(self, data):
     targetData = data[0]
     return (PUtils.getTotalBattlesHeaderParam(targetData, PROFILE.SECTION_STATISTICS_SCORES_TOTALBATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_BATTLESCOUNT),
      PUtils.packLditItemData(self._formattedWinsEfficiency, PROFILE.SECTION_STATISTICS_SCORES_TOTALWINS, PROFILE.PROFILE_PARAMS_TOOLTIP_WINS, 'wins40x32.png'),
      _packAvgDmgLditItemData(self._avgDmg),
      _packAvgXPLditItemData(self._avgXP),
      PUtils.packLditItemData(self._maxXP_formattedStr, PROFILE.SECTION_STATISTICS_SCORES_MAXEXPERIENCE, PROFILE.PROFILE_PARAMS_TOOLTIP_MAXEXP, 'maxExp40x32.png', PUtils.getVehicleRecordTooltipData(targetData.getMaxXpVehicle)),
      PUtils.packLditItemData(self._damageEfficiency, PROFILE.SECTION_STATISTICS_SCORES_CLAN_SUMMARYDAMAGECOEFFICIENT, PROFILE.PROFILE_PARAMS_TOOLTIP_CLAN_SUMMARYDAMAGECOEFFICIENT, 'dmgRatio40x32.png', PUtils.createToolTipData((BigWorld.wg_getIntegralFormat(self._dmgDealt), BigWorld.wg_getIntegralFormat(self._dmgReceived)))))
Пример #9
0
 def _getHeaderData(self, data):
     targetData = data[0]
     return (PUtils.getTotalBattlesHeaderParam(targetData, PROFILE.SECTION_STATISTICS_SCORES_TOTALBATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_BATTLESCOUNT),
      PUtils.packLditItemData(self._formattedWinsEfficiency, PROFILE.SECTION_STATISTICS_SCORES_TOTALWINS, PROFILE.PROFILE_PARAMS_TOOLTIP_WINS, 'wins40x32.png'),
      _packAvgDmgLditItemData(self._avgDmg),
      _packAvgXPLditItemData(self._avgXP),
      PUtils.packLditItemData(self._maxXP_formattedStr, PROFILE.SECTION_STATISTICS_SCORES_MAXEXPERIENCE, PROFILE.PROFILE_PARAMS_TOOLTIP_MAXEXP, 'maxExp40x32.png', PUtils.getVehicleRecordTooltipData(targetData.getMaxXpVehicle)),
      PUtils.packLditItemData(BigWorld.wg_getIntegralFormat(targetData.getMarksOfMastery()[3]), PROFILE.SECTION_STATISTICS_SCORES_COOLSIGNS, PROFILE.PROFILE_PARAMS_TOOLTIP_MARKOFMASTERY, 'markOfMastery40x32.png'))
 def __updateHeader(self):
     isCreator = self.unitFunctional.getPlayerInfo().isCreator() if self.unitFunctional is not None else False
     club = self.clubsCtrl.getClub(self.__clubDBID)
     hasRankForModeChange = club is not None and club.getPermissions().canSetRanked()
     seasonActive = isSeasonInProgress()
     modeLabel = ''
     modeTooltip = ''
     modeTextStyle = TEXT_MANAGER_STYLES.STANDARD_TEXT
     if not seasonActive:
         modeLabel = CYBERSPORT.STATICFORMATION_UNITVIEW_MODECHANGEWARNING_NOSEASON
         modeTooltip = CYBERSPORT.STATICFORMATION_UNITVIEW_MODECHANGEWARNING_NOSEASONTOOLTIP
     elif isCreator:
         if not hasRankForModeChange:
             modeLabel = CYBERSPORT.STATICFORMATION_UNITVIEW_MODECHANGEWARNING_LOWRANK
             modeTooltip = CYBERSPORT.STATICFORMATION_UNITVIEW_MODECHANGEWARNING_LOWRANKTOOLTIP
         elif self.__extra.isRatedBattle:
             modeLabel = CYBERSPORT.STATICFORMATION_UNITVIEW_SETUNRANKEDMODE
         else:
             modeLabel = CYBERSPORT.STATICFORMATION_UNITVIEW_SETRANKEDMODE
     elif self.__extra.isRatedBattle:
         modeLabel = CYBERSPORT.STATICFORMATION_UNITVIEW_RANKEDMODE
         modeTextStyle = TEXT_MANAGER_STYLES.NEUTRAL_TEXT
     else:
         modeLabel = CYBERSPORT.STATICFORMATION_UNITVIEW_MODECHANGEWARNING_WRONGROLE
         modeTooltip = CYBERSPORT.STATICFORMATION_UNITVIEW_MODECHANGEWARNING_WRONGROLETOOLTIP
     bgSource = RES_ICONS.MAPS_ICONS_LIBRARY_CYBERSPORT_LEAGUERIBBONS_UNRANKED
     battles = self.ABSENT_VALUES
     winRate = self.ABSENT_VALUES
     leagueIcon = getLadderChevron64x64()
     enableWinRateTF = False
     if club is not None:
         clubTotalStats = club.getTotalDossier().getTotalStats()
         battles = BigWorld.wg_getNiceNumberFormat(clubTotalStats.getBattlesCount())
         division = club.getLadderInfo().division
         leagueIcon = getLadderChevron64x64(division)
         winRateValue = ProfileUtils.getValueOrUnavailable(clubTotalStats.getWinsEfficiency())
         if winRateValue != ProfileUtils.UNAVAILABLE_VALUE:
             enableWinRateTF = True
             winRate = ProfileUtils.formatFloatPercent(winRateValue)
         else:
             winRate = self.ABSENT_VALUES
         if self.__extra.isRatedBattle:
             bgSource = getLadderBackground(division)
         self.requestClubEmblem64x64(club.getClubDbID(), club.getEmblem64x64())
     self.as_setHeaderDataS({'teamName': self.__extra.clubName,
      'isRankedMode': bool(self.__extra.isRatedBattle),
      'battles': battles,
      'winRate': winRate,
      'enableWinRateTF': enableWinRateTF,
      'leagueIcon': leagueIcon,
      'isFixedMode': not seasonActive or not isCreator,
      'modeLabel': TextManager.getText(modeTextStyle, _ms(modeLabel)),
      'modeTooltip': modeTooltip,
      'bgSource': bgSource})
     return
Пример #11
0
 def _sendAccountData(self, targetData, accountDossier):
     outcome = ProfileUtils.packProfileDossierInfo(targetData)
     outcome['avgDamage'] = targetData.getAvgDamage()
     outcome['maxDestroyed'] = targetData.getMaxFrags()
     vehicle = g_itemsCache.items.getItemByCD(targetData.getMaxFragsVehicle())
     outcome['maxDestroyedByVehicle'] = vehicle.shortUserName if vehicle is not None else ''
     outcome['globalRating'] = self.getGlobalRating(self._databaseID)
     outcome['significantAchievements'] = ProfileUtils.packAchievementList(accountDossier.getSignificantAchievements(), accountDossier, self._userID is None)
     outcome['nearestAchievements'] = ProfileUtils.packAchievementList(accountDossier.getNearestAchievements(), accountDossier, self._userID is None)
     self.as_responseDossierS(self._battlesType, outcome)
     return
Пример #12
0
    def _getHeaderData(self, data):
        targetData = data[0]
        histBattleFieldAchievesCount = 0
        for record in layouts.HISTORY_BATTLEFIELD_GROUP:
            achieve = targetData.getAchievement(record)
            if achieve.isInDossier():
                histBattleFieldAchievesCount += 1

        histBattleFieldAchievesCount = BigWorld.wg_getIntegralFormat(histBattleFieldAchievesCount)
        return (PUtils.getTotalBattlesHeaderParam(targetData, PROFILE.SECTION_STATISTICS_SCORES_TOTALBATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_BATTLESCOUNT),
         PUtils.packLditItemData(self._formattedWinsEfficiency, PROFILE.SECTION_STATISTICS_SCORES_TOTALWINS, PROFILE.PROFILE_PARAMS_TOOLTIP_WINS, 'wins40x32.png'),
         PUtils.packLditItemData(histBattleFieldAchievesCount, PROFILE.SECTION_STATISTICS_SCORES_ACHIEVEMENTSCOUNT, PROFILE.PROFILE_PARAMS_TOOLTIP_ACHIEVEMENTSCOUNT, 'honors40x32.png'),
         PUtils.packLditItemData(BigWorld.wg_getIntegralFormat(len(targetData.getVehicles())), PROFILE.SECTION_STATISTICS_SCORES_USEDTECHNICS, PROFILE.PROFILE_PARAMS_TOOLTIP_USEDTECHNICS, 'techRatio40x32.png'))
Пример #13
0
 def _getHeaderData(self, data):
     return (PUtils.getTotalBattlesHeaderParam(
         data, FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLESCOUNT_LABEL,
         FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLESCOUNT_TOOLTIP),
             PUtils.packLditItemData(
                 PUtils.getFormattedWinsEfficiency(data),
                 FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_WINS_LABEL,
                 FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_WINS_TOOLTIP,
                 'wins40x32.png'),
             PUtils.packLditItemData(
                 PUtils.formatEfficiency(data.getBattlesCount(),
                                         data.getAvgLoot),
                 FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_AVGDEFRES_LABEL,
                 FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_AVGDEFRES_TOOLTIP,
                 'avgDefes40x32.png'))
Пример #14
0
def _packItemData(text, description, tooltip, icon):
    return {'type': HeaderItemsTypes.COMMON,
     'text': text,
     'description': _ms(description),
     'iconPath': ProfileUtils.getIconPath(icon),
     'tooltip': tooltip,
     'enabled': True}
Пример #15
0
def _getDetailedStatisticsData(label, targetData, isCurrentUser, layout = STATISTICS_LAYOUT):
    detailedStatisticsData = DSUtils.getStatistics(targetData, isCurrentUser, layout)
    result = []
    for val in detailedStatisticsData:
        result.append([val])

    return PUtils.getLabelViewTypeDataObject(label, result, PUtils.VIEW_TYPE_TABLES)
def _packStat(description, tooltip, icon, isEnabled, text):
    return {'type': HeaderItemsTypes.COMMON,
     'text': text,
     'description': _ms(description),
     'iconPath': ProfileUtils.getIconPath(icon),
     'tooltip': tooltip,
     'enabled': isEnabled}
Пример #17
0
 def __getIndicatorData(self, value, formater, description, icon, tooltip):
     val = ProfileUtils.getValueOrUnavailable(value)
     return {'value': formater(val),
      'description': description,
      'iconSource': icon,
      'tooltip': tooltip,
      'enabled': val != ProfileUtils.UNAVAILABLE_VALUE}
Пример #18
0
 def __getIndicatorData(self, value, formater, description, icon, tooltip):
     val = ProfileUtils.getValueOrUnavailable(value)
     return {'value': formater(val),
      'description': description,
      'iconSource': icon,
      'tooltip': tooltip,
      'enabled': val != ProfileUtils.UNAVAILABLE_VALUE}
Пример #19
0
def _packItemData(text, description, tooltip, icon):
    return {'type': HeaderItemsTypes.COMMON,
     'text': text,
     'description': _ms(description),
     'iconPath': ProfileUtils.getIconPath(icon),
     'tooltip': tooltip,
     'enabled': True}
Пример #20
0
 def _sendAccountData(self, targetData, accountDossier):
     outcome = ProfileUtils.packProfileDossierInfo(targetData)
     outcome['avgDamage'] = targetData.getAvgDamage()
     outcome['maxDestroyed'] = targetData.getMaxFrags()
     vehicle = g_itemsCache.items.getItemByCD(
         targetData.getMaxFragsVehicle())
     outcome[
         'maxDestroyedByVehicle'] = vehicle.shortUserName if vehicle is not None else ''
     outcome['globalRating'] = self.getGlobalRating(self._databaseID)
     outcome['significantAchievements'] = ProfileUtils.packAchievementList(
         accountDossier.getSignificantAchievements(), accountDossier,
         self._userID is None)
     outcome['nearestAchievements'] = ProfileUtils.packAchievementList(
         accountDossier.getNearestAchievements(), accountDossier,
         self._userID is None)
     self.as_responseDossierS(self._battlesType, outcome)
     return
Пример #21
0
 def _getHeaderData(self, data):
     targetData = data[0]
     return (PUtils.getTotalBattlesHeaderParam(targetData, PROFILE.SECTION_STATISTICS_SCORES_TOTALBATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_DIF_FALLOUT_BATTLESCOUNT),
      self.__packAvgVictoryPointsData(self.__avgVictoryPoints),
      _packAvgXPLditItemData(self._avgXP),
      self.__packAvgDmgData(self._avgDmg),
      self.__packMaxVictoryPoints(self.__maxVictoryPoints),
      self.__packKDR(self.__kdr, self.__kills, self.__consumablesKills, self.__deaths))
Пример #22
0
 def __init__(self, targetData, accountDossier, isCurrentUser):
     self.__avgVictoryPoints = PUtils.getValueOrUnavailable(targetData.getAvgVictoryPoints())
     self.__maxVictoryPoints = targetData.getMaxVictoryPoints()
     self.__kdr = targetData.getFragsEfficiency()
     self.__kills = targetData.getFragsCount()
     self.__consumablesKills = targetData.getConsumablesFragsCount()
     self.__deaths = targetData.getDeathsCount()
     super(ProfileFalloutStatisticsVO, self).__init__(targetData, accountDossier, isCurrentUser)
Пример #23
0
    def __getDetailedStatisticsData(self, label, targetData):
        detailedStatisticsData = DetailedStatisticsUtils.getStatistics(targetData)
        detailedStatisticsData[0]['data'].append(DetailedStatisticsUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_CAPTUREPOINTS, BigWorld.wg_getIntegralFormat(targetData.getCapturePoints()), PROFILE.PROFILE_PARAMS_TOOLTIP_CAPTUREPOINTS))
        detailedStatisticsData[0]['data'].append(DetailedStatisticsUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_DROPPEDCAPTUREPOINTS, BigWorld.wg_getIntegralFormat(targetData.getDroppedCapturePoints()), PROFILE.PROFILE_PARAMS_TOOLTIP_DROPPEDCAPTUREPOINTS))
        result = []
        for val in detailedStatisticsData:
            result.append([val])

        return ProfileUtils.getLabelViewTypeDataObject(label, result, ProfileUtils.VIEW_TYPE_TABLES)
Пример #24
0
 def _getDetailedData(self, data):
     return PUtils.getLabelDataObject(CL.SECTION_FORT_VIEW_STATISTICS_SORTIES_DETAILED_HEADER, [SUtils.getDetailedDataObject(CL.SECTION_FORT_VIEW_STATISTICS_SORTIES_DETAILED_MIDDLEBATTLESCOUNT, BigWorld.wg_getIntegralFormat(data.getMiddleBattlesCount()), CL.SECTION_FORT_TOOLTIPS_MIDDLEBATTLESCOUNT),
      SUtils.getDetailedDataObject(CL.SECTION_FORT_VIEW_STATISTICS_SORTIES_DETAILED_CHAMPIONBATTLESCOUNT, BigWorld.wg_getIntegralFormat(data.getChampionBattlesCount()), CL.SECTION_FORT_TOOLTIPS_CHAMPIONBATTLESCOUNT),
      SUtils.getDetailedDataObject(CL.SECTION_FORT_VIEW_STATISTICS_SORTIES_DETAILED_ABSOLUTEBATTLESCOUNT, BigWorld.wg_getIntegralFormat(data.getAbsoluteBattlesCount()), CL.SECTION_FORT_TOOLTIPS_ABSOLUTEBATTLESCOUNT),
      None,
      SUtils.getDetailedDataObject(CL.SECTION_FORT_VIEW_STATISTICS_SORTIES_DETAILED_WINSEFFICIENCY28, PUtils.getEfficiencyPercent(self.__sortiesWinsCountLast28d, self.__sortiesBattlesCountLast28d), CL.SECTION_FORT_TOOLTIPS_WINSEFFICIENCY28),
      SUtils.getDetailedDataObject(CL.SECTION_FORT_VIEW_STATISTICS_SORTIES_DETAILED_AVGBATTLESCOUNT28, BigWorld.wg_getIntegralFormat(self.__sortiesBattlesCountLast28d), CL.SECTION_FORT_TOOLTIPS_AVGBATTLESCOUNT28),
      None,
      SUtils.getDetailedDataObject(CL.SECTION_FORT_VIEW_STATISTICS_SORTIES_DETAILED_LOOTINSORTIES, _resourceParam(BigWorld.wg_getIntegralFormat(data.getLoot())), CL.SECTION_FORT_TOOLTIPS_LOOTINSORTIES)])
Пример #25
0
 def __getIndicatorData(self, value, formater, description, icon, tooltip):
     val = ProfileUtils.getValueOrUnavailable(value)
     return {
         "value": formater(val),
         "description": description,
         "iconSource": icon,
         "tooltip": tooltip,
         "enabled": val != ProfileUtils.UNAVAILABLE_VALUE,
     }
Пример #26
0
 def _getHeaderData(self, data):
     stats = data['stats']
     return (PUtils.packLditItemData(
         formatField(getter=stats.getBattlesCount,
                     formatter=BigWorld.wg_getIntegralFormat),
         CL.GLOBALMAPVIEW_STATS_BATTLES,
         CL.GLOBALMAPVIEW_STATS_BATTLES_TOOLTIP, 'battles40x32.png'),
             PUtils.packLditItemData(
                 formatField(getter=stats.getWinsEfficiency,
                             formatter=PUtils.formatFloatPercent),
                 CL.GLOBALMAPVIEW_STATS_WINS,
                 CL.GLOBALMAPVIEW_STATS_WINS_TOOLTIP, 'wins40x32.png'),
             PUtils.packLditItemData(
                 formatField(getter=stats.getCapturedProvincesCount,
                             formatter=BigWorld.wg_getIntegralFormat),
                 CL.GLOBALMAPVIEW_STATS_SEIZED,
                 CL.GLOBALMAPVIEW_STATS_SEIZED_TOOLTIP,
                 'seizedProvinces40x32.png'))
Пример #27
0
def _getDetailedStatisticsData(label, targetData, isCurrentUser):
    detailedStatisticsData = DSUtils.getStatistics(targetData, isCurrentUser)
    additionalDataBlock = detailedStatisticsData[0]['data']
    additionalDataBlock.append(DSUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_CAPTUREPOINTS, BigWorld.wg_getIntegralFormat(targetData.getCapturePoints()), PROFILE.PROFILE_PARAMS_TOOLTIP_CAPTUREPOINTS))
    additionalDataBlock.append(DSUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_DROPPEDCAPTUREPOINTS, BigWorld.wg_getIntegralFormat(targetData.getDroppedCapturePoints()), PROFILE.PROFILE_PARAMS_TOOLTIP_DROPPEDCAPTUREPOINTS))
    result = []
    for val in detailedStatisticsData:
        result.append([val])

    return PUtils.getLabelViewTypeDataObject(label, result, PUtils.VIEW_TYPE_TABLES)
Пример #28
0
 def _getHeaderData(self, data):
     headerParams = []
     if isFortificationBattlesEnabled():
         headerParams.append(PUtils.getTotalBattlesHeaderParam(self.__fortBattlesTargetData, PROFILE.SECTION_STATISTICS_SCORES_FORT_BATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_BATTLES))
         headerParams.append(PUtils.packLditItemData(PUtils.getFormattedWinsEfficiency(self.__fortBattlesTargetData), PROFILE.SECTION_STATISTICS_SCORES_FORT_BATTLESWINSEFFICIENCY, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_BATTLESWINSEFFICIENCY, 'wins40x32.png'))
     else:
         headerParams.append(PUtils.packLditItemData(str(PUtils.UNAVAILABLE_VALUE), PROFILE.SECTION_STATISTICS_SCORES_FORT_BATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_UNAVAILABLE_FORT_BATTLES, 'battles40x32.png'))
         headerParams.append(PUtils.packLditItemData(str(PUtils.UNAVAILABLE_VALUE), PROFILE.SECTION_STATISTICS_SCORES_FORT_BATTLESWINSEFFICIENCY, PROFILE.PROFILE_PARAMS_TOOLTIP_UNAVAILABLE_FORT_WINSEFFICIENCY, 'wins40x32.png'))
     headerParams.append(PUtils.getTotalBattlesHeaderParam(data[0], PROFILE.SECTION_STATISTICS_SCORES_FORT_SORTIE, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_SORTIE))
     headerParams.append(PUtils.packLditItemData(self._formattedWinsEfficiency, PROFILE.SECTION_STATISTICS_SCORES_FORT_SORTIEWINSEFFICIENCY, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_SORTIEWINSEFFICIENCY, 'wins40x32.png'))
     headerParams.append(PUtils.packLditItemData(str(self.__avgFortSortiesLoot), PROFILE.SECTION_STATISTICS_SCORES_FORT_RESOURCE, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_RESOURCE, 'resources40x32.png'))
     return headerParams
Пример #29
0
def _getLevelParams(i18nFunc, battlesCountGetter, winsEfficiencyGetter, eloRatingGetter, placeGetter, favArenaNameGetter, ratingOutdated):
    battlesCount = formatField(getter=battlesCountGetter, formatter=BigWorld.wg_getIntegralFormat)
    winsEfficiency = formatField(getter=winsEfficiencyGetter, formatter=lambda x: PUtils.formatFloatPercent(x))
    eloRating = formatField(getter=eloRatingGetter, formatter=BigWorld.wg_getIntegralFormat)
    place = formatField(getter=placeGetter, formatter=BigWorld.wg_getIntegralFormat)
    favArenaName = formatField(getter=favArenaNameGetter, formatter=lambda x: getI18ArenaById(getArenaGeomentryName(x)))
    return [_getDataObject('battles', i18nFunc, battlesCount),
     _getDataObject('wins', i18nFunc, winsEfficiency),
     _getDataObject('eloRating', i18nFunc, eloRating),
     _getDataObject('place', i18nFunc, place, ratingOutdated),
     _getDataObjectTruncatedValue('favoriteMap', i18nFunc, favArenaName)]
 def __updateSortieData(self):
     ms = i18n.makeString
     dossier = self.fortCtrl.getFort().getFortDossier()
     sortiesStats = dossier.getSortiesStats()
     totalRes = sortiesStats.getLoot()
     defresValueStr = str(BigWorld.wg_getIntegralFormat(totalRes)) + ' '
     formattedDefresValue = ''.join((text_styles.defRes(defresValueStr), icons.nut()))
     middleBattlesCount = BigWorld.wg_getIntegralFormat(sortiesStats.getMiddleBattlesCount())
     championshipBattlesCount = BigWorld.wg_getIntegralFormat(sortiesStats.getChampionBattlesCount())
     absoluteBattlesCount = BigWorld.wg_getIntegralFormat(sortiesStats.getAbsoluteBattlesCount())
     self.__data.update({'clanName': g_clanCache.clanTag,
      'sortieBattlesCount': ProfileUtils.getTotalBattlesHeaderParam(sortiesStats, FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLESCOUNT_LABEL, FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLESCOUNT_TOOLTIP),
      'sortieWins': ProfileUtils.packLditItemData(ProfileUtils.getFormattedWinsEfficiency(sortiesStats), FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_WINS_LABEL, FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_WINS_TOOLTIP, 'wins40x32.png'),
      'sortieAvgDefres': ProfileUtils.packLditItemData(ProfileUtils.formatEfficiency(sortiesStats.getBattlesCount(), sortiesStats.getAvgLoot), FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_AVGDEFRES_LABEL, FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_AVGDEFRES_TOOLTIP, 'avgDefes40x32.png'),
      'sortieBattlesStats': [{'value': self.__getMiddleTitleText(middleBattlesCount),
                              'label': ms(FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLES_MIDDLEBATTLESCOUNT_LABEL)}, {'value': self.__getMiddleTitleText(championshipBattlesCount),
                              'label': ms(FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLES_CHAMPIONBATTLESCOUNT_LABEL)}, {'value': self.__getMiddleTitleText(absoluteBattlesCount),
                              'label': ms(FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLES_ABSOLUTEBATTLESCOUNT_LABEL)}],
      'sortieDefresStats': [{'value': formattedDefresValue,
                             'label': ms(FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_DEFRES_LOOTINSORTIES_LABEL)}]})
Пример #31
0
 def __updateSortieData(self):
     ms = i18n.makeString
     dossier = self.fortCtrl.getFort().getFortDossier()
     sortiesStats = dossier.getSortiesStats()
     totalRes = sortiesStats.getLoot()
     defresValueStr = str(BigWorld.wg_getIntegralFormat(totalRes)) + ' '
     formattedDefresValue = ''.join((text_styles.defRes(defresValueStr), icons.nut()))
     middleBattlesCount = BigWorld.wg_getIntegralFormat(sortiesStats.getMiddleBattlesCount())
     championshipBattlesCount = BigWorld.wg_getIntegralFormat(sortiesStats.getChampionBattlesCount())
     absoluteBattlesCount = BigWorld.wg_getIntegralFormat(sortiesStats.getAbsoluteBattlesCount())
     self.__data.update({'clanName': g_clanCache.clanTag,
      'sortieBattlesCount': ProfileUtils.getTotalBattlesHeaderParam(sortiesStats, FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLESCOUNT_LABEL, FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLESCOUNT_TOOLTIP),
      'sortieWins': ProfileUtils.packLditItemData(ProfileUtils.getFormattedWinsEfficiency(sortiesStats), FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_WINS_LABEL, FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_WINS_TOOLTIP, 'wins40x32.png'),
      'sortieAvgDefres': ProfileUtils.packLditItemData(ProfileUtils.formatEfficiency(sortiesStats.getBattlesCount(), sortiesStats.getAvgLoot), FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_AVGDEFRES_LABEL, FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_AVGDEFRES_TOOLTIP, 'avgDefes40x32.png'),
      'sortieBattlesStats': [{'value': self.__getMiddleTitleText(middleBattlesCount),
                              'label': ms(FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLES_MIDDLEBATTLESCOUNT_LABEL)}, {'value': self.__getMiddleTitleText(championshipBattlesCount),
                              'label': ms(FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLES_CHAMPIONBATTLESCOUNT_LABEL)}, {'value': self.__getMiddleTitleText(absoluteBattlesCount),
                              'label': ms(FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLES_ABSOLUTEBATTLESCOUNT_LABEL)}],
      'sortieDefresStats': [{'value': formattedDefresValue,
                             'label': ms(FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_DEFRES_LOOTINSORTIES_LABEL)}]})
Пример #32
0
 def _getDetailedData(self, data):
     return PUtils.getLabelDataObject(
         CL.SECTION_FORT_VIEW_STATISTICS_SORTIES_DETAILED_HEADER, [
             SUtils.getDetailedDataObject(
                 CL.
                 SECTION_FORT_VIEW_STATISTICS_SORTIES_DETAILED_MIDDLEBATTLESCOUNT,
                 BigWorld.wg_getIntegralFormat(
                     data.getMiddleBattlesCount()),
                 CL.SECTION_FORT_TOOLTIPS_MIDDLEBATTLESCOUNT),
             SUtils.getDetailedDataObject(
                 CL.
                 SECTION_FORT_VIEW_STATISTICS_SORTIES_DETAILED_CHAMPIONBATTLESCOUNT,
                 BigWorld.wg_getIntegralFormat(
                     data.getChampionBattlesCount()),
                 CL.SECTION_FORT_TOOLTIPS_CHAMPIONBATTLESCOUNT),
             SUtils.getDetailedDataObject(
                 CL.
                 SECTION_FORT_VIEW_STATISTICS_SORTIES_DETAILED_ABSOLUTEBATTLESCOUNT,
                 BigWorld.wg_getIntegralFormat(
                     data.getAbsoluteBattlesCount()),
                 CL.SECTION_FORT_TOOLTIPS_ABSOLUTEBATTLESCOUNT), None,
             SUtils.getDetailedDataObject(
                 CL.
                 SECTION_FORT_VIEW_STATISTICS_SORTIES_DETAILED_WINSEFFICIENCY28,
                 PUtils.getEfficiencyPercent(
                     self.__sortiesWinsCountLast28d,
                     self.__sortiesBattlesCountLast28d),
                 CL.SECTION_FORT_TOOLTIPS_WINSEFFICIENCY28),
             SUtils.getDetailedDataObject(
                 CL.
                 SECTION_FORT_VIEW_STATISTICS_SORTIES_DETAILED_AVGBATTLESCOUNT28,
                 BigWorld.wg_getIntegralFormat(
                     self.__sortiesBattlesCountLast28d),
                 CL.SECTION_FORT_TOOLTIPS_AVGBATTLESCOUNT28), None,
             SUtils.getDetailedDataObject(
                 CL.
                 SECTION_FORT_VIEW_STATISTICS_SORTIES_DETAILED_LOOTINSORTIES,
                 _resourceParam(
                     BigWorld.wg_getIntegralFormat(data.getLoot())),
                 CL.SECTION_FORT_TOOLTIPS_LOOTINSORTIES)
         ])
Пример #33
0
 def _getHeaderData(self, data):
     return (PUtils.packLditItemData(
         BigWorld.wg_getIntegralFormat(data.getBattlesCount()),
         FORTIFICATIONS.CLANSTATS_PARAMS_PERIODDEFENCE_BATTLESCOUNT_LABEL,
         TOOLTIPS.
         FORTIFICATION_CLANSTATS_PERIODDEFENCE_BATTLES_BATTLESCOUNT,
         'battles40x32.png',
         PUtils.createToolTipData([
             BigWorld.wg_getIntegralFormat(data.getWinsCount()),
             BigWorld.wg_getIntegralFormat(data.getLossesCount())
         ])),
             PUtils.packLditItemData(
                 PUtils.getFormattedWinsEfficiency(data),
                 FORTIFICATIONS.CLANSTATS_PARAMS_PERIODDEFENCE_WINS_LABEL,
                 FORTIFICATIONS.CLANSTATS_PARAMS_PERIODDEFENCE_WINS_TOOLTIP,
                 'wins40x32.png'),
             PUtils.packLditItemData(
                 PUtils.formatEfficiency(
                     self.__resourceLossCount,
                     lambda: float(self.__resourceCaptureCount) / self.
                     __resourceLossCount), FORTIFICATIONS.
                 CLANSTATS_PARAMS_PERIODDEFENCE_AVGDEFRES_LABEL,
                 FORTIFICATIONS.
                 CLANSTATS_PARAMS_PERIODDEFENCE_AVGDEFRES_TOOLTIP,
                 'defresRatio40x32.png'))
Пример #34
0
 def __init__(self, targetData, accountDossier, isCurrentUser):
     self._isCurrentUser = isCurrentUser
     self._formattedWinsEfficiency = PUtils.getFormattedWinsEfficiency(targetData)
     self._dmgDealt = targetData.getDamageDealt()
     self._dmgReceived = targetData.getDamageReceived()
     self._damageEfficiency = BigWorld.wg_getNiceNumberFormat(PUtils.getValueOrUnavailable(targetData.getDamageEfficiency()))
     damageBlockedByArmor = targetData.getDamageBlockedByArmor()
     potentialDamageReceived = targetData.getPotentialDamageReceived()
     pResDmg = potentialDamageReceived - damageBlockedByArmor
     self._armorUsingEfficiency = PUtils.getValueOrUnavailable(targetData.getArmorUsingEfficiency())
     self._avgXP = PUtils.getValueOrUnavailable(targetData.getAvgXP())
     self._avgDmg = PUtils.getValueOrUnavailable(targetData.getAvgDamage())
     maxXP = targetData.getMaxXp()
     self._maxXP_formattedStr = BigWorld.wg_getIntegralFormat(maxXP)
     self._armorUsingToolTipData = PUtils.createToolTipData([PUtils.getAvgDamageBlockedValue(targetData)])
     self._avgAssistDmg = BigWorld.wg_getNiceNumberFormat(PUtils.getValueOrUnavailable(targetData.getDamageAssistedEfficiency()))
     super(ProfileDictStatisticsVO, self).__init__((targetData, accountDossier))
Пример #35
0
 def _getHeaderData(self, data):
     headerParams = []
     if isFortificationBattlesEnabled():
         headerParams.append(
             PUtils.getTotalBattlesHeaderParam(
                 self.__fortBattlesTargetData,
                 PROFILE.SECTION_STATISTICS_SCORES_FORT_BATTLES,
                 PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_BATTLES))
         headerParams.append(
             PUtils.packLditItemData(
                 PUtils.getFormattedWinsEfficiency(
                     self.__fortBattlesTargetData), PROFILE.
                 SECTION_STATISTICS_SCORES_FORT_BATTLESWINSEFFICIENCY,
                 PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_BATTLESWINSEFFICIENCY,
                 'wins40x32.png'))
     else:
         headerParams.append(
             PUtils.packLditItemData(
                 str(PUtils.UNAVAILABLE_VALUE),
                 PROFILE.SECTION_STATISTICS_SCORES_FORT_BATTLES,
                 PROFILE.PROFILE_PARAMS_TOOLTIP_UNAVAILABLE_FORT_BATTLES,
                 'battles40x32.png'))
         headerParams.append(
             PUtils.packLditItemData(
                 str(PUtils.UNAVAILABLE_VALUE), PROFILE.
                 SECTION_STATISTICS_SCORES_FORT_BATTLESWINSEFFICIENCY,
                 PROFILE.
                 PROFILE_PARAMS_TOOLTIP_UNAVAILABLE_FORT_WINSEFFICIENCY,
                 'wins40x32.png'))
     headerParams.append(
         PUtils.getTotalBattlesHeaderParam(
             data[0], PROFILE.SECTION_STATISTICS_SCORES_FORT_SORTIE,
             PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_SORTIE))
     headerParams.append(
         PUtils.packLditItemData(
             self._formattedWinsEfficiency,
             PROFILE.SECTION_STATISTICS_SCORES_FORT_SORTIEWINSEFFICIENCY,
             PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_SORTIEWINSEFFICIENCY,
             'wins40x32.png'))
     headerParams.append(
         PUtils.packLditItemData(
             str(self.__avgFortSortiesLoot),
             PROFILE.SECTION_STATISTICS_SCORES_FORT_RESOURCE,
             PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_RESOURCE,
             'resources40x32.png'))
     return headerParams
Пример #36
0
    def _sendAccountData(self, targetData, accountDossier):
        super(ProfileAwards, self)._sendAccountData(targetData, accountDossier)
        achievements = targetData.getAchievements()
        totalItemsList = []
        for block in achievements:
            totalItemsList.append(len(block))

        if self.__achievementsFilter == PROFILE.SECTION_AWARDS_DROPDOWN_LABELS_INPROCESS:
            achievements = targetData.getAchievements(isInDossier=True)
        elif self.__achievementsFilter == PROFILE.SECTION_AWARDS_DROPDOWN_LABELS_NONE:
            achievements = targetData.getAchievements(isInDossier=False)
        packedList = []
        for achievementBlockList in achievements:
            packedList.append(ProfileUtils.packAchievementList(achievementBlockList, accountDossier, self._userID is None))

        self.as_responseDossierS(self._battlesType, {'achievementsList': packedList,
         'totalItemsList': totalItemsList,
         'battlesCount': targetData.getBattlesCount()})
Пример #37
0
 def _sendAccountData(self, targetData, accountDossier):
     commonParams = ProfileUtils.packProfileDossierInfo(targetData)
     commonParams['survivalEfficiency'] = targetData.getSurvivalEfficiency()
     detailedParams = {}
     detailedParams['fragsCount'] = targetData.getFragsCount()
     detailedParams['deathsCount'] = targetData.getDeathsCount()
     detailedParams['fragsEfficiency'] = targetData.getFragsEfficiency()
     detailedParams['damageDealt'] = targetData.getDamageDealt()
     detailedParams['damageReceived'] = targetData.getDamageReceived()
     detailedParams['damageEfficiency'] = targetData.getDamageEfficiency()
     detailedParams['avgFrags'] = targetData.getAvgFrags()
     detailedParams['maxFrags'] = targetData.getMaxFrags()
     detailedParams['avgDamageDealt'] = targetData.getAvgDamageDealt()
     detailedParams['avgDamageReceived'] = targetData.getAvgDamageReceived()
     detailedParams['avgEnemiesSpotted'] = targetData.getAvgEnemiesSpotted()
     chartsParams = targetData.getBattlesStats()
     self.as_responseDossierS(self._battlesType, {'commonParams': commonParams,
      'detailedParams': detailedParams,
      'chartsParams': chartsParams})
Пример #38
0
def _getDetailedStatisticsData(label, targetData, isCurrentUser):
    detailedStatisticsData = DSUtils.getStatistics(targetData, isCurrentUser)
    additionalDataBlock = detailedStatisticsData[0]['data']
    additionalDataBlock.append(
        DSUtils.getDetailedDataObject(
            PROFILE.SECTION_STATISTICS_SCORES_CAPTUREPOINTS,
            BigWorld.wg_getIntegralFormat(targetData.getCapturePoints()),
            PROFILE.PROFILE_PARAMS_TOOLTIP_CAPTUREPOINTS))
    additionalDataBlock.append(
        DSUtils.getDetailedDataObject(
            PROFILE.SECTION_STATISTICS_SCORES_DROPPEDCAPTUREPOINTS,
            BigWorld.wg_getIntegralFormat(
                targetData.getDroppedCapturePoints()),
            PROFILE.PROFILE_PARAMS_TOOLTIP_DROPPEDCAPTUREPOINTS))
    result = []
    for val in detailedStatisticsData:
        result.append([val])

    return PUtils.getLabelViewTypeDataObject(label, result,
                                             PUtils.VIEW_TYPE_TABLES)
Пример #39
0
 def _getDetailedData(self, stats):
     defenceCount = stats.getDefenceCount()
     atackCount = stats.getAttackCount()
     sucessDefenceCount = stats.getSuccessDefenceCount()
     sucessAtackCount = stats.getSuccessAttackCount()
     resourceCaptureCount = stats.getResourceCaptureCount()
     resourceLossCount = stats.getResourceLossCount()
     resourcesProfitValue = resourceCaptureCount - resourceLossCount
     return PUtils.getLabelDataObject(CL.SECTION_FORT_VIEW_STATISTICS_BATTLES_DETAILED_HEADER, [SUtils.getDetailedDataObject(CL.SECTION_FORT_VIEW_STATISTICS_BATTLES_DETAILED_COUNTCAPTUREDCOMMANDCENTRES, BigWorld.wg_getIntegralFormat(stats.getEnemyBaseCaptureCount()), CL.SECTION_FORT_TOOLTIPS_COUNTCAPTUREDCOMMANDCENTRES),
      SUtils.getDetailedDataObject(CL.SECTION_FORT_VIEW_STATISTICS_BATTLES_DETAILED_COUNTPLUNDEREDENEMYBUILDINGS, BigWorld.wg_getIntegralFormat(stats.getCaptureEnemyBuildingTotalCount()), CL.SECTION_FORT_TOOLTIPS_COUNTPLUNDEREDENEMYBUILDINGS),
      SUtils.getDetailedDataObject(CL.SECTION_FORT_VIEW_STATISTICS_BATTLES_DETAILED_COUNTPLUNDEREDALLYBUILDINGS, BigWorld.wg_getIntegralFormat(stats.getLossOwnBuildingTotalCount()), CL.SECTION_FORT_TOOLTIPS_COUNTPLUNDEREDALLYBUILDINGS),
      None,
      SUtils.getDetailedDataObject(CL.SECTION_FORT_VIEW_STATISTICS_BATTLES_DETAILED_EFFICIENCYOFATTACK, PUtils.formatEfficiency(atackCount, lambda : float(sucessAtackCount) / atackCount), CL.SECTION_FORT_TOOLTIPS_EFFICIENCYOFATTACK, PUtils.createToolTipData([BigWorld.wg_getIntegralFormat(sucessAtackCount), BigWorld.wg_getIntegralFormat(atackCount)])),
      SUtils.getDetailedDataObject(CL.SECTION_FORT_VIEW_STATISTICS_BATTLES_DETAILED_EFFICIENCYOFDEFENCE, PUtils.formatEfficiency(defenceCount, lambda : float(sucessDefenceCount) / defenceCount), CL.SECTION_FORT_TOOLTIPS_EFFICIENCYOFDEFENCE, PUtils.createToolTipData([BigWorld.wg_getIntegralFormat(sucessDefenceCount), BigWorld.wg_getIntegralFormat(defenceCount)])),
      None,
      SUtils.getDetailedDataObject(CL.SECTION_FORT_VIEW_STATISTICS_BATTLES_DETAILED_COUNTPROMRES, _resourceParam(BigWorld.wg_getIntegralFormat(resourceCaptureCount)), CL.SECTION_FORT_TOOLTIPS_COUNTPROMRES),
      SUtils.getDetailedDataObject(CL.SECTION_FORT_VIEW_STATISTICS_BATTLES_DETAILED_LOSTPROMRES, _resourceParam(BigWorld.wg_getIntegralFormat(resourceLossCount)), CL.SECTION_FORT_TOOLTIPS_LOSTPROMRES),
      SUtils.getDetailedDataObject(CL.SECTION_FORT_VIEW_STATISTICS_BATTLES_DETAILED_PROFIT, _resourceParam(BigWorld.wg_getIntegralFormat(resourcesProfitValue)), CL.SECTION_FORT_TOOLTIPS_PROFIT),
      None,
      SUtils.getDetailedDataObject(CL.SECTION_FORT_VIEW_STATISTICS_BATTLES_DETAILED_CHEMPIONLVLBATTLES, BigWorld.wg_getIntegralFormat(self.__fbBattlesCountAbs), CL.SECTION_FORT_TOOLTIPS_CHEMPIONLVLBATTLES),
      SUtils.getDetailedDataObject(CL.SECTION_FORT_VIEW_STATISTICS_BATTLES_DETAILED_ABSOLUTELVLBATTLES, BigWorld.wg_getIntegralFormat(self.__fbBattlesCountChemp), CL.SECTION_FORT_TOOLTIPS_ABSOLUTELVLBATTLES)])
Пример #40
0
def _getLevelParams(i18nFunc, battlesCountGetter, winsEfficiencyGetter,
                    eloRatingGetter, placeGetter, favArenaNameGetter,
                    ratingOutdated):
    battlesCount = formatField(getter=battlesCountGetter,
                               formatter=BigWorld.wg_getIntegralFormat)
    winsEfficiency = formatField(
        getter=winsEfficiencyGetter,
        formatter=lambda x: PUtils.formatFloatPercent(x))
    eloRating = formatField(getter=eloRatingGetter,
                            formatter=BigWorld.wg_getIntegralFormat)
    place = formatField(getter=placeGetter,
                        formatter=BigWorld.wg_getIntegralFormat)
    favArenaName = formatField(
        getter=favArenaNameGetter,
        formatter=lambda arena_id: getI18ArenaById(arena_id))
    return [
        _getDataObject('battles', i18nFunc, battlesCount),
        _getDataObject('wins', i18nFunc, winsEfficiency),
        _getDataObject('eloRating', i18nFunc, eloRating),
        _getDataObject('place', i18nFunc, place, ratingOutdated),
        _getDataObjectTruncatedValue('favoriteMap', i18nFunc, favArenaName)
    ]
 def __updateDefenceData(self):
     dossier = self.fortCtrl.getFort().getFortDossier()
     stats = dossier.getBattlesStats()
     ms = i18n.makeString
     resourceLossCount = stats.getResourceLossCount()
     defenceCount = stats.getDefenceCount()
     atackCount = stats.getAttackCount()
     sucessDefenceCount = stats.getSuccessDefenceCount()
     sucessAtackCount = stats.getSuccessAttackCount()
     resourceCaptureCount = stats.getResourceCaptureCount()
     resourcesProvitValue = resourceCaptureCount - resourceLossCount
     resourcesProfitStr = BigWorld.wg_getIntegralFormat(resourcesProvitValue)
     if resourcesProvitValue > 0:
         resourcesProfitStr = '+' + resourcesProfitStr
     attackEfficiencyValue = ProfileUtils.formatEfficiency(atackCount, lambda : float(sucessAtackCount) / atackCount)
     defEfficiencyValue = ProfileUtils.formatEfficiency(defenceCount, lambda : float(sucessDefenceCount) / defenceCount)
     self.__data.update({'periodBattles': ProfileUtils.packLditItemData(BigWorld.wg_getIntegralFormat(stats.getBattlesCount()), FORTIFICATIONS.CLANSTATS_PARAMS_PERIODDEFENCE_BATTLESCOUNT_LABEL, TOOLTIPS.FORTIFICATION_CLANSTATS_PERIODDEFENCE_BATTLES_BATTLESCOUNT, 'battles40x32.png', ProfileUtils.createToolTipData([BigWorld.wg_getIntegralFormat(stats.getWinsCount()), BigWorld.wg_getIntegralFormat(stats.getLossesCount())])),
      'periodWins': ProfileUtils.packLditItemData(ProfileUtils.getFormattedWinsEfficiency(stats), FORTIFICATIONS.CLANSTATS_PARAMS_PERIODDEFENCE_WINS_LABEL, FORTIFICATIONS.CLANSTATS_PARAMS_PERIODDEFENCE_WINS_TOOLTIP, 'wins40x32.png'),
      'periodAvgDefres': ProfileUtils.packLditItemData(ProfileUtils.formatEfficiency(resourceLossCount, lambda : float(resourceCaptureCount) / resourceLossCount), FORTIFICATIONS.CLANSTATS_PARAMS_PERIODDEFENCE_AVGDEFRES_LABEL, FORTIFICATIONS.CLANSTATS_PARAMS_PERIODDEFENCE_AVGDEFRES_TOOLTIP, 'defresRatio40x32.png'),
      'periodBattlesStats': [{'value': self.__getMiddleTitleText(BigWorld.wg_getIntegralFormat(stats.getEnemyBaseCaptureCount())),
                              'label': ms(FORTIFICATIONS.CLANSTATS_PARAMS_PERIODDEFENCE_BATTLES_COUNTCAPTUREDCOMMANDCENTRES_LABEL)},
                             {'value': self.__getMiddleTitleText(BigWorld.wg_getIntegralFormat(stats.getCaptureEnemyBuildingTotalCount())),
                              'label': ms(FORTIFICATIONS.CLANSTATS_PARAMS_PERIODDEFENCE_BATTLES_COUNTPLUNDEREDENEMYBUILDINGS_LABEL)},
                             {'value': self.__getMiddleTitleText(BigWorld.wg_getIntegralFormat(stats.getLossOwnBuildingTotalCount())),
                              'label': ms(FORTIFICATIONS.CLANSTATS_PARAMS_PERIODDEFENCE_BATTLES_COUNTPLUNDEREDALLYBUILDINGS_LABEL)},
                             {'value': self.__getMiddleTitleText(attackEfficiencyValue),
                              'label': ms(FORTIFICATIONS.CLANSTATS_PARAMS_PERIODDEFENCE_BATTLES_EFFICIENCYOFATTACK),
                              'ttLabel': TOOLTIPS.FORTIFICATION_CLANSTATS_PERIODDEFENCE_BATTLES_EFFICIENCYOFATTACK,
                              'ttBodyParams': {'countAtack': BigWorld.wg_getIntegralFormat(sucessAtackCount),
                                               'countTotalAtack': BigWorld.wg_getIntegralFormat(atackCount)},
                              'enabled': attackEfficiencyValue != -1},
                             {'value': self.__getMiddleTitleText(defEfficiencyValue),
                              'label': ms(FORTIFICATIONS.CLANSTATS_PARAMS_PERIODDEFENCE_BATTLES_EFFICIENCYOFDEFENCE),
                              'ttLabel': TOOLTIPS.FORTIFICATION_CLANSTATS_PERIODDEFENCE_BATTLES_EFFICIENCYOFDEFENCE,
                              'ttBodyParams': {'countDefences': BigWorld.wg_getIntegralFormat(sucessDefenceCount),
                                               'countTotalDefences': BigWorld.wg_getIntegralFormat(defenceCount)},
                              'enabled': defEfficiencyValue != -1}],
      'periodDefresStats': [{'value': self.__getFormattedDefresValue(BigWorld.wg_getIntegralFormat(resourceCaptureCount)),
                             'label': ms(FORTIFICATIONS.CLANSTATS_PARAMS_PERIODDEFENCE_BATTLES_COUNTPROMRES_LABEL)}, {'value': self.__getFormattedDefresValue(BigWorld.wg_getIntegralFormat(resourceLossCount)),
                             'label': ms(FORTIFICATIONS.CLANSTATS_PARAMS_PERIODDEFENCE_BATTLES_LOSTPROMRES_LABEL)}, {'value': self.__getFormattedDefresValue(resourcesProfitStr),
                             'label': ms(FORTIFICATIONS.CLANSTATS_PARAMS_PERIODDEFENCE_BATTLES_PROFIT_LABEL)}]})
Пример #42
0
 def _getInitData(self):
     return {'commonScores': {'battles': self._formIconLabelInitObject(PROFILE.SECTION_SUMMARY_SCORES_TOTALBATTLES, ProfileUtils.getIconPath('battles40x32.png')),
                       'wins': self._formIconLabelInitObject(PROFILE.SECTION_SUMMARY_SCORES_TOTALWINS, ProfileUtils.getIconPath('wins40x32.png')),
                       'coolSigns': self._formIconLabelInitObject(PROFILE.SECTION_SUMMARY_SCORES_COOLSIGNS, ProfileUtils.getIconPath('markOfMastery40x32.png')),
                       'maxDestroyed': self._formIconLabelInitObject(PROFILE.SECTION_SUMMARY_SCORES_MAXDESTROYED, ProfileUtils.getIconPath('maxDestroyed40x32.png')),
                       'maxExperience': self._formIconLabelInitObject(PROFILE.SECTION_SUMMARY_SCORES_MAXEXPERIENCE, ProfileUtils.getIconPath('maxExp40x32.png')),
                       'avgExperience': self._formIconLabelInitObject(PROFILE.SECTION_SUMMARY_SCORES_AVGEXPERIENCE, ProfileUtils.getIconPath('avgExp40x32.png')),
                       'hits': self._formIconLabelInitObject(PROFILE.SECTION_SUMMARY_SCORES_HITS, ProfileUtils.getIconPath('hits40x32.png')),
                       'avgDamage': self._formIconLabelInitObject(PROFILE.SECTION_SUMMARY_SCORES_AVGDAMAGE, ProfileUtils.getIconPath('avgDamage40x32.png')),
                       'personalScore': self._formIconLabelInitObject(PROFILE.SECTION_SUMMARY_SCORES_PERSONALSCORE, ProfileUtils.getIconPath('battles40x32.png'))},
      'significantAwardsLabel': PROFILE.SECTION_SUMMARY_LABELS_SIGNIFICANTAWARDS,
      'significantAwardsErrorText': PROFILE.SECTION_SUMMARY_ERRORTEXT_SIGNIFICANTAWARDS}
 def __getFormattedDefresValue(self, value):
     return ''.join((text_styles.defRes(ProfileUtils.getAvailableValueStr(value) + ' '), icons.nut()))
Пример #44
0
    def _sendAccountData(self, targetData, accountDossier):
        formattedWinsEfficiency = ProfileUtils.getFormattedWinsEfficiency(targetData)
        dmgDealt = targetData.getDamageDealt()
        dmgReceived = targetData.getDamageReceived()
        damageEfficiency = BigWorld.wg_getNiceNumberFormat(ProfileUtils.getValueOrUnavailable(targetData.getDamageEfficiency()))
        damageBlockedByArmor = targetData.getDamageBlockedByArmor()
        potentialDamageReceived = targetData.getPotentialDamageReceived()
        pResDmg = potentialDamageReceived - damageBlockedByArmor
        armorUsingEfficiency = ProfileUtils.getValueOrUnavailable(targetData.getArmorUsingEfficiency())
        avgXP = ProfileUtils.getValueOrUnavailable(targetData.getAvgXP())
        avgDmg = ProfileUtils.getValueOrUnavailable(targetData.getAvgDamage())
        maxXP = targetData.getMaxXp()
        maxXP_formattedStr = BigWorld.wg_getIntegralFormat(maxXP)
        armorUsingToolTipData = ProfileUtils.createToolTipData([ProfileUtils.getAvgDamageBlockedValue(targetData)])
        avgAssistDmg = BigWorld.wg_getNiceNumberFormat(ProfileUtils.getValueOrUnavailable(targetData.getDamageAssistedEfficiency()))
        vehicles = targetData.getVehicles()
        vehiclesLen = len(vehicles)
        headerParams = []
        dataList = []
        if self._battlesType == PROFILE.PROFILE_DROPDOWN_LABELS_TEAM:
            headerText = i18n.makeString(PROFILE.SECTION_STATISTICS_HEADERTEXT_TEAM)
            headerParams.append(ProfileUtils.getTotalBattlesHeaderParam(targetData, PROFILE.SECTION_STATISTICS_SCORES_TOTALBATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_BATTLESCOUNT))
            headerParams.append(ProfileUtils.packLditItemData(damageEfficiency, PROFILE.SECTION_STATISTICS_DETAILED_DAMAGECOEFFICIENT, PROFILE.PROFILE_PARAMS_TOOLTIP_DAMAGECOEFF, 'dmgRatio40x32.png', {'tooltipData': ProfileUtils.createToolTipData((BigWorld.wg_getIntegralFormat(dmgDealt), BigWorld.wg_getIntegralFormat(dmgReceived)))}, HeaderItemsTypes.VALUES))
            headerParams.append(self.__packAvgDmgLditItemData(avgDmg))
            headerParams.append(self.__packAvgXPLditItemData(avgXP))
            headerParams.append(ProfileUtils.packLditItemData(avgAssistDmg, PROFILE.SECTION_STATISTICS_SCORES_AVGASSISTEDDAMAGE, PROFILE.PROFILE_PARAMS_TOOLTIP_AVGASSISTEDDAMAGE, 'assist40x32.png'))
            headerParams.append(ProfileUtils.packLditItemData(BigWorld.wg_getNiceNumberFormat(armorUsingEfficiency), PROFILE.SECTION_STATISTICS_SCORES_ARMORUSING, PROFILE.PROFILE_PARAMS_TOOLTIP_ARMORUSING, 'armorUsing40x32.png', {'tooltipData': armorUsingToolTipData}, HeaderItemsTypes.VALUES))
            dataList.append(self.__getDetailedStatisticsData(PROFILE.SECTION_STATISTICS_BODYBAR_LABEL_DETAILED, targetData))
            dataList.append(self.__getChartsData(targetData))
        elif self._battlesType == PROFILE.PROFILE_DROPDOWN_LABELS_HISTORICAL:
            headerParams.append(ProfileUtils.getTotalBattlesHeaderParam(targetData, PROFILE.SECTION_STATISTICS_SCORES_TOTALBATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_BATTLESCOUNT))
            headerText = i18n.makeString(PROFILE.SECTION_STATISTICS_HEADERTEXT_HISTORICAL)
            histBattleFieldAchievesCount = 0
            for record in layouts.HISTORY_BATTLEFIELD_GROUP:
                achieve = targetData.getAchievement(record)
                if achieve.isInDossier():
                    histBattleFieldAchievesCount += 1

            histBattleFieldAchievesCount = BigWorld.wg_getIntegralFormat(histBattleFieldAchievesCount)
            histBattleFieldAchievesCountTotal = BigWorld.wg_getIntegralFormat(len(layouts.HISTORY_BATTLEFIELD_GROUP))
            headerParams.append(ProfileUtils.packLditItemData(formattedWinsEfficiency, PROFILE.SECTION_STATISTICS_SCORES_TOTALWINS, PROFILE.PROFILE_PARAMS_TOOLTIP_WINS, 'wins40x32.png'))
            headerParams.append(ProfileUtils.packLditItemData(histBattleFieldAchievesCount, PROFILE.SECTION_STATISTICS_SCORES_ACHIEVEMENTSCOUNT, PROFILE.PROFILE_PARAMS_TOOLTIP_ACHIEVEMENTSCOUNT, 'honors40x32.png', {'total': histBattleFieldAchievesCountTotal}, HeaderItemsTypes.RATIO))
            headerParams.append(ProfileUtils.packLditItemData(BigWorld.wg_getIntegralFormat(vehiclesLen), PROFILE.SECTION_STATISTICS_SCORES_USEDTECHNICS, PROFILE.PROFILE_PARAMS_TOOLTIP_USEDTECHNICS, 'techRatio40x32.png'))
            dataList.append(self.__getDetailedStatisticsData(PROFILE.SECTION_STATISTICS_BODYBAR_LABEL_DETAILED, targetData))
        elif self._battlesType == PROFILE.PROFILE_DROPDOWN_LABELS_FORTIFICATIONS:
            headerText = i18n.makeString(PROFILE.SECTION_STATISTICS_HEADERTEXT_FORTIFICATIONS)
            fortBattlesTargetData = accountDossier.getFortBattlesStats()
            fortMiscTargetData = accountDossier.getFortMiscStats()
            if isFortificationBattlesEnabled():
                headerParams.append(ProfileUtils.getTotalBattlesHeaderParam(fortBattlesTargetData, PROFILE.SECTION_STATISTICS_SCORES_FORT_BATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_BATTLES))
                headerParams.append(ProfileUtils.packLditItemData(ProfileUtils.getFormattedWinsEfficiency(fortBattlesTargetData), PROFILE.SECTION_STATISTICS_SCORES_FORT_BATTLESWINSEFFICIENCY, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_BATTLESWINSEFFICIENCY, 'wins40x32.png'))
            else:
                headerParams.append(ProfileUtils.packLditItemData(str(ProfileUtils.UNAVAILABLE_VALUE), PROFILE.SECTION_STATISTICS_SCORES_FORT_BATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_UNAVAILABLE_FORT_BATTLES, 'battles40x32.png'))
                headerParams.append(ProfileUtils.packLditItemData(str(ProfileUtils.UNAVAILABLE_VALUE), PROFILE.SECTION_STATISTICS_SCORES_FORT_BATTLESWINSEFFICIENCY, PROFILE.PROFILE_PARAMS_TOOLTIP_UNAVAILABLE_FORT_WINSEFFICIENCY, 'wins40x32.png'))
            headerParams.append(ProfileUtils.getTotalBattlesHeaderParam(targetData, PROFILE.SECTION_STATISTICS_SCORES_FORT_SORTIE, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_SORTIE))
            headerParams.append(ProfileUtils.packLditItemData(formattedWinsEfficiency, PROFILE.SECTION_STATISTICS_SCORES_FORT_SORTIEWINSEFFICIENCY, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_SORTIEWINSEFFICIENCY, 'wins40x32.png'))
            totalSortiesLoot = fortMiscTargetData.getLootInSorties()
            avgFortSortiesLoot = self.__getFortAvgLoot(targetData, totalSortiesLoot)
            headerParams.append(ProfileUtils.packLditItemData(str(avgFortSortiesLoot), PROFILE.SECTION_STATISTICS_SCORES_FORT_RESOURCE, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_RESOURCE, 'resources40x32.png'))
            if isFortificationBattlesEnabled():
                fortBattlesDetaildStatisticsTabData = self.__getDetailedStatisticsData(PROFILE.SECTION_STATISTICS_BODYBAR_LABEL_FORTBATTLES, fortBattlesTargetData)
                fortBattlesDetaildStatisticsTabData['data'][0][0]['data'][0]['tooltip'] = PROFILE.PROFILE_PARAMS_TOOLTIP_DIF_FORT_BATTLESCOUNT
                dataList.append(fortBattlesDetaildStatisticsTabData)
            dataList.append(self.__getDetailedStatisticsData(PROFILE.SECTION_STATISTICS_BODYBAR_LABEL_FORTSORTIE, targetData))
            specificData = []
            battlesCount = fortBattlesTargetData.getBattlesCount()
            lossesCount = fortBattlesTargetData.getLossesCount()
            winsCount = fortBattlesTargetData.getWinsCount()
            battlesToolTipData = [BigWorld.wg_getIntegralFormat(winsCount), BigWorld.wg_getIntegralFormat(lossesCount)]
            formattedBattlesCount = BigWorld.wg_getIntegralFormat(battlesCount)
            specificDataColumn1 = []
            if isFortificationBattlesEnabled():
                specificDataColumn1.append(ProfileUtils.getLabelDataObject(PROFILE.SECTION_STATISTICS_BODYPARAMS_LABEL_FORTBATTLES, [DetailedStatisticsUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTTOTALBATTLES, formattedBattlesCount, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_BATTLES, ProfileUtils.createToolTipData(battlesToolTipData)),
                 DetailedStatisticsUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTBATTLESTOTALWINS, ProfileUtils.getFormattedWinsEfficiency(fortBattlesTargetData), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLESWINS),
                 DetailedStatisticsUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_LOOTING, fortMiscTargetData.getEnemyBasePlunderNumber(), PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_LOOTING),
                 DetailedStatisticsUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTBATTLES_ATTACKS, fortMiscTargetData.getAttackNumber(), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLES_ATTACKS),
                 DetailedStatisticsUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTBATTLES_DEFENCES, fortMiscTargetData.getDefenceHours(), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLES_DEFENCES)]))
            battlesCount = targetData.getBattlesCount()
            lossesCount = targetData.getLossesCount()
            winsCount = targetData.getWinsCount()
            drawsCount = ProfileUtils.getDrawCount(battlesCount, lossesCount, winsCount)
            battlesToolTipData = [BigWorld.wg_getIntegralFormat(winsCount), BigWorld.wg_getIntegralFormat(lossesCount), BigWorld.wg_getIntegralFormat(drawsCount)]
            formattedBattlesCount = BigWorld.wg_getIntegralFormat(battlesCount)
            specificDataColumn1.append(ProfileUtils.getLabelDataObject(PROFILE.SECTION_STATISTICS_BODYPARAMS_LABEL_FORTSORTIE, [DetailedStatisticsUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORT_SORTIE, formattedBattlesCount, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_SORTIE, ProfileUtils.createToolTipData(battlesToolTipData)), DetailedStatisticsUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTSORTIETOTALWINS, formattedWinsEfficiency, PROFILE.PROFILE_PARAMS_TOOLTIP_FORTSORTIEWINS)]))
            specificData.append(specificDataColumn1)
            resourcesDataList = []
            resourcesDataList.append(DetailedStatisticsUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTSORTIES_AVGRESOURCES, avgFortSortiesLoot, PROFILE.PROFILE_PARAMS_TOOLTIP_FORTSORTIES_AVGRESOURCES))
            resourcesDataList.append(DetailedStatisticsUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTSORTIES_TOTALRESOURCES, BigWorld.wg_getIntegralFormat(totalSortiesLoot), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTSORTIES_TOTALRESOURCES))
            if isFortificationBattlesEnabled():
                resourcesDataList.append(DetailedStatisticsUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTBATTLES_TOTALRESOURCES, BigWorld.wg_getIntegralFormat(fortMiscTargetData.getLootInBattles()), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLES_TOTALRESOURCES))
                resourcesDataList.append(DetailedStatisticsUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTBATTLES_MAXRESOURCES, BigWorld.wg_getIntegralFormat(fortMiscTargetData.getMaxLootInBattles()), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLES_MAXRESOURCES))
            specificData.append([ProfileUtils.getLabelDataObject(PROFILE.SECTION_STATISTICS_BODYPARAMS_LABEL_RESOURCE, resourcesDataList)])
            dataList.append(ProfileUtils.getLabelViewTypeDataObject(PROFILE.SECTION_STATISTICS_BODYBAR_LABEL_SPECIFIC, specificData, ProfileUtils.VIEW_TYPE_TABLES))
        else:
            maxExpToolTipData = ProfileUtils.getVehicleRecordTooltipData(targetData.getMaxXpVehicle)
            headerText = i18n.makeString(PROFILE.SECTION_STATISTICS_HEADERTEXT_ALL)
            headerParams.append(ProfileUtils.getTotalBattlesHeaderParam(targetData, PROFILE.SECTION_STATISTICS_SCORES_TOTALBATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_BATTLESCOUNT))
            headerParams.append(ProfileUtils.packLditItemData(formattedWinsEfficiency, PROFILE.SECTION_STATISTICS_SCORES_TOTALWINS, PROFILE.PROFILE_PARAMS_TOOLTIP_WINS, 'wins40x32.png'))
            headerParams.append(self.__packAvgDmgLditItemData(avgDmg))
            headerParams.append(self.__packAvgXPLditItemData(avgXP))
            headerParams.append(ProfileUtils.packLditItemData(maxXP_formattedStr, PROFILE.SECTION_STATISTICS_SCORES_MAXEXPERIENCE, PROFILE.PROFILE_PARAMS_TOOLTIP_MAXEXP, 'maxExp40x32.png', {'tooltipData': maxExpToolTipData}, HeaderItemsTypes.VALUES))
            headerParams.append(ProfileUtils.packLditItemData(BigWorld.wg_getIntegralFormat(targetData.getMarksOfMastery()[3]), PROFILE.SECTION_STATISTICS_SCORES_COOLSIGNS, PROFILE.PROFILE_PARAMS_TOOLTIP_MARKOFMASTERY, 'markOfMastery40x32.png', {'total': BigWorld.wg_getIntegralFormat(vehiclesLen)}, HeaderItemsTypes.RATIO))
            dataList.append(self.__getDetailedStatisticsData(PROFILE.SECTION_STATISTICS_BODYBAR_LABEL_DETAILED, targetData))
            dataList.append(self.__getChartsData(targetData))
        bodyParams = {'dataList': dataList}
        self.as_responseDossierS(self._battlesType, {'headerText': headerText,
         'headerParams': headerParams,
         'bodyParams': bodyParams})