diff --git a/pubg_python/clients.py b/pubg_python/clients.py index a0664d0..8bb0af4 100644 --- a/pubg_python/clients.py +++ b/pubg_python/clients.py @@ -23,7 +23,8 @@ def __init__(self): self.session.headers.update({'Accept': 'application/vnd.api+json'}) self.url = furl.furl() - def request(self, endpoint): + def request(self, endpoint, **kwargs): + self.session.params = kwargs.get('params',None) response = self.session.get(endpoint, timeout=DEFAULT_TIMEOUT) if response.status_code != self.API_OK: diff --git a/pubg_python/domain/telemetry/events.py b/pubg_python/domain/telemetry/events.py index 791f064..72a9772 100644 --- a/pubg_python/domain/telemetry/events.py +++ b/pubg_python/domain/telemetry/events.py @@ -88,6 +88,7 @@ def from_dict(self): self.damage_type_category = self._data.get('damageTypeCategory') self.damage_reason = self._data.get('damageReason') self.distance = self._data.get('distance') + self.damage_causer_name = self._data.get('damageCauserName') class LogParachuteLanding(Event): @@ -143,7 +144,7 @@ class LogItemDetach(LogItemBundle): pass -class LogItemPickupFromCarePackage(LogItemPickup): +class LogItemPickupFromCarepackage(LogItemPickup): pass diff --git a/pubg_python/domain/telemetry/objects.py b/pubg_python/domain/telemetry/objects.py index de6369f..3df7d23 100644 --- a/pubg_python/domain/telemetry/objects.py +++ b/pubg_python/domain/telemetry/objects.py @@ -87,6 +87,7 @@ def from_dict(self): self.location = Location(self._data.get('location', {})) self.ranking = self._data.get('ranking') self.account_id = self._data.get('accountId') + self.zone = self._data.get('zone') class Vehicle(Object): diff --git a/pubg_python/querysets.py b/pubg_python/querysets.py index 34c7d52..006d22c 100644 --- a/pubg_python/querysets.py +++ b/pubg_python/querysets.py @@ -31,15 +31,15 @@ def __getitem__(self, key): return Domain.instance({'data': self._data['data'][key]}) @invalidates_cache - def get(self, id=None): + def get(self, id=None, **kwargs): # get can be a fetchy filter in the future if id: self.endpoint.path.segments.append(id) - self.fetch() + self.fetch(**kwargs) del self.endpoint.path.segments[-1] # dirty? return Domain.instance(self._data) - def fetch(self): + def fetch(self, **kwargs): if self._data: return - self._data = self.client.request(self.endpoint) + self._data = self.client.request(self.endpoint, **kwargs)