Skip to content

Commit

Permalink
Merge pull request #75 from ramonsaraiva/changelog-sync
Browse files Browse the repository at this point in the history
Changelog sync
  • Loading branch information
ramonsaraiva authored Sep 2, 2019
2 parents 1677c08 + 6611e49 commit 31a4918
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.10.0 / 2019-09-02

* Sync domain classes/telemetry data with latest API changes (synced with V14.1.0)

## 0.9.0 / 2019-09-01

* Add leaderboards support
Expand Down
10 changes: 3 additions & 7 deletions pubg_python/domain/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Shard(Enum):
XBOX_EU = 'xbox-eu' # Europe
XBOX_NA = 'xbox-na' # North America
XBOX_OC = 'xbox-oc' # Oceania
XBOX_SA = 'xbox-sa' # South America
KAKAO = 'kakao' # Kakao
PSN = 'psn'
STEAM = 'steam'
Expand Down Expand Up @@ -119,6 +120,7 @@ def from_dict(self):
self.stats = self.attributes.get('stats')
self.tags = self.attributes.get('tags')
self.title_id = self.attributes.get('titleId')
self.season_state = self.attributes.get('seasonState')


class Roster(Domain):
Expand Down Expand Up @@ -148,12 +150,9 @@ def unpack_stats(self):
self.headshot_kills = self.stats.get('headshotKills')
self.heals = self.stats.get('heals')
self.kill_place = self.stats.get('killPlace')
self.kill_points = self.stats.get('killPoints')
self.kill_points_delta = self.stats.get('killPointsDelta')
self.kill_streaks = self.stats.get('killStreaks')
self.kills = self.stats.get('kills')
self.longest_kill = self.stats.get('longestKill')
self.most_damage = self.stats.get('mostDamage')
self.name = self.stats.get('name')
self.player_id = self.stats.get('playerId')
self.revives = self.stats.get('revives')
Expand All @@ -166,8 +165,6 @@ def unpack_stats(self):
self.walk_distance = self.stats.get('walkDistance')
self.weapons_acquired = self.stats.get('weaponsAcquired')
self.win_place = self.stats.get('winPlace')
self.win_points = self.stats.get('winPoints')
self.win_points_delta = self.stats.get('winPointsDelta')


class Asset(Domain):
Expand Down Expand Up @@ -202,6 +199,7 @@ def from_dict(self):
super().from_dict()
self.is_current_season = self.attributes.get('isCurrentSeason')
self.is_off_season = self.attributes.get('isOffSeason')
self.best_rank_point = self.attributes.get('bestRankPoint')


class Playerseason(Domain):
Expand Down Expand Up @@ -232,7 +230,6 @@ def from_dict(self):
self.daily_wins = self._data.get('dailyWins')
self.headshot_kills = self._data.get('headshotKills')
self.heals = self._data.get('heals')
self.kill_points = self._data.get('killPoints')
self.kills = self._data.get('kills')
self.longest_kill = self._data.get('longestKill')
self.longest_time_survived = self._data.get('longestTimeSurvived')
Expand All @@ -256,7 +253,6 @@ def from_dict(self):
self.weapons_acquired = self._data.get('weaponsAcquired')
self.weekly_kills = self._data.get('weeklyKills')
self.weekly_wins = self._data.get('weeklyWins')
self.win_points = self._data.get('winPoints')
self.wins = self._data.get('wins')


Expand Down
14 changes: 14 additions & 0 deletions pubg_python/domain/telemetry/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ def from_dict(self):
self.attack_id = self._data.get('attackId')
self.killer = objects.Character(self._data.get('killer', {}))
self.victim = objects.Character(self._data.get('victim', {}))
self.victim_weapon = self._data.get('victimWeapon')
self.victim_weapon_additional_info = self._data.get(
'victimWeaponAdditionalInfo')
self.assistant = objects.Character(self._data.get('assistant', {}))
self.dbno_id = self._data.get('dBNOId')
self.damage_type_category = self._data.get('damageTypeCategory')
Expand Down Expand Up @@ -204,6 +207,10 @@ class LogVehicleRide(LogVehicle):
def from_dict(self):
super().from_dict()
self.seat_index = self._data.get('seatIndex')
self.fellow_passengers = [
objects.Character(data)
for data in self._data.get('fellowPassengers', [])
]


class LogVehicleLeave(LogVehicle):
Expand All @@ -213,6 +220,10 @@ def from_dict(self):
self.ride_distance = self._data.get('rideDistance')
self.seat_index = self._data.get('seatIndex')
self.max_speed = self._data.get('maxSpeed')
self.fellow_passengers = [
objects.Character(data)
for data in self._data.get('fellowPassengers', [])
]


class LogVehicleDestroy(Event):
Expand Down Expand Up @@ -343,6 +354,9 @@ def from_dict(self):
self.attack_id = self._data.get('attackId')
self.attacker = objects.Character(self._data.get('attacker', {}))
self.victim = objects.Character(self._data.get('victim', {}))
self.victim_weapon = self._data.get('victimWeapon')
self.victim_weapon_additional_info = self._data.get(
'victimWeaponAdditionalInfo')
self.damage_reason = self._data.get('damageReason')
self.damage_type_category = self._data.get('damageTypeCategory')
self.damage_causer_name = self._data.get('damageCauserName')
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def read(fname):

setup(
name='pubg-python',
version='0.9.0',
version='0.10.0',
description='A python wrapper for the PUBG developer API',
long_description=read('README.md'),
long_description_content_type='text/markdown',
Expand Down

0 comments on commit 31a4918

Please sign in to comment.