1
0
mirror of synced 2025-02-12 08:32:58 +01:00

127 Commits

Author SHA1 Message Date
akanyan
fa667d15f2 ongeki: proper handling of music ranking list 2025-01-06 18:39:49 +00: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](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
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
bc7524c8fc fix: make database async 2024-11-14 12:36:22 +07:00
Midorica
b7a006f7ee core: pushing changes regarding MySQL ssl toggle that is now mandatory 2024-11-12 10:53:02 -05:00
daydensteve
c2d4abcc26 db and import updates for userbox, avatar, voice, and map icon 2024-11-03 16:37:05 -05:00
Kevin Trocolli
0cef797a8a mai2: rework photo uploads, relates to #67 2024-10-06 03:47:10 -04: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: https://gitea.tendokyu.moe/Hay1tsme/artemis/pulls/177
Co-authored-by: ppc <albie@ppc.moe>
Co-committed-by: ppc <albie@ppc.moe>
2024-09-23 17:21:29 +00:00
ppc
1db020b5fc fix generated keychip validation failures 2024-09-09 16:53:14 +00:00
Kevin Trocolli
6a43e0eada update keychip serial generation code 2024-07-09 15:10:42 -04:00
Hay1tsme
c65c71e89e card: add memos 2024-07-06 23:13:41 -04:00
Kevin Trocolli
44fb6037cf chuni: add missing alembic script 2024-06-29 00:08:11 -04:00
Hay1tsme
4446ff1f21 mai2: add present support 2024-06-28 15:48:27 -04:00
Hay1tsme
7242a187ab sao: fix sao_hero_log_data nullability 2024-06-28 12:25:33 -04:00
Kevin Trocolli
601cec9075 sao: you already know what it is 2024-06-27 10:02:19 -04:00
Kevin Trocolli
177f851368 sao: cleanup 2024-06-27 00:07:10 -04:00
Kevin Trocolli
40a66614bc sao: fix user_hero_log_id 2024-06-27 00:04:23 -04:00
Kevin Trocolli
171131493f sao: fix new issues 2024-06-26 23:57:07 -04:00
Kevin Trocolli
c13b096190 sao: split massive upgrade in half and hope it works 2024-06-26 23:31:59 -04:00
Kevin Trocolli
5eb2ef8311 sao: schema fixes 3: the misery never ends 2024-06-26 23:01:47 -04:00
Kevin Trocolli
f27f789269 sao: alembic sucks sometimes. 2024-06-26 22:37:56 -04:00
Kevin Trocolli
7206af83cb sao: fix upgrade script 2024-06-26 22:30:12 -04:00
Kevin Trocolli
e91f84fecc sao: backport changes from diana 2024-06-25 14:02:53 -04:00
Hay1tsme
8f9e9d4766 fix downgrade script issue referenced in #156 2024-06-24 13:37:10 -04:00
Kevin Trocolli
3979a020a6 add idm and chip_id fields to card table 2024-06-22 00:47:12 -04:00
Kevin Trocolli
ca9ccbe8a3 chuni: add missing net battle funcs 2024-06-21 23:00:35 -04:00
beerpsi
5378655c52 [chunithm] Support LUMINOUS 2024-06-20 08:11:24 +07:00
Kevin Trocolli
784ac544f0 fix event log ordering, paging, add timestamp 2024-06-16 14:42:23 -04:00
Kevin Trocolli
00224585bb pokken: fix pokemon_data uk 2024-06-14 00:06:39 -04:00
Kevin Trocolli
79f511c837 frontend: add username login 2024-06-08 19:18:15 -04:00
Kevin Trocolli
f94d22ab0d mai2: add tables for rivals and favorite music 2024-06-08 19:04:27 -04:00
akanyan
df2a4d3074 ongeki: clearstatus db migration 2024-05-29 19:15:22 +09:00
Kevin Trocolli
a2fe83ae06 cxb: add grade to playlog 2024-05-28 22:32:38 -04:00
Kevin Trocolli
e66ae91740 add basic event log viewer 2024-05-22 01:36:41 -04:00
Kevin Trocolli
4ee4c26f5e allnet: enhance logging 2024-05-22 00:05:32 -04:00
Kevin Trocolli
a9587a9c91 add additional details to event_log 2024-05-21 23:05:22 -04:00
Hay1tsme
926713431d Merge branch 'develop' of https://gitea.tendokyu.moe/Hay1tsme/artemis into develop 2024-04-02 16:43:16 -04:00
Hay1tsme
1072a9d63b database: fix create_revision_auto 2024-04-02 16:43:13 -04:00
Hay1tsme
87c7c91e3a add ability to add users, cards, arcades and cabs on the webui 2024-03-23 20:01:32 -04:00
Dniel97
3613f4dbd2
mai2: BUDDiES support added 2024-03-20 21:42:38 +01: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
Kevin Trocolli
b63c2c2d12 dbutils: add autocreate option to revision 2024-03-11 21:24:57 -04:00
Kevin Trocolli
c4deff9d1c add database downgrading 2024-03-04 00:50:51 -05:00
Kevin Trocolli
e69149632f frontend: fix namechange and password change failing 2024-03-02 17:52:01 -05:00
Kevin Trocolli
bd97428166 frontend: fix account and owner creation (fixes #108) 2024-03-02 17:48:48 -05:00
Hay1tsme
4149944d56 aimedb: update card last login time properly 2024-02-12 15:53:28 -05:00
Kevin Trocolli
fc3f0900b3 dbutils: add create-revision command 2024-01-11 20:48:27 -05:00
Kevin Trocolli
19fd008598 fix legacy upgrade script 2024-01-11 20:39:29 -05:00