Skip to content

Commit

Permalink
Start working on level lists.
Browse files Browse the repository at this point in the history
  • Loading branch information
nekitdev committed Jan 10, 2024
1 parent aab9af1 commit 832e02b
Show file tree
Hide file tree
Showing 4 changed files with 267 additions and 266 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,20 @@ If you are interested in contributing to `gd.py`, make sure to take a look at th

`gd.py` is licensed under the MIT License terms. See [License][License] for details.

<!-- TODO: change `v2 -> main` when merging -->

[Email]: mailto:[email protected]

[Discord]: https://nekit.dev/discord

[Actions]: https://github.com/nekitdev/gd.py/actions

[Changelog]: https://github.com/nekitdev/gd.py/blob/main/CHANGELOG.md
[Code of Conduct]: https://github.com/nekitdev/gd.py/blob/main/CODE_OF_CONDUCT.md
[Contributing Guide]: https://github.com/nekitdev/gd.py/blob/main/CONTRIBUTING.md
[Security]: https://github.com/nekitdev/gd.py/blob/main/SECURITY.md
[Changelog]: https://github.com/nekitdev/gd.py/blob/v2/CHANGELOG.md
[Code of Conduct]: https://github.com/nekitdev/gd.py/blob/v2/CODE_OF_CONDUCT.md
[Contributing Guide]: https://github.com/nekitdev/gd.py/blob/v2/CONTRIBUTING.md
[Security]: https://github.com/nekitdev/gd.py/blob/v2/SECURITY.md

[License]: https://github.com/nekitdev/gd.py/blob/main/LICENSE
[License]: https://github.com/nekitdev/gd.py/blob/v2/LICENSE

[Package]: https://pypi.org/project/gd.py
[Coverage]: https://codecov.io/gh/nekitdev/gd.py
Expand All @@ -207,9 +209,9 @@ If you are interested in contributing to `gd.py`, make sure to take a look at th
[Documentation Badge]: https://github.com/nekitdev/gd.py/workflows/docs/badge.svg
[Check Badge]: https://github.com/nekitdev/gd.py/workflows/check/badge.svg
[Test Badge]: https://github.com/nekitdev/gd.py/workflows/test/badge.svg
[Coverage Badge]: https://codecov.io/gh/nekitdev/gd.py/branch/main/graph/badge.svg
[Coverage Badge]: https://codecov.io/gh/nekitdev/gd.py/branch/v2/graph/badge.svg

[Song]: https://github.com/nekitdev/gd.py/blob/main/assets/song.svg?raw=true
[Song]: https://github.com/nekitdev/gd.py/blob/v2/assets/song.svg?raw=true

[gd.client.Client.login]: https://nekitdev.github.io/gd.py/reference/client#gd.client.Client.login
[gd.encoding.hash_password]: https://nekitdev.github.io/gd.py/reference/encoding#gd.encoding.hash_password
10 changes: 8 additions & 2 deletions gd/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
DEFAULT_LOW_DETAIL,
DEFAULT_OBJECT_COUNT,
DEFAULT_PAGE,
DEFAULT_PLATFORMER,
DEFAULT_RECORD,
DEFAULT_SECONDS,
DEFAULT_SEND,
Expand Down Expand Up @@ -217,6 +218,8 @@
GET_CHESTS = "getGJRewards.php"
GET_ARTISTS = "getGJTopArtists.php"
GET_SONG = "getGJSongInfo.php"
GET_LEVEL_LISTS = "getGJLevelLists.php"
GET_PLATFORMER_LEADERBOARD = "getGJLevelScoresPlat.php"

VALID_ERRORS = (OSError, ClientError)

Expand Down Expand Up @@ -1769,13 +1772,16 @@ async def get_level_leaderboard(
check: bool = DEFAULT_CHECK,
progress: Optional[Progress] = None,
send: bool = DEFAULT_SEND,
platformer: bool = DEFAULT_PLATFORMER,
*,
account_id: int,
hashed_password: str,
) -> str:
) -> str: # TODO: handle platformer mode
error_codes = {-1: MissingAccess(FAILED_TO_GET_LEADERBOARD.format(level_id))}

route = Route(POST, GET_LEVEL_LEADERBOARD)
endpoint = GET_PLATFORMER_LEADERBOARD if platformer else GET_LEVEL_LEADERBOARD

route = Route(POST, endpoint)

payload = Payload(
game_version=self.get_game_version(),
Expand Down
Loading

0 comments on commit 832e02b

Please sign in to comment.