summaryrefslogtreecommitdiff
path: root/FortniteClient.py
diff options
context:
space:
mode:
authorue86388 <dmitrii.morozov@sbb.ch>2024-04-10 15:09:51 +0200
committerue86388 <dmitrii.morozov@sbb.ch>2024-04-10 15:09:51 +0200
commita53ea1d94a25f010dbba8a471bc832874bbb4ae7 (patch)
tree330470ee421ffbae34434b4637ff16b1dfb4b5f5 /FortniteClient.py
parent70c2e0df67e76f755db292a5a817c31770267a70 (diff)
Make it work again
Diffstat (limited to 'FortniteClient.py')
-rwxr-xr-xFortniteClient.py17
1 files changed, 4 insertions, 13 deletions
diff --git a/FortniteClient.py b/FortniteClient.py
index 7c5858c..c9b9997 100755
--- a/FortniteClient.py
+++ b/FortniteClient.py
@@ -12,17 +12,15 @@ __fortnite_account_key__ = 'fornite-account-key'
class FortniteClient(fortnitepy.Client):
device_auth = DeviceAuth()
- observers = []
+ observer = None
- def __init__(self):
+ def __init__(self, friendPresenceObserver: PresenceObserver):
+ self.observer = friendPresenceObserver
if self.device_auth.device_auth_file_exists():
self.__auth_device_auth()
else:
self.__auth_authorization_code()
- def attach(self, observer: any):
- self.observers.append(observer)
-
def get_friends(self):
return self.friends
@@ -74,15 +72,8 @@ class FortniteClient(fortnitepy.Client):
for friend_request in self.incoming_pending_friends:
await self.event_friend_request(friend_request)
- async def event_party_invite(self, invitation: fortnitepy.ReceivedPartyInvitation):
- await PartyInvite.on_event(invitation = invitation)
-
async def event_friend_request(self, request: typing.Union[fortnitepy.friend.IncomingPendingFriend, fortnitepy.friend.OutgoingPendingFriend]):
await IncomingFriendRequest.on_event(request)
async def event_friend_presence(self, before, after: fortnitepy.Presence):
- await FriendPresence.on_event(before, after, self.observers)
-
-# Debug
-#client = FortniteClient()
-#client.run() \ No newline at end of file
+ await FriendPresence.on_event(before, after, self.observer) \ No newline at end of file