22 Commits

Author SHA1 Message Date
SoulGateKey
611806828a add Gate 5,6 judgement 2025-05-15 08:19:42 +08:00
SoulGateKey
d598c8fba0 add prism+ playlog support 2025-04-07 09:15:29 +08:00
SoulGateKey
9a7fc007bc standardization KaleidxScope variable names 2025-04-04 05:42:53 +08:00
SoulGateKey
3d84e32892 add Kaleidx Scope Support 2025-04-02 09:42:08 +08:00
SoulGateKey
d77d02c2dd database add Mai2Prism support 2025-04-02 06:42:28 +08:00
beerpsi
58a5177a30 use SQL's limit/offset pagination for nextIndex/maxCount requests (#185)
Instead of retrieving the entire list of items/characters/scores/etc. at once (and even store them in memory), use SQL's `LIMIT ... OFFSET ...` pagination so we only take what we need.

Currently only CHUNITHM uses this, but this will also affect maimai DX and O.N.G.E.K.I. once the PR is ready.

Also snuck in a fix for CHUNITHM/maimai DX's `GetUserRivalMusicApi` to respect the `userRivalMusicLevelList` sent by the client.

### How this works

Say we have a `GetUserCharacterApi` request:

```json
{
    "userId": 10000,
    "maxCount": 700,
    "nextIndex": 0
}
```

Instead of getting the entire character list from the database (which can be very large if the user force unlocked everything), add limit/offset to the query:

```python
select(character)
.where(character.c.user == user_id)
.order_by(character.c.id.asc())
.limit(max_count + 1)
.offset(next_index)
```

The query takes `maxCount + 1` items from the database to determine if there is more items than can be returned:

```python
rows = ...

if len(rows) > max_count:
    # return only max_count rows
    next_index += max_count
else:
    # return everything left
    next_index = -1
```

This has the benefit of not needing to load everything into memory (and also having to store server state, as seen in the [`SCORE_BUFFER` list](2274b42358/titles/chuni/base.py (L13)).)

Reviewed-on: https://gitea.tendokyu.moe/Hay1tsme/artemis/pulls/185
Co-authored-by: beerpsi <beerpsi@duck.com>
Co-committed-by: beerpsi <beerpsi@duck.com>
2024-11-16 19:10:29 +00:00
SoulGateKey
598e4aad76 Update mai2/schema/score.py to support new handle_get_game_ranking 2024-10-11 16:16:40 +00:00
Hay1tsme
e85728f33c chuni/mai2: remove upsert from put_playlog 2024-09-20 17:10:48 -04:00
Kevin Trocolli
b4b8650acc mai2: add basic webui 2024-06-09 03:05:57 -04:00
Kevin Trocolli
eccbd1ad81 mai2: add rivals support 2024-06-08 21:25:48 -04:00
Dniel97
3613f4dbd2 mai2: BUDDiES support added 2024-03-20 21:42:38 +01:00
Hay1tsme
05586df08a move to async database 2024-01-09 14:42:17 -05:00
Kevin Trocolli
f279adb894 mai2: add consecutive day login count, update db to v7, fix reader, courses, and docs 2023-07-01 21:51:18 -04:00
Kevin Trocolli
318b73dd57 finale: finish porting request data from aqua 2023-07-01 01:08:54 -04:00
Kevin Trocolli
127e6f8aa8 mai2: add finale databases 2023-06-27 00:32:35 -04:00
Kevin Trocolli
5ca16f2067 mai2: fix GetUserMusicApi pagination 2023-06-13 22:07:48 -04:00
Dniel97
f63dd07937 maimai: Initial Festival support 2023-04-10 19:11:58 +02:00
Dniel97
2af7751504 Added support for maimai and Chunithm in Card Maker 1.34/1.35 (#14)
Co-authored-by: Dniel97 <Dniel97@noreply.gitea.tendokyu.moe>
Reviewed-on: https://gitea.tendokyu.moe/Hay1tsme/artemis/pulls/14
Co-authored-by: Dniel97 <dniel97@noreply.gitea.tendokyu.moe>
Co-committed-by: Dniel97 <dniel97@noreply.gitea.tendokyu.moe>
2023-03-15 20:03:22 +00:00
Hay1tsme
a76bb94eb1 let black do it's magic 2023-03-09 11:38:58 -05:00
Hay1tsme
1f2d12f318 maidx: upgrade schema for uni+ 2023-02-27 11:55:51 -05:00
Hay1tsme
806dd717e6 maidx: fix score, playlog and courses not saving properly 2023-02-27 11:39:42 -05:00
Hay1tsme
7e3396a7ff add back games, conform them to new title dispatch 2023-02-17 01:02:21 -05:00