Skip to content

Conversation

@AumJavalgikar
Copy link
Contributor

No description provided.

AumJavalgikar and others added 4 commits February 5, 2023 18:34
* compare Capital districts properly

* extend Client class to work with context manager

* Include the new API endpoint properly

* [BUG] The new json files do not have resourc cost. Will need to fix them.

* Removed resource key from json files

* Fix HERO_PETS_ORDER

Fixes mathsman5133#125

* Update version to reflect pull request update

* Use a generator for raidlog and add district hall level

* Fix RaidClan.attacks

* Introducing ClanWarLog as Generator for WarLogs

* support batch requesting for warlog and raidlog

* add support for api endpoint current goldpass season and add related event

* Update coc/client.py

remove additional line in docstring

Co-authored-by: Priyam <roy_priyam@outlook.com>

* Update coc/client.py

Co-authored-by: Priyam <roy_priyam@outlook.com>

* Revert "Api request update"

* [Modified http.py] Added documentation to the Route function to make it clearer how the class is modifying the URL string

* [Modified client.py] Documented the `paginated` parameter and added the `limit` parameter to change how pagination works

* [Modified wars.py] Added circular annotation from client.py

* [Modified client.py] Added limit parameters

* Iterated on Doluks idea

* Implemented the abstract class for both log enpoints (warlogs and capital raids). Some documentation and testing is still needed.

* There is currently a bug with fetching odd number items from the API. It currently seems like the API contains the but and not the code. More testing is needed

* Stop async iter in page mode properly in case page ends and no after filter is available, fix indexing in arrays if array length changes

* clean up example

* fix some __eq__ functions

* fix RaidClan __eq__

* Merged Doluks fixes and Doluks context manager. Went ahead and updated the examples.

* events_example.py build test fails because of context manager. I left out the context manager out of this file

* Bumped version for release

* Merge conflicts resolved.

* Readme updated. Ready for release.

* fix the docs

* Revert "fix the docs"

* remove slots

* escape not initialized attributes

* change login_with_keys to be similar to login

* make client.login_with_keys async

* update docs

* modify iterator.py: _clan_war to clan_war

Fix mathsman5133#137

* Moved "Recall Spell" at the end of elixir spells

* Fix bug with league wars where the first clan isn't the searched clan and a bug which affected the end of the scwl

* fix default value for rounds

* Update iterators.py

fix typo

* version bump to v2.2.1

* add changelog for v2.2.1 and v2.2.0

* fix changelog

* Add Required Townhall to clan class

is available in the api now, I tested it & works, but not super familiar if there is any other edits that need to be made

* wrapperchanges

* extend lab_to_townhall to work properly with townhalls with no lab

* newest changes in static files

* handle load of DataContainer from json properly in terms of cls.lab_level, load cls.village

