Commit Graph

32 Commits

Author SHA1 Message Date
ppc
2d61646307 support removing favourite music entires 2025-08-06 18:04:40 +01:00
9a7fc007bc standardization KaleidxScope variable names 2025-04-04 05:42:53 +08:00
3d84e32892 add Kaleidx Scope Support 2025-04-02 09:42:08 +08:00
6821ab6f46 add UploadUserPlaylogListApi handler for Exp version 2025-04-02 04:35:39 +08:00
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: Hay1tsme/artemis#185
Co-authored-by: beerpsi <beerpsi@duck.com>
Co-committed-by: beerpsi <beerpsi@duck.com>
2024-11-16 19:10:29 +00:00
ppc
f47175a144 [mai2] add buddies plus support (#177)
Adds favorite music support (there's an option in the results screen to star a song), handlers for new methods and fixes upsert failures for `userFavoriteList`.
The `UserIntimateApi` has been added but didn't seem to add any data during testing, and `CreateTokenApi`/`RemoveTokenApi` have also been added but I think they're only used during guest play.

---
Tested on 1.45 with no errors/game crashes (see logs). Card Maker hasn't been tested as I don't have a setup to play with.

Reviewed-on: Hay1tsme/artemis#177
Co-authored-by: ppc <albie@ppc.moe>
Co-committed-by: ppc <albie@ppc.moe>
2024-09-23 17:21:29 +00:00
ecb2e9ec75 mai2: properly add present items 2024-06-28 23:55:23 -04:00
af8bd1d1c0 mai2: fix presents 2024-06-28 23:29:31 -04:00
4446ff1f21 mai2: add present support 2024-06-28 15:48:27 -04:00
e7ddfcda2e mai2: oops, forgot version 2024-06-08 22:29:49 -04:00
319aea098f dx: fix GetUserRivalMusicApi list index out of range 2024-06-08 22:19:59 -04:00
8b03f1a4f1 mai2: fix rival data load failing due to inheritance 2024-06-08 22:02:31 -04:00
08891d0851 mai2: some improve for DX earlier version and return game code in uri (#125)
Attention: There are all talking about maimai DX and newer version, not Pre-DX

dx and newer version request these but no used, they are just exist in game code, only found `oldServerUrl` used in SDEZ 1.00, this should also fix SDGA and SDGB try to visit `ServerUrl + movieServerUrl` although that just because of SEGA shit code
tested work

![image](/attachments/f2c79134-4651-4976-8278-bbcf268f424a)

Reviewed-on: Hay1tsme/artemis#125
Co-authored-by: zaphkito <zaphkito@noreply.gitea.tendokyu.moe>
Co-committed-by: zaphkito <zaphkito@noreply.gitea.tendokyu.moe>
2024-05-05 05:41:14 +00:00
d5c80cfb0f [mai2/chuni/ongeki] Properly ignore guest plays (#132)
For all three games, guest plays are created using:
```python
0x1000000000001 | ((allnet_place_id & 65535) << 32)
```

Reviewed-on: Hay1tsme/artemis#132
Co-authored-by: beerpsi <beerpsi@duck.com>
Co-committed-by: beerpsi <beerpsi@duck.com>
2024-04-24 17:00:01 +00:00
0c1c24148d fix: mai2 DX reboot time from config (#120)
Reviewed-on: Hay1tsme/artemis#120
Co-authored-by: topty <topty@noreply.gitea.tendokyu.moe>
Co-committed-by: topty <topty@noreply.gitea.tendokyu.moe>
2024-04-07 19:11:35 +00:00
3613f4dbd2 mai2: BUDDiES support added 2024-03-20 21:42:38 +01:00
6f654f8ba9 mai2: remove redundant method (fixes #103) 2024-03-02 18:00:14 -05:00
05586df08a move to async database 2024-01-09 14:42:17 -05:00
14fa0f5e8e begin move 2024-01-09 03:07:04 -05:00
26cdc6c10f maidx: ignore guest upserts, fixes #74 2023-12-10 17:36:29 -05:00
104a483f4c maimai: fixes for finale 2023-12-02 22:30:55 -05:00
d6e4db48f4 Added maimai DX FESTiVAL PLUS support
- Added Card Maker support for FESTiVAL PLUS
- Bumped SDEZ database to version 8
- Updated docs for FESTiVAL PLUS
2023-10-15 19:04:15 +02:00
88a1462304 logger: change from warn to warning 2023-08-08 10:17:56 -04:00
156b4e4ede mai2: fix get user music for dx and up 2023-07-24 00:49:08 -04:00
d0e43140ba mai2: fix ghost saving, add memorial photo upload 2023-07-16 16:06:34 -04:00
f39317301b mai2: fixed update script, added mai2 heredity, fixed cards import 2023-07-15 22:51:54 +02:00
d60f827000 fix typing across multiple games, fixes #23 2023-07-05 10:47:43 -04:00
318b73dd57 finale: finish porting request data from aqua 2023-07-01 01:08:54 -04:00
49166c1a7b mai2: fix handle_get_game_setting_api_request 2023-05-11 09:52:18 -04:00
42ed222095 mai2: add gamesetting urls 2023-05-10 02:31:30 -04:00
b34b441ba8 mai2: reimplement pre-dx versions 2023-05-06 19:04:10 -04:00
deeac1d8db add finale handler, pre-dx game codes 2023-04-30 22:19:31 -04:00