1
0
mirror of synced 2025-02-15 18:02:39 +01:00

295 Commits

Author SHA1 Message Date
Hay1tsme
6a305d2514 Merge pull request '[database] fix invalid transaction being left open' (#187) from beerpsi/artemis:fix/invalid-transaction into develop
Reviewed-on: https://gitea.tendokyu.moe/Hay1tsme/artemis/pulls/187
2024-12-19 06:14:45 +00:00
beerpsi
d6d98d20cb fix: typing shenanigans 2024-12-12 20:47:34 +07:00
Kevin Trocolli
a8f5ef1550 allnet: properly dfi encode downloadorder responses 2024-12-01 14:19:55 -05: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
Hay1tsme
d1048694d4 Fix --config option not being respected, fixes #172 2024-09-06 10:36:57 -04:00
Kevin Trocolli
5c497032f1 frontend: "Edit Card" -> "Card Information" 2024-08-09 02:43:39 -04:00
Kevin Trocolli
06a7fdb1b1 frontend: implement add/edit card 2024-08-09 02:37:34 -04:00
Hay1tsme
68bbde209a aimedb: add warning for all-zero access code/idm 2024-07-18 13:30:46 -04:00
Hay1tsme
02cee4198d aimedb: block all-zero access codes and idms 2024-07-18 13:26:57 -04:00
Kevin Trocolli
6a43e0eada update keychip serial generation code 2024-07-09 15:10:42 -04:00
Hay1tsme
d7e8c9b490 frontend: fix event log buttons 2024-07-06 23:20:04 -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
Kevin Trocolli
6ae11f96a2 aimedb: fix idm zfill issue 2024-06-24 22:28:22 -04:00
Hay1tsme
8f9e9d4766 fix downgrade script issue referenced in #156 2024-06-24 13:37:10 -04:00
Kevin Trocolli
bdbb22f164 logic fix 2024-06-23 22:19:27 -04:00
Kevin Trocolli
068aa5eaa3 prevent setting chipid if it's 0x04030201 2024-06-23 22:09:56 -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
e21568cfd9 pokken: fix profile loading fail 2024-06-12 23:24:45 -04:00
Kevin Trocolli
e69922d91b ongeki: fix frontend versions 2024-06-09 03:14:43 -04:00
Kevin Trocolli
b4b8650acc mai2: add basic webui 2024-06-09 03:05:57 -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
Hay1tsme
12f035b7e5 add no logs message to event viewer 2024-05-26 22:49:05 -04:00
Kevin Trocolli
e66ae91740 add basic event log viewer 2024-05-22 01:36:41 -04:00