* Create FullWarApi.py (mathsman5133#7)

Create FullWarApi.py

* make it mergeable with the official repo

* refactoring as extentension

* make it mergeable with official repo

* make it mergeable with official repo

* minor changes

* Fix calculation of WarClan.total_attacks

Fix for mathsman5133#96

* clean up of mysterious commits

* clean up of mysterious commits part 2

* solving calendar.IllegalMonthError:

solving a calender problem that made a 13nd month, and then an exception.

* fix a bug where attacks_per_member is not initialized

* Fix a bug for clients with realtime access

The wrong scope prevented the key creation with  email and password and force the users to login with keys

* [Began 2.2.2 candidate]

* [Fixed realtime access] Merged PR with realtime access fix with some modifications.

* add Super Miner

* [Fixed realtime access] Merged PR with realtime access fix with some modifications.

* [Updaed static files]

* [Unittest creation] Creating the unittest for testing the levels of troops before merging the PR for the fix

* Create super miner

* Fix min level for super minner

* request the correct endpoint

* fix memory leak

* [Merged PRs] Merged a few PRs. The other PRs will be on their own release.

* [Incremented version]

* [Incremented version]

* add log message

* [Added docs] Added the requirements list for the doc generation

* [Fixed sphinx errors]

* [Doc fix] Fix error with missing underline in Ranked Player

* [Doc fix] Fixed error where code-blcok directive required a new line after the directive

* [Doc fix] Fixed langauge missing setting

* Moved "Electro Titan" at the end of elixir troops

* [Fixing docs] Slowly working through fixing each error one file at a time

* add clan capital leaderboards

(cherry picked from commit e12bc39)

* Fix for only one raid per clan showing on atk/def log

Due to the attack & defense log using a dict, when an attack/defense was assigned to the key, it would replace the previous attack or defense, common in higher clan capital clans where they can attack or defend the same clan multiple times.

* Adds new clan class fields

add clan capital league, clan capital trophy points, and the new family friendly field

* add missing classes to __init__.py

* remove raw_data

* blank lines added back

* fix bug when `cache_max_size` is 0 and make `coc.http.stats` work

* fix broken copy of LRU

* rename LRU to FIFO

* create pyproject.toml

* make setup.py use pyproject.toml

* fix infinite loop eq loop and introduce the index to RaidClan to fix

* fix discord link test for forks/pr

* fix expires_at attribute of the key for full war api

* add missing renamings of LRU -> FIFO

* add events for raidseason start/end, clangames start/end and new_war event for new wars (not invoked for preparation_start_time is none

* update static files

* Add optional _raw_data attribute to allow access to the raw json data

* Revert "Add optional _raw_data attribute to allow access to the raw json data"

This reverts commit f793ffc.

* Add optional _raw_data attribute to allow access to the raw json data

* Add optional _raw_data attribute to allow access to the raw json data

* formating

* add raid weekend time utils

* Revert "add clan capital leaderboards"

* remove unneccessary spaces

* correct empty line location

* Fix a Bug, causing problems with 10 keys, where at least one key has the correct name but wrong ip range (mathsman5133#119)

Co-authored-by: Lukas Dobler <69309597+doluk@users.noreply.github.com>

* Fix typo

* Fix the sphinx docs by moving the __repr__ function to the class instead of having it in the Meta/Parentclass

* Mark coc.login and coc.login_with_keys as deprecated

* increase version number

* A first step towards new docs

* make subtopics consistent

* change default to None to fix docs

* add support for member_versus_rank events

* Propagate the _response_retry property forward to log entry to avoid conflicts with requesting stuff

* Add a kwarg option to bypass caching if needed

* Fix typo (Please @doluk learn to type)

* add models to docs and re sort them

* make `raid_weekend` naming consistent (in coc.py)

* Enhance Enumerations

* add hero pets order and a note about the elder role

* make index a little less depth to increase readability

* fix typo

* Handle client being None

* Update tests

* update static

* add required_townhall_level to pet description as well as get max for townhall level and is max for townhall

* fix for [mathsman5133#156](mathsman5133#156)

* remove old docs

* rename docs2 to docs

* rename raidseason to raid_weekend

* bump some version numbers

* enhance changelog.rst

* make changelog.rst even bigger

* huge docs restructuring

* fix path in config

* add labels for ref

* added ref for full war api

* small adjustments for docs

* some more docs tweaks

* change login_with_keys to use Client.login_using_keys and mark login_with_keys as deprecated

* introduce Client.login_using_keys as asynchronous version of Client.login_with_keys to avoid breaking changes. Marked Client.login_with_keys as deprecated.

* Rename Client.login_using_keys to Client.login_with_tokens

* Point coc.login_with_keys to coc.Client.login_with_tokens

* Update docs to match login_with_tokens

* fix broken docs for new login and a little more

* resolve the first chunk of easy doobie reviews

* remove id

* removing did not work, added back without magic number

* first part of review changes

* review fixes part 2

* Update docs/extensions/discord_links.rst

Co-authored-by: Joshua Bramley <38833292+mathsman5133@users.noreply.github.com>

* resolve some of mathsmans reviews

* add Barrack2 (Super Troops) to production buildings

* fix id again

* cleanup of fullwar api init

* add `get_clan_games_[start|end]` utils and a few event examples

* fixed double client in docs and typo in changelog.rst

* Revert "Revert "add clan capital leaderboards""

This reverts commit a12c91b.

* add changelog entry

* bump version numbers

---------

Co-authored-by: doluk <lukas.dobler@uni-konstanz.de>
Co-authored-by: Lukas <lukas.dobler10@gmail.com>
Co-authored-by: doobie <sgtmajordoobie@live.com>
Co-authored-by: Lukas Dobler <69309597+doluk@users.noreply.github.com>
Co-authored-by: Amaan Q <amaanq12@gmail.com>
Co-authored-by: Priyam <roy_priyam@outlook.com>
Co-authored-by: ferune <64608776+ferune@users.noreply.github.com>
Co-authored-by: RREEMMII <64311122+rreemmii-dev@users.noreply.github.com>
Co-authored-by: mathsman5133 <mathsman5132@gmail.com>
Co-authored-by: Joshua Bramley <38833292+mathsman5133@users.noreply.github.com>
Co-authored-by: Magic <82341152+MagicTheDev@users.noreply.github.com>
Co-authored-by: av02 <39122034+av02@users.noreply.github.com>
Co-authored-by: Lukas Thaler <33826427+lukasthaler@users.noreply.github.com>
Co-authored-by: Jose Manuel Herrera <85388833+jmherrera76@users.noreply.github.com>
Co-authored-by: tammes <tabu.der.erste@gmx.de>
Co-authored-by: Kuchenmampfer <79256346+Kuchenmampfer@users.noreply.github.com>
@doluk
Copy link
Collaborator

doluk commented Feb 5, 2023

@Kuchenmampfer @majordoobie we have currently no checks if the passed keys are valid and suitable for the IP. Should we add that to the next release?
We can get the ip and decode the tokens or we do one call with every token directly to the API (which would be safer but slower).

Copy link
Collaborator

@doluk doluk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just one minor change. Can you please add it to the login_with_keys too? It is depreciated, but still there and affected by the same bug.

@doluk doluk changed the base branch from master to g8_2.4.0_candidate February 5, 2023 15:24
@doluk doluk merged commit 6563757 into mathsman5133:g8_2.4.0_candidate Feb 5, 2023
@AumJavalgikar AumJavalgikar deleted the fix_login_with_tokens branch February 5, 2023 16:28
AumJavalgikar added a commit to AumJavalgikar/coc.py that referenced this pull request Feb 17, 2023
* Easier fix for login_with_tokens() (mathsman5133#175)

* Bug fix to prevent using more keys than key_count, because more keys are suitable

* Bug fix for login_with_keys to fix unknown variable

* Bug fix for usage of Client with context manager which overwrote parameters to default

* Set throttle_limit to a reasonable number

* Update war_logs example to be less spam

* Add PlayerHouse to Player

* Start changelog for 2.4.0

* Add the newest maintainer

* Make additional query parameters visible for users

* Fix type of label_ids

* Fix default value of label_ids

* Handle cache control header properly for realtime requests

* Add missing endpoints on http level

* Remove duplicate endpoint on http level

* Add new endpoints on user facing level

---------

Co-authored-by: Lukas Dobler <69309597+doluk@users.noreply.github.com>
Co-authored-by: Lukas <lukas.dobler10@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants