diff options
Diffstat (limited to 'FortniteClient.py')
-rwxr-xr-x | FortniteClient.py | 17 |
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 |