Skip to content

Commit

Permalink
[Began 2.2.2 candidate]
Browse files Browse the repository at this point in the history
  • Loading branch information
majordoobie committed Dec 6, 2022
1 parent 1395266 commit 60e9dc6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 8 additions & 1 deletion coc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ class Client:
load_game_data: :class:`LoadGameData`
The option for how coc.py will load game data. See :ref:`initialising_game_data` for more info.
realtime: :class:`bool`
Some developers are given special access to an uncached API access by
Super Cell. If you are one of those developers, your account will have
special flags that will only be interpreted by coc.py if you set this
bool to True.
Attributes
----------
Expand Down Expand Up @@ -168,7 +173,7 @@ def __init__(
cache_max_size: int = 10000,
stats_max_size: int = 1000,
load_game_data: LoadGameData = LoadGameData(default=True),
realtime = False,
realtime=False,
**_,
):

Expand Down Expand Up @@ -253,6 +258,8 @@ def _create_holders(self):
async def login(self, email: str, password: str) -> None:
"""Retrieves all keys and creates an HTTP connection ready for use.
@Deprecated
Parameters
----------
email : str
Expand Down
5 changes: 5 additions & 0 deletions coc/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,11 @@ async def initialise_keys(self):

resp = await session.post("https://developer.clashofclans.com/api/apikey/create", json=data)
key = await resp.json()

if resp.status != 200:
LOG.error(key.get("description"))
raise ValueError(key.get("description"))

self._keys.append(key["key"]["key"])

if len(keys) == 10 and len(self._keys) < self.key_count:
Expand Down

0 comments on commit 60e9dc6

Please sign in to comment.