Skip to content

Commit

Permalink
Add stripped down Client called BasicClient
Browse files Browse the repository at this point in the history
Adds a stripped down client named BasicClient. This client can only perform basic http requests. Client now inherits from BasicClient.

#163
  • Loading branch information
Terbau committed Jul 28, 2022
1 parent 4133fca commit 270f25e
Show file tree
Hide file tree
Showing 4 changed files with 1,106 additions and 918 deletions.
18 changes: 15 additions & 3 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,25 @@ how you can set up this auth with file storage for the preferred login which is
.. autoclass:: AdvancedAuth


Clients
-------

BasicClient
~~~~~~~~~~~

.. attributetable:: BasicClient

.. autoclass:: BasicClient()
:members:

Client
------
~~~~~~

.. attributetable:: Client

.. autoclass:: Client
:members:
.. autoclass:: Client()
:members:
:inherited-members:


Utility Functions
Expand Down
2 changes: 1 addition & 1 deletion fortnitepy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

__version__ = '3.6.5'

from .client import Client, run_multiple, start_multiple, close_multiple
from .client import BasicClient, Client, run_multiple, start_multiple, close_multiple
from .auth import (Auth, EmailAndPasswordAuth, ExchangeCodeAuth,
AuthorizationCodeAuth, DeviceAuth, RefreshTokenAuth,
AdvancedAuth)
Expand Down
9 changes: 1 addition & 8 deletions fortnitepy/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,14 +273,7 @@ async def do_refresh(self) -> None:

log.debug('Successfully reauthenticated.')

try:
log.debug('Refreshing xmpp session')
await self.client.xmpp.close()
await self.client.xmpp.run()

await self.client._reconnect_to_party()
except AttributeError:
pass
await self.client.dispatch_and_wait_event('internal_auth_refresh')

self.refresh_i += 1
log.debug('Sessions was successfully refreshed.')
Expand Down
Loading

0 comments on commit 270f25e

Please sign in to comment.