22 Commits
Author SHA1 Message Date
beerpsi 2cbf34dc28 CHUNITHM X-VERSE support (#238)
Reviewed-on: https://gitea.tendokyu.moe/Hay1tsme/artemis/pulls/238
Co-authored-by: beerpsi <beerpsi@duck.com>
Co-committed-by: beerpsi <beerpsi@duck.com>
2026-01-01 21:35:23 +00:00
beerpsi 29a52d2712 chuni: fix map area/unlock challenge conditions (#237)
- Document all map area/unlock challenge condition IDs
- Add conditions for missing secret maps in LUMINOUS PLUS/VERSE

Reviewed-on: https://gitea.tendokyu.moe/Hay1tsme/artemis/pulls/237
Reviewed-by: Dniel97 <dniel97@noreply.gitea.tendokyu.moe>
Co-authored-by: beerpsi <beerpsi@duck.com>
Co-committed-by: beerpsi <beerpsi@duck.com>
2025-12-31 14:37:46 +00:00
beerpsi 5475b52336 [chunithm] support luminous+ 2024-12-19 13:03:37 +07:00
beerpsi fe8f365d8a [chunithm] fix rival music not showing up in game 2024-12-12 20:49:39 +07:00
beerpsi d6d98d20cb fix: typing shenanigans 2024-12-12 20:47:34 +07:00
beerpsi 476a911df9 [database] fix invalid transaction being left open 2024-11-25 20:13:51 +07: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](https://gitea.tendokyu.moe/Hay1tsme/artemis/src/commit/2274b42358d9ef449ca541a46ce654b846ce7f7c/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
beerpsi 789d50c406 use AsyncSession directly
see the warnings in https://docs.sqlalchemy.org/en/14/orm/extensions/asyncio.html#using-asyncio-scoped-session
2024-11-14 13:10:14 +07:00
beerpsi 4c33f4282a oops forgot a dependency on aiomysql 2024-11-14 12:38:00 +07:00
beerpsi bc7524c8fc fix: make database async 2024-11-14 12:36:22 +07:00
beerpsi f747a731bf [chuni] Use the map flag event ID when checking in GetGameMapAreaConditionApi 2024-06-23 01:36:48 +07:00
beerpsi ce124ffe13 [chuni] Improve GetGameMapAreaConditionApi 2024-06-23 00:08:53 +07:00
beerpsi a1d54efbac add upserts 2024-06-20 20:28:52 +07:00
beerpsi 5378655c52 [chunithm] Support LUMINOUS 2024-06-20 08:11:24 +07:00
beerpsi 243d40cfd8 Add changelog and docs 2024-06-18 09:39:14 +07:00
beerpsi bf8631448a support SDGS encryption 2024-06-15 22:22:07 +07:00
beerpsi c3efc36be2 [chuni] Add correct endpoint iter_counts for all versions with encryption 2024-06-12 16:09:36 +07:00
beerpsi 960cf73a04 [allnet] Enable DFI-encoded responses 2024-04-30 22:34:41 +07:00
beerpsi 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: https://gitea.tendokyu.moe/Hay1tsme/artemis/pulls/132
Co-authored-by: beerpsi <beerpsi@duck.com>
Co-committed-by: beerpsi <beerpsi@duck.com>
2024-04-24 17:00:01 +00:00
beerpsi a8daa0344a [mai2] Support encryption (#130)
Similar to O.N.G.E.K.I. and CHUNITHM, with the caveat that the obfuscated endpoint is created using `md5(endpoint + salt)` instead of using PBKDF2 like other games.

Tested and confirmed working on FESTiVAL+.

The current implementation is also affected by #129, so I'm open to ideas.

Reviewed-on: https://gitea.tendokyu.moe/Hay1tsme/artemis/pulls/130
Co-authored-by: beerpsi <beerpsi@duck.com>
Co-committed-by: beerpsi <beerpsi@duck.com>
2024-04-24 16:59:33 +00:00
beerpsi d939755574 [mai2] Support maimai DX International (#118)
Reviewed-on: https://gitea.tendokyu.moe/Hay1tsme/artemis/pulls/118
Co-authored-by: beerpsi <beerpsi@duck.com>
Co-committed-by: beerpsi <beerpsi@duck.com>
2024-04-07 19:12:12 +00:00
beerpsi 40a0817009 CHUNITHM & O.N.G.E.K.I.: Handle userRatingBase*List (#113)
These tables are not used by the game, but are useful for anyone wanting to develop a web UI showing what the player's rating consists of. As such, instead of storing them in JSON columns, I've split them out, one row per each entry.

Reviewed-on: https://gitea.tendokyu.moe/Hay1tsme/artemis/pulls/113
Co-authored-by: beerpsi <beerpsi@duck.com>
Co-committed-by: beerpsi <beerpsi@duck.com>
2024-03-14 14:44:32 +00:00