Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix telemetry events #102

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
68 changes: 66 additions & 2 deletions pubg_python/domain/telemetry/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,28 @@ def from_dict(self):
'isThroughPenetrableWall')


class LogPlayerKillV2(Event):

def from_dict(self):
super().from_dict()
self.attack_id = self._data.get('attackId')
self.dbno_id = self._data.get('dBNOId')
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.dbno_marker = objects.Character(self._data.get('dBNOMaker', {}))
self.dbno_damage_info = objects.DamageInfo(
self._data.get('dBNODamageInfo', {}))
self.finisher = objects.Character(self._data.get('dBNOMaker', {}))
self.finisher_damage_info = objects.DamageInfo(
self._data.get('finishDamageInfo', {}))
self.killer = objects.Character(self._data.get('killer', {}))
self.killer_damage_info = objects.DamageInfo(
self._data.get('killerDamageInfo', {}))
self.is_suicide = self._data.get('isSuicide')


class LogParachuteLanding(Event):

def from_dict(self):
Expand Down Expand Up @@ -195,6 +217,7 @@ def from_dict(self):
super().from_dict()
self.character = objects.Character(self._data.get('character', {}))
self.item = objects.Item(self._data.get('item', {}))
self.care_package_unique_id = self._data.get('carePackageUniqueId')


class LogItemPickupFromLootBox(LogItemPickup):
Expand All @@ -203,6 +226,7 @@ def from_dict(self):
super().from_dict()
self.creator_id = self._data.get('creatorAccountId')
self.team_id = self._data.get('ownerTeamId')
self.creator_account_id = self._data.get('creatorAccountId')


class LogHeal(Event):
Expand All @@ -211,7 +235,10 @@ def from_dict(self):
super().from_dict()
self.character = objects.Character(self._data.get('character', {}))
self.item = objects.Item(self._data.get('item', {}))
self.heal_amount = self._data.get('healAmount')
if self._data.get('healamount'):
self.heal_amount = self._data.get('healamount')
else:
self.heal_amount = self._data.get('healAmount')


class LogObjectDestroy(Event):
Expand All @@ -233,14 +260,14 @@ def from_dict(self):
self.object_type_status = self._data.get('objectTypeStatus')
self.object_type_additional_info = self._data.get(
'objectTypeAdditionalInfo')
self.object_type_count = self._data.get('objectTypeCount')


class LogVaultStart(Event):

def from_dict(self):
super().from_dict()
self.character = objects.Character(self._data.get('character', {}))
self.is_ledge_grab = self._data.get('isLedgeGrab')


class LogVehicle(Event):
Expand Down Expand Up @@ -287,6 +314,10 @@ def from_dict(self):
self.distance = self._data.get('distance')


class LogVehicleDamage(Event):
pass


class LogCarePackageEvent(Event):

def from_dict(self):
Expand All @@ -303,6 +334,10 @@ class LogCarePackageLand(LogCarePackageEvent):
pass


class LogItemPickupFromCustomPackage(LogCarePackageEvent):
pass


class LogMatchDefinition(Event):

def from_dict(self):
Expand Down Expand Up @@ -444,3 +479,32 @@ class LogPhaseChange(Event):
def from_dict(self):
super().from_dict()
self.phase = self._data.get('phase')
self.elapsed_time = self._data.get('elapsedTime')


class LogEmPickupLiftOff(Event):
pass


class LogPlayerDestroyProp(Event):
pass


class LogPlayerRedeployBRStart(Event):
pass


class LogPlayerRedeploy(Event):
pass


class LogItemPutToVehicleTrunk(Event):
pass


class LogItemPickupFromVehicleTrunk(Event):
pass


class LogCharacterCarry(Event):
pass
13 changes: 13 additions & 0 deletions pubg_python/domain/telemetry/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,16 @@ def from_dict(self):
self.team_id = self._data.get('teamId')
self.stats = Stats(self._data.get('stats', {}))
self.account_id = self._data.get('accountId')


class DamageInfo(Object):

def from_dict(self):
super().from_dict()
self.damage_reason = self._data.get('damageReason')
self.damage_type_category = self._data.get('damageTypeCategory')
self.damage_causer_name = self._data.get('damageCauserName')
self.additional_info = self._data.get("additionalInfo")
self.distance = self._data.get("distance")
self.is_through_penetrable_wall = self._data.get(
'isThroughPenetrableWall')
Loading