From a53ea1d94a25f010dbba8a471bc832874bbb4ae7 Mon Sep 17 00:00:00 2001 From: ue86388 Date: Wed, 10 Apr 2024 15:09:51 +0200 Subject: Make it work again --- FortniteClient.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'FortniteClient.py') 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 -- cgit v1.2.3