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
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
def _sendAccountData(self, targetData, accountDossier): super(ProfileAwards, self)._sendAccountData(targetData, accountDossier) achievements = accountDossier.getAchievements(None) totalItemsList = [] for block in achievements: totalItemsList.append(len(block)) if self.__achievementsFilter == PROFILE.SECTION_AWARDS_DROPDOWN_LABELS_INPROCESS: achievements = accountDossier.getAchievements(True) elif self.__achievementsFilter == PROFILE.SECTION_AWARDS_DROPDOWN_LABELS_NONE: achievements = accountDossier.getAchievements(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() }) return
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
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
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()